From 15e0873f3028f23f1f2608801e6d631724474da1 Mon Sep 17 00:00:00 2001 From: glenn Date: Tue, 30 Jul 2024 10:11:07 -0400 Subject: [PATCH 001/128] initial auto-genned code --- sdk/ai/azure-ai-inference/CHANGELOG.md | 13 + sdk/ai/azure-ai-inference/README.md | 80 +++ sdk/ai/azure-ai-inference/assets.json | 6 + sdk/ai/azure-ai-inference/pom.xml | 99 +++ .../inference/ChatCompletionsAsyncClient.java | 230 +++++++ .../ai/inference/ChatCompletionsClient.java | 225 +++++++ .../ChatCompletionsClientBuilder.java | 355 +++++++++++ .../ai/inference/ModelServiceVersion.java | 40 ++ .../ChatCompletionsClientImpl.java | 436 +++++++++++++ .../models/CompleteOptions.java | 501 +++++++++++++++ .../models/CompleteRequest.java | 575 ++++++++++++++++++ .../models/ExtraParameters.java | 64 ++ .../implementation/models/package-info.java | 8 + .../implementation/package-info.java | 8 + .../azure/ai/inference/models/ChatChoice.java | 129 ++++ .../ai/inference/models/ChatCompletions.java | 189 ++++++ .../ChatCompletionsFunctionToolCall.java | 114 ++++ ...ChatCompletionsFunctionToolDefinition.java | 107 ++++ .../ChatCompletionsFunctionToolSelection.java | 84 +++ ...CompletionsNamedFunctionToolSelection.java | 107 ++++ .../ChatCompletionsNamedToolSelection.java | 107 ++++ .../models/ChatCompletionsResponseFormat.java | 111 ++++ .../ChatCompletionsResponseFormatJSON.java | 83 +++ .../ChatCompletionsResponseFormatText.java | 81 +++ .../models/ChatCompletionsToolCall.java | 133 ++++ .../models/ChatCompletionsToolDefinition.java | 107 ++++ .../ChatCompletionsToolSelectionPreset.java | 65 ++ .../models/ChatMessageContentItem.java | 108 ++++ .../models/ChatMessageImageContentItem.java | 108 ++++ .../models/ChatMessageImageDetailLevel.java | 65 ++ .../inference/models/ChatMessageImageUrl.java | 123 ++++ .../models/ChatMessageTextContentItem.java | 106 ++++ .../models/ChatRequestAssistantMessage.java | 150 +++++ .../inference/models/ChatRequestMessage.java | 112 ++++ .../models/ChatRequestSystemMessage.java | 107 ++++ .../models/ChatRequestToolMessage.java | 128 ++++ .../models/ChatRequestUserMessage.java | 107 ++++ .../inference/models/ChatResponseMessage.java | 132 ++++ .../azure/ai/inference/models/ChatRole.java | 69 +++ .../models/CompletionsFinishReason.java | 70 +++ .../ai/inference/models/CompletionsUsage.java | 129 ++++ .../ai/inference/models/FunctionCall.java | 111 ++++ .../inference/models/FunctionDefinition.java | 156 +++++ .../azure/ai/inference/models/ModelInfo.java | 127 ++++ .../azure/ai/inference/models/ModelType.java | 81 +++ .../ai/inference/models/package-info.java | 8 + .../com/azure/ai/inference/package-info.java | 8 + .../src/main/java/module-info.java | 11 + ...azure-ai-inference_apiview_properties.json | 50 ++ .../resources/azure-ai-inference.properties | 2 + .../com/azure/ai/inference/ReadmeSamples.java | 12 + .../ChatCompletionsClientTestBase.java | 45 ++ sdk/ai/azure-ai-inference/tsp-location.yaml | 5 + 53 files changed, 6187 insertions(+) create mode 100644 sdk/ai/azure-ai-inference/CHANGELOG.md create mode 100644 sdk/ai/azure-ai-inference/README.md create mode 100644 sdk/ai/azure-ai-inference/assets.json create mode 100644 sdk/ai/azure-ai-inference/pom.xml create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClientBuilder.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ModelServiceVersion.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsClientImpl.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/CompleteOptions.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/CompleteRequest.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/ExtraParameters.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/package-info.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/package-info.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatChoice.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletions.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolCall.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolDefinition.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolSelection.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsNamedFunctionToolSelection.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsNamedToolSelection.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormat.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatJSON.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatText.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsToolCall.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsToolDefinition.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsToolSelectionPreset.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageContentItem.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageContentItem.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageDetailLevel.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageUrl.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageTextContentItem.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestAssistantMessage.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestMessage.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestSystemMessage.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestToolMessage.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatResponseMessage.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRole.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/CompletionsFinishReason.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/CompletionsUsage.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionCall.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ModelInfo.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ModelType.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/package-info.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/package-info.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/module-info.java create mode 100644 sdk/ai/azure-ai-inference/src/main/resources/META-INF/azure-ai-inference_apiview_properties.json create mode 100644 sdk/ai/azure-ai-inference/src/main/resources/azure-ai-inference.properties create mode 100644 sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/ReadmeSamples.java create mode 100644 sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/ChatCompletionsClientTestBase.java create mode 100644 sdk/ai/azure-ai-inference/tsp-location.yaml diff --git a/sdk/ai/azure-ai-inference/CHANGELOG.md b/sdk/ai/azure-ai-inference/CHANGELOG.md new file mode 100644 index 000000000000..cca21c56cfdf --- /dev/null +++ b/sdk/ai/azure-ai-inference/CHANGELOG.md @@ -0,0 +1,13 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +- Azure Model client library for Java. This package contains Microsoft Azure Model client library. + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes diff --git a/sdk/ai/azure-ai-inference/README.md b/sdk/ai/azure-ai-inference/README.md new file mode 100644 index 000000000000..877c737a1409 --- /dev/null +++ b/sdk/ai/azure-ai-inference/README.md @@ -0,0 +1,80 @@ +# Azure Model client library for Java + +Azure Model client library for Java. + +This package contains Microsoft Azure Model client library. + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] +- [Product documentation][product_documentation] + +## 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:azure-ai-inference;current}) +```xml + + com.azure + azure-ai-inference + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Authentication + +[Azure Identity][azure_identity] package provides the default implementation for authenticating the client. + +## Key concepts + +## Examples + +```java com.azure.ai.inference.readme +``` + +### Service API versions + +The client library targets the latest service API version by default. +The service client builder accepts an optional service API version parameter to specify which API version to communicate. + +#### Select a service API version + +You have the flexibility to explicitly select a supported service API version when initializing a service client via the service client builder. +This ensures that the client can communicate with services using the specified API version. + +When selecting an API version, it is important to verify that there are no breaking changes compared to the latest API version. +If there are significant differences, API calls may fail due to incompatibility. + +Always ensure that the chosen API version is fully supported and operational for your specific use case and that it aligns with the service's versioning policy. + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[product_documentation]: https://azure.microsoft.com/services/ +[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 + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fai%2Fazure-ai-inference%2FREADME.png) diff --git a/sdk/ai/azure-ai-inference/assets.json b/sdk/ai/azure-ai-inference/assets.json new file mode 100644 index 000000000000..6dbf72e5cd89 --- /dev/null +++ b/sdk/ai/azure-ai-inference/assets.json @@ -0,0 +1,6 @@ +{ + "AssetsRepo" : "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath" : "java", + "TagPrefix" : "java/ai/azure-ai-inference", + "Tag" : "" +} \ No newline at end of file diff --git a/sdk/ai/azure-ai-inference/pom.xml b/sdk/ai/azure-ai-inference/pom.xml new file mode 100644 index 000000000000..3fd4a4ac6e86 --- /dev/null +++ b/sdk/ai/azure-ai-inference/pom.xml @@ -0,0 +1,99 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure + azure-ai-inference + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Model + This package contains Microsoft Azure Model client library. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + com.azure + azure-json + 1.2.0 + + + com.azure + azure-xml + 1.1.0 + + + com.azure + azure-core + 1.50.0 + + + com.azure + azure-core-http-netty + 1.15.2 + + + org.junit.jupiter + junit-jupiter-api + 5.9.3 + test + + + org.junit.jupiter + junit-jupiter-engine + 5.9.3 + test + + + com.azure + azure-core-test + 1.26.1 + test + + + com.azure + azure-identity + 1.13.1 + test + + + org.slf4j + slf4j-simple + 1.7.36 + test + + + diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java new file mode 100644 index 000000000000..87464483a466 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference; + +import com.azure.ai.inference.implementation.ChatCompletionsClientImpl; +import com.azure.ai.inference.implementation.models.CompleteOptions; +import com.azure.ai.inference.implementation.models.CompleteRequest; +import com.azure.ai.inference.implementation.models.ExtraParameters; +import com.azure.ai.inference.models.ChatCompletions; +import com.azure.ai.inference.models.ModelInfo; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous ChatCompletionsClient type. + */ +@ServiceClient(builder = ChatCompletionsClientBuilder.class, isAsync = true) +public final class ChatCompletionsAsyncClient { + @Generated + private final ChatCompletionsClientImpl serviceClient; + + /** + * Initializes an instance of ChatCompletionsAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ChatCompletionsAsyncClient(ChatCompletionsClientImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Gets chat completions for the provided chat messages. + * Completions support a wide variety of tasks and generate text that continues from or "completes" + * provided prompt data. The method makes a REST API call to the `/chat/completions` route + * on the given endpoint. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
extra-parametersStringNoControls what happens if extra parameters, undefined + * by the REST API, + * are passed in the JSON request payload. + * This sets the HTTP request header `extra-parameters`. Allowed values: "error", "drop", "pass-through".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     messages (Required): [
+     *          (Required){
+     *             role: String(system/user/assistant/tool) (Required)
+     *         }
+     *     ]
+     *     frequency_penalty: Double (Optional)
+     *     stream: Boolean (Optional)
+     *     presence_penalty: Double (Optional)
+     *     temperature: Double (Optional)
+     *     top_p: Double (Optional)
+     *     max_tokens: Integer (Optional)
+     *     response_format (Optional): {
+     *         type: String (Required)
+     *     }
+     *     stop (Optional): [
+     *         String (Optional)
+     *     ]
+     *     tools (Optional): [
+     *          (Optional){
+     *             type: String (Required)
+     *         }
+     *     ]
+     *     tool_choice: BinaryData (Optional)
+     *     seed: Long (Optional)
+     *     model: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     created: long (Required)
+     *     model: String (Required)
+     *     usage (Required): {
+     *         completion_tokens: int (Required)
+     *         prompt_tokens: int (Required)
+     *         total_tokens: int (Required)
+     *     }
+     *     choices (Required): [
+     *          (Required){
+     *             index: int (Required)
+     *             finish_reason: String(stop/length/content_filter/tool_calls) (Required)
+     *             message (Required): {
+     *                 role: String(system/user/assistant/tool) (Required)
+     *                 content: String (Required)
+     *                 tool_calls (Optional): [
+     *                      (Optional){
+     *                         type: String (Required)
+     *                         id: String (Required)
+     *                     }
+     *                 ]
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param completeRequest The completeRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return chat completions for the provided chat messages. + * Completions support a wide variety of tasks and generate text that continues from or "completes" + * provided prompt data along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> completeWithResponse(BinaryData completeRequest, RequestOptions requestOptions) { + return this.serviceClient.completeWithResponseAsync(completeRequest, requestOptions); + } + + /** + * Returns information about the AI model. + * The method makes a REST API call to the `/info` route on the given endpoint. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     model_name: String (Required)
+     *     model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat) (Required)
+     *     model_provider_name: String (Required)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents some basic information about the AI model along with {@link Response} on successful completion + * of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getModelInfoWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getModelInfoWithResponseAsync(requestOptions); + } + + /** + * Gets chat completions for the provided chat messages. + * Completions support a wide variety of tasks and generate text that continues from or "completes" + * provided prompt data. The method makes a REST API call to the `/chat/completions` route + * on the given endpoint. + * + * @param options Options for complete API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return chat completions for the provided chat messages. + * Completions support a wide variety of tasks and generate text that continues from or "completes" + * provided prompt data on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono complete(CompleteOptions options) { + // Generated convenience method for completeWithResponse + RequestOptions requestOptions = new RequestOptions(); + CompleteRequest completeRequestObj + = new CompleteRequest(options.getMessages()).setFrequencyPenalty(options.getFrequencyPenalty()) + .setStream(options.isStream()) + .setPresencePenalty(options.getPresencePenalty()) + .setTemperature(options.getTemperature()) + .setTopP(options.getTopP()) + .setMaxTokens(options.getMaxTokens()) + .setResponseFormat(options.getResponseFormat()) + .setStop(options.getStop()) + .setTools(options.getTools()) + .setToolChoice(options.getToolChoice()) + .setSeed(options.getSeed()) + .setModel(options.getModel()); + BinaryData completeRequest = BinaryData.fromObject(completeRequestObj); + ExtraParameters extraParams = options.getExtraParams(); + if (extraParams != null) { + requestOptions.setHeader(HttpHeaderName.fromString("extra-parameters"), extraParams.toString()); + } + return completeWithResponse(completeRequest, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ChatCompletions.class)); + } + + /** + * Returns information about the AI model. + * The method makes a REST API call to the `/info` route on the given endpoint. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents some basic information about the AI model on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getModelInfo() { + // Generated convenience method for getModelInfoWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getModelInfoWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelInfo.class)); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java new file mode 100644 index 000000000000..be71658ef53d --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference; + +import com.azure.ai.inference.implementation.ChatCompletionsClientImpl; +import com.azure.ai.inference.implementation.models.CompleteOptions; +import com.azure.ai.inference.implementation.models.CompleteRequest; +import com.azure.ai.inference.implementation.models.ExtraParameters; +import com.azure.ai.inference.models.ChatCompletions; +import com.azure.ai.inference.models.ModelInfo; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; + +/** + * Initializes a new instance of the synchronous ChatCompletionsClient type. + */ +@ServiceClient(builder = ChatCompletionsClientBuilder.class) +public final class ChatCompletionsClient { + @Generated + private final ChatCompletionsClientImpl serviceClient; + + /** + * Initializes an instance of ChatCompletionsClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ChatCompletionsClient(ChatCompletionsClientImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Gets chat completions for the provided chat messages. + * Completions support a wide variety of tasks and generate text that continues from or "completes" + * provided prompt data. The method makes a REST API call to the `/chat/completions` route + * on the given endpoint. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
extra-parametersStringNoControls what happens if extra parameters, undefined + * by the REST API, + * are passed in the JSON request payload. + * This sets the HTTP request header `extra-parameters`. Allowed values: "error", "drop", "pass-through".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     messages (Required): [
+     *          (Required){
+     *             role: String(system/user/assistant/tool) (Required)
+     *         }
+     *     ]
+     *     frequency_penalty: Double (Optional)
+     *     stream: Boolean (Optional)
+     *     presence_penalty: Double (Optional)
+     *     temperature: Double (Optional)
+     *     top_p: Double (Optional)
+     *     max_tokens: Integer (Optional)
+     *     response_format (Optional): {
+     *         type: String (Required)
+     *     }
+     *     stop (Optional): [
+     *         String (Optional)
+     *     ]
+     *     tools (Optional): [
+     *          (Optional){
+     *             type: String (Required)
+     *         }
+     *     ]
+     *     tool_choice: BinaryData (Optional)
+     *     seed: Long (Optional)
+     *     model: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     created: long (Required)
+     *     model: String (Required)
+     *     usage (Required): {
+     *         completion_tokens: int (Required)
+     *         prompt_tokens: int (Required)
+     *         total_tokens: int (Required)
+     *     }
+     *     choices (Required): [
+     *          (Required){
+     *             index: int (Required)
+     *             finish_reason: String(stop/length/content_filter/tool_calls) (Required)
+     *             message (Required): {
+     *                 role: String(system/user/assistant/tool) (Required)
+     *                 content: String (Required)
+     *                 tool_calls (Optional): [
+     *                      (Optional){
+     *                         type: String (Required)
+     *                         id: String (Required)
+     *                     }
+     *                 ]
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param completeRequest The completeRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return chat completions for the provided chat messages. + * Completions support a wide variety of tasks and generate text that continues from or "completes" + * provided prompt data along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Response completeWithResponse(BinaryData completeRequest, RequestOptions requestOptions) { + return this.serviceClient.completeWithResponse(completeRequest, requestOptions); + } + + /** + * Returns information about the AI model. + * The method makes a REST API call to the `/info` route on the given endpoint. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     model_name: String (Required)
+     *     model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat) (Required)
+     *     model_provider_name: String (Required)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents some basic information about the AI model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getModelInfoWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getModelInfoWithResponse(requestOptions); + } + + /** + * Gets chat completions for the provided chat messages. + * Completions support a wide variety of tasks and generate text that continues from or "completes" + * provided prompt data. The method makes a REST API call to the `/chat/completions` route + * on the given endpoint. + * + * @param options Options for complete API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return chat completions for the provided chat messages. + * Completions support a wide variety of tasks and generate text that continues from or "completes" + * provided prompt data. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + ChatCompletions complete(CompleteOptions options) { + // Generated convenience method for completeWithResponse + RequestOptions requestOptions = new RequestOptions(); + CompleteRequest completeRequestObj + = new CompleteRequest(options.getMessages()).setFrequencyPenalty(options.getFrequencyPenalty()) + .setStream(options.isStream()) + .setPresencePenalty(options.getPresencePenalty()) + .setTemperature(options.getTemperature()) + .setTopP(options.getTopP()) + .setMaxTokens(options.getMaxTokens()) + .setResponseFormat(options.getResponseFormat()) + .setStop(options.getStop()) + .setTools(options.getTools()) + .setToolChoice(options.getToolChoice()) + .setSeed(options.getSeed()) + .setModel(options.getModel()); + BinaryData completeRequest = BinaryData.fromObject(completeRequestObj); + ExtraParameters extraParams = options.getExtraParams(); + if (extraParams != null) { + requestOptions.setHeader(HttpHeaderName.fromString("extra-parameters"), extraParams.toString()); + } + return completeWithResponse(completeRequest, requestOptions).getValue().toObject(ChatCompletions.class); + } + + /** + * Returns information about the AI model. + * The method makes a REST API call to the `/info` route on the given endpoint. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents some basic information about the AI model. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelInfo getModelInfo() { + // Generated convenience method for getModelInfoWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getModelInfoWithResponse(requestOptions).getValue().toObject(ModelInfo.class); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClientBuilder.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClientBuilder.java new file mode 100644 index 000000000000..760ad8e0ea27 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClientBuilder.java @@ -0,0 +1,355 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference; + +import com.azure.ai.inference.implementation.ChatCompletionsClientImpl; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; +import com.azure.core.client.traits.HttpTrait; +import com.azure.core.client.traits.KeyCredentialTrait; +import com.azure.core.client.traits.TokenCredentialTrait; +import com.azure.core.credential.KeyCredential; +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.KeyCredentialPolicy; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.ClientOptions; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.builder.ClientBuilderUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.serializer.JacksonAdapter; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * A builder for creating a new instance of the ChatCompletionsClient type. + */ +@ServiceClientBuilder(serviceClients = { ChatCompletionsClient.class, ChatCompletionsAsyncClient.class }) +public final class ChatCompletionsClientBuilder implements HttpTrait, + ConfigurationTrait, TokenCredentialTrait, + KeyCredentialTrait, EndpointTrait { + @Generated + private static final String SDK_NAME = "name"; + + @Generated + private static final String SDK_VERSION = "version"; + + @Generated + private static final String[] DEFAULT_SCOPES = new String[] { "https://ml.azure.com/.default" }; + + @Generated + private static final Map PROPERTIES = CoreUtils.getProperties("azure-ai-inference.properties"); + + @Generated + private final List pipelinePolicies; + + /** + * Create an instance of the ChatCompletionsClientBuilder. + */ + @Generated + public ChatCompletionsClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * The HTTP pipeline to send requests through. + */ + @Generated + private HttpPipeline pipeline; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public ChatCompletionsClientBuilder pipeline(HttpPipeline pipeline) { + if (this.pipeline != null && pipeline == null) { + LOGGER.atInfo().log("HttpPipeline is being set to 'null' when it was previously configured."); + } + this.pipeline = pipeline; + return this; + } + + /* + * The HTTP client used to send the request. + */ + @Generated + private HttpClient httpClient; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public ChatCompletionsClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The logging configuration for HTTP requests and responses. + */ + @Generated + private HttpLogOptions httpLogOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public ChatCompletionsClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = httpLogOptions; + return this; + } + + /* + * The client options such as application ID and custom headers to set on a request. + */ + @Generated + private ClientOptions clientOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public ChatCompletionsClientBuilder clientOptions(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + return this; + } + + /* + * The retry options to configure retry policy for failed requests. + */ + @Generated + private RetryOptions retryOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public ChatCompletionsClientBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public ChatCompletionsClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); + pipelinePolicies.add(customPolicy); + return this; + } + + /* + * The configuration store that is used during construction of the service client. + */ + @Generated + private Configuration configuration; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public ChatCompletionsClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The TokenCredential used for authentication. + */ + @Generated + private TokenCredential tokenCredential; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public ChatCompletionsClientBuilder credential(TokenCredential tokenCredential) { + this.tokenCredential = tokenCredential; + return this; + } + + /* + * The KeyCredential used for authentication. + */ + @Generated + private KeyCredential keyCredential; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public ChatCompletionsClientBuilder credential(KeyCredential keyCredential) { + this.keyCredential = keyCredential; + return this; + } + + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public ChatCompletionsClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * Service version + */ + @Generated + private ModelServiceVersion serviceVersion; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the ChatCompletionsClientBuilder. + */ + @Generated + public ChatCompletionsClientBuilder serviceVersion(ModelServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } + + /* + * The retry policy that will attempt to retry failed requests, if applicable. + */ + @Generated + private RetryPolicy retryPolicy; + + /** + * Sets The retry policy that will attempt to retry failed requests, if applicable. + * + * @param retryPolicy the retryPolicy value. + * @return the ChatCompletionsClientBuilder. + */ + @Generated + public ChatCompletionsClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Builds an instance of ChatCompletionsClientImpl with the provided parameters. + * + * @return an instance of ChatCompletionsClientImpl. + */ + @Generated + private ChatCompletionsClientImpl buildInnerClient() { + this.validateClient(); + HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + ModelServiceVersion localServiceVersion + = (serviceVersion != null) ? serviceVersion : ModelServiceVersion.getLatest(); + ChatCompletionsClientImpl client = new ChatCompletionsClientImpl(localPipeline, + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); + return client; + } + + @Generated + private void validateClient() { + // This method is invoked from 'buildInnerClient'/'buildClient' method. + // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + } + + @Generated + private HttpPipeline createHttpPipeline() { + Configuration buildConfiguration + = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; + ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; + List policies = new ArrayList<>(); + String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); + policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); + policies.add(new RequestIdPolicy()); + policies.add(new AddHeadersFromContextPolicy()); + HttpHeaders headers = CoreUtils.createHttpHeadersFromClientOptions(localClientOptions); + if (headers != null) { + policies.add(new AddHeadersPolicy(headers)); + } + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .forEach(p -> policies.add(p)); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); + policies.add(new AddDatePolicy()); + if (keyCredential != null) { + policies.add(new KeyCredentialPolicy("api-key", keyCredential)); + } + if (tokenCredential != null) { + policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); + } + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .forEach(p -> policies.add(p)); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(localHttpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(localClientOptions) + .build(); + return httpPipeline; + } + + /** + * Builds an instance of ChatCompletionsAsyncClient class. + * + * @return an instance of ChatCompletionsAsyncClient. + */ + @Generated + public ChatCompletionsAsyncClient buildAsyncClient() { + return new ChatCompletionsAsyncClient(buildInnerClient()); + } + + /** + * Builds an instance of ChatCompletionsClient class. + * + * @return an instance of ChatCompletionsClient. + */ + @Generated + public ChatCompletionsClient buildClient() { + return new ChatCompletionsClient(buildInnerClient()); + } + + private static final ClientLogger LOGGER = new ClientLogger(ChatCompletionsClientBuilder.class); +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ModelServiceVersion.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ModelServiceVersion.java new file mode 100644 index 000000000000..269914beaec8 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ModelServiceVersion.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference; + +import com.azure.core.util.ServiceVersion; + +/** + * Service version of ModelClient. + */ +public enum ModelServiceVersion implements ServiceVersion { + /** + * Enum value 2024-05-01-preview. + */ + V2024_05_01_PREVIEW("2024-05-01-preview"); + + private final String version; + + ModelServiceVersion(String version) { + this.version = version; + } + + /** + * {@inheritDoc} + */ + @Override + public String getVersion() { + return this.version; + } + + /** + * Gets the latest service version supported by this client library. + * + * @return The latest {@link ModelServiceVersion}. + */ + public static ModelServiceVersion getLatest() { + return V2024_05_01_PREVIEW; + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsClientImpl.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsClientImpl.java new file mode 100644 index 000000000000..f8dd0a0d45d3 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsClientImpl.java @@ -0,0 +1,436 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.implementation; + +import com.azure.ai.inference.ModelServiceVersion; +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.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerAdapter; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the ChatCompletionsClient type. + */ +public final class ChatCompletionsClientImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ChatCompletionsClientService service; + + /** + * Server parameter. + */ + private final String endpoint; + + /** + * Gets Server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Service version. + */ + private final ModelServiceVersion serviceVersion; + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public ModelServiceVersion getServiceVersion() { + return this.serviceVersion; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + public SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * Initializes an instance of ChatCompletionsClient client. + * + * @param endpoint Server parameter. + * @param serviceVersion Service version. + */ + public ChatCompletionsClientImpl(String endpoint, ModelServiceVersion serviceVersion) { + this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + } + + /** + * Initializes an instance of ChatCompletionsClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Server parameter. + * @param serviceVersion Service version. + */ + public ChatCompletionsClientImpl(HttpPipeline httpPipeline, String endpoint, ModelServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + } + + /** + * Initializes an instance of ChatCompletionsClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Server parameter. + * @param serviceVersion Service version. + */ + public ChatCompletionsClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, + ModelServiceVersion serviceVersion) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; + this.serviceVersion = serviceVersion; + this.service + = RestProxy.create(ChatCompletionsClientService.class, this.httpPipeline, this.getSerializerAdapter()); + } + + /** + * The interface defining all the services for ChatCompletionsClient to be used by the proxy service to perform REST + * calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ChatCompletionsClien") + public interface ChatCompletionsClientService { + @Post("/chat/completions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> complete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData completeRequest, RequestOptions requestOptions, Context context); + + @Post("/chat/completions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response completeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData completeRequest, RequestOptions requestOptions, Context context); + + @Get("/info") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getModelInfo(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/info") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getModelInfoSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + } + + /** + * Gets chat completions for the provided chat messages. + * Completions support a wide variety of tasks and generate text that continues from or "completes" + * provided prompt data. The method makes a REST API call to the `/chat/completions` route + * on the given endpoint. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
extra-parametersStringNoControls what happens if extra parameters, undefined + * by the REST API, + * are passed in the JSON request payload. + * This sets the HTTP request header `extra-parameters`. Allowed values: "error", "drop", "pass-through".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     messages (Required): [
+     *          (Required){
+     *             role: String(system/user/assistant/tool) (Required)
+     *         }
+     *     ]
+     *     frequency_penalty: Double (Optional)
+     *     stream: Boolean (Optional)
+     *     presence_penalty: Double (Optional)
+     *     temperature: Double (Optional)
+     *     top_p: Double (Optional)
+     *     max_tokens: Integer (Optional)
+     *     response_format (Optional): {
+     *         type: String (Required)
+     *     }
+     *     stop (Optional): [
+     *         String (Optional)
+     *     ]
+     *     tools (Optional): [
+     *          (Optional){
+     *             type: String (Required)
+     *         }
+     *     ]
+     *     tool_choice: BinaryData (Optional)
+     *     seed: Long (Optional)
+     *     model: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     created: long (Required)
+     *     model: String (Required)
+     *     usage (Required): {
+     *         completion_tokens: int (Required)
+     *         prompt_tokens: int (Required)
+     *         total_tokens: int (Required)
+     *     }
+     *     choices (Required): [
+     *          (Required){
+     *             index: int (Required)
+     *             finish_reason: String(stop/length/content_filter/tool_calls) (Required)
+     *             message (Required): {
+     *                 role: String(system/user/assistant/tool) (Required)
+     *                 content: String (Required)
+     *                 tool_calls (Optional): [
+     *                      (Optional){
+     *                         type: String (Required)
+     *                         id: String (Required)
+     *                     }
+     *                 ]
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param completeRequest The completeRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return chat completions for the provided chat messages. + * Completions support a wide variety of tasks and generate text that continues from or "completes" + * provided prompt data along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> completeWithResponseAsync(BinaryData completeRequest, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.complete(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, completeRequest, requestOptions, context)); + } + + /** + * Gets chat completions for the provided chat messages. + * Completions support a wide variety of tasks and generate text that continues from or "completes" + * provided prompt data. The method makes a REST API call to the `/chat/completions` route + * on the given endpoint. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
extra-parametersStringNoControls what happens if extra parameters, undefined + * by the REST API, + * are passed in the JSON request payload. + * This sets the HTTP request header `extra-parameters`. Allowed values: "error", "drop", "pass-through".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     messages (Required): [
+     *          (Required){
+     *             role: String(system/user/assistant/tool) (Required)
+     *         }
+     *     ]
+     *     frequency_penalty: Double (Optional)
+     *     stream: Boolean (Optional)
+     *     presence_penalty: Double (Optional)
+     *     temperature: Double (Optional)
+     *     top_p: Double (Optional)
+     *     max_tokens: Integer (Optional)
+     *     response_format (Optional): {
+     *         type: String (Required)
+     *     }
+     *     stop (Optional): [
+     *         String (Optional)
+     *     ]
+     *     tools (Optional): [
+     *          (Optional){
+     *             type: String (Required)
+     *         }
+     *     ]
+     *     tool_choice: BinaryData (Optional)
+     *     seed: Long (Optional)
+     *     model: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     created: long (Required)
+     *     model: String (Required)
+     *     usage (Required): {
+     *         completion_tokens: int (Required)
+     *         prompt_tokens: int (Required)
+     *         total_tokens: int (Required)
+     *     }
+     *     choices (Required): [
+     *          (Required){
+     *             index: int (Required)
+     *             finish_reason: String(stop/length/content_filter/tool_calls) (Required)
+     *             message (Required): {
+     *                 role: String(system/user/assistant/tool) (Required)
+     *                 content: String (Required)
+     *                 tool_calls (Optional): [
+     *                      (Optional){
+     *                         type: String (Required)
+     *                         id: String (Required)
+     *                     }
+     *                 ]
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param completeRequest The completeRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return chat completions for the provided chat messages. + * Completions support a wide variety of tasks and generate text that continues from or "completes" + * provided prompt data along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response completeWithResponse(BinaryData completeRequest, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.completeSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, completeRequest, + requestOptions, Context.NONE); + } + + /** + * Returns information about the AI model. + * The method makes a REST API call to the `/info` route on the given endpoint. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     model_name: String (Required)
+     *     model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat) (Required)
+     *     model_provider_name: String (Required)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents some basic information about the AI model along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getModelInfoWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getModelInfo(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * Returns information about the AI model. + * The method makes a REST API call to the `/info` route on the given endpoint. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     model_name: String (Required)
+     *     model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat) (Required)
+     *     model_provider_name: String (Required)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents some basic information about the AI model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getModelInfoWithResponse(RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getModelInfoSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + requestOptions, Context.NONE); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/CompleteOptions.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/CompleteOptions.java new file mode 100644 index 000000000000..e5d92064339e --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/CompleteOptions.java @@ -0,0 +1,501 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.implementation.models; + +import com.azure.ai.inference.models.ChatCompletionsResponseFormat; +import com.azure.ai.inference.models.ChatCompletionsToolDefinition; +import com.azure.ai.inference.models.ChatRequestMessage; +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.BinaryData; +import java.util.List; + +/** + * Options for complete API. + */ +@Fluent +public final class CompleteOptions { + /* + * The collection of context messages associated with this chat completions request. + * Typical usage begins with a chat message for the System role that provides instructions for + * the behavior of the assistant, followed by alternating messages between the User and + * Assistant roles. + */ + @Generated + private final List messages; + + /* + * A value that influences the probability of generated tokens appearing based on their cumulative + * frequency in generated text. + * Positive values will make tokens less likely to appear as their frequency increases and + * decrease the likelihood of the model repeating the same statements verbatim. + * Supported range is [-2, 2]. + */ + @Generated + private Double frequencyPenalty; + + /* + * A value indicating whether chat completions should be streamed for this request. + */ + @Generated + private Boolean stream; + + /* + * A value that influences the probability of generated tokens appearing based on their existing + * presence in generated text. + * Positive values will make tokens less likely to appear when they already exist and increase the + * model's likelihood to output new topics. + * Supported range is [-2, 2]. + */ + @Generated + private Double presencePenalty; + + /* + * The sampling temperature to use that controls the apparent creativity of generated completions. + * Higher values will make output more random while lower values will make results more focused + * and deterministic. + * It is not recommended to modify temperature and top_p for the same completions request as the + * interaction of these two settings is difficult to predict. + * Supported range is [0, 1]. + */ + @Generated + private Double temperature; + + /* + * An alternative to sampling with temperature called nucleus sampling. This value causes the + * model to consider the results of tokens with the provided probability mass. As an example, a + * value of 0.15 will cause only the tokens comprising the top 15% of probability mass to be + * considered. + * It is not recommended to modify temperature and top_p for the same completions request as the + * interaction of these two settings is difficult to predict. + * Supported range is [0, 1]. + */ + @Generated + private Double topP; + + /* + * The maximum number of tokens to generate. + */ + @Generated + private Integer maxTokens; + + /* + * The format that the model must output. Use this to enable JSON mode instead of the default text mode. + * Note that to enable JSON mode, some AI models may also require you to instruct the model to produce JSON + * via a system or user message. + */ + @Generated + private ChatCompletionsResponseFormat responseFormat; + + /* + * A collection of textual sequences that will end completions generation. + */ + @Generated + private List stop; + + /* + * The available tool definitions that the chat completions request can use, including caller-defined functions. + */ + @Generated + private List tools; + + /* + * If specified, the model will configure which of the provided tools it can use for the chat completions response. + */ + @Generated + private BinaryData toolChoice; + + /* + * If specified, the system will make a best effort to sample deterministically such that repeated requests with the + * same seed and parameters should return the same result. Determinism is not guaranteed. + */ + @Generated + private Long seed; + + /* + * ID of the specific AI model to use, if more than one model is available on the endpoint. + */ + @Generated + private String model; + + /* + * Controls what happens if extra parameters, undefined by the REST API, + * are passed in the JSON request payload. + * This sets the HTTP request header `extra-parameters`. + */ + @Generated + private ExtraParameters extraParams; + + /** + * Creates an instance of CompleteOptions class. + * + * @param messages the messages value to set. + */ + @Generated + public CompleteOptions(List messages) { + this.messages = messages; + } + + /** + * Get the messages property: The collection of context messages associated with this chat completions request. + * Typical usage begins with a chat message for the System role that provides instructions for + * the behavior of the assistant, followed by alternating messages between the User and + * Assistant roles. + * + * @return the messages value. + */ + @Generated + public List getMessages() { + return this.messages; + } + + /** + * Get the frequencyPenalty property: A value that influences the probability of generated tokens appearing based on + * their cumulative + * frequency in generated text. + * Positive values will make tokens less likely to appear as their frequency increases and + * decrease the likelihood of the model repeating the same statements verbatim. + * Supported range is [-2, 2]. + * + * @return the frequencyPenalty value. + */ + @Generated + public Double getFrequencyPenalty() { + return this.frequencyPenalty; + } + + /** + * Set the frequencyPenalty property: A value that influences the probability of generated tokens appearing based on + * their cumulative + * frequency in generated text. + * Positive values will make tokens less likely to appear as their frequency increases and + * decrease the likelihood of the model repeating the same statements verbatim. + * Supported range is [-2, 2]. + * + * @param frequencyPenalty the frequencyPenalty value to set. + * @return the CompleteOptions object itself. + */ + @Generated + public CompleteOptions setFrequencyPenalty(Double frequencyPenalty) { + this.frequencyPenalty = frequencyPenalty; + return this; + } + + /** + * Get the stream property: A value indicating whether chat completions should be streamed for this request. + * + * @return the stream value. + */ + @Generated + public Boolean isStream() { + return this.stream; + } + + /** + * Set the stream property: A value indicating whether chat completions should be streamed for this request. + * + * @param stream the stream value to set. + * @return the CompleteOptions object itself. + */ + @Generated + public CompleteOptions setStream(Boolean stream) { + this.stream = stream; + return this; + } + + /** + * Get the presencePenalty property: A value that influences the probability of generated tokens appearing based on + * their existing + * presence in generated text. + * Positive values will make tokens less likely to appear when they already exist and increase the + * model's likelihood to output new topics. + * Supported range is [-2, 2]. + * + * @return the presencePenalty value. + */ + @Generated + public Double getPresencePenalty() { + return this.presencePenalty; + } + + /** + * Set the presencePenalty property: A value that influences the probability of generated tokens appearing based on + * their existing + * presence in generated text. + * Positive values will make tokens less likely to appear when they already exist and increase the + * model's likelihood to output new topics. + * Supported range is [-2, 2]. + * + * @param presencePenalty the presencePenalty value to set. + * @return the CompleteOptions object itself. + */ + @Generated + public CompleteOptions setPresencePenalty(Double presencePenalty) { + this.presencePenalty = presencePenalty; + return this; + } + + /** + * Get the temperature property: The sampling temperature to use that controls the apparent creativity of generated + * completions. + * Higher values will make output more random while lower values will make results more focused + * and deterministic. + * It is not recommended to modify temperature and top_p for the same completions request as the + * interaction of these two settings is difficult to predict. + * Supported range is [0, 1]. + * + * @return the temperature value. + */ + @Generated + public Double getTemperature() { + return this.temperature; + } + + /** + * Set the temperature property: The sampling temperature to use that controls the apparent creativity of generated + * completions. + * Higher values will make output more random while lower values will make results more focused + * and deterministic. + * It is not recommended to modify temperature and top_p for the same completions request as the + * interaction of these two settings is difficult to predict. + * Supported range is [0, 1]. + * + * @param temperature the temperature value to set. + * @return the CompleteOptions object itself. + */ + @Generated + public CompleteOptions setTemperature(Double temperature) { + this.temperature = temperature; + return this; + } + + /** + * Get the topP property: An alternative to sampling with temperature called nucleus sampling. This value causes the + * model to consider the results of tokens with the provided probability mass. As an example, a + * value of 0.15 will cause only the tokens comprising the top 15% of probability mass to be + * considered. + * It is not recommended to modify temperature and top_p for the same completions request as the + * interaction of these two settings is difficult to predict. + * Supported range is [0, 1]. + * + * @return the topP value. + */ + @Generated + public Double getTopP() { + return this.topP; + } + + /** + * Set the topP property: An alternative to sampling with temperature called nucleus sampling. This value causes the + * model to consider the results of tokens with the provided probability mass. As an example, a + * value of 0.15 will cause only the tokens comprising the top 15% of probability mass to be + * considered. + * It is not recommended to modify temperature and top_p for the same completions request as the + * interaction of these two settings is difficult to predict. + * Supported range is [0, 1]. + * + * @param topP the topP value to set. + * @return the CompleteOptions object itself. + */ + @Generated + public CompleteOptions setTopP(Double topP) { + this.topP = topP; + return this; + } + + /** + * Get the maxTokens property: The maximum number of tokens to generate. + * + * @return the maxTokens value. + */ + @Generated + public Integer getMaxTokens() { + return this.maxTokens; + } + + /** + * Set the maxTokens property: The maximum number of tokens to generate. + * + * @param maxTokens the maxTokens value to set. + * @return the CompleteOptions object itself. + */ + @Generated + public CompleteOptions setMaxTokens(Integer maxTokens) { + this.maxTokens = maxTokens; + return this; + } + + /** + * Get the responseFormat property: The format that the model must output. Use this to enable JSON mode instead of + * the default text mode. + * Note that to enable JSON mode, some AI models may also require you to instruct the model to produce JSON + * via a system or user message. + * + * @return the responseFormat value. + */ + @Generated + public ChatCompletionsResponseFormat getResponseFormat() { + return this.responseFormat; + } + + /** + * Set the responseFormat property: The format that the model must output. Use this to enable JSON mode instead of + * the default text mode. + * Note that to enable JSON mode, some AI models may also require you to instruct the model to produce JSON + * via a system or user message. + * + * @param responseFormat the responseFormat value to set. + * @return the CompleteOptions object itself. + */ + @Generated + public CompleteOptions setResponseFormat(ChatCompletionsResponseFormat responseFormat) { + this.responseFormat = responseFormat; + return this; + } + + /** + * Get the stop property: A collection of textual sequences that will end completions generation. + * + * @return the stop value. + */ + @Generated + public List getStop() { + return this.stop; + } + + /** + * Set the stop property: A collection of textual sequences that will end completions generation. + * + * @param stop the stop value to set. + * @return the CompleteOptions object itself. + */ + @Generated + public CompleteOptions setStop(List stop) { + this.stop = stop; + return this; + } + + /** + * Get the tools property: The available tool definitions that the chat completions request can use, including + * caller-defined functions. + * + * @return the tools value. + */ + @Generated + public List getTools() { + return this.tools; + } + + /** + * Set the tools property: The available tool definitions that the chat completions request can use, including + * caller-defined functions. + * + * @param tools the tools value to set. + * @return the CompleteOptions object itself. + */ + @Generated + public CompleteOptions setTools(List tools) { + this.tools = tools; + return this; + } + + /** + * Get the toolChoice property: If specified, the model will configure which of the provided tools it can use for + * the chat completions response. + * + * @return the toolChoice value. + */ + @Generated + public BinaryData getToolChoice() { + return this.toolChoice; + } + + /** + * Set the toolChoice property: If specified, the model will configure which of the provided tools it can use for + * the chat completions response. + * + * @param toolChoice the toolChoice value to set. + * @return the CompleteOptions object itself. + */ + @Generated + public CompleteOptions setToolChoice(BinaryData toolChoice) { + this.toolChoice = toolChoice; + return this; + } + + /** + * Get the seed property: If specified, the system will make a best effort to sample deterministically such that + * repeated requests with the + * same seed and parameters should return the same result. Determinism is not guaranteed. + * + * @return the seed value. + */ + @Generated + public Long getSeed() { + return this.seed; + } + + /** + * Set the seed property: If specified, the system will make a best effort to sample deterministically such that + * repeated requests with the + * same seed and parameters should return the same result. Determinism is not guaranteed. + * + * @param seed the seed value to set. + * @return the CompleteOptions object itself. + */ + @Generated + public CompleteOptions setSeed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Get the model property: ID of the specific AI model to use, if more than one model is available on the endpoint. + * + * @return the model value. + */ + @Generated + public String getModel() { + return this.model; + } + + /** + * Set the model property: ID of the specific AI model to use, if more than one model is available on the endpoint. + * + * @param model the model value to set. + * @return the CompleteOptions object itself. + */ + @Generated + public CompleteOptions setModel(String model) { + this.model = model; + return this; + } + + /** + * Get the extraParams property: Controls what happens if extra parameters, undefined by the REST API, + * are passed in the JSON request payload. + * This sets the HTTP request header `extra-parameters`. + * + * @return the extraParams value. + */ + @Generated + public ExtraParameters getExtraParams() { + return this.extraParams; + } + + /** + * Set the extraParams property: Controls what happens if extra parameters, undefined by the REST API, + * are passed in the JSON request payload. + * This sets the HTTP request header `extra-parameters`. + * + * @param extraParams the extraParams value to set. + * @return the CompleteOptions object itself. + */ + @Generated + public CompleteOptions setExtraParams(ExtraParameters extraParams) { + this.extraParams = extraParams; + return this; + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/CompleteRequest.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/CompleteRequest.java new file mode 100644 index 000000000000..d0e37318e1b4 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/CompleteRequest.java @@ -0,0 +1,575 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.implementation.models; + +import com.azure.ai.inference.models.ChatCompletionsResponseFormat; +import com.azure.ai.inference.models.ChatCompletionsToolDefinition; +import com.azure.ai.inference.models.ChatRequestMessage; +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.BinaryData; +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 CompleteRequest model. + */ +@Fluent +public final class CompleteRequest implements JsonSerializable { + /* + * The collection of context messages associated with this chat completions request. + * Typical usage begins with a chat message for the System role that provides instructions for + * the behavior of the assistant, followed by alternating messages between the User and + * Assistant roles. + */ + @Generated + private final List messages; + + /* + * A value that influences the probability of generated tokens appearing based on their cumulative + * frequency in generated text. + * Positive values will make tokens less likely to appear as their frequency increases and + * decrease the likelihood of the model repeating the same statements verbatim. + * Supported range is [-2, 2]. + */ + @Generated + private Double frequencyPenalty; + + /* + * A value indicating whether chat completions should be streamed for this request. + */ + @Generated + private Boolean stream; + + /* + * A value that influences the probability of generated tokens appearing based on their existing + * presence in generated text. + * Positive values will make tokens less likely to appear when they already exist and increase the + * model's likelihood to output new topics. + * Supported range is [-2, 2]. + */ + @Generated + private Double presencePenalty; + + /* + * The sampling temperature to use that controls the apparent creativity of generated completions. + * Higher values will make output more random while lower values will make results more focused + * and deterministic. + * It is not recommended to modify temperature and top_p for the same completions request as the + * interaction of these two settings is difficult to predict. + * Supported range is [0, 1]. + */ + @Generated + private Double temperature; + + /* + * An alternative to sampling with temperature called nucleus sampling. This value causes the + * model to consider the results of tokens with the provided probability mass. As an example, a + * value of 0.15 will cause only the tokens comprising the top 15% of probability mass to be + * considered. + * It is not recommended to modify temperature and top_p for the same completions request as the + * interaction of these two settings is difficult to predict. + * Supported range is [0, 1]. + */ + @Generated + private Double topP; + + /* + * The maximum number of tokens to generate. + */ + @Generated + private Integer maxTokens; + + /* + * The format that the model must output. Use this to enable JSON mode instead of the default text mode. + * Note that to enable JSON mode, some AI models may also require you to instruct the model to produce JSON + * via a system or user message. + */ + @Generated + private ChatCompletionsResponseFormat responseFormat; + + /* + * A collection of textual sequences that will end completions generation. + */ + @Generated + private List stop; + + /* + * The available tool definitions that the chat completions request can use, including caller-defined functions. + */ + @Generated + private List tools; + + /* + * If specified, the model will configure which of the provided tools it can use for the chat completions response. + */ + @Generated + private BinaryData toolChoice; + + /* + * If specified, the system will make a best effort to sample deterministically such that repeated requests with the + * same seed and parameters should return the same result. Determinism is not guaranteed. + */ + @Generated + private Long seed; + + /* + * ID of the specific AI model to use, if more than one model is available on the endpoint. + */ + @Generated + private String model; + + /** + * Creates an instance of CompleteRequest class. + * + * @param messages the messages value to set. + */ + @Generated + public CompleteRequest(List messages) { + this.messages = messages; + } + + /** + * Get the messages property: The collection of context messages associated with this chat completions request. + * Typical usage begins with a chat message for the System role that provides instructions for + * the behavior of the assistant, followed by alternating messages between the User and + * Assistant roles. + * + * @return the messages value. + */ + @Generated + public List getMessages() { + return this.messages; + } + + /** + * Get the frequencyPenalty property: A value that influences the probability of generated tokens appearing based on + * their cumulative + * frequency in generated text. + * Positive values will make tokens less likely to appear as their frequency increases and + * decrease the likelihood of the model repeating the same statements verbatim. + * Supported range is [-2, 2]. + * + * @return the frequencyPenalty value. + */ + @Generated + public Double getFrequencyPenalty() { + return this.frequencyPenalty; + } + + /** + * Set the frequencyPenalty property: A value that influences the probability of generated tokens appearing based on + * their cumulative + * frequency in generated text. + * Positive values will make tokens less likely to appear as their frequency increases and + * decrease the likelihood of the model repeating the same statements verbatim. + * Supported range is [-2, 2]. + * + * @param frequencyPenalty the frequencyPenalty value to set. + * @return the CompleteRequest object itself. + */ + @Generated + public CompleteRequest setFrequencyPenalty(Double frequencyPenalty) { + this.frequencyPenalty = frequencyPenalty; + return this; + } + + /** + * Get the stream property: A value indicating whether chat completions should be streamed for this request. + * + * @return the stream value. + */ + @Generated + public Boolean isStream() { + return this.stream; + } + + /** + * Set the stream property: A value indicating whether chat completions should be streamed for this request. + * + * @param stream the stream value to set. + * @return the CompleteRequest object itself. + */ + @Generated + public CompleteRequest setStream(Boolean stream) { + this.stream = stream; + return this; + } + + /** + * Get the presencePenalty property: A value that influences the probability of generated tokens appearing based on + * their existing + * presence in generated text. + * Positive values will make tokens less likely to appear when they already exist and increase the + * model's likelihood to output new topics. + * Supported range is [-2, 2]. + * + * @return the presencePenalty value. + */ + @Generated + public Double getPresencePenalty() { + return this.presencePenalty; + } + + /** + * Set the presencePenalty property: A value that influences the probability of generated tokens appearing based on + * their existing + * presence in generated text. + * Positive values will make tokens less likely to appear when they already exist and increase the + * model's likelihood to output new topics. + * Supported range is [-2, 2]. + * + * @param presencePenalty the presencePenalty value to set. + * @return the CompleteRequest object itself. + */ + @Generated + public CompleteRequest setPresencePenalty(Double presencePenalty) { + this.presencePenalty = presencePenalty; + return this; + } + + /** + * Get the temperature property: The sampling temperature to use that controls the apparent creativity of generated + * completions. + * Higher values will make output more random while lower values will make results more focused + * and deterministic. + * It is not recommended to modify temperature and top_p for the same completions request as the + * interaction of these two settings is difficult to predict. + * Supported range is [0, 1]. + * + * @return the temperature value. + */ + @Generated + public Double getTemperature() { + return this.temperature; + } + + /** + * Set the temperature property: The sampling temperature to use that controls the apparent creativity of generated + * completions. + * Higher values will make output more random while lower values will make results more focused + * and deterministic. + * It is not recommended to modify temperature and top_p for the same completions request as the + * interaction of these two settings is difficult to predict. + * Supported range is [0, 1]. + * + * @param temperature the temperature value to set. + * @return the CompleteRequest object itself. + */ + @Generated + public CompleteRequest setTemperature(Double temperature) { + this.temperature = temperature; + return this; + } + + /** + * Get the topP property: An alternative to sampling with temperature called nucleus sampling. This value causes the + * model to consider the results of tokens with the provided probability mass. As an example, a + * value of 0.15 will cause only the tokens comprising the top 15% of probability mass to be + * considered. + * It is not recommended to modify temperature and top_p for the same completions request as the + * interaction of these two settings is difficult to predict. + * Supported range is [0, 1]. + * + * @return the topP value. + */ + @Generated + public Double getTopP() { + return this.topP; + } + + /** + * Set the topP property: An alternative to sampling with temperature called nucleus sampling. This value causes the + * model to consider the results of tokens with the provided probability mass. As an example, a + * value of 0.15 will cause only the tokens comprising the top 15% of probability mass to be + * considered. + * It is not recommended to modify temperature and top_p for the same completions request as the + * interaction of these two settings is difficult to predict. + * Supported range is [0, 1]. + * + * @param topP the topP value to set. + * @return the CompleteRequest object itself. + */ + @Generated + public CompleteRequest setTopP(Double topP) { + this.topP = topP; + return this; + } + + /** + * Get the maxTokens property: The maximum number of tokens to generate. + * + * @return the maxTokens value. + */ + @Generated + public Integer getMaxTokens() { + return this.maxTokens; + } + + /** + * Set the maxTokens property: The maximum number of tokens to generate. + * + * @param maxTokens the maxTokens value to set. + * @return the CompleteRequest object itself. + */ + @Generated + public CompleteRequest setMaxTokens(Integer maxTokens) { + this.maxTokens = maxTokens; + return this; + } + + /** + * Get the responseFormat property: The format that the model must output. Use this to enable JSON mode instead of + * the default text mode. + * Note that to enable JSON mode, some AI models may also require you to instruct the model to produce JSON + * via a system or user message. + * + * @return the responseFormat value. + */ + @Generated + public ChatCompletionsResponseFormat getResponseFormat() { + return this.responseFormat; + } + + /** + * Set the responseFormat property: The format that the model must output. Use this to enable JSON mode instead of + * the default text mode. + * Note that to enable JSON mode, some AI models may also require you to instruct the model to produce JSON + * via a system or user message. + * + * @param responseFormat the responseFormat value to set. + * @return the CompleteRequest object itself. + */ + @Generated + public CompleteRequest setResponseFormat(ChatCompletionsResponseFormat responseFormat) { + this.responseFormat = responseFormat; + return this; + } + + /** + * Get the stop property: A collection of textual sequences that will end completions generation. + * + * @return the stop value. + */ + @Generated + public List getStop() { + return this.stop; + } + + /** + * Set the stop property: A collection of textual sequences that will end completions generation. + * + * @param stop the stop value to set. + * @return the CompleteRequest object itself. + */ + @Generated + public CompleteRequest setStop(List stop) { + this.stop = stop; + return this; + } + + /** + * Get the tools property: The available tool definitions that the chat completions request can use, including + * caller-defined functions. + * + * @return the tools value. + */ + @Generated + public List getTools() { + return this.tools; + } + + /** + * Set the tools property: The available tool definitions that the chat completions request can use, including + * caller-defined functions. + * + * @param tools the tools value to set. + * @return the CompleteRequest object itself. + */ + @Generated + public CompleteRequest setTools(List tools) { + this.tools = tools; + return this; + } + + /** + * Get the toolChoice property: If specified, the model will configure which of the provided tools it can use for + * the chat completions response. + * + * @return the toolChoice value. + */ + @Generated + public BinaryData getToolChoice() { + return this.toolChoice; + } + + /** + * Set the toolChoice property: If specified, the model will configure which of the provided tools it can use for + * the chat completions response. + * + * @param toolChoice the toolChoice value to set. + * @return the CompleteRequest object itself. + */ + @Generated + public CompleteRequest setToolChoice(BinaryData toolChoice) { + this.toolChoice = toolChoice; + return this; + } + + /** + * Get the seed property: If specified, the system will make a best effort to sample deterministically such that + * repeated requests with the + * same seed and parameters should return the same result. Determinism is not guaranteed. + * + * @return the seed value. + */ + @Generated + public Long getSeed() { + return this.seed; + } + + /** + * Set the seed property: If specified, the system will make a best effort to sample deterministically such that + * repeated requests with the + * same seed and parameters should return the same result. Determinism is not guaranteed. + * + * @param seed the seed value to set. + * @return the CompleteRequest object itself. + */ + @Generated + public CompleteRequest setSeed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Get the model property: ID of the specific AI model to use, if more than one model is available on the endpoint. + * + * @return the model value. + */ + @Generated + public String getModel() { + return this.model; + } + + /** + * Set the model property: ID of the specific AI model to use, if more than one model is available on the endpoint. + * + * @param model the model value to set. + * @return the CompleteRequest object itself. + */ + @Generated + public CompleteRequest setModel(String model) { + this.model = model; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("messages", this.messages, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("frequency_penalty", this.frequencyPenalty); + jsonWriter.writeBooleanField("stream", this.stream); + jsonWriter.writeNumberField("presence_penalty", this.presencePenalty); + jsonWriter.writeNumberField("temperature", this.temperature); + jsonWriter.writeNumberField("top_p", this.topP); + jsonWriter.writeNumberField("max_tokens", this.maxTokens); + jsonWriter.writeJsonField("response_format", this.responseFormat); + jsonWriter.writeArrayField("stop", this.stop, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("tools", this.tools, (writer, element) -> writer.writeJson(element)); + if (this.toolChoice != null) { + jsonWriter.writeUntypedField("tool_choice", this.toolChoice.toObject(Object.class)); + } + jsonWriter.writeNumberField("seed", this.seed); + jsonWriter.writeStringField("model", this.model); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CompleteRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CompleteRequest if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CompleteRequest. + */ + @Generated + public static CompleteRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List messages = null; + Double frequencyPenalty = null; + Boolean stream = null; + Double presencePenalty = null; + Double temperature = null; + Double topP = null; + Integer maxTokens = null; + ChatCompletionsResponseFormat responseFormat = null; + List stop = null; + List tools = null; + BinaryData toolChoice = null; + Long seed = null; + String model = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("messages".equals(fieldName)) { + messages = reader.readArray(reader1 -> ChatRequestMessage.fromJson(reader1)); + } else if ("frequency_penalty".equals(fieldName)) { + frequencyPenalty = reader.getNullable(JsonReader::getDouble); + } else if ("stream".equals(fieldName)) { + stream = reader.getNullable(JsonReader::getBoolean); + } else if ("presence_penalty".equals(fieldName)) { + presencePenalty = reader.getNullable(JsonReader::getDouble); + } else if ("temperature".equals(fieldName)) { + temperature = reader.getNullable(JsonReader::getDouble); + } else if ("top_p".equals(fieldName)) { + topP = reader.getNullable(JsonReader::getDouble); + } else if ("max_tokens".equals(fieldName)) { + maxTokens = reader.getNullable(JsonReader::getInt); + } else if ("response_format".equals(fieldName)) { + responseFormat = ChatCompletionsResponseFormat.fromJson(reader); + } else if ("stop".equals(fieldName)) { + stop = reader.readArray(reader1 -> reader1.getString()); + } else if ("tools".equals(fieldName)) { + tools = reader.readArray(reader1 -> ChatCompletionsToolDefinition.fromJson(reader1)); + } else if ("tool_choice".equals(fieldName)) { + toolChoice + = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); + } else if ("seed".equals(fieldName)) { + seed = reader.getNullable(JsonReader::getLong); + } else if ("model".equals(fieldName)) { + model = reader.getString(); + } else { + reader.skipChildren(); + } + } + CompleteRequest deserializedCompleteRequest = new CompleteRequest(messages); + deserializedCompleteRequest.frequencyPenalty = frequencyPenalty; + deserializedCompleteRequest.stream = stream; + deserializedCompleteRequest.presencePenalty = presencePenalty; + deserializedCompleteRequest.temperature = temperature; + deserializedCompleteRequest.topP = topP; + deserializedCompleteRequest.maxTokens = maxTokens; + deserializedCompleteRequest.responseFormat = responseFormat; + deserializedCompleteRequest.stop = stop; + deserializedCompleteRequest.tools = tools; + deserializedCompleteRequest.toolChoice = toolChoice; + deserializedCompleteRequest.seed = seed; + deserializedCompleteRequest.model = model; + + return deserializedCompleteRequest; + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/ExtraParameters.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/ExtraParameters.java new file mode 100644 index 000000000000..53e3ff8fa2ed --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/ExtraParameters.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Controls what happens if extra parameters, undefined by the REST API, are passed in the JSON request payload. + */ +public final class ExtraParameters extends ExpandableStringEnum { + /** + * The service will error if it detected extra parameters in the request payload. This is the service default. + */ + @Generated + public static final ExtraParameters ERROR = fromString("error"); + + /** + * The service will ignore (drop) extra parameters in the request payload. It will only pass the known parameters to + * the back-end AI model. + */ + @Generated + public static final ExtraParameters DROP = fromString("drop"); + + /** + * The service will pass extra parameters to the back-end AI model. + */ + @Generated + public static final ExtraParameters PASS_THROUGH = fromString("pass-through"); + + /** + * Creates a new instance of ExtraParameters value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public ExtraParameters() { + } + + /** + * Creates or finds a ExtraParameters from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExtraParameters. + */ + @Generated + public static ExtraParameters fromString(String name) { + return fromString(name, ExtraParameters.class); + } + + /** + * Gets known ExtraParameters values. + * + * @return known ExtraParameters values. + */ + @Generated + public static Collection values() { + return values(ExtraParameters.class); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/package-info.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/package-info.java new file mode 100644 index 000000000000..165b7203bc56 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the data models for Model. + */ +package com.azure.ai.inference.implementation.models; diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/package-info.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/package-info.java new file mode 100644 index 000000000000..5acfabb9301b --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the implementations for Model. + */ +package com.azure.ai.inference.implementation; diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatChoice.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatChoice.java new file mode 100644 index 000000000000..4386f2da79f3 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatChoice.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The representation of a single prompt completion as part of an overall chat completions request. + * Generally, `n` choices are generated per provided prompt with a default value of 1. + * Token limits and other settings may limit the number of choices generated. + */ +@Immutable +public final class ChatChoice implements JsonSerializable { + /* + * The ordered index associated with this chat completions choice. + */ + @Generated + private final int index; + + /* + * The reason that this chat completions choice completed its generated. + */ + @Generated + private final CompletionsFinishReason finishReason; + + /* + * The chat message for a given chat completions prompt. + */ + @Generated + private final ChatResponseMessage message; + + /** + * Creates an instance of ChatChoice class. + * + * @param index the index value to set. + * @param finishReason the finishReason value to set. + * @param message the message value to set. + */ + @Generated + private ChatChoice(int index, CompletionsFinishReason finishReason, ChatResponseMessage message) { + this.index = index; + this.finishReason = finishReason; + this.message = message; + } + + /** + * Get the index property: The ordered index associated with this chat completions choice. + * + * @return the index value. + */ + @Generated + public int getIndex() { + return this.index; + } + + /** + * Get the finishReason property: The reason that this chat completions choice completed its generated. + * + * @return the finishReason value. + */ + @Generated + public CompletionsFinishReason getFinishReason() { + return this.finishReason; + } + + /** + * Get the message property: The chat message for a given chat completions prompt. + * + * @return the message value. + */ + @Generated + public ChatResponseMessage getMessage() { + return this.message; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("index", this.index); + jsonWriter.writeStringField("finish_reason", this.finishReason == null ? null : this.finishReason.toString()); + jsonWriter.writeJsonField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChatChoice from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChatChoice if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ChatChoice. + */ + @Generated + public static ChatChoice fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int index = 0; + CompletionsFinishReason finishReason = null; + ChatResponseMessage message = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("index".equals(fieldName)) { + index = reader.getInt(); + } else if ("finish_reason".equals(fieldName)) { + finishReason = CompletionsFinishReason.fromString(reader.getString()); + } else if ("message".equals(fieldName)) { + message = ChatResponseMessage.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return new ChatChoice(index, finishReason, message); + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletions.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletions.java new file mode 100644 index 000000000000..c959cb487d44 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletions.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; +import java.util.List; + +/** + * Representation of the response data from a chat completions request. + * Completions support a wide variety of tasks and generate text that continues from or "completes" + * provided prompt data. + */ +@Immutable +public final class ChatCompletions implements JsonSerializable { + /* + * A unique identifier associated with this chat completions response. + */ + @Generated + private final String id; + + /* + * The first timestamp associated with generation activity for this completions response, + * represented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970. + */ + @Generated + private final long created; + + /* + * The model used for the chat completion. + */ + @Generated + private final String model; + + /* + * Usage information for tokens processed and generated as part of this completions operation. + */ + @Generated + private final CompletionsUsage usage; + + /* + * The collection of completions choices associated with this completions response. + * Generally, `n` choices are generated per provided prompt with a default value of 1. + * Token limits and other settings may limit the number of choices generated. + */ + @Generated + private final List choices; + + /** + * Creates an instance of ChatCompletions class. + * + * @param id the id value to set. + * @param created the created value to set. + * @param model the model value to set. + * @param usage the usage value to set. + * @param choices the choices value to set. + */ + @Generated + private ChatCompletions(String id, OffsetDateTime created, String model, CompletionsUsage usage, + List choices) { + this.id = id; + if (created == null) { + this.created = 0L; + } else { + this.created = created.toEpochSecond(); + } + this.model = model; + this.usage = usage; + this.choices = choices; + } + + /** + * Get the id property: A unique identifier associated with this chat completions response. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the created property: The first timestamp associated with generation activity for this completions response, + * represented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970. + * + * @return the created value. + */ + @Generated + public OffsetDateTime getCreated() { + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.created), ZoneOffset.UTC); + } + + /** + * Get the model property: The model used for the chat completion. + * + * @return the model value. + */ + @Generated + public String getModel() { + return this.model; + } + + /** + * Get the usage property: Usage information for tokens processed and generated as part of this completions + * operation. + * + * @return the usage value. + */ + @Generated + public CompletionsUsage getUsage() { + return this.usage; + } + + /** + * Get the choices property: The collection of completions choices associated with this completions response. + * Generally, `n` choices are generated per provided prompt with a default value of 1. + * Token limits and other settings may limit the number of choices generated. + * + * @return the choices value. + */ + @Generated + public List getChoices() { + return this.choices; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeLongField("created", this.created); + jsonWriter.writeStringField("model", this.model); + jsonWriter.writeJsonField("usage", this.usage); + jsonWriter.writeArrayField("choices", this.choices, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChatCompletions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChatCompletions if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ChatCompletions. + */ + @Generated + public static ChatCompletions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + OffsetDateTime created = null; + String model = null; + CompletionsUsage usage = null; + List choices = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("created".equals(fieldName)) { + created = OffsetDateTime.ofInstant(Instant.ofEpochSecond(reader.getLong()), ZoneOffset.UTC); + } else if ("model".equals(fieldName)) { + model = reader.getString(); + } else if ("usage".equals(fieldName)) { + usage = CompletionsUsage.fromJson(reader); + } else if ("choices".equals(fieldName)) { + choices = reader.readArray(reader1 -> ChatChoice.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + return new ChatCompletions(id, created, model, usage, choices); + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolCall.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolCall.java new file mode 100644 index 000000000000..4cdbfb0505df --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolCall.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A tool call to a function tool, issued by the model in evaluation of a configured function tool, that represents + * a function invocation needed for a subsequent chat completions request to resolve. + */ +@Immutable +public final class ChatCompletionsFunctionToolCall extends ChatCompletionsToolCall { + /* + * The object type. + */ + @Generated + private String type = "function"; + + /* + * The details of the function invocation requested by the tool call. + */ + @Generated + private final FunctionCall function; + + /** + * Creates an instance of ChatCompletionsFunctionToolCall class. + * + * @param id the id value to set. + * @param function the function value to set. + */ + @Generated + public ChatCompletionsFunctionToolCall(String id, FunctionCall function) { + super(id); + this.function = function; + } + + /** + * Get the type property: The object type. + * + * @return the type value. + */ + @Generated + @Override + public String getType() { + return this.type; + } + + /** + * Get the function property: The details of the function invocation requested by the tool call. + * + * @return the function value. + */ + @Generated + public FunctionCall getFunction() { + return this.function; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", getId()); + jsonWriter.writeJsonField("function", this.function); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChatCompletionsFunctionToolCall from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChatCompletionsFunctionToolCall if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ChatCompletionsFunctionToolCall. + */ + @Generated + public static ChatCompletionsFunctionToolCall fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + FunctionCall function = null; + String type = "function"; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("function".equals(fieldName)) { + function = FunctionCall.fromJson(reader); + } else if ("type".equals(fieldName)) { + type = reader.getString(); + } else { + reader.skipChildren(); + } + } + ChatCompletionsFunctionToolCall deserializedChatCompletionsFunctionToolCall + = new ChatCompletionsFunctionToolCall(id, function); + deserializedChatCompletionsFunctionToolCall.type = type; + + return deserializedChatCompletionsFunctionToolCall; + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolDefinition.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolDefinition.java new file mode 100644 index 000000000000..d0afd1795e82 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolDefinition.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The definition information for a chat completions function tool that can call a function in response to a tool call. + */ +@Immutable +public final class ChatCompletionsFunctionToolDefinition extends ChatCompletionsToolDefinition { + /* + * The object type. + */ + @Generated + private String type = "function"; + + /* + * The function definition details for the function tool. + */ + @Generated + private final FunctionDefinition function; + + /** + * Creates an instance of ChatCompletionsFunctionToolDefinition class. + * + * @param function the function value to set. + */ + @Generated + public ChatCompletionsFunctionToolDefinition(FunctionDefinition function) { + this.function = function; + } + + /** + * Get the type property: The object type. + * + * @return the type value. + */ + @Generated + @Override + public String getType() { + return this.type; + } + + /** + * Get the function property: The function definition details for the function tool. + * + * @return the function value. + */ + @Generated + public FunctionDefinition getFunction() { + return this.function; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("function", this.function); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChatCompletionsFunctionToolDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChatCompletionsFunctionToolDefinition if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ChatCompletionsFunctionToolDefinition. + */ + @Generated + public static ChatCompletionsFunctionToolDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FunctionDefinition function = null; + String type = "function"; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("function".equals(fieldName)) { + function = FunctionDefinition.fromJson(reader); + } else if ("type".equals(fieldName)) { + type = reader.getString(); + } else { + reader.skipChildren(); + } + } + ChatCompletionsFunctionToolDefinition deserializedChatCompletionsFunctionToolDefinition + = new ChatCompletionsFunctionToolDefinition(function); + deserializedChatCompletionsFunctionToolDefinition.type = type; + + return deserializedChatCompletionsFunctionToolDefinition; + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolSelection.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolSelection.java new file mode 100644 index 000000000000..4f51d507fcfe --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolSelection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A tool selection of a specific, named function tool that will limit chat completions to using the named function. + */ +@Immutable +public final class ChatCompletionsFunctionToolSelection + implements JsonSerializable { + /* + * The name of the function that should be called. + */ + @Generated + private final String name; + + /** + * Creates an instance of ChatCompletionsFunctionToolSelection class. + * + * @param name the name value to set. + */ + @Generated + public ChatCompletionsFunctionToolSelection(String name) { + this.name = name; + } + + /** + * Get the name property: The name of the function that should be called. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChatCompletionsFunctionToolSelection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChatCompletionsFunctionToolSelection if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ChatCompletionsFunctionToolSelection. + */ + @Generated + public static ChatCompletionsFunctionToolSelection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + name = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new ChatCompletionsFunctionToolSelection(name); + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsNamedFunctionToolSelection.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsNamedFunctionToolSelection.java new file mode 100644 index 000000000000..dae54fe7e768 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsNamedFunctionToolSelection.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A tool selection of a specific, named function tool that will limit chat completions to using the named function. + */ +@Immutable +public final class ChatCompletionsNamedFunctionToolSelection extends ChatCompletionsNamedToolSelection { + /* + * The object type. + */ + @Generated + private String type = "function"; + + /* + * The function that should be called. + */ + @Generated + private final ChatCompletionsFunctionToolSelection function; + + /** + * Creates an instance of ChatCompletionsNamedFunctionToolSelection class. + * + * @param function the function value to set. + */ + @Generated + public ChatCompletionsNamedFunctionToolSelection(ChatCompletionsFunctionToolSelection function) { + this.function = function; + } + + /** + * Get the type property: The object type. + * + * @return the type value. + */ + @Generated + @Override + public String getType() { + return this.type; + } + + /** + * Get the function property: The function that should be called. + * + * @return the function value. + */ + @Generated + public ChatCompletionsFunctionToolSelection getFunction() { + return this.function; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("function", this.function); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChatCompletionsNamedFunctionToolSelection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChatCompletionsNamedFunctionToolSelection if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ChatCompletionsNamedFunctionToolSelection. + */ + @Generated + public static ChatCompletionsNamedFunctionToolSelection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ChatCompletionsFunctionToolSelection function = null; + String type = "function"; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("function".equals(fieldName)) { + function = ChatCompletionsFunctionToolSelection.fromJson(reader); + } else if ("type".equals(fieldName)) { + type = reader.getString(); + } else { + reader.skipChildren(); + } + } + ChatCompletionsNamedFunctionToolSelection deserializedChatCompletionsNamedFunctionToolSelection + = new ChatCompletionsNamedFunctionToolSelection(function); + deserializedChatCompletionsNamedFunctionToolSelection.type = type; + + return deserializedChatCompletionsNamedFunctionToolSelection; + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsNamedToolSelection.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsNamedToolSelection.java new file mode 100644 index 000000000000..b9bf1f0a9876 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsNamedToolSelection.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An abstract representation of an explicit, named tool selection to use for a chat completions request. + */ +@Immutable +public class ChatCompletionsNamedToolSelection implements JsonSerializable { + /* + * The object type. + */ + @Generated + private String type = "ChatCompletionsNamedToolSelection"; + + /** + * Creates an instance of ChatCompletionsNamedToolSelection class. + */ + @Generated + public ChatCompletionsNamedToolSelection() { + } + + /** + * Get the type property: The object type. + * + * @return the type value. + */ + @Generated + public String getType() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChatCompletionsNamedToolSelection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChatCompletionsNamedToolSelection if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ChatCompletionsNamedToolSelection. + */ + @Generated + public static ChatCompletionsNamedToolSelection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("type".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("function".equals(discriminatorValue)) { + return ChatCompletionsNamedFunctionToolSelection.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static ChatCompletionsNamedToolSelection fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ChatCompletionsNamedToolSelection deserializedChatCompletionsNamedToolSelection + = new ChatCompletionsNamedToolSelection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedChatCompletionsNamedToolSelection.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedChatCompletionsNamedToolSelection; + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormat.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormat.java new file mode 100644 index 000000000000..6887db621fa6 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormat.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the format that the model must output. Use this to enable JSON mode instead of the default text mode. + * Note that to enable JSON mode, some AI models may also require you to instruct the model to produce JSON + * via a system or user message. + */ +@Immutable +public class ChatCompletionsResponseFormat implements JsonSerializable { + /* + * The response format type to use for chat completions. + */ + @Generated + private String type = "ChatCompletionsResponseFormat"; + + /** + * Creates an instance of ChatCompletionsResponseFormat class. + */ + @Generated + public ChatCompletionsResponseFormat() { + } + + /** + * Get the type property: The response format type to use for chat completions. + * + * @return the type value. + */ + @Generated + public String getType() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChatCompletionsResponseFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChatCompletionsResponseFormat if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ChatCompletionsResponseFormat. + */ + @Generated + public static ChatCompletionsResponseFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("type".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("text".equals(discriminatorValue)) { + return ChatCompletionsResponseFormatText.fromJson(readerToUse.reset()); + } else if ("json_object".equals(discriminatorValue)) { + return ChatCompletionsResponseFormatJSON.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static ChatCompletionsResponseFormat fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ChatCompletionsResponseFormat deserializedChatCompletionsResponseFormat + = new ChatCompletionsResponseFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedChatCompletionsResponseFormat.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedChatCompletionsResponseFormat; + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatJSON.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatJSON.java new file mode 100644 index 000000000000..26533be57a55 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatJSON.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A response format for Chat Completions that restricts responses to emitting valid JSON objects. + * Note that to enable JSON mode, some AI models may also require you to instruct the model to produce JSON + * via a system or user message. + */ +@Immutable +public final class ChatCompletionsResponseFormatJSON extends ChatCompletionsResponseFormat { + /* + * The response format type to use for chat completions. + */ + @Generated + private String type = "json_object"; + + /** + * Creates an instance of ChatCompletionsResponseFormatJSON class. + */ + @Generated + public ChatCompletionsResponseFormatJSON() { + } + + /** + * Get the type property: The response format type to use for chat completions. + * + * @return the type value. + */ + @Generated + @Override + public String getType() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChatCompletionsResponseFormatJSON from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChatCompletionsResponseFormatJSON if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ChatCompletionsResponseFormatJSON. + */ + @Generated + public static ChatCompletionsResponseFormatJSON fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ChatCompletionsResponseFormatJSON deserializedChatCompletionsResponseFormatJSON + = new ChatCompletionsResponseFormatJSON(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedChatCompletionsResponseFormatJSON.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedChatCompletionsResponseFormatJSON; + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatText.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatText.java new file mode 100644 index 000000000000..d8177f2c3cc1 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatText.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A response format for Chat Completions that emits text responses. This is the default response format. + */ +@Immutable +public final class ChatCompletionsResponseFormatText extends ChatCompletionsResponseFormat { + /* + * The response format type to use for chat completions. + */ + @Generated + private String type = "text"; + + /** + * Creates an instance of ChatCompletionsResponseFormatText class. + */ + @Generated + public ChatCompletionsResponseFormatText() { + } + + /** + * Get the type property: The response format type to use for chat completions. + * + * @return the type value. + */ + @Generated + @Override + public String getType() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChatCompletionsResponseFormatText from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChatCompletionsResponseFormatText if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ChatCompletionsResponseFormatText. + */ + @Generated + public static ChatCompletionsResponseFormatText fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ChatCompletionsResponseFormatText deserializedChatCompletionsResponseFormatText + = new ChatCompletionsResponseFormatText(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedChatCompletionsResponseFormatText.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedChatCompletionsResponseFormatText; + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsToolCall.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsToolCall.java new file mode 100644 index 000000000000..43a1bbf306b9 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsToolCall.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An abstract representation of a tool call that must be resolved in a subsequent request to perform the requested + * chat completion. + */ +@Immutable +public class ChatCompletionsToolCall implements JsonSerializable { + /* + * The object type. + */ + @Generated + private String type = "ChatCompletionsToolCall"; + + /* + * The ID of the tool call. + */ + @Generated + private final String id; + + /** + * Creates an instance of ChatCompletionsToolCall class. + * + * @param id the id value to set. + */ + @Generated + public ChatCompletionsToolCall(String id) { + this.id = id; + } + + /** + * Get the type property: The object type. + * + * @return the type value. + */ + @Generated + public String getType() { + return this.type; + } + + /** + * Get the id property: The ID of the tool call. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChatCompletionsToolCall from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChatCompletionsToolCall if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ChatCompletionsToolCall. + */ + @Generated + public static ChatCompletionsToolCall fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("type".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("function".equals(discriminatorValue)) { + return ChatCompletionsFunctionToolCall.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static ChatCompletionsToolCall fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + String type = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("type".equals(fieldName)) { + type = reader.getString(); + } else { + reader.skipChildren(); + } + } + ChatCompletionsToolCall deserializedChatCompletionsToolCall = new ChatCompletionsToolCall(id); + deserializedChatCompletionsToolCall.type = type; + + return deserializedChatCompletionsToolCall; + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsToolDefinition.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsToolDefinition.java new file mode 100644 index 000000000000..ffea2854bed6 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsToolDefinition.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An abstract representation of a tool that can be used by the model to improve a chat completions response. + */ +@Immutable +public class ChatCompletionsToolDefinition implements JsonSerializable { + /* + * The object type. + */ + @Generated + private String type = "ChatCompletionsToolDefinition"; + + /** + * Creates an instance of ChatCompletionsToolDefinition class. + */ + @Generated + public ChatCompletionsToolDefinition() { + } + + /** + * Get the type property: The object type. + * + * @return the type value. + */ + @Generated + public String getType() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChatCompletionsToolDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChatCompletionsToolDefinition if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ChatCompletionsToolDefinition. + */ + @Generated + public static ChatCompletionsToolDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("type".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("function".equals(discriminatorValue)) { + return ChatCompletionsFunctionToolDefinition.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static ChatCompletionsToolDefinition fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ChatCompletionsToolDefinition deserializedChatCompletionsToolDefinition + = new ChatCompletionsToolDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedChatCompletionsToolDefinition.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedChatCompletionsToolDefinition; + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsToolSelectionPreset.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsToolSelectionPreset.java new file mode 100644 index 000000000000..33c436ca7b0b --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsToolSelectionPreset.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Represents a generic policy for how a chat completions tool may be selected. + */ +public final class ChatCompletionsToolSelectionPreset extends ExpandableStringEnum { + /** + * Specifies that the model may either use any of the tools provided in this chat completions request or + * instead return a standard chat completions response as if no tools were provided. + */ + @Generated + public static final ChatCompletionsToolSelectionPreset AUTO = fromString("auto"); + + /** + * Specifies that the model should not respond with a tool call and should instead provide a standard chat + * completions response. Response content may still be influenced by the provided tool definitions. + */ + @Generated + public static final ChatCompletionsToolSelectionPreset NONE = fromString("none"); + + /** + * Specifies that the model should respond with a call to one or more tools. + */ + @Generated + public static final ChatCompletionsToolSelectionPreset REQUIRED = fromString("required"); + + /** + * Creates a new instance of ChatCompletionsToolSelectionPreset value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public ChatCompletionsToolSelectionPreset() { + } + + /** + * Creates or finds a ChatCompletionsToolSelectionPreset from its string representation. + * + * @param name a name to look for. + * @return the corresponding ChatCompletionsToolSelectionPreset. + */ + @Generated + public static ChatCompletionsToolSelectionPreset fromString(String name) { + return fromString(name, ChatCompletionsToolSelectionPreset.class); + } + + /** + * Gets known ChatCompletionsToolSelectionPreset values. + * + * @return known ChatCompletionsToolSelectionPreset values. + */ + @Generated + public static Collection values() { + return values(ChatCompletionsToolSelectionPreset.class); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageContentItem.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageContentItem.java new file mode 100644 index 000000000000..5e355d1364bd --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageContentItem.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An abstract representation of a structured content item within a chat message. + */ +@Immutable +public class ChatMessageContentItem implements JsonSerializable { + /* + * The discriminated object type. + */ + @Generated + private String type = "ChatMessageContentItem"; + + /** + * Creates an instance of ChatMessageContentItem class. + */ + @Generated + public ChatMessageContentItem() { + } + + /** + * Get the type property: The discriminated object type. + * + * @return the type value. + */ + @Generated + public String getType() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChatMessageContentItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChatMessageContentItem if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ChatMessageContentItem. + */ + @Generated + public static ChatMessageContentItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("type".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("text".equals(discriminatorValue)) { + return ChatMessageTextContentItem.fromJson(readerToUse.reset()); + } else if ("image_url".equals(discriminatorValue)) { + return ChatMessageImageContentItem.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static ChatMessageContentItem fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ChatMessageContentItem deserializedChatMessageContentItem = new ChatMessageContentItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedChatMessageContentItem.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedChatMessageContentItem; + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageContentItem.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageContentItem.java new file mode 100644 index 000000000000..52822b48db66 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageContentItem.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A structured chat content item containing an image reference. + */ +@Immutable +public final class ChatMessageImageContentItem extends ChatMessageContentItem { + /* + * The discriminated object type. + */ + @Generated + private String type = "image_url"; + + /* + * An internet location, which must be accessible to the model,from which the image may be retrieved. + */ + @Generated + private final ChatMessageImageUrl imageUrl; + + /** + * Creates an instance of ChatMessageImageContentItem class. + * + * @param imageUrl the imageUrl value to set. + */ + @Generated + public ChatMessageImageContentItem(ChatMessageImageUrl imageUrl) { + this.imageUrl = imageUrl; + } + + /** + * Get the type property: The discriminated object type. + * + * @return the type value. + */ + @Generated + @Override + public String getType() { + return this.type; + } + + /** + * Get the imageUrl property: An internet location, which must be accessible to the model,from which the image may + * be retrieved. + * + * @return the imageUrl value. + */ + @Generated + public ChatMessageImageUrl getImageUrl() { + return this.imageUrl; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("image_url", this.imageUrl); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChatMessageImageContentItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChatMessageImageContentItem if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ChatMessageImageContentItem. + */ + @Generated + public static ChatMessageImageContentItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ChatMessageImageUrl imageUrl = null; + String type = "image_url"; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("image_url".equals(fieldName)) { + imageUrl = ChatMessageImageUrl.fromJson(reader); + } else if ("type".equals(fieldName)) { + type = reader.getString(); + } else { + reader.skipChildren(); + } + } + ChatMessageImageContentItem deserializedChatMessageImageContentItem + = new ChatMessageImageContentItem(imageUrl); + deserializedChatMessageImageContentItem.type = type; + + return deserializedChatMessageImageContentItem; + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageDetailLevel.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageDetailLevel.java new file mode 100644 index 000000000000..f056199e229f --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageDetailLevel.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * A representation of the possible image detail levels for image-based chat completions message content. + */ +public final class ChatMessageImageDetailLevel extends ExpandableStringEnum { + /** + * Specifies that the model should determine which detail level to apply using heuristics like image size. + */ + @Generated + public static final ChatMessageImageDetailLevel AUTO = fromString("auto"); + + /** + * Specifies that image evaluation should be constrained to the 'low-res' model that may be faster and consume fewer + * tokens but may also be less accurate for highly detailed images. + */ + @Generated + public static final ChatMessageImageDetailLevel LOW = fromString("low"); + + /** + * Specifies that image evaluation should enable the 'high-res' model that may be more accurate for highly detailed + * images but may also be slower and consume more tokens. + */ + @Generated + public static final ChatMessageImageDetailLevel HIGH = fromString("high"); + + /** + * Creates a new instance of ChatMessageImageDetailLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public ChatMessageImageDetailLevel() { + } + + /** + * Creates or finds a ChatMessageImageDetailLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding ChatMessageImageDetailLevel. + */ + @Generated + public static ChatMessageImageDetailLevel fromString(String name) { + return fromString(name, ChatMessageImageDetailLevel.class); + } + + /** + * Gets known ChatMessageImageDetailLevel values. + * + * @return known ChatMessageImageDetailLevel values. + */ + @Generated + public static Collection values() { + return values(ChatMessageImageDetailLevel.class); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageUrl.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageUrl.java new file mode 100644 index 000000000000..60d319a61a9b --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageUrl.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An internet location from which the model may retrieve an image. + */ +@Fluent +public final class ChatMessageImageUrl implements JsonSerializable { + /* + * The URL of the image. + */ + @Generated + private final String url; + + /* + * The evaluation quality setting to use, which controls relative prioritization of speed, token consumption, and + * accuracy. + */ + @Generated + private ChatMessageImageDetailLevel detail; + + /** + * Creates an instance of ChatMessageImageUrl class. + * + * @param url the url value to set. + */ + @Generated + public ChatMessageImageUrl(String url) { + this.url = url; + } + + /** + * Get the url property: The URL of the image. + * + * @return the url value. + */ + @Generated + public String getUrl() { + return this.url; + } + + /** + * Get the detail property: The evaluation quality setting to use, which controls relative prioritization of speed, + * token consumption, and + * accuracy. + * + * @return the detail value. + */ + @Generated + public ChatMessageImageDetailLevel getDetail() { + return this.detail; + } + + /** + * Set the detail property: The evaluation quality setting to use, which controls relative prioritization of speed, + * token consumption, and + * accuracy. + * + * @param detail the detail value to set. + * @return the ChatMessageImageUrl object itself. + */ + @Generated + public ChatMessageImageUrl setDetail(ChatMessageImageDetailLevel detail) { + this.detail = detail; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("url", this.url); + jsonWriter.writeStringField("detail", this.detail == null ? null : this.detail.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChatMessageImageUrl from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChatMessageImageUrl if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ChatMessageImageUrl. + */ + @Generated + public static ChatMessageImageUrl fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String url = null; + ChatMessageImageDetailLevel detail = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("url".equals(fieldName)) { + url = reader.getString(); + } else if ("detail".equals(fieldName)) { + detail = ChatMessageImageDetailLevel.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + ChatMessageImageUrl deserializedChatMessageImageUrl = new ChatMessageImageUrl(url); + deserializedChatMessageImageUrl.detail = detail; + + return deserializedChatMessageImageUrl; + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageTextContentItem.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageTextContentItem.java new file mode 100644 index 000000000000..a41b8e6d3dbd --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageTextContentItem.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A structured chat content item containing plain text. + */ +@Immutable +public final class ChatMessageTextContentItem extends ChatMessageContentItem { + /* + * The discriminated object type. + */ + @Generated + private String type = "text"; + + /* + * The content of the message. + */ + @Generated + private final String text; + + /** + * Creates an instance of ChatMessageTextContentItem class. + * + * @param text the text value to set. + */ + @Generated + public ChatMessageTextContentItem(String text) { + this.text = text; + } + + /** + * Get the type property: The discriminated object type. + * + * @return the type value. + */ + @Generated + @Override + public String getType() { + return this.type; + } + + /** + * Get the text property: The content of the message. + * + * @return the text value. + */ + @Generated + public String getText() { + return this.text; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("text", this.text); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChatMessageTextContentItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChatMessageTextContentItem if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ChatMessageTextContentItem. + */ + @Generated + public static ChatMessageTextContentItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String text = null; + String type = "text"; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("text".equals(fieldName)) { + text = reader.getString(); + } else if ("type".equals(fieldName)) { + type = reader.getString(); + } else { + reader.skipChildren(); + } + } + ChatMessageTextContentItem deserializedChatMessageTextContentItem = new ChatMessageTextContentItem(text); + deserializedChatMessageTextContentItem.type = type; + + return deserializedChatMessageTextContentItem; + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestAssistantMessage.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestAssistantMessage.java new file mode 100644 index 000000000000..23dee5d48f57 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestAssistantMessage.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A request chat message representing response or action from the assistant. + */ +@Fluent +public final class ChatRequestAssistantMessage extends ChatRequestMessage { + /* + * The chat role associated with this message. + */ + @Generated + private ChatRole role = ChatRole.ASSISTANT; + + /* + * The content of the message. + */ + @Generated + private String content; + + /* + * The tool calls that must be resolved and have their outputs appended to subsequent input messages for the chat + * completions request to resolve as configured. + */ + @Generated + private List toolCalls; + + /** + * Creates an instance of ChatRequestAssistantMessage class. + */ + @Generated + public ChatRequestAssistantMessage() { + } + + /** + * Get the role property: The chat role associated with this message. + * + * @return the role value. + */ + @Generated + @Override + public ChatRole getRole() { + return this.role; + } + + /** + * Get the content property: The content of the message. + * + * @return the content value. + */ + @Generated + public String getContent() { + return this.content; + } + + /** + * Set the content property: The content of the message. + * + * @param content the content value to set. + * @return the ChatRequestAssistantMessage object itself. + */ + @Generated + public ChatRequestAssistantMessage setContent(String content) { + this.content = content; + return this; + } + + /** + * Get the toolCalls property: The tool calls that must be resolved and have their outputs appended to subsequent + * input messages for the chat + * completions request to resolve as configured. + * + * @return the toolCalls value. + */ + @Generated + public List getToolCalls() { + return this.toolCalls; + } + + /** + * Set the toolCalls property: The tool calls that must be resolved and have their outputs appended to subsequent + * input messages for the chat + * completions request to resolve as configured. + * + * @param toolCalls the toolCalls value to set. + * @return the ChatRequestAssistantMessage object itself. + */ + @Generated + public ChatRequestAssistantMessage setToolCalls(List toolCalls) { + this.toolCalls = toolCalls; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("role", this.role == null ? null : this.role.toString()); + jsonWriter.writeStringField("content", this.content); + jsonWriter.writeArrayField("tool_calls", this.toolCalls, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChatRequestAssistantMessage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChatRequestAssistantMessage if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ChatRequestAssistantMessage. + */ + @Generated + public static ChatRequestAssistantMessage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ChatRequestAssistantMessage deserializedChatRequestAssistantMessage = new ChatRequestAssistantMessage(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("role".equals(fieldName)) { + deserializedChatRequestAssistantMessage.role = ChatRole.fromString(reader.getString()); + } else if ("content".equals(fieldName)) { + deserializedChatRequestAssistantMessage.content = reader.getString(); + } else if ("tool_calls".equals(fieldName)) { + List toolCalls + = reader.readArray(reader1 -> ChatCompletionsToolCall.fromJson(reader1)); + deserializedChatRequestAssistantMessage.toolCalls = toolCalls; + } else { + reader.skipChildren(); + } + } + + return deserializedChatRequestAssistantMessage; + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestMessage.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestMessage.java new file mode 100644 index 000000000000..f3561af1968a --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestMessage.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An abstract representation of a chat message as provided in a request. + */ +@Immutable +public class ChatRequestMessage implements JsonSerializable { + /* + * The chat role associated with this message. + */ + @Generated + private ChatRole role = ChatRole.fromString("ChatRequestMessage"); + + /** + * Creates an instance of ChatRequestMessage class. + */ + @Generated + public ChatRequestMessage() { + } + + /** + * Get the role property: The chat role associated with this message. + * + * @return the role value. + */ + @Generated + public ChatRole getRole() { + return this.role; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("role", this.role == null ? null : this.role.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChatRequestMessage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChatRequestMessage if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ChatRequestMessage. + */ + @Generated + public static ChatRequestMessage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("role".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("system".equals(discriminatorValue)) { + return ChatRequestSystemMessage.fromJson(readerToUse.reset()); + } else if ("user".equals(discriminatorValue)) { + return ChatRequestUserMessage.fromJson(readerToUse.reset()); + } else if ("assistant".equals(discriminatorValue)) { + return ChatRequestAssistantMessage.fromJson(readerToUse.reset()); + } else if ("tool".equals(discriminatorValue)) { + return ChatRequestToolMessage.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static ChatRequestMessage fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ChatRequestMessage deserializedChatRequestMessage = new ChatRequestMessage(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("role".equals(fieldName)) { + deserializedChatRequestMessage.role = ChatRole.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedChatRequestMessage; + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestSystemMessage.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestSystemMessage.java new file mode 100644 index 000000000000..75c915004e68 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestSystemMessage.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A request chat message containing system instructions that influence how the model will generate a chat completions + * response. + */ +@Immutable +public final class ChatRequestSystemMessage extends ChatRequestMessage { + /* + * The chat role associated with this message. + */ + @Generated + private ChatRole role = ChatRole.SYSTEM; + + /* + * The contents of the system message. + */ + @Generated + private final String content; + + /** + * Creates an instance of ChatRequestSystemMessage class. + * + * @param content the content value to set. + */ + @Generated + public ChatRequestSystemMessage(String content) { + this.content = content; + } + + /** + * Get the role property: The chat role associated with this message. + * + * @return the role value. + */ + @Generated + @Override + public ChatRole getRole() { + return this.role; + } + + /** + * Get the content property: The contents of the system message. + * + * @return the content value. + */ + @Generated + public String getContent() { + return this.content; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("content", this.content); + jsonWriter.writeStringField("role", this.role == null ? null : this.role.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChatRequestSystemMessage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChatRequestSystemMessage if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ChatRequestSystemMessage. + */ + @Generated + public static ChatRequestSystemMessage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String content = null; + ChatRole role = ChatRole.SYSTEM; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("content".equals(fieldName)) { + content = reader.getString(); + } else if ("role".equals(fieldName)) { + role = ChatRole.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + ChatRequestSystemMessage deserializedChatRequestSystemMessage = new ChatRequestSystemMessage(content); + deserializedChatRequestSystemMessage.role = role; + + return deserializedChatRequestSystemMessage; + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestToolMessage.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestToolMessage.java new file mode 100644 index 000000000000..db776da6f681 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestToolMessage.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A request chat message representing requested output from a configured tool. + */ +@Immutable +public final class ChatRequestToolMessage extends ChatRequestMessage { + /* + * The chat role associated with this message. + */ + @Generated + private ChatRole role = ChatRole.TOOL; + + /* + * The content of the message. + */ + @Generated + private final String content; + + /* + * The ID of the tool call resolved by the provided content. + */ + @Generated + private final String toolCallId; + + /** + * Creates an instance of ChatRequestToolMessage class. + * + * @param content the content value to set. + * @param toolCallId the toolCallId value to set. + */ + @Generated + public ChatRequestToolMessage(String content, String toolCallId) { + this.content = content; + this.toolCallId = toolCallId; + } + + /** + * Get the role property: The chat role associated with this message. + * + * @return the role value. + */ + @Generated + @Override + public ChatRole getRole() { + return this.role; + } + + /** + * Get the content property: The content of the message. + * + * @return the content value. + */ + @Generated + public String getContent() { + return this.content; + } + + /** + * Get the toolCallId property: The ID of the tool call resolved by the provided content. + * + * @return the toolCallId value. + */ + @Generated + public String getToolCallId() { + return this.toolCallId; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("content", this.content); + jsonWriter.writeStringField("tool_call_id", this.toolCallId); + jsonWriter.writeStringField("role", this.role == null ? null : this.role.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChatRequestToolMessage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChatRequestToolMessage if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ChatRequestToolMessage. + */ + @Generated + public static ChatRequestToolMessage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String content = null; + String toolCallId = null; + ChatRole role = ChatRole.TOOL; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("content".equals(fieldName)) { + content = reader.getString(); + } else if ("tool_call_id".equals(fieldName)) { + toolCallId = reader.getString(); + } else if ("role".equals(fieldName)) { + role = ChatRole.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + ChatRequestToolMessage deserializedChatRequestToolMessage = new ChatRequestToolMessage(content, toolCallId); + deserializedChatRequestToolMessage.role = role; + + return deserializedChatRequestToolMessage; + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java new file mode 100644 index 000000000000..9eb66d55c297 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A request chat message representing user input to the assistant. + */ +@Immutable +public final class ChatRequestUserMessage extends ChatRequestMessage { + /* + * The chat role associated with this message. + */ + @Generated + private ChatRole role = ChatRole.USER; + + /* + * The contents of the user message, with available input types varying by selected model. + */ + @Generated + private final BinaryData content; + + /** + * Creates an instance of ChatRequestUserMessage class. + * + * @param content the content value to set. + */ + @Generated + public ChatRequestUserMessage(BinaryData content) { + this.content = content; + } + + /** + * Get the role property: The chat role associated with this message. + * + * @return the role value. + */ + @Generated + @Override + public ChatRole getRole() { + return this.role; + } + + /** + * Get the content property: The contents of the user message, with available input types varying by selected model. + * + * @return the content value. + */ + @Generated + public BinaryData getContent() { + return this.content; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeUntypedField("content", this.content.toObject(Object.class)); + jsonWriter.writeStringField("role", this.role == null ? null : this.role.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChatRequestUserMessage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChatRequestUserMessage if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ChatRequestUserMessage. + */ + @Generated + public static ChatRequestUserMessage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BinaryData content = null; + ChatRole role = ChatRole.USER; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("content".equals(fieldName)) { + content = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); + } else if ("role".equals(fieldName)) { + role = ChatRole.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + ChatRequestUserMessage deserializedChatRequestUserMessage = new ChatRequestUserMessage(content); + deserializedChatRequestUserMessage.role = role; + + return deserializedChatRequestUserMessage; + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatResponseMessage.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatResponseMessage.java new file mode 100644 index 000000000000..12b800edb254 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatResponseMessage.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A representation of a chat message as received in a response. + */ +@Immutable +public final class ChatResponseMessage implements JsonSerializable { + /* + * The chat role associated with the message. + */ + @Generated + private final ChatRole role; + + /* + * The content of the message. + */ + @Generated + private final String content; + + /* + * The tool calls that must be resolved and have their outputs appended to subsequent input messages for the chat + * completions request to resolve as configured. + */ + @Generated + private List toolCalls; + + /** + * Creates an instance of ChatResponseMessage class. + * + * @param role the role value to set. + * @param content the content value to set. + */ + @Generated + private ChatResponseMessage(ChatRole role, String content) { + this.role = role; + this.content = content; + } + + /** + * Get the role property: The chat role associated with the message. + * + * @return the role value. + */ + @Generated + public ChatRole getRole() { + return this.role; + } + + /** + * Get the content property: The content of the message. + * + * @return the content value. + */ + @Generated + public String getContent() { + return this.content; + } + + /** + * Get the toolCalls property: The tool calls that must be resolved and have their outputs appended to subsequent + * input messages for the chat + * completions request to resolve as configured. + * + * @return the toolCalls value. + */ + @Generated + public List getToolCalls() { + return this.toolCalls; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("role", this.role == null ? null : this.role.toString()); + jsonWriter.writeStringField("content", this.content); + jsonWriter.writeArrayField("tool_calls", this.toolCalls, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChatResponseMessage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChatResponseMessage if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ChatResponseMessage. + */ + @Generated + public static ChatResponseMessage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ChatRole role = null; + String content = null; + List toolCalls = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("role".equals(fieldName)) { + role = ChatRole.fromString(reader.getString()); + } else if ("content".equals(fieldName)) { + content = reader.getString(); + } else if ("tool_calls".equals(fieldName)) { + toolCalls = reader.readArray(reader1 -> ChatCompletionsToolCall.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + ChatResponseMessage deserializedChatResponseMessage = new ChatResponseMessage(role, content); + deserializedChatResponseMessage.toolCalls = toolCalls; + + return deserializedChatResponseMessage; + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRole.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRole.java new file mode 100644 index 000000000000..c2ff65b95341 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRole.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * A description of the intended purpose of a message within a chat completions interaction. + */ +public final class ChatRole extends ExpandableStringEnum { + /** + * The role that instructs or sets the behavior of the assistant. + */ + @Generated + public static final ChatRole SYSTEM = fromString("system"); + + /** + * The role that provides input for chat completions. + */ + @Generated + public static final ChatRole USER = fromString("user"); + + /** + * The role that provides responses to system-instructed, user-prompted input. + */ + @Generated + public static final ChatRole ASSISTANT = fromString("assistant"); + + /** + * The role that represents extension tool activity within a chat completions operation. + */ + @Generated + public static final ChatRole TOOL = fromString("tool"); + + /** + * Creates a new instance of ChatRole value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public ChatRole() { + } + + /** + * Creates or finds a ChatRole from its string representation. + * + * @param name a name to look for. + * @return the corresponding ChatRole. + */ + @Generated + public static ChatRole fromString(String name) { + return fromString(name, ChatRole.class); + } + + /** + * Gets known ChatRole values. + * + * @return known ChatRole values. + */ + @Generated + public static Collection values() { + return values(ChatRole.class); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/CompletionsFinishReason.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/CompletionsFinishReason.java new file mode 100644 index 000000000000..24cbd157376e --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/CompletionsFinishReason.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Representation of the manner in which a completions response concluded. + */ +public final class CompletionsFinishReason extends ExpandableStringEnum { + /** + * Completions ended normally and reached its end of token generation. + */ + @Generated + public static final CompletionsFinishReason STOPPED = fromString("stop"); + + /** + * Completions exhausted available token limits before generation could complete. + */ + @Generated + public static final CompletionsFinishReason TOKEN_LIMIT_REACHED = fromString("length"); + + /** + * Completions generated a response that was identified as potentially sensitive per content + * moderation policies. + */ + @Generated + public static final CompletionsFinishReason CONTENT_FILTERED = fromString("content_filter"); + + /** + * Completion ended with the model calling a provided tool for output. + */ + @Generated + public static final CompletionsFinishReason TOOL_CALLS = fromString("tool_calls"); + + /** + * Creates a new instance of CompletionsFinishReason value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public CompletionsFinishReason() { + } + + /** + * Creates or finds a CompletionsFinishReason from its string representation. + * + * @param name a name to look for. + * @return the corresponding CompletionsFinishReason. + */ + @Generated + public static CompletionsFinishReason fromString(String name) { + return fromString(name, CompletionsFinishReason.class); + } + + /** + * Gets known CompletionsFinishReason values. + * + * @return known CompletionsFinishReason values. + */ + @Generated + public static Collection values() { + return values(CompletionsFinishReason.class); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/CompletionsUsage.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/CompletionsUsage.java new file mode 100644 index 000000000000..1325f76153ad --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/CompletionsUsage.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Representation of the token counts processed for a completions request. + * Counts consider all tokens across prompts, choices, choice alternates, best_of generations, and + * other consumers. + */ +@Immutable +public final class CompletionsUsage implements JsonSerializable { + /* + * The number of tokens generated across all completions emissions. + */ + @Generated + private final int completionTokens; + + /* + * The number of tokens in the provided prompts for the completions request. + */ + @Generated + private final int promptTokens; + + /* + * The total number of tokens processed for the completions request and response. + */ + @Generated + private final int totalTokens; + + /** + * Creates an instance of CompletionsUsage class. + * + * @param completionTokens the completionTokens value to set. + * @param promptTokens the promptTokens value to set. + * @param totalTokens the totalTokens value to set. + */ + @Generated + private CompletionsUsage(int completionTokens, int promptTokens, int totalTokens) { + this.completionTokens = completionTokens; + this.promptTokens = promptTokens; + this.totalTokens = totalTokens; + } + + /** + * Get the completionTokens property: The number of tokens generated across all completions emissions. + * + * @return the completionTokens value. + */ + @Generated + public int getCompletionTokens() { + return this.completionTokens; + } + + /** + * Get the promptTokens property: The number of tokens in the provided prompts for the completions request. + * + * @return the promptTokens value. + */ + @Generated + public int getPromptTokens() { + return this.promptTokens; + } + + /** + * Get the totalTokens property: The total number of tokens processed for the completions request and response. + * + * @return the totalTokens value. + */ + @Generated + public int getTotalTokens() { + return this.totalTokens; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("completion_tokens", this.completionTokens); + jsonWriter.writeIntField("prompt_tokens", this.promptTokens); + jsonWriter.writeIntField("total_tokens", this.totalTokens); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CompletionsUsage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CompletionsUsage if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CompletionsUsage. + */ + @Generated + public static CompletionsUsage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int completionTokens = 0; + int promptTokens = 0; + int totalTokens = 0; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("completion_tokens".equals(fieldName)) { + completionTokens = reader.getInt(); + } else if ("prompt_tokens".equals(fieldName)) { + promptTokens = reader.getInt(); + } else if ("total_tokens".equals(fieldName)) { + totalTokens = reader.getInt(); + } else { + reader.skipChildren(); + } + } + return new CompletionsUsage(completionTokens, promptTokens, totalTokens); + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionCall.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionCall.java new file mode 100644 index 000000000000..1b65e7209b13 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionCall.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The name and arguments of a function that should be called, as generated by the model. + */ +@Immutable +public final class FunctionCall implements JsonSerializable { + /* + * The name of the function to call. + */ + @Generated + private final String name; + + /* + * The arguments to call the function with, as generated by the model in JSON format. + * Note that the model does not always generate valid JSON, and may hallucinate parameters + * not defined by your function schema. Validate the arguments in your code before calling + * your function. + */ + @Generated + private final String arguments; + + /** + * Creates an instance of FunctionCall class. + * + * @param name the name value to set. + * @param arguments the arguments value to set. + */ + @Generated + public FunctionCall(String name, String arguments) { + this.name = name; + this.arguments = arguments; + } + + /** + * Get the name property: The name of the function to call. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the arguments property: The arguments to call the function with, as generated by the model in JSON format. + * Note that the model does not always generate valid JSON, and may hallucinate parameters + * not defined by your function schema. Validate the arguments in your code before calling + * your function. + * + * @return the arguments value. + */ + @Generated + public String getArguments() { + return this.arguments; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("arguments", this.arguments); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FunctionCall from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FunctionCall if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FunctionCall. + */ + @Generated + public static FunctionCall fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + String arguments = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("arguments".equals(fieldName)) { + arguments = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new FunctionCall(name, arguments); + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java new file mode 100644 index 000000000000..0184ee4fdb19 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The definition of a caller-specified function that chat completions may invoke in response to matching user input. + */ +@Fluent +public final class FunctionDefinition implements JsonSerializable { + /* + * The name of the function to be called. + */ + @Generated + private final String name; + + /* + * A description of what the function does. The model will use this description when selecting the function and + * interpreting its parameters. + */ + @Generated + private String description; + + /* + * The parameters the function accepts, described as a JSON Schema object. + */ + @Generated + private Object parameters; + + /** + * Creates an instance of FunctionDefinition class. + * + * @param name the name value to set. + */ + @Generated + public FunctionDefinition(String name) { + this.name = name; + } + + /** + * Get the name property: The name of the function to be called. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the description property: A description of what the function does. The model will use this description when + * selecting the function and + * interpreting its parameters. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: A description of what the function does. The model will use this description when + * selecting the function and + * interpreting its parameters. + * + * @param description the description value to set. + * @return the FunctionDefinition object itself. + */ + @Generated + public FunctionDefinition setDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the parameters property: The parameters the function accepts, described as a JSON Schema object. + * + * @return the parameters value. + */ + @Generated + public Object getParameters() { + return this.parameters; + } + + /** + * Set the parameters property: The parameters the function accepts, described as a JSON Schema object. + * + * @param parameters the parameters value to set. + * @return the FunctionDefinition object itself. + */ + @Generated + public FunctionDefinition setParameters(Object parameters) { + this.parameters = parameters; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeUntypedField("parameters", this.parameters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FunctionDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FunctionDefinition if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FunctionDefinition. + */ + @Generated + public static FunctionDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + String description = null; + Object parameters = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("parameters".equals(fieldName)) { + parameters = reader.readUntyped(); + } else { + reader.skipChildren(); + } + } + FunctionDefinition deserializedFunctionDefinition = new FunctionDefinition(name); + deserializedFunctionDefinition.description = description; + deserializedFunctionDefinition.parameters = parameters; + + return deserializedFunctionDefinition; + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ModelInfo.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ModelInfo.java new file mode 100644 index 000000000000..653d90a0cfe6 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ModelInfo.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents some basic information about the AI model. + */ +@Immutable +public final class ModelInfo implements JsonSerializable { + /* + * The name of the AI model. For example: `Phi21` + */ + @Generated + private final String modelName; + + /* + * The type of the AI model. A Unique identifier for the profile. + */ + @Generated + private final ModelType modelType; + + /* + * The model provider name. For example: `Microsoft Research` + */ + @Generated + private final String modelProviderName; + + /** + * Creates an instance of ModelInfo class. + * + * @param modelName the modelName value to set. + * @param modelType the modelType value to set. + * @param modelProviderName the modelProviderName value to set. + */ + @Generated + private ModelInfo(String modelName, ModelType modelType, String modelProviderName) { + this.modelName = modelName; + this.modelType = modelType; + this.modelProviderName = modelProviderName; + } + + /** + * Get the modelName property: The name of the AI model. For example: `Phi21`. + * + * @return the modelName value. + */ + @Generated + public String getModelName() { + return this.modelName; + } + + /** + * Get the modelType property: The type of the AI model. A Unique identifier for the profile. + * + * @return the modelType value. + */ + @Generated + public ModelType getModelType() { + return this.modelType; + } + + /** + * Get the modelProviderName property: The model provider name. For example: `Microsoft Research`. + * + * @return the modelProviderName value. + */ + @Generated + public String getModelProviderName() { + return this.modelProviderName; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("model_name", this.modelName); + jsonWriter.writeStringField("model_type", this.modelType == null ? null : this.modelType.toString()); + jsonWriter.writeStringField("model_provider_name", this.modelProviderName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ModelInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ModelInfo if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ModelInfo. + */ + @Generated + public static ModelInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String modelName = null; + ModelType modelType = null; + String modelProviderName = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("model_name".equals(fieldName)) { + modelName = reader.getString(); + } else if ("model_type".equals(fieldName)) { + modelType = ModelType.fromString(reader.getString()); + } else if ("model_provider_name".equals(fieldName)) { + modelProviderName = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new ModelInfo(modelName, modelType, modelProviderName); + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ModelType.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ModelType.java new file mode 100644 index 000000000000..79c51729bb85 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ModelType.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of AI model. + */ +public final class ModelType extends ExpandableStringEnum { + /** + * Embeddings. + */ + @Generated + public static final ModelType EMBEDDINGS = fromString("embeddings"); + + /** + * Image generation. + */ + @Generated + public static final ModelType IMAGE_GENERATION = fromString("image_generation"); + + /** + * Text generation. + */ + @Generated + public static final ModelType TEXT_GENERATION = fromString("text_generation"); + + /** + * Image embeddings. + */ + @Generated + public static final ModelType IMAGE_EMBEDDINGS = fromString("image_embeddings"); + + /** + * Audio generation. + */ + @Generated + public static final ModelType AUDIO_GENERATION = fromString("audio_generation"); + + /** + * Chat completions. + */ + @Generated + public static final ModelType CHAT = fromString("chat"); + + /** + * Creates a new instance of ModelType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public ModelType() { + } + + /** + * Creates or finds a ModelType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ModelType. + */ + @Generated + public static ModelType fromString(String name) { + return fromString(name, ModelType.class); + } + + /** + * Gets known ModelType values. + * + * @return known ModelType values. + */ + @Generated + public static Collection values() { + return values(ModelType.class); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/package-info.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/package-info.java new file mode 100644 index 000000000000..59ce7efa59bf --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the data models for Model. + */ +package com.azure.ai.inference.models; diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/package-info.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/package-info.java new file mode 100644 index 000000000000..7e46067adf99 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the classes for Model. + */ +package com.azure.ai.inference; diff --git a/sdk/ai/azure-ai-inference/src/main/java/module-info.java b/sdk/ai/azure-ai-inference/src/main/java/module-info.java new file mode 100644 index 000000000000..20f5ec8d9d92 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/module-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +module com.azure.ai.inference { + requires transitive com.azure.core; + exports com.azure.ai.inference; + exports com.azure.ai.inference.models; + opens com.azure.ai.inference.models to com.azure.core; + opens com.azure.ai.inference.implementation.models to com.azure.core; +} \ No newline at end of file diff --git a/sdk/ai/azure-ai-inference/src/main/resources/META-INF/azure-ai-inference_apiview_properties.json b/sdk/ai/azure-ai-inference/src/main/resources/META-INF/azure-ai-inference_apiview_properties.json new file mode 100644 index 000000000000..6791e76714a7 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/resources/META-INF/azure-ai-inference_apiview_properties.json @@ -0,0 +1,50 @@ +{ + "flavor": "azure", + "CrossLanguageDefinitionId": { + "com.azure.ai.inference.ChatCompletionsAsyncClient": "AI.Model.ChatCompletionsClient", + "com.azure.ai.inference.ChatCompletionsAsyncClient.complete": "Customizations.Client1.complete", + "com.azure.ai.inference.ChatCompletionsAsyncClient.completeWithResponse": "Customizations.Client1.complete", + "com.azure.ai.inference.ChatCompletionsAsyncClient.getModelInfo": "Customizations.Client1.getModelInfo", + "com.azure.ai.inference.ChatCompletionsAsyncClient.getModelInfoWithResponse": "Customizations.Client1.getModelInfo", + "com.azure.ai.inference.ChatCompletionsClient": "AI.Model.ChatCompletionsClient", + "com.azure.ai.inference.ChatCompletionsClient.complete": "Customizations.Client1.complete", + "com.azure.ai.inference.ChatCompletionsClient.completeWithResponse": "Customizations.Client1.complete", + "com.azure.ai.inference.ChatCompletionsClient.getModelInfo": "Customizations.Client1.getModelInfo", + "com.azure.ai.inference.ChatCompletionsClient.getModelInfoWithResponse": "Customizations.Client1.getModelInfo", + "com.azure.ai.inference.ChatCompletionsClientBuilder": "AI.Model.ChatCompletionsClient", + "com.azure.ai.inference.implementation.models.CompleteOptions": "null", + "com.azure.ai.inference.implementation.models.CompleteRequest": "complete.Request.anonymous", + "com.azure.ai.inference.implementation.models.ExtraParameters": "AI.Model.ExtraParameters", + "com.azure.ai.inference.models.ChatChoice": "AI.Model.ChatChoice", + "com.azure.ai.inference.models.ChatCompletions": "AI.Model.ChatCompletions", + "com.azure.ai.inference.models.ChatCompletionsFunctionToolCall": "AI.Model.ChatCompletionsFunctionToolCall", + "com.azure.ai.inference.models.ChatCompletionsFunctionToolDefinition": "AI.Model.ChatCompletionsFunctionToolDefinition", + "com.azure.ai.inference.models.ChatCompletionsFunctionToolSelection": "AI.Model.ChatCompletionsFunctionToolSelection", + "com.azure.ai.inference.models.ChatCompletionsNamedFunctionToolSelection": "AI.Model.ChatCompletionsNamedFunctionToolSelection", + "com.azure.ai.inference.models.ChatCompletionsNamedToolSelection": "AI.Model.ChatCompletionsNamedToolSelection", + "com.azure.ai.inference.models.ChatCompletionsResponseFormat": "AI.Model.ChatCompletionsResponseFormat", + "com.azure.ai.inference.models.ChatCompletionsResponseFormatJSON": "AI.Model.ChatCompletionsResponseFormatJSON", + "com.azure.ai.inference.models.ChatCompletionsResponseFormatText": "AI.Model.ChatCompletionsResponseFormatText", + "com.azure.ai.inference.models.ChatCompletionsToolCall": "AI.Model.ChatCompletionsToolCall", + "com.azure.ai.inference.models.ChatCompletionsToolDefinition": "AI.Model.ChatCompletionsToolDefinition", + "com.azure.ai.inference.models.ChatCompletionsToolSelectionPreset": "AI.Model.ChatCompletionsToolSelectionPreset", + "com.azure.ai.inference.models.ChatMessageContentItem": "AI.Model.ChatMessageContentItem", + "com.azure.ai.inference.models.ChatMessageImageContentItem": "AI.Model.ChatMessageImageContentItem", + "com.azure.ai.inference.models.ChatMessageImageDetailLevel": "AI.Model.ChatMessageImageDetailLevel", + "com.azure.ai.inference.models.ChatMessageImageUrl": "AI.Model.ChatMessageImageUrl", + "com.azure.ai.inference.models.ChatMessageTextContentItem": "AI.Model.ChatMessageTextContentItem", + "com.azure.ai.inference.models.ChatRequestAssistantMessage": "AI.Model.ChatRequestAssistantMessage", + "com.azure.ai.inference.models.ChatRequestMessage": "AI.Model.ChatRequestMessage", + "com.azure.ai.inference.models.ChatRequestSystemMessage": "AI.Model.ChatRequestSystemMessage", + "com.azure.ai.inference.models.ChatRequestToolMessage": "AI.Model.ChatRequestToolMessage", + "com.azure.ai.inference.models.ChatRequestUserMessage": "AI.Model.ChatRequestUserMessage", + "com.azure.ai.inference.models.ChatResponseMessage": "AI.Model.ChatResponseMessage", + "com.azure.ai.inference.models.ChatRole": "AI.Model.ChatRole", + "com.azure.ai.inference.models.CompletionsFinishReason": "AI.Model.CompletionsFinishReason", + "com.azure.ai.inference.models.CompletionsUsage": "AI.Model.CompletionsUsage", + "com.azure.ai.inference.models.FunctionCall": "AI.Model.FunctionCall", + "com.azure.ai.inference.models.FunctionDefinition": "AI.Model.FunctionDefinition", + "com.azure.ai.inference.models.ModelInfo": "AI.Model.ModelInfo", + "com.azure.ai.inference.models.ModelType": "AI.Model.ModelType" + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/resources/azure-ai-inference.properties b/sdk/ai/azure-ai-inference/src/main/resources/azure-ai-inference.properties new file mode 100644 index 000000000000..ca812989b4f2 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/resources/azure-ai-inference.properties @@ -0,0 +1,2 @@ +name=${project.artifactId} +version=${project.version} diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/ReadmeSamples.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/ReadmeSamples.java new file mode 100644 index 000000000000..0108965a9e1e --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/ReadmeSamples.java @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference; + +public final class ReadmeSamples { + public void readmeSamples() { + // BEGIN: com.azure.ai.inference.readme + // END: com.azure.ai.inference.readme + } +} diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/ChatCompletionsClientTestBase.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/ChatCompletionsClientTestBase.java new file mode 100644 index 000000000000..1a66b287435d --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/ChatCompletionsClientTestBase.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.generated; + +// The Java test files under 'generated' package are generated for your reference. +// If you wish to modify these files, please copy them out of the 'generated' package, and modify there. +// See https://aka.ms/azsdk/dpg/java/tests for guide on adding a test. + +import com.azure.ai.inference.ChatCompletionsClient; +import com.azure.ai.inference.ChatCompletionsClientBuilder; +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.policy.HttpLogDetailLevel; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.test.TestMode; +import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import java.time.OffsetDateTime; +import reactor.core.publisher.Mono; + +class ChatCompletionsClientTestBase extends TestProxyTestBase { + protected ChatCompletionsClient chatCompletionsClient; + + @Override + protected void beforeTest() { + ChatCompletionsClientBuilder chatCompletionsClientbuilder = new ChatCompletionsClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + chatCompletionsClientbuilder.httpClient(interceptorManager.getPlaybackClient()) + .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); + } else if (getTestMode() == TestMode.RECORD) { + chatCompletionsClientbuilder.addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + chatCompletionsClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + chatCompletionsClient = chatCompletionsClientbuilder.buildClient(); + + } +} diff --git a/sdk/ai/azure-ai-inference/tsp-location.yaml b/sdk/ai/azure-ai-inference/tsp-location.yaml new file mode 100644 index 000000000000..ada3b01632dc --- /dev/null +++ b/sdk/ai/azure-ai-inference/tsp-location.yaml @@ -0,0 +1,5 @@ +commit: 6449340e804611b97c3e1a77cf2a74a9716a3d3d +additionalDirectories: [] +repo: Azure/azure-rest-api-specs +directory: specification/ai/ModelClient + From 8aeeaa0f0db23d921ae5348d9680fb8e10b99c0c Mon Sep 17 00:00:00 2001 From: glenn Date: Wed, 31 Jul 2024 10:13:37 -0400 Subject: [PATCH 002/128] use camel case for Json in class name --- sdk/ai/azure-ai-inference/CHANGELOG.md | 2 +- .../models/ChatCompletionsResponseFormat.java | 2 +- .../ChatCompletionsResponseFormatJSON.java | 22 +++++++++---------- ...azure-ai-inference_apiview_properties.json | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/sdk/ai/azure-ai-inference/CHANGELOG.md b/sdk/ai/azure-ai-inference/CHANGELOG.md index cca21c56cfdf..56fe2aa6db74 100644 --- a/sdk/ai/azure-ai-inference/CHANGELOG.md +++ b/sdk/ai/azure-ai-inference/CHANGELOG.md @@ -2,7 +2,7 @@ ## 1.0.0-beta.1 (Unreleased) -- Azure Model client library for Java. This package contains Microsoft Azure Model client library. +- Azure AI Inference client library for Java. This package contains Microsoft Azure AI Inference client library. ### Features Added diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormat.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormat.java index 6887db621fa6..e525c83c6e3d 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormat.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormat.java @@ -81,7 +81,7 @@ public static ChatCompletionsResponseFormat fromJson(JsonReader jsonReader) thro if ("text".equals(discriminatorValue)) { return ChatCompletionsResponseFormatText.fromJson(readerToUse.reset()); } else if ("json_object".equals(discriminatorValue)) { - return ChatCompletionsResponseFormatJSON.fromJson(readerToUse.reset()); + return ChatCompletionsResponseFormatJson.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatJSON.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatJSON.java index 26533be57a55..ca1ef0a58f4b 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatJSON.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatJSON.java @@ -17,7 +17,7 @@ * via a system or user message. */ @Immutable -public final class ChatCompletionsResponseFormatJSON extends ChatCompletionsResponseFormat { +public final class ChatCompletionsResponseFormatJson extends ChatCompletionsResponseFormat { /* * The response format type to use for chat completions. */ @@ -25,10 +25,10 @@ public final class ChatCompletionsResponseFormatJSON extends ChatCompletionsResp private String type = "json_object"; /** - * Creates an instance of ChatCompletionsResponseFormatJSON class. + * Creates an instance of ChatCompletionsResponseFormatJson class. */ @Generated - public ChatCompletionsResponseFormatJSON() { + public ChatCompletionsResponseFormatJson() { } /** @@ -54,30 +54,30 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of ChatCompletionsResponseFormatJSON from the JsonReader. + * Reads an instance of ChatCompletionsResponseFormatJson from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ChatCompletionsResponseFormatJSON if the JsonReader was pointing to an instance of it, or + * @return An instance of ChatCompletionsResponseFormatJson if the JsonReader was pointing to an instance of it, or * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the ChatCompletionsResponseFormatJSON. + * @throws IOException If an error occurs while reading the ChatCompletionsResponseFormatJson. */ @Generated - public static ChatCompletionsResponseFormatJSON fromJson(JsonReader jsonReader) throws IOException { + public static ChatCompletionsResponseFormatJson fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - ChatCompletionsResponseFormatJSON deserializedChatCompletionsResponseFormatJSON - = new ChatCompletionsResponseFormatJSON(); + ChatCompletionsResponseFormatJson deserializedChatCompletionsResponseFormatJson + = new ChatCompletionsResponseFormatJson(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("type".equals(fieldName)) { - deserializedChatCompletionsResponseFormatJSON.type = reader.getString(); + deserializedChatCompletionsResponseFormatJson.type = reader.getString(); } else { reader.skipChildren(); } } - return deserializedChatCompletionsResponseFormatJSON; + return deserializedChatCompletionsResponseFormatJson; }); } } diff --git a/sdk/ai/azure-ai-inference/src/main/resources/META-INF/azure-ai-inference_apiview_properties.json b/sdk/ai/azure-ai-inference/src/main/resources/META-INF/azure-ai-inference_apiview_properties.json index 6791e76714a7..b0893af5a456 100644 --- a/sdk/ai/azure-ai-inference/src/main/resources/META-INF/azure-ai-inference_apiview_properties.json +++ b/sdk/ai/azure-ai-inference/src/main/resources/META-INF/azure-ai-inference_apiview_properties.json @@ -23,7 +23,7 @@ "com.azure.ai.inference.models.ChatCompletionsNamedFunctionToolSelection": "AI.Model.ChatCompletionsNamedFunctionToolSelection", "com.azure.ai.inference.models.ChatCompletionsNamedToolSelection": "AI.Model.ChatCompletionsNamedToolSelection", "com.azure.ai.inference.models.ChatCompletionsResponseFormat": "AI.Model.ChatCompletionsResponseFormat", - "com.azure.ai.inference.models.ChatCompletionsResponseFormatJSON": "AI.Model.ChatCompletionsResponseFormatJSON", + "com.azure.ai.inference.models.ChatCompletionsResponseFormatJson": "AI.Model.ChatCompletionsResponseFormatJson", "com.azure.ai.inference.models.ChatCompletionsResponseFormatText": "AI.Model.ChatCompletionsResponseFormatText", "com.azure.ai.inference.models.ChatCompletionsToolCall": "AI.Model.ChatCompletionsToolCall", "com.azure.ai.inference.models.ChatCompletionsToolDefinition": "AI.Model.ChatCompletionsToolDefinition", From 64c6fbe4233f28ef1b87b318f6c19138140f3537 Mon Sep 17 00:00:00 2001 From: glenn Date: Thu, 1 Aug 2024 17:05:45 -0400 Subject: [PATCH 003/128] initial work on setting up a test --- .../implementation/ChatCompletionsUtils.java | 34 ++++ .../ChatCompletionsClientTestBase.java | 91 +++++++-- .../ChatCompletionsSyncClientTest.java | 181 ++++++++++++++++++ .../ai/inference/generated/TestUtils.java | 36 ++++ 4 files changed, 327 insertions(+), 15 deletions(-) create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsUtils.java create mode 100644 sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/ChatCompletionsSyncClientTest.java create mode 100644 sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/TestUtils.java diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsUtils.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsUtils.java new file mode 100644 index 000000000000..d35996596261 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsUtils.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.inference.implementation; + +import com.azure.ai.openai.inference.CompleteOptions; +import com.azure.ai.openai.inference.ChatRequestUserMessage; + +import com.azure.core.util.BinaryData; +import java.util.ArrayList; +import java.util.List; + +/** This class contains convenience methods and constants for operations related to ChatCompletions */ +public final class ChatCompletionsUtils { + + private ChatCompletionsUtils() { + } + + /** + * Convenience method for minimal initialization for the CompleteOptions class + * @param prompt from which ChatCompletions will be generated + * @return A CompleteOptions object + * */ + public static CompleteOptions defaultCompleteOptions(String prompt) { + List messages = new ArrayList<>(); + String contentString = String.format("{\"content\":\"%s\"}", prompt); + ChatRequestUserMessage message = new ChatRequestUserMessage( + BinaryData.fromString(contentString) + ); + messages.add(message); + return new CompleteOptions(messages); + } + +} diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/ChatCompletionsClientTestBase.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/ChatCompletionsClientTestBase.java index 1a66b287435d..9a272375f4ec 100644 --- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/ChatCompletionsClientTestBase.java +++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/ChatCompletionsClientTestBase.java @@ -10,36 +10,97 @@ import com.azure.ai.inference.ChatCompletionsClient; import com.azure.ai.inference.ChatCompletionsClientBuilder; +import com.azure.ai.inference.models.ChatChoice; +import com.azure.ai.inference.models.ChatCompletions; +import com.azure.ai.inference.models.Choice; +import com.azure.ai.inference.models.Completions; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.policy.HttpLogDetailLevel; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.test.models.CustomMatcher; +import com.azure.core.test.models.TestProxySanitizer; +import com.azure.core.test.models.TestProxySanitizerType; import com.azure.core.util.Configuration; import com.azure.identity.DefaultAzureCredentialBuilder; import java.time.OffsetDateTime; import reactor.core.publisher.Mono; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; + class ChatCompletionsClientTestBase extends TestProxyTestBase { protected ChatCompletionsClient chatCompletionsClient; + private boolean sanitizersRemoved = false; + + ChatCompletionsClientBuilder getChatCompletionsClientBuilder(HttpClient httpClient) { + ChatCompletionsClientBuilder builder = new ChatCompletionsClientBuilder() + .httpClient(httpClient); + TestMode testMode = getTestMode(); + if (testMode != TestMode.LIVE) { + addTestRecordCustomSanitizers(); + addCustomMatchers(); + // Disable "$..id"=AZSDK3430, "Set-Cookie"=AZSDK2015 for both azure and non-azure clients from the list of common sanitizers. + if (!sanitizersRemoved) { + interceptorManager.removeSanitizers("AZSDK3430", "AZSDK3493"); + sanitizersRemoved = true; + } + } - @Override - protected void beforeTest() { - ChatCompletionsClientBuilder chatCompletionsClientbuilder = new ChatCompletionsClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - if (getTestMode() == TestMode.PLAYBACK) { - chatCompletionsClientbuilder.httpClient(interceptorManager.getPlaybackClient()) - .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); - } else if (getTestMode() == TestMode.RECORD) { - chatCompletionsClientbuilder.addPolicy(interceptorManager.getRecordPolicy()) - .credential(new DefaultAzureCredentialBuilder().build()); - } else if (getTestMode() == TestMode.LIVE) { - chatCompletionsClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + if (testMode == TestMode.PLAYBACK) { + builder + .endpoint("https://localhost:8080") + .credential(new AzureKeyCredential(FAKE_API_KEY)); + } else if (testMode == TestMode.RECORD) { + builder + .addPolicy(interceptorManager.getRecordPolicy()) + .endpoint(Configuration.getGlobalConfiguration().get("MODEL_ENDPOINT")) + .credential(new AzureKeyCredential(Configuration.getGlobalConfiguration().get("AZURE_API_KEY"))); + } else { + builder + .endpoint(Configuration.getGlobalConfiguration().get("MODEL_ENDPOINT")) + .credential(new AzureKeyCredential(Configuration.getGlobalConfiguration().get("AZURE_API_KEY"))); } - chatCompletionsClient = chatCompletionsClientbuilder.buildClient(); + return builder; + } + private void addTestRecordCustomSanitizers() { + interceptorManager.addSanitizers(Arrays.asList( + new TestProxySanitizer("$..key", null, "REDACTED", TestProxySanitizerType.BODY_KEY), + new TestProxySanitizer("$..endpoint", null, "https://REDACTED", TestProxySanitizerType.BODY_KEY), + new TestProxySanitizer("Content-Type", "(^multipart\\/form-data; boundary=[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{2})", + "multipart\\/form-data; boundary=BOUNDARY", TestProxySanitizerType.HEADER) + )); } + + private void addCustomMatchers() { + interceptorManager.addMatchers(new CustomMatcher().setExcludedHeaders(Arrays.asList("Cookie", "Set-Cookie"))); + } + + @Test + public abstract void testGetCompletions(HttpClient httpClient); + + static void assertCompletions(int choicesPerPrompt, Completions actual) { + assertNotNull(actual); + assertInstanceOf(Completions.class, actual); + assertChoices(choicesPerPrompt, actual.getChoices()); + assertNotNull(actual.getUsage()); + } + + static void assertChoices(int choicesPerPrompt, List actual) { + assertEquals(choicesPerPrompt, actual.size()); + for (int i = 0; i < actual.size(); i++) { + assertChoice(i, actual.get(i)); + } + } + + static void assertChoice(int index, Choice actual) { + assertNotNull(actual.getText()); + assertEquals(index, actual.getIndex()); + assertNotNull(actual.getFinishReason()); + } + } diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/ChatCompletionsSyncClientTest.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/ChatCompletionsSyncClientTest.java new file mode 100644 index 000000000000..13e2a753049d --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/ChatCompletionsSyncClientTest.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.ai.inference; + +import com.azure.ai.inference.ChatCompletionsClient; +import com.azure.ai.inference.ChatCompletionsClientBuilder; +import com.azure.ai.inference.models.ChatCompletions; +import com.azure.ai.inference.models.CompleteOptions; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.test.annotation.RecordWithoutRequestBody; +import com.azure.core.util.BinaryData; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.IterableStream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; + +import static com.azure.ai.openai.TestUtils.DISPLAY_NAME_WITH_ARGUMENTS; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class ChatCompletionsSyncClientTest extends ChatCompletionsClientTestBase { + private ChatCompletionsClient client; + + private ChatCompletionsClient getChatCompletionsClient(HttpClient httpClient) { + return getChatCompletionsClientBuilder( + interceptorManager.isPlaybackMode() ? interceptorManager.getPlaybackClient() : httpClient) + .buildClient(); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.inference.TestUtils#getTestParameters") + public void testGetChatCompletions(HttpClient httpClient) { + client = getChatCompletionsClient(httpClient); + getChatCompletionsRunner((prompt) -> { + ChatCompletions resultCompletions = client.complete(new CompleteOptions(prompt)); + assertChatCompletions(1, resultCompletions); + }); + } + +/* + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.inference.TestUtils#getTestParameters") + public void testGetCompletionsStream(HttpClient httpClient, OpenAIServiceVersion serviceVersion) { + client = getModelClient(httpClient); + getCompletionsRunner((deploymentId, prompt) -> { + IterableStream resultCompletions = client.getCompletionsStream(deploymentId, new CompletionsOptions(prompt)); + assertTrue(resultCompletions.stream().toArray().length > 1); + resultCompletions.forEach(OpenAIClientTestBase::assertCompletionsStream); + }); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.TestUtils#getTestParameters") + public void testGetCompletionsFromPrompt(HttpClient httpClient, OpenAIServiceVersion serviceVersion) { + client = getModelClient(httpClient); + getCompletionsFromSinglePromptRunner((deploymentId, prompts) -> { + Completions completions = client.getCompletions(deploymentId, prompts); + assertCompletions(1, completions); + }); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.TestUtils#getTestParameters") + public void testGetCompletionsWithResponse(HttpClient httpClient, OpenAIServiceVersion serviceVersion) { + client = getModelClient(httpClient); + getCompletionsRunner((deploymentId, prompt) -> { + Response response = client.getCompletionsWithResponse(deploymentId, + BinaryData.fromObject(new CompletionsOptions(prompt)), new RequestOptions()); + Completions resultCompletions = assertAndGetValueFromResponse(response, Completions.class, 200); + assertCompletions(1, resultCompletions); + }); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.TestUtils#getTestParameters") + public void testGetCompletionsWithResponseBadDeployment(HttpClient httpClient, OpenAIServiceVersion serviceVersion) { + client = getModelClient(httpClient); + getCompletionsRunner((_deploymentId, prompt) -> { + String deploymentId = "BAD_DEPLOYMENT_ID"; + ResourceNotFoundException exception = assertThrows(ResourceNotFoundException.class, + () -> client.getCompletionsWithResponse(deploymentId, + BinaryData.fromObject(new CompletionsOptions(prompt)), new RequestOptions())); + assertEquals(404, exception.getResponse().getStatusCode()); + }); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.TestUtils#getTestParameters") + public void testGetCompletionsUsageField(HttpClient httpClient, OpenAIServiceVersion serviceVersion) { + client = getModelClient(httpClient); + getCompletionsRunner((modelId, prompt) -> { + CompletionsOptions completionsOptions = new CompletionsOptions(prompt); + completionsOptions.setMaxTokens(1024); + completionsOptions.setN(3); + completionsOptions.setLogprobs(1); + + Completions resultCompletions = client.getCompletions(modelId, completionsOptions); + + CompletionsUsage usage = resultCompletions.getUsage(); + assertCompletions(completionsOptions.getN() * completionsOptions.getPrompt().size(), resultCompletions); + assertNotNull(usage); + assertTrue(usage.getTotalTokens() > 0); + assertEquals(usage.getCompletionTokens() + usage.getPromptTokens(), usage.getTotalTokens()); + }); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.TestUtils#getTestParameters") + public void testGetCompletionsTokenCutoff(HttpClient httpClient, OpenAIServiceVersion serviceVersion) { + client = getModelClient(httpClient); + getCompletionsRunner((modelId, prompt) -> { + CompletionsOptions completionsOptions = new CompletionsOptions(prompt); + completionsOptions.setMaxTokens(3); + Completions resultCompletions = client.getCompletions(modelId, completionsOptions); + assertCompletions(1, resultCompletions); + }); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.TestUtils#getTestParameters") + public void testGetChatCompletions(HttpClient httpClient, OpenAIServiceVersion serviceVersion) { + client = getModelClient(httpClient); + getChatCompletionsRunner((deploymentId, chatMessages) -> { + ChatCompletions resultChatCompletions = client.getChatCompletions(deploymentId, new ChatCompletionsOptions(chatMessages)); + assertChatCompletions(1, resultChatCompletions); + }); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.TestUtils#getTestParameters") + public void testGetChatCompletionsStream(HttpClient httpClient, OpenAIServiceVersion serviceVersion) { + client = getModelClient(httpClient); + getChatCompletionsRunner((deploymentId, chatMessages) -> { + IterableStream resultChatCompletions = client.getChatCompletionsStream(deploymentId, new ChatCompletionsOptions(chatMessages)); + assertTrue(resultChatCompletions.stream().toArray().length > 1); + resultChatCompletions.forEach(OpenAIClientTestBase::assertChatCompletionsStream); + }); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.TestUtils#getTestParameters") + public void testGetChatCompletionsStreamWithResponse(HttpClient httpClient, OpenAIServiceVersion serviceVersion) { + client = getModelClient(httpClient); + getChatCompletionsWithResponseRunner(deploymentId -> chatMessages -> requestOptions -> { + Response> response = client.getChatCompletionsStreamWithResponse( + deploymentId, new ChatCompletionsOptions(chatMessages), requestOptions); + assertResponseRequestHeader(response.getRequest()); + IterableStream value = response.getValue(); + assertTrue(value.stream().toArray().length > 1); + value.forEach(OpenAIClientTestBase::assertChatCompletionsStream); + }); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.TestUtils#getTestParameters") + public void testGetChatCompletionsWithResponse(HttpClient httpClient, OpenAIServiceVersion serviceVersion) { + client = getModelClient(httpClient); + getChatCompletionsRunner((deploymentId, chatMessages) -> { + Response response = client.getChatCompletionsWithResponse(deploymentId, + BinaryData.fromObject(new ChatCompletionsOptions(chatMessages)), new RequestOptions()); + ChatCompletions resultChatCompletions = assertAndGetValueFromResponse(response, ChatCompletions.class, 200); + assertChatCompletions(1, resultChatCompletions); + }); + } +*/ + +} diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/TestUtils.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/TestUtils.java new file mode 100644 index 000000000000..36915dd2bd92 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/TestUtils.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.inference; + +import com.azure.core.http.HttpClient; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import org.junit.jupiter.params.provider.Arguments; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Stream; + +import static com.azure.core.test.TestBase.getHttpClients; + +public class TestUtils { + static final String DISPLAY_NAME_WITH_ARGUMENTS = "{displayName} with [{arguments}]"; + static final String FAKE_API_KEY = "fakeKeyPlaceholder"; + + /** + * Returns a stream of arguments that includes all combinations of eligible {@link HttpClient HttpClients} + * that should be tested. + * + * @return A stream of HttpClients to test. + */ + static Stream getTestParameters() { + // when this issues is closed, the newer version of junit will have better support for + // cartesian product of arguments - https://github.com/junit-team/junit5/issues/1427 + List argumentsList = new ArrayList<>(); + getHttpClients().forEach(httpClient -> argumentsList.add(Arguments.of(httpClient)))); + return argumentsList.stream(); + } + +} From bc4f8baf950b315f7abafec2b3fd8bfd76deeb5d Mon Sep 17 00:00:00 2001 From: glenn Date: Fri, 2 Aug 2024 11:54:40 -0400 Subject: [PATCH 004/128] Fix some compile errors --- .../ai/inference/ChatCompletionsClient.java | 20 ++++++++++++ .../implementation/ChatCompletionsUtils.java | 31 ++++++++++++++----- .../ChatCompletionsClientTestBase.java | 17 +++++----- .../ChatCompletionsSyncClientTest.java | 5 ++- .../ai/inference/generated/TestUtils.java | 2 +- 5 files changed, 55 insertions(+), 20 deletions(-) diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java index be71658ef53d..53b0e57cdfe9 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java @@ -8,6 +8,7 @@ import com.azure.ai.inference.implementation.models.CompleteOptions; import com.azure.ai.inference.implementation.models.CompleteRequest; import com.azure.ai.inference.implementation.models.ExtraParameters; +import com.azure.ai.inference.implementation.ChatCompletionsUtils; import com.azure.ai.inference.models.ChatCompletions; import com.azure.ai.inference.models.ModelInfo; import com.azure.core.annotation.Generated; @@ -204,6 +205,25 @@ ChatCompletions complete(CompleteOptions options) { return completeWithResponse(completeRequest, requestOptions).getValue().toObject(ChatCompletions.class); } + /** + * Gets completions for the provided input prompt. Completions support a wide variety of tasks and generate text + * that continues from or "completes" provided prompt data. + * + * @param prompt The prompt to generate completion text from. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return chat completions for the provided input prompts. Chat completions support a wide variety of tasks and generate text + * that continues from or "completes" provided prompt data. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ChatCompletions complete(String prompt) { + return complete(ChatCompletionsUtils.defaultCompleteOptions(prompt)); + } + /** * Returns information about the AI model. * The method makes a REST API call to the `/info` route on the given endpoint. diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsUtils.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsUtils.java index d35996596261..de578233f5b3 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsUtils.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsUtils.java @@ -3,16 +3,22 @@ package com.azure.ai.inference.implementation; -import com.azure.ai.openai.inference.CompleteOptions; -import com.azure.ai.openai.inference.ChatRequestUserMessage; +import com.azure.ai.inference.implementation.models.CompleteOptions; +import com.azure.ai.inference.models.ChatRequestMessage; import com.azure.core.util.BinaryData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonProviders; +import com.azure.json.JsonReader; import java.util.ArrayList; import java.util.List; +import java.io.StringReader; +import java.io.IOException; /** This class contains convenience methods and constants for operations related to ChatCompletions */ public final class ChatCompletionsUtils { + private static final ClientLogger LOGGER = new ClientLogger(ChatCompletionsUtils.class); private ChatCompletionsUtils() { } @@ -22,12 +28,21 @@ private ChatCompletionsUtils() { * @return A CompleteOptions object * */ public static CompleteOptions defaultCompleteOptions(String prompt) { - List messages = new ArrayList<>(); - String contentString = String.format("{\"content\":\"%s\"}", prompt); - ChatRequestUserMessage message = new ChatRequestUserMessage( - BinaryData.fromString(contentString) - ); - messages.add(message); + List messages = new ArrayList<>(); + String jsonPrompt = "{" + + "\"role\":\"user\"," + + "\"content\":\"%s\"," + + "}"; + String contentString = String.format(jsonPrompt, prompt); + try { + ChatRequestMessage message = ChatRequestMessage.fromJson( + JsonProviders.createReader(new StringReader(contentString)) + ); + messages.add(message); + } catch (IOException ex) { + throw LOGGER.logThrowableAsError(new IllegalArgumentException( + "prompt string not accepted for JSON parsing")); + } return new CompleteOptions(messages); } diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/ChatCompletionsClientTestBase.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/ChatCompletionsClientTestBase.java index 9a272375f4ec..8c263ad3a0b7 100644 --- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/ChatCompletionsClientTestBase.java +++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/ChatCompletionsClientTestBase.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.ai.inference.generated; +package com.azure.ai.inference; // The Java test files under 'generated' package are generated for your reference. // If you wish to modify these files, please copy them out of the 'generated' package, and modify there. @@ -12,8 +12,6 @@ import com.azure.ai.inference.ChatCompletionsClientBuilder; import com.azure.ai.inference.models.ChatChoice; import com.azure.ai.inference.models.ChatCompletions; -import com.azure.ai.inference.models.Choice; -import com.azure.ai.inference.models.Completions; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.policy.HttpLogDetailLevel; @@ -26,13 +24,16 @@ import com.azure.core.util.Configuration; import com.azure.identity.DefaultAzureCredentialBuilder; import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; import reactor.core.publisher.Mono; +import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertEquals; -class ChatCompletionsClientTestBase extends TestProxyTestBase { +public abstract class ChatCompletionsClientTestBase extends TestProxyTestBase { protected ChatCompletionsClient chatCompletionsClient; private boolean sanitizersRemoved = false; @@ -81,23 +82,23 @@ private void addCustomMatchers() { } @Test - public abstract void testGetCompletions(HttpClient httpClient); + public abstract void testGetChatCompletions(HttpClient httpClient); - static void assertCompletions(int choicesPerPrompt, Completions actual) { + static void assertCompletions(int choicesPerPrompt, ChatCompletions actual) { assertNotNull(actual); assertInstanceOf(Completions.class, actual); assertChoices(choicesPerPrompt, actual.getChoices()); assertNotNull(actual.getUsage()); } - static void assertChoices(int choicesPerPrompt, List actual) { + static void assertChoices(int choicesPerPrompt, List actual) { assertEquals(choicesPerPrompt, actual.size()); for (int i = 0; i < actual.size(); i++) { assertChoice(i, actual.get(i)); } } - static void assertChoice(int index, Choice actual) { + static void assertChoice(int index, ChatChoice actual) { assertNotNull(actual.getText()); assertEquals(index, actual.getIndex()); assertNotNull(actual.getFinishReason()); diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/ChatCompletionsSyncClientTest.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/ChatCompletionsSyncClientTest.java index 13e2a753049d..7aa8472c46b1 100644 --- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/ChatCompletionsSyncClientTest.java +++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/ChatCompletionsSyncClientTest.java @@ -5,7 +5,6 @@ import com.azure.ai.inference.ChatCompletionsClient; import com.azure.ai.inference.ChatCompletionsClientBuilder; import com.azure.ai.inference.models.ChatCompletions; -import com.azure.ai.inference.models.CompleteOptions; import com.azure.core.exception.HttpResponseException; import com.azure.core.exception.ResourceNotFoundException; import com.azure.core.http.HttpClient; @@ -23,7 +22,7 @@ import java.util.Iterator; import java.util.List; -import static com.azure.ai.openai.TestUtils.DISPLAY_NAME_WITH_ARGUMENTS; +import static com.azure.ai.inference.TestUtils.DISPLAY_NAME_WITH_ARGUMENTS; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertInstanceOf; @@ -46,7 +45,7 @@ private ChatCompletionsClient getChatCompletionsClient(HttpClient httpClient) { public void testGetChatCompletions(HttpClient httpClient) { client = getChatCompletionsClient(httpClient); getChatCompletionsRunner((prompt) -> { - ChatCompletions resultCompletions = client.complete(new CompleteOptions(prompt)); + ChatCompletions resultCompletions = client.complete(prompt); assertChatCompletions(1, resultCompletions); }); } diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/TestUtils.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/TestUtils.java index 36915dd2bd92..e42e70cbe296 100644 --- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/TestUtils.java +++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/TestUtils.java @@ -29,7 +29,7 @@ static Stream getTestParameters() { // when this issues is closed, the newer version of junit will have better support for // cartesian product of arguments - https://github.com/junit-team/junit5/issues/1427 List argumentsList = new ArrayList<>(); - getHttpClients().forEach(httpClient -> argumentsList.add(Arguments.of(httpClient)))); + getHttpClients().forEach(httpClient -> argumentsList.add(Arguments.of(httpClient))); return argumentsList.stream(); } From f2ef2a6df8c81c520041e8a13a8e645931b07ace Mon Sep 17 00:00:00 2001 From: glenn Date: Fri, 2 Aug 2024 12:36:08 -0400 Subject: [PATCH 005/128] test actually compiles (and fails) --- .../ChatCompletionsClientTestBase.java | 13 +++++++++++-- .../ChatCompletionsSyncClientTest.java | 2 +- .../ai/inference/{generated => }/TestUtils.java | 0 3 files changed, 12 insertions(+), 3 deletions(-) rename sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/{generated => }/ChatCompletionsClientTestBase.java (91%) rename sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/{generated => }/ChatCompletionsSyncClientTest.java (99%) rename sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/{generated => }/TestUtils.java (100%) diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/ChatCompletionsClientTestBase.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java similarity index 91% rename from sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/ChatCompletionsClientTestBase.java rename to sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java index 8c263ad3a0b7..51412d0cc47e 100644 --- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/ChatCompletionsClientTestBase.java +++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java @@ -13,6 +13,8 @@ import com.azure.ai.inference.models.ChatChoice; import com.azure.ai.inference.models.ChatCompletions; import com.azure.core.credential.AccessToken; +import com.azure.core.credential.AzureKeyCredential; +import com.azure.core.credential.KeyCredential; import com.azure.core.http.HttpClient; import com.azure.core.http.policy.HttpLogDetailLevel; import com.azure.core.http.policy.HttpLogOptions; @@ -25,13 +27,16 @@ import com.azure.identity.DefaultAzureCredentialBuilder; import java.time.OffsetDateTime; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; +import java.util.function.Consumer; import reactor.core.publisher.Mono; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertEquals; +import static com.azure.ai.inference.TestUtils.FAKE_API_KEY; public abstract class ChatCompletionsClientTestBase extends TestProxyTestBase { protected ChatCompletionsClient chatCompletionsClient; @@ -84,9 +89,13 @@ private void addCustomMatchers() { @Test public abstract void testGetChatCompletions(HttpClient httpClient); + void getChatCompletionsRunner(Consumer testRunner) { + testRunner.accept("Say this is a test"); + } + static void assertCompletions(int choicesPerPrompt, ChatCompletions actual) { assertNotNull(actual); - assertInstanceOf(Completions.class, actual); + assertInstanceOf(ChatCompletions.class, actual); assertChoices(choicesPerPrompt, actual.getChoices()); assertNotNull(actual.getUsage()); } @@ -99,7 +108,7 @@ static void assertChoices(int choicesPerPrompt, List actual) { } static void assertChoice(int index, ChatChoice actual) { - assertNotNull(actual.getText()); + assertNotNull(actual.getMessage().getContent()); assertEquals(index, actual.getIndex()); assertNotNull(actual.getFinishReason()); } diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/ChatCompletionsSyncClientTest.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java similarity index 99% rename from sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/ChatCompletionsSyncClientTest.java rename to sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java index 7aa8472c46b1..19c40deb16f5 100644 --- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/ChatCompletionsSyncClientTest.java +++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java @@ -46,7 +46,7 @@ public void testGetChatCompletions(HttpClient httpClient) { client = getChatCompletionsClient(httpClient); getChatCompletionsRunner((prompt) -> { ChatCompletions resultCompletions = client.complete(prompt); - assertChatCompletions(1, resultCompletions); + assertCompletions(1, resultCompletions); }); } diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/TestUtils.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/TestUtils.java similarity index 100% rename from sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/generated/TestUtils.java rename to sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/TestUtils.java From 5e37b21a3ac825b2fe89b905b353784855ca2def Mon Sep 17 00:00:00 2001 From: glenn Date: Mon, 5 Aug 2024 10:45:40 -0400 Subject: [PATCH 006/128] add to azure-sdks-all --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + sdk/ai/azure-ai-inference/pom.xml | 4 +-- sdk/ai/ci.yml | 47 +++++++++++++++++++++++++++++++ sdk/ai/pom.xml | 15 ++++++++++ 5 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 sdk/ai/ci.yml create mode 100644 sdk/ai/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 94e72bd1a59d..5dc03c7f7b10 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -42,6 +42,7 @@ com.azure:azure-ai-documentintelligence;1.0.0-beta.3;1.0.0-beta.4 com.azure:azure-ai-documenttranslator;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-ai-formrecognizer;4.1.9;4.1.10 com.azure:azure-ai-formrecognizer-perf;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-ai-inference;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-ai-metricsadvisor;1.1.27;1.2.0 com.azure:azure-ai-metricsadvisor-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-ai-openai;1.0.0-beta.10;1.0.0-beta.11 diff --git a/pom.xml b/pom.xml index bab1932942a3..6eb36a7f0ea9 100644 --- a/pom.xml +++ b/pom.xml @@ -13,6 +13,7 @@ eng/code-quality-reports sdk/advisor sdk/agrifood + sdk/ai sdk/alertsmanagement sdk/anomalydetector sdk/aot diff --git a/sdk/ai/azure-ai-inference/pom.xml b/sdk/ai/azure-ai-inference/pom.xml index 3fd4a4ac6e86..ae2a11302767 100644 --- a/sdk/ai/azure-ai-inference/pom.xml +++ b/sdk/ai/azure-ai-inference/pom.xml @@ -17,8 +17,8 @@ 1.0.0-beta.1 jar - Microsoft Azure SDK for Model - This package contains Microsoft Azure Model client library. + Microsoft Azure SDK for Inference + This package contains Microsoft Azure Inference client library. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/ai/ci.yml b/sdk/ai/ci.yml new file mode 100644 index 000000000000..cd2382d15f1b --- /dev/null +++ b/sdk/ai/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/ai/ci.yml + - sdk/ai/azure-ai-inference/ + exclude: + - sdk/ai/pom.xml + - sdk/ai/azure-ai-inference/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/ai/ci.yml + - sdk/ai/azure-ai-inference/ + exclude: + - sdk/ai/pom.xml + - sdk/ai/azure-ai-inference/pom.xml + +parameters: + - name: release_azureaiinference + displayName: azure-ai-inference + type: boolean + default: true + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: ai + EnableBatchRelease: true + Artifacts: + - name: azure-ai-inference + groupId: com.azure + safeName: azureaiinference + releaseInBatch: ${{ parameters.release_azureaiinference }} \ No newline at end of file diff --git a/sdk/ai/pom.xml b/sdk/ai/pom.xml new file mode 100644 index 000000000000..14915ac80174 --- /dev/null +++ b/sdk/ai/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-ai-service + pom + 1.0.0 + + + azure-ai-inference + + From bbceade4489064d749a78437569be5b94ad7a450 Mon Sep 17 00:00:00 2001 From: glenn Date: Tue, 6 Aug 2024 12:47:50 -0400 Subject: [PATCH 007/128] fix json typo causing defaultCompleteOptions to throw --- .../ai/inference/implementation/ChatCompletionsUtils.java | 4 +--- .../src/test/java/com/azure/ai/inference/TestUtils.java | 3 --- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsUtils.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsUtils.java index de578233f5b3..dbcf78a0c941 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsUtils.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsUtils.java @@ -6,10 +6,8 @@ import com.azure.ai.inference.implementation.models.CompleteOptions; import com.azure.ai.inference.models.ChatRequestMessage; -import com.azure.core.util.BinaryData; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonProviders; -import com.azure.json.JsonReader; import java.util.ArrayList; import java.util.List; import java.io.StringReader; @@ -31,7 +29,7 @@ public static CompleteOptions defaultCompleteOptions(String prompt) { List messages = new ArrayList<>(); String jsonPrompt = "{" + "\"role\":\"user\"," - + "\"content\":\"%s\"," + + "\"content\":\"%s\"" + "}"; String contentString = String.format(jsonPrompt, prompt); try { diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/TestUtils.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/TestUtils.java index e42e70cbe296..ac5ced527df7 100644 --- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/TestUtils.java +++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/TestUtils.java @@ -4,12 +4,9 @@ package com.azure.ai.inference; import com.azure.core.http.HttpClient; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; import org.junit.jupiter.params.provider.Arguments; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import java.util.stream.Stream; From 96d551753f63b56625384fbceb848ba871227dbe Mon Sep 17 00:00:00 2001 From: glenn Date: Wed, 7 Aug 2024 11:31:24 -0400 Subject: [PATCH 008/128] add completeStreaming convenience method and InferenceSSE class --- .../ai/inference/ChatCompletionsClient.java | 150 ++++++++++++++++-- .../InferenceServerSentEvents.java | 96 +++++++++++ 2 files changed, 237 insertions(+), 9 deletions(-) create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/InferenceServerSentEvents.java diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java index 53b0e57cdfe9..a3ebd1d33b88 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java @@ -5,6 +5,7 @@ package com.azure.ai.inference; import com.azure.ai.inference.implementation.ChatCompletionsClientImpl; +import com.azure.ai.inference.implementation.InferenceServerSentEvents; import com.azure.ai.inference.implementation.models.CompleteOptions; import com.azure.ai.inference.implementation.models.CompleteRequest; import com.azure.ai.inference.implementation.models.ExtraParameters; @@ -23,6 +24,10 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; +import com.azure.core.util.IterableStream; +import reactor.core.publisher.Flux; + +import java.nio.ByteBuffer; /** * Initializes a new instance of the synchronous ChatCompletionsClient type. @@ -34,7 +39,7 @@ public final class ChatCompletionsClient { /** * Initializes an instance of ChatCompletionsClient class. - * + * * @param serviceClient the service client implementation. */ @Generated @@ -58,7 +63,7 @@ public final class ChatCompletionsClient { * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

- * + * *
{@code
      * {
      *     messages (Required): [
@@ -88,9 +93,9 @@ public final class ChatCompletionsClient {
      *     model: String (Optional)
      * }
      * }
- * + * *

Response Body Schema

- * + * *
{@code
      * {
      *     id: String (Required)
@@ -119,7 +124,7 @@ public final class ChatCompletionsClient {
      *     ]
      * }
      * }
- * + * * @param completeRequest The completeRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -140,7 +145,7 @@ Response completeWithResponse(BinaryData completeRequest, RequestOpt * Returns information about the AI model. * The method makes a REST API call to the `/info` route on the given endpoint. *

Response Body Schema

- * + * *
{@code
      * {
      *     model_name: String (Required)
@@ -148,7 +153,7 @@ Response completeWithResponse(BinaryData completeRequest, RequestOpt
      *     model_provider_name: String (Required)
      * }
      * }
- * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -167,7 +172,7 @@ public Response getModelInfoWithResponse(RequestOptions requestOptio * Completions support a wide variety of tasks and generate text that continues from or "completes" * provided prompt data. The method makes a REST API call to the `/chat/completions` route * on the given endpoint. - * + * * @param options Options for complete API. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -224,10 +229,137 @@ public ChatCompletions complete(String prompt) { return complete(ChatCompletionsUtils.defaultCompleteOptions(prompt)); } + /** + * 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 + *

+ * + * + *
+     * ChatCompletionsClient.completeStreaming(new CompleteOptions(chatMessages))
+     *         .forEach(chatCompletions -> {
+     *             if (CoreUtils.isNullOrEmpty(chatCompletions.getChoices())) {
+     *                 return;
+     *             }
+     *             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 completeOptions The configuration information for a chat completions request. Completions support a + * wide variety of tasks and generate text that continues from or "completes" provided prompt data. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return chat completions stream for the provided chat messages. Completions support a wide variety of tasks and + * generate text that continues from or "completes" provided prompt data. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public IterableStream completeStreaming(CompleteOptions completeOptions) { + completeOptions.setStream(true); + RequestOptions requestOptions = new RequestOptions(); + Flux responseStream = completeStreamingWithResponse( + BinaryData.fromObject(completeOptions), requestOptions).getValue().toFluxByteBuffer(); + InferenceServerSentEvents chatCompletionsStream + = new InferenceServerSentEvents<>(responseStream, ChatCompletions.class); + return new IterableStream<>(chatCompletionsStream.getEvents()); + } + + /** + * Gets chat completions for the provided chat messages. Completions support a wide variety of tasks and generate + * text that continues from or "completes" provided prompt data. + * + *

+ * Request Body Schema + * + *

{@code
+     * {
+     *     messages (Required): [
+     *          (Required){
+     *             role: String(system/assistant/user) (Required)
+     *             content: String (Optional)
+     *         }
+     *     ]
+     *     max_tokens: Integer (Optional)
+     *     temperature: Double (Optional)
+     *     top_p: Double (Optional)
+     *     logit_bias (Optional): {
+     *         String: int (Optional)
+     *     }
+     *     user: String (Optional)
+     *     n: Integer (Optional)
+     *     stop (Optional): [
+     *         String (Optional)
+     *     ]
+     *     presence_penalty: Double (Optional)
+     *     frequency_penalty: Double (Optional)
+     *     stream: Boolean (Optional)
+     *     model: String (Optional)
+     * }
+     * }
+ * + *

+ * Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     created: int (Required)
+     *     choices (Required): [
+     *          (Required){
+     *             message (Optional): {
+     *                 role: String(system/assistant/user) (Required)
+     *                 content: String (Optional)
+     *             }
+     *             index: int (Required)
+     *             finish_reason: String(stopped/tokenLimitReached/contentFiltered) (Required)
+     *             delta (Optional): {
+     *                 role: String(system/assistant/user) (Optional)
+     *                 content: String (Optional)
+     *             }
+     *         }
+     *     ]
+     *     usage (Required): {
+     *         completion_tokens: int (Required)
+     *         prompt_tokens: int (Required)
+     *         total_tokens: int (Required)
+     *     }
+     * }
+     * }
+ * + * (when using non-Azure OpenAI) to use for this request. + * @param chatCompletionsOptions The configuration information for a chat completions request. Completions support a + * wide variety of tasks and generate text that continues from or "completes" provided prompt data. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return chat completions for the provided chat messages. Completions support a wide variety of tasks and generate + * text that continues from or "completes" provided prompt data along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response completeStreamingWithResponse(BinaryData chatCompletionsOptions, RequestOptions requestOptions) { + return serviceClient.completeWithResponse(chatCompletionsOptions, requestOptions); + } + /** * Returns information about the AI model. * The method makes a REST API call to the `/info` route on the given endpoint. - * + * * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/InferenceServerSentEvents.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/InferenceServerSentEvents.java new file mode 100644 index 000000000000..a1f64c0c1d6c --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/InferenceServerSentEvents.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.inference.implementation; + +import com.azure.core.util.serializer.JsonSerializer; +import com.azure.core.util.serializer.JsonSerializerProviders; +import com.azure.core.util.serializer.TypeReference; +import reactor.core.publisher.Flux; +import reactor.core.scheduler.Schedulers; +import java.io.ByteArrayOutputStream; +import java.io.UncheckedIOException; +import java.io.UnsupportedEncodingException; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public final class InferenceServerSentEvents { + + private static final List STREAM_COMPLETION_EVENT = Arrays.asList("data: [DONE]", "data:[DONE]"); + private final Flux source; + private final Class type; + private ByteArrayOutputStream outStream; + + private static final JsonSerializer SERIALIZER = JsonSerializerProviders.createInstance(true); + + public InferenceServerSentEvents(Flux source, Class type) { + this.source = source; + this.type = type; + this.outStream = new ByteArrayOutputStream(); + } + + public Flux getEvents() { + return mapByteBuffersToEvents(); + } + + private Flux mapByteBuffersToEvents() { + return source + .publishOn(Schedulers.boundedElastic()) + .concatMap(byteBuffer -> { + List values = new ArrayList<>(); + byte[] byteArray = byteBuffer.array(); + for (byte currentByte : byteArray) { + if (currentByte == 0xA || currentByte == 0xD) { + try { + handleCurrentLine(outStream.toString(StandardCharsets.UTF_8.name()), values); + } catch (UnsupportedEncodingException | UncheckedIOException e) { + return Flux.error(e); + } + outStream = new ByteArrayOutputStream(); + } else { + outStream.write(currentByte); + } + } + try { + handleCurrentLine(outStream.toString(StandardCharsets.UTF_8.name()), values); + outStream = new ByteArrayOutputStream(); + } catch (IllegalStateException | UncheckedIOException e) { + // return the values collected so far, as this could be because the server sent event is + // split across two byte buffers and the last line is incomplete and will be continued in + // the next byte buffer + return Flux.fromIterable(values); + } catch (UnsupportedEncodingException e) { + return Flux.error(e); + } + return Flux.fromIterable(values); + }).cache(); + } + + private void handleCurrentLine(String currentLine, List values) throws UncheckedIOException { + if (currentLine.isEmpty() || STREAM_COMPLETION_EVENT.contains(currentLine)) { + return; + } + + // The expected line format of the server sent event is data: {...} + String[] split = currentLine.split(":", 2); + if (split.length != 2) { + throw new IllegalStateException("Invalid data format " + currentLine); + } + + String dataValue = split[1]; + if (split[1].startsWith(" ")) { + dataValue = split[1].substring(1); + } + + T value = SERIALIZER.deserializeFromBytes(dataValue.getBytes(StandardCharsets.UTF_8), TypeReference.createInstance(type)); + if (value == null) { + throw new IllegalStateException("Failed to deserialize the data value " + dataValue); + } + + values.add(value); + + } +} From 1482e5393dcc889d2aa08b0d4e2ba2ae7e6128a4 Mon Sep 17 00:00:00 2001 From: glenn Date: Thu, 8 Aug 2024 11:14:57 -0400 Subject: [PATCH 009/128] add chat samples (sync), streaming convenience fields --- .../azure/ai/inference/models/ChatChoice.java | 36 +++++++-- .../models/ChatRequestAssistantMessage.java | 22 ++++-- .../models/ChatRequestUserMessage.java | 32 +++++++- .../com/azure/ai/inference/ReadmeSamples.java | 12 --- .../ai/inference/usage/BasicChatSample.java | 34 +++++++++ .../inference/usage/StreamingChatSample.java | 75 +++++++++++++++++++ 6 files changed, 181 insertions(+), 30 deletions(-) delete mode 100644 sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/ReadmeSamples.java create mode 100644 sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatSample.java create mode 100644 sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatChoice.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatChoice.java index 4386f2da79f3..bee8fb31b29b 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatChoice.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatChoice.java @@ -37,9 +37,15 @@ public final class ChatChoice implements JsonSerializable { @Generated private final ChatResponseMessage message; + /* + * The delta message content for a streaming response. + */ + @Generated + private ChatResponseMessage delta; + /** * Creates an instance of ChatChoice class. - * + * * @param index the index value to set. * @param finishReason the finishReason value to set. * @param message the message value to set. @@ -53,7 +59,7 @@ private ChatChoice(int index, CompletionsFinishReason finishReason, ChatResponse /** * Get the index property: The ordered index associated with this chat completions choice. - * + * * @return the index value. */ @Generated @@ -61,9 +67,18 @@ public int getIndex() { return this.index; } + /** + * Get the delta property: The delta message content for a streaming response. + * + * @return the delta value. + */ + public ChatResponseMessage getDelta() { + return this.delta; + } + /** * Get the finishReason property: The reason that this chat completions choice completed its generated. - * + * * @return the finishReason value. */ @Generated @@ -73,7 +88,7 @@ public CompletionsFinishReason getFinishReason() { /** * Get the message property: The chat message for a given chat completions prompt. - * + * * @return the message value. */ @Generated @@ -84,31 +99,31 @@ public ChatResponseMessage getMessage() { /** * {@inheritDoc} */ - @Generated @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeIntField("index", this.index); jsonWriter.writeStringField("finish_reason", this.finishReason == null ? null : this.finishReason.toString()); jsonWriter.writeJsonField("message", this.message); + jsonWriter.writeJsonField("delta", this.delta); return jsonWriter.writeEndObject(); } /** * Reads an instance of ChatChoice from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of ChatChoice if the JsonReader was pointing to an instance of it, or null if it was pointing * to JSON null. * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the ChatChoice. */ - @Generated public static ChatChoice fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { int index = 0; CompletionsFinishReason finishReason = null; ChatResponseMessage message = null; + ChatResponseMessage delta = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -117,13 +132,18 @@ public static ChatChoice fromJson(JsonReader jsonReader) throws IOException { index = reader.getInt(); } else if ("finish_reason".equals(fieldName)) { finishReason = CompletionsFinishReason.fromString(reader.getString()); + } else if ("delta".equals(fieldName)) { + delta = ChatResponseMessage.fromJson(reader); } else if ("message".equals(fieldName)) { message = ChatResponseMessage.fromJson(reader); } else { reader.skipChildren(); } } - return new ChatChoice(index, finishReason, message); + + ChatChoice deserializedChatChoice = new ChatChoice(index, finishReason, message); + deserializedChatChoice.delta = delta; + return deserializedChatChoice; }); } } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestAssistantMessage.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestAssistantMessage.java index 23dee5d48f57..558db3eb368b 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestAssistantMessage.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestAssistantMessage.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; +import com.azure.core.util.BinaryData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -43,9 +44,18 @@ public final class ChatRequestAssistantMessage extends ChatRequestMessage { public ChatRequestAssistantMessage() { } + /** + * Creates an instance of ChatRequestUserMessage class. + * + * @param content the content value to set. + */ + public ChatRequestAssistantMessage(String content) { + this.content = content; + } + /** * Get the role property: The chat role associated with this message. - * + * * @return the role value. */ @Generated @@ -56,7 +66,7 @@ public ChatRole getRole() { /** * Get the content property: The content of the message. - * + * * @return the content value. */ @Generated @@ -66,7 +76,7 @@ public String getContent() { /** * Set the content property: The content of the message. - * + * * @param content the content value to set. * @return the ChatRequestAssistantMessage object itself. */ @@ -80,7 +90,7 @@ public ChatRequestAssistantMessage setContent(String content) { * Get the toolCalls property: The tool calls that must be resolved and have their outputs appended to subsequent * input messages for the chat * completions request to resolve as configured. - * + * * @return the toolCalls value. */ @Generated @@ -92,7 +102,7 @@ public List getToolCalls() { * Set the toolCalls property: The tool calls that must be resolved and have their outputs appended to subsequent * input messages for the chat * completions request to resolve as configured. - * + * * @param toolCalls the toolCalls value to set. * @return the ChatRequestAssistantMessage object itself. */ @@ -117,7 +127,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of ChatRequestAssistantMessage from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of ChatRequestAssistantMessage if the JsonReader was pointing to an instance of it, or null * if it was pointing to JSON null. diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java index 9eb66d55c297..5c9d461d790f 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java @@ -7,10 +7,12 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.azure.core.util.BinaryData; +import com.azure.json.JsonProviders; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.io.StringReader; /** * A request chat message representing user input to the assistant. @@ -31,7 +33,7 @@ public final class ChatRequestUserMessage extends ChatRequestMessage { /** * Creates an instance of ChatRequestUserMessage class. - * + * * @param content the content value to set. */ @Generated @@ -41,7 +43,7 @@ public ChatRequestUserMessage(BinaryData content) { /** * Get the role property: The chat role associated with this message. - * + * * @return the role value. */ @Generated @@ -52,7 +54,7 @@ public ChatRole getRole() { /** * Get the content property: The contents of the user message, with available input types varying by selected model. - * + * * @return the content value. */ @Generated @@ -74,7 +76,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of ChatRequestUserMessage from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of ChatRequestUserMessage if the JsonReader was pointing to an instance of it, or null if it * was pointing to JSON null. @@ -104,4 +106,26 @@ public static ChatRequestUserMessage fromJson(JsonReader jsonReader) throws IOEx return deserializedChatRequestUserMessage; }); } + + /** + * Creates an instance of ChatRequestUserMessage class. + * + * @param content the content value to set. + * @return An instance of ChatRequestUserMessage if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + */ + public static ChatRequestUserMessage fromString(String content) { + String jsonPrompt = "{" + + "\"content\":\"%s\"" + + "}"; + String contentString = String.format(jsonPrompt, content); + try { + return ChatRequestUserMessage.fromJson( + JsonProviders.createReader(new StringReader(contentString)) + ); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + } diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/ReadmeSamples.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/ReadmeSamples.java deleted file mode 100644 index 0108965a9e1e..000000000000 --- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/ReadmeSamples.java +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.ai.inference; - -public final class ReadmeSamples { - public void readmeSamples() { - // BEGIN: com.azure.ai.inference.readme - // END: com.azure.ai.inference.readme - } -} diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatSample.java new file mode 100644 index 000000000000..897bc699d70d --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatSample.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.usage; + +import com.azure.ai.inference.ChatCompletionsClient; +import com.azure.ai.inference.ChatCompletionsClientBuilder; +import com.azure.ai.inference.models.ChatChoice; +import com.azure.ai.inference.models.ChatCompletions; +import com.azure.core.credential.AzureKeyCredential; +import com.azure.core.util.Configuration; + +public final class BasicChatSample { + /** + * @param args Unused. Arguments to the program. + */ + public static void main(String[] args) { + String key = Configuration.getGlobalConfiguration().get("AZURE_API_KEY"); + String endpoint = Configuration.getGlobalConfiguration().get("MODEL_ENDPOINT"); + ChatCompletionsClient client = new ChatCompletionsClientBuilder() + .credential(new AzureKeyCredential(key)) + .endpoint(endpoint) + .buildClient(); + + String prompt = "Tell me 3 jokes about trains"; + + ChatCompletions completions = client.complete(prompt); + + for (ChatChoice choice : completions.getChoices()) { + System.out.printf("%s.%n", choice.getMessage().getContent()); + } + } +} diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java new file mode 100644 index 000000000000..3677dc618a67 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.usage; + +import com.azure.ai.inference.ChatCompletionsClient; +import com.azure.ai.inference.ChatCompletionsClientBuilder; +import com.azure.ai.inference.implementation.models.CompleteOptions; +import com.azure.ai.inference.models.*; +import com.azure.core.credential.AzureKeyCredential; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.IterableStream; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; + +public final class StreamingChatSample { + /** + * @param args Unused. Arguments to the program. + */ + public static void main(String[] args) { + String key = Configuration.getGlobalConfiguration().get("AZURE_API_KEY"); + String endpoint = Configuration.getGlobalConfiguration().get("MODEL_ENDPOINT"); + ChatCompletionsClient client = new ChatCompletionsClientBuilder() + .credential(new AzureKeyCredential(key)) + .endpoint(endpoint) + .buildClient(); + + List chatMessages = new ArrayList<>(); + chatMessages.add(new ChatRequestSystemMessage("You are a helpful assistant. You will talk like a pirate.")); + chatMessages.add(ChatRequestUserMessage.fromString("Can you help me?")); + chatMessages.add(new ChatRequestAssistantMessage("Of course, me hearty! What can I do for ye?")); + chatMessages.add(ChatRequestUserMessage.fromString("What's the best way to train a parrot?")); + + IterableStream chatCompletionsStream = client.completeStreaming( + new CompleteOptions(chatMessages)); + + // The delta is the message content for a streaming response. + // Subsequence of streaming delta will be like: + // "delta": { + // "role": "assistant" + // }, + // "delta": { + // "content": "Why" + // }, + // "delta": { + // "content": " don" + // }, + // "delta": { + // "content": "'t" + // } + chatCompletionsStream + .stream() + .forEach(chatCompletions -> { + if (CoreUtils.isNullOrEmpty(chatCompletions.getChoices())) { + return; + } + + ChatResponseMessage delta = chatCompletions.getChoices().getFirst().getDelta(); + + if (delta.getRole() != null) { + System.out.println("Role = " + delta.getRole()); + } + + if (delta.getContent() != null) { + String content = delta.getContent(); + System.out.print(content); + } + }); + + } +} From 21a93a7d0323c7b240bdd1f70ef6c40d60471223 Mon Sep 17 00:00:00 2001 From: glenn Date: Thu, 8 Aug 2024 11:45:27 -0400 Subject: [PATCH 010/128] simplify convenience method for defaultCompleteOptions --- .../implementation/ChatCompletionsUtils.java | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsUtils.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsUtils.java index dbcf78a0c941..57c3e5299067 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsUtils.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsUtils.java @@ -6,6 +6,7 @@ import com.azure.ai.inference.implementation.models.CompleteOptions; import com.azure.ai.inference.models.ChatRequestMessage; +import com.azure.ai.inference.models.ChatRequestUserMessage; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonProviders; import java.util.ArrayList; @@ -27,20 +28,7 @@ private ChatCompletionsUtils() { * */ public static CompleteOptions defaultCompleteOptions(String prompt) { List messages = new ArrayList<>(); - String jsonPrompt = "{" - + "\"role\":\"user\"," - + "\"content\":\"%s\"" - + "}"; - String contentString = String.format(jsonPrompt, prompt); - try { - ChatRequestMessage message = ChatRequestMessage.fromJson( - JsonProviders.createReader(new StringReader(contentString)) - ); - messages.add(message); - } catch (IOException ex) { - throw LOGGER.logThrowableAsError(new IllegalArgumentException( - "prompt string not accepted for JSON parsing")); - } + messages.add(ChatRequestUserMessage.fromString(prompt)); return new CompleteOptions(messages); } From db2adaffd9d14d3e516993a492da8c32116b465d Mon Sep 17 00:00:00 2001 From: glenn Date: Fri, 9 Aug 2024 09:38:28 -0400 Subject: [PATCH 011/128] got test working in intellij --- sdk/ai/azure-ai-inference/pom.xml | 72 +++++++++++++++---- .../ChatCompletionsClientTestBase.java | 10 --- .../ChatCompletionsSyncClientTest.java | 23 +----- 3 files changed, 59 insertions(+), 46 deletions(-) diff --git a/sdk/ai/azure-ai-inference/pom.xml b/sdk/ai/azure-ai-inference/pom.xml index ae2a11302767..186aaf776aaf 100644 --- a/sdk/ai/azure-ai-inference/pom.xml +++ b/sdk/ai/azure-ai-inference/pom.xml @@ -58,25 +58,15 @@ com.azure azure-core - 1.50.0 + 1.51.0 com.azure azure-core-http-netty - 1.15.2 - - - org.junit.jupiter - junit-jupiter-api - 5.9.3 - test - - - org.junit.jupiter - junit-jupiter-engine - 5.9.3 - test + 1.15.3 + + com.azure azure-core-test @@ -95,5 +85,59 @@ 1.7.36 test + + com.azure + azure-core-http-okhttp + 1.12.1 + test + + + com.azure + azure-core-http-vertx + 1.0.0-beta.19 + test + + + com.knuddels + jtokkit + 1.0.0 + test + + + + org.junit.jupiter + junit-jupiter-api + 5.9.3 + test + + + org.junit.jupiter + junit-jupiter-engine + 5.9.3 + test + + + org.junit.jupiter + junit-jupiter-params + 5.9.3 + test + + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.14 + test + + + + diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java index 51412d0cc47e..d0cc16b2866d 100644 --- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java +++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java @@ -8,29 +8,19 @@ // If you wish to modify these files, please copy them out of the 'generated' package, and modify there. // See https://aka.ms/azsdk/dpg/java/tests for guide on adding a test. -import com.azure.ai.inference.ChatCompletionsClient; -import com.azure.ai.inference.ChatCompletionsClientBuilder; import com.azure.ai.inference.models.ChatChoice; import com.azure.ai.inference.models.ChatCompletions; -import com.azure.core.credential.AccessToken; import com.azure.core.credential.AzureKeyCredential; -import com.azure.core.credential.KeyCredential; import com.azure.core.http.HttpClient; -import com.azure.core.http.policy.HttpLogDetailLevel; -import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; import com.azure.core.test.models.CustomMatcher; import com.azure.core.test.models.TestProxySanitizer; import com.azure.core.test.models.TestProxySanitizerType; import com.azure.core.util.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; -import java.time.OffsetDateTime; -import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.function.Consumer; -import reactor.core.publisher.Mono; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertInstanceOf; diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java index 19c40deb16f5..a19a3c668725 100644 --- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java +++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java @@ -2,34 +2,13 @@ // Licensed under the MIT License. package com.azure.ai.inference; -import com.azure.ai.inference.ChatCompletionsClient; -import com.azure.ai.inference.ChatCompletionsClientBuilder; import com.azure.ai.inference.models.ChatCompletions; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceNotFoundException; import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.test.annotation.RecordWithoutRequestBody; -import com.azure.core.util.BinaryData; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.IterableStream; + import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; - import static com.azure.ai.inference.TestUtils.DISPLAY_NAME_WITH_ARGUMENTS; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertInstanceOf; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; public class ChatCompletionsSyncClientTest extends ChatCompletionsClientTestBase { private ChatCompletionsClient client; From 182283dfe2abcf3debf4385a6708dc89045abdf8 Mon Sep 17 00:00:00 2001 From: glenn Date: Fri, 9 Aug 2024 10:14:43 -0400 Subject: [PATCH 012/128] add streaming chat test --- .../inference/ChatCompletionsAsyncClient.java | 20 +++--- .../ai/inference/ChatCompletionsClient.java | 44 ++++++------- .../implementation/ChatCompletionsUtils.java | 6 +- .../models/CompleteOptions.java | 62 +++++++++---------- .../ChatCompletionsClientTestBase.java | 20 ++++++ .../ChatCompletionsSyncClientTest.java | 22 +++++-- 6 files changed, 101 insertions(+), 73 deletions(-) rename sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/{implementation => }/models/CompleteOptions.java (97%) diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java index 87464483a466..74a33dbfa28b 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java @@ -5,7 +5,7 @@ package com.azure.ai.inference; import com.azure.ai.inference.implementation.ChatCompletionsClientImpl; -import com.azure.ai.inference.implementation.models.CompleteOptions; +import com.azure.ai.inference.models.CompleteOptions; import com.azure.ai.inference.implementation.models.CompleteRequest; import com.azure.ai.inference.implementation.models.ExtraParameters; import com.azure.ai.inference.models.ChatCompletions; @@ -35,7 +35,7 @@ public final class ChatCompletionsAsyncClient { /** * Initializes an instance of ChatCompletionsAsyncClient class. - * + * * @param serviceClient the service client implementation. */ @Generated @@ -59,7 +59,7 @@ public final class ChatCompletionsAsyncClient { * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

- * + * *
{@code
      * {
      *     messages (Required): [
@@ -89,9 +89,9 @@ public final class ChatCompletionsAsyncClient {
      *     model: String (Optional)
      * }
      * }
- * + * *

Response Body Schema

- * + * *
{@code
      * {
      *     id: String (Required)
@@ -120,7 +120,7 @@ public final class ChatCompletionsAsyncClient {
      *     ]
      * }
      * }
- * + * * @param completeRequest The completeRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -141,7 +141,7 @@ Mono> completeWithResponse(BinaryData completeRequest, Requ * Returns information about the AI model. * The method makes a REST API call to the `/info` route on the given endpoint. *

Response Body Schema

- * + * *
{@code
      * {
      *     model_name: String (Required)
@@ -149,7 +149,7 @@ Mono> completeWithResponse(BinaryData completeRequest, Requ
      *     model_provider_name: String (Required)
      * }
      * }
- * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -169,7 +169,7 @@ public Mono> getModelInfoWithResponse(RequestOptions reques * Completions support a wide variety of tasks and generate text that continues from or "completes" * provided prompt data. The method makes a REST API call to the `/chat/completions` route * on the given endpoint. - * + * * @param options Options for complete API. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -211,7 +211,7 @@ Mono complete(CompleteOptions options) { /** * Returns information about the AI model. * The method makes a REST API call to the `/info` route on the given endpoint. - * + * * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java index a3ebd1d33b88..60cfacb7cc80 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java @@ -6,7 +6,7 @@ import com.azure.ai.inference.implementation.ChatCompletionsClientImpl; import com.azure.ai.inference.implementation.InferenceServerSentEvents; -import com.azure.ai.inference.implementation.models.CompleteOptions; +import com.azure.ai.inference.models.CompleteOptions; import com.azure.ai.inference.implementation.models.CompleteRequest; import com.azure.ai.inference.implementation.models.ExtraParameters; import com.azure.ai.inference.implementation.ChatCompletionsUtils; @@ -237,26 +237,10 @@ public ChatCompletions complete(String prompt) { *

* * - *
-     * ChatCompletionsClient.completeStreaming(new CompleteOptions(chatMessages))
-     *         .forEach(chatCompletions -> {
-     *             if (CoreUtils.isNullOrEmpty(chatCompletions.getChoices())) {
-     *                 return;
-     *             }
-     *             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 completeOptions The configuration information for a chat completions request. Completions support a + * @param options The configuration information for a chat completions request. Completions support a * wide variety of tasks and generate text that continues from or "completes" provided prompt data. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -268,11 +252,29 @@ public ChatCompletions complete(String prompt) { * generate text that continues from or "completes" provided prompt data. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public IterableStream completeStreaming(CompleteOptions completeOptions) { - completeOptions.setStream(true); + public IterableStream completeStreaming(CompleteOptions options) { + options.setStream(true); RequestOptions requestOptions = new RequestOptions(); + CompleteRequest completeRequestObj + = new CompleteRequest(options.getMessages()).setFrequencyPenalty(options.getFrequencyPenalty()) + .setStream(options.isStream()) + .setPresencePenalty(options.getPresencePenalty()) + .setTemperature(options.getTemperature()) + .setTopP(options.getTopP()) + .setMaxTokens(options.getMaxTokens()) + .setResponseFormat(options.getResponseFormat()) + .setStop(options.getStop()) + .setTools(options.getTools()) + .setToolChoice(options.getToolChoice()) + .setSeed(options.getSeed()) + .setModel(options.getModel()); + BinaryData completeRequest = BinaryData.fromObject(completeRequestObj); + ExtraParameters extraParams = options.getExtraParams(); + if (extraParams != null) { + requestOptions.setHeader(HttpHeaderName.fromString("extra-parameters"), extraParams.toString()); + } Flux responseStream = completeStreamingWithResponse( - BinaryData.fromObject(completeOptions), requestOptions).getValue().toFluxByteBuffer(); + completeRequest, requestOptions).getValue().toFluxByteBuffer(); InferenceServerSentEvents chatCompletionsStream = new InferenceServerSentEvents<>(responseStream, ChatCompletions.class); return new IterableStream<>(chatCompletionsStream.getEvents()); diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsUtils.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsUtils.java index 57c3e5299067..3b3d97d38def 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsUtils.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsUtils.java @@ -3,16 +3,14 @@ package com.azure.ai.inference.implementation; -import com.azure.ai.inference.implementation.models.CompleteOptions; +import com.azure.ai.inference.models.CompleteOptions; import com.azure.ai.inference.models.ChatRequestMessage; import com.azure.ai.inference.models.ChatRequestUserMessage; import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonProviders; + import java.util.ArrayList; import java.util.List; -import java.io.StringReader; -import java.io.IOException; /** This class contains convenience methods and constants for operations related to ChatCompletions */ public final class ChatCompletionsUtils { diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/CompleteOptions.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/CompleteOptions.java similarity index 97% rename from sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/CompleteOptions.java rename to sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/CompleteOptions.java index e5d92064339e..702d0c61e8ad 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/CompleteOptions.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/CompleteOptions.java @@ -2,11 +2,9 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.ai.inference.implementation.models; +package com.azure.ai.inference.models; -import com.azure.ai.inference.models.ChatCompletionsResponseFormat; -import com.azure.ai.inference.models.ChatCompletionsToolDefinition; -import com.azure.ai.inference.models.ChatRequestMessage; +import com.azure.ai.inference.implementation.models.ExtraParameters; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.azure.core.util.BinaryData; @@ -130,7 +128,7 @@ public final class CompleteOptions { /** * Creates an instance of CompleteOptions class. - * + * * @param messages the messages value to set. */ @Generated @@ -143,7 +141,7 @@ public CompleteOptions(List messages) { * Typical usage begins with a chat message for the System role that provides instructions for * the behavior of the assistant, followed by alternating messages between the User and * Assistant roles. - * + * * @return the messages value. */ @Generated @@ -158,7 +156,7 @@ public List getMessages() { * Positive values will make tokens less likely to appear as their frequency increases and * decrease the likelihood of the model repeating the same statements verbatim. * Supported range is [-2, 2]. - * + * * @return the frequencyPenalty value. */ @Generated @@ -173,7 +171,7 @@ public Double getFrequencyPenalty() { * Positive values will make tokens less likely to appear as their frequency increases and * decrease the likelihood of the model repeating the same statements verbatim. * Supported range is [-2, 2]. - * + * * @param frequencyPenalty the frequencyPenalty value to set. * @return the CompleteOptions object itself. */ @@ -185,7 +183,7 @@ public CompleteOptions setFrequencyPenalty(Double frequencyPenalty) { /** * Get the stream property: A value indicating whether chat completions should be streamed for this request. - * + * * @return the stream value. */ @Generated @@ -195,7 +193,7 @@ public Boolean isStream() { /** * Set the stream property: A value indicating whether chat completions should be streamed for this request. - * + * * @param stream the stream value to set. * @return the CompleteOptions object itself. */ @@ -212,7 +210,7 @@ public CompleteOptions setStream(Boolean stream) { * Positive values will make tokens less likely to appear when they already exist and increase the * model's likelihood to output new topics. * Supported range is [-2, 2]. - * + * * @return the presencePenalty value. */ @Generated @@ -227,7 +225,7 @@ public Double getPresencePenalty() { * Positive values will make tokens less likely to appear when they already exist and increase the * model's likelihood to output new topics. * Supported range is [-2, 2]. - * + * * @param presencePenalty the presencePenalty value to set. * @return the CompleteOptions object itself. */ @@ -245,7 +243,7 @@ public CompleteOptions setPresencePenalty(Double presencePenalty) { * It is not recommended to modify temperature and top_p for the same completions request as the * interaction of these two settings is difficult to predict. * Supported range is [0, 1]. - * + * * @return the temperature value. */ @Generated @@ -261,7 +259,7 @@ public Double getTemperature() { * It is not recommended to modify temperature and top_p for the same completions request as the * interaction of these two settings is difficult to predict. * Supported range is [0, 1]. - * + * * @param temperature the temperature value to set. * @return the CompleteOptions object itself. */ @@ -279,7 +277,7 @@ public CompleteOptions setTemperature(Double temperature) { * It is not recommended to modify temperature and top_p for the same completions request as the * interaction of these two settings is difficult to predict. * Supported range is [0, 1]. - * + * * @return the topP value. */ @Generated @@ -295,7 +293,7 @@ public Double getTopP() { * It is not recommended to modify temperature and top_p for the same completions request as the * interaction of these two settings is difficult to predict. * Supported range is [0, 1]. - * + * * @param topP the topP value to set. * @return the CompleteOptions object itself. */ @@ -307,7 +305,7 @@ public CompleteOptions setTopP(Double topP) { /** * Get the maxTokens property: The maximum number of tokens to generate. - * + * * @return the maxTokens value. */ @Generated @@ -317,7 +315,7 @@ public Integer getMaxTokens() { /** * Set the maxTokens property: The maximum number of tokens to generate. - * + * * @param maxTokens the maxTokens value to set. * @return the CompleteOptions object itself. */ @@ -332,7 +330,7 @@ public CompleteOptions setMaxTokens(Integer maxTokens) { * the default text mode. * Note that to enable JSON mode, some AI models may also require you to instruct the model to produce JSON * via a system or user message. - * + * * @return the responseFormat value. */ @Generated @@ -345,7 +343,7 @@ public ChatCompletionsResponseFormat getResponseFormat() { * the default text mode. * Note that to enable JSON mode, some AI models may also require you to instruct the model to produce JSON * via a system or user message. - * + * * @param responseFormat the responseFormat value to set. * @return the CompleteOptions object itself. */ @@ -357,7 +355,7 @@ public CompleteOptions setResponseFormat(ChatCompletionsResponseFormat responseF /** * Get the stop property: A collection of textual sequences that will end completions generation. - * + * * @return the stop value. */ @Generated @@ -367,7 +365,7 @@ public List getStop() { /** * Set the stop property: A collection of textual sequences that will end completions generation. - * + * * @param stop the stop value to set. * @return the CompleteOptions object itself. */ @@ -380,7 +378,7 @@ public CompleteOptions setStop(List stop) { /** * Get the tools property: The available tool definitions that the chat completions request can use, including * caller-defined functions. - * + * * @return the tools value. */ @Generated @@ -391,7 +389,7 @@ public List getTools() { /** * Set the tools property: The available tool definitions that the chat completions request can use, including * caller-defined functions. - * + * * @param tools the tools value to set. * @return the CompleteOptions object itself. */ @@ -404,7 +402,7 @@ public CompleteOptions setTools(List tools) { /** * Get the toolChoice property: If specified, the model will configure which of the provided tools it can use for * the chat completions response. - * + * * @return the toolChoice value. */ @Generated @@ -415,7 +413,7 @@ public BinaryData getToolChoice() { /** * Set the toolChoice property: If specified, the model will configure which of the provided tools it can use for * the chat completions response. - * + * * @param toolChoice the toolChoice value to set. * @return the CompleteOptions object itself. */ @@ -429,7 +427,7 @@ public CompleteOptions setToolChoice(BinaryData toolChoice) { * Get the seed property: If specified, the system will make a best effort to sample deterministically such that * repeated requests with the * same seed and parameters should return the same result. Determinism is not guaranteed. - * + * * @return the seed value. */ @Generated @@ -441,7 +439,7 @@ public Long getSeed() { * Set the seed property: If specified, the system will make a best effort to sample deterministically such that * repeated requests with the * same seed and parameters should return the same result. Determinism is not guaranteed. - * + * * @param seed the seed value to set. * @return the CompleteOptions object itself. */ @@ -453,7 +451,7 @@ public CompleteOptions setSeed(Long seed) { /** * Get the model property: ID of the specific AI model to use, if more than one model is available on the endpoint. - * + * * @return the model value. */ @Generated @@ -463,7 +461,7 @@ public String getModel() { /** * Set the model property: ID of the specific AI model to use, if more than one model is available on the endpoint. - * + * * @param model the model value to set. * @return the CompleteOptions object itself. */ @@ -477,7 +475,7 @@ public CompleteOptions setModel(String model) { * Get the extraParams property: Controls what happens if extra parameters, undefined by the REST API, * are passed in the JSON request payload. * This sets the HTTP request header `extra-parameters`. - * + * * @return the extraParams value. */ @Generated @@ -489,7 +487,7 @@ public ExtraParameters getExtraParams() { * Set the extraParams property: Controls what happens if extra parameters, undefined by the REST API, * are passed in the JSON request payload. * This sets the HTTP request header `extra-parameters`. - * + * * @param extraParams the extraParams value to set. * @return the CompleteOptions object itself. */ diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java index d0cc16b2866d..d0e1d094d8d9 100644 --- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java +++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java @@ -10,6 +10,8 @@ import com.azure.ai.inference.models.ChatChoice; import com.azure.ai.inference.models.ChatCompletions; +import com.azure.ai.inference.models.ChatRequestMessage; +import com.azure.ai.inference.models.ChatRequestUserMessage; import com.azure.core.credential.AzureKeyCredential; import com.azure.core.http.HttpClient; import com.azure.core.test.TestMode; @@ -18,6 +20,8 @@ import com.azure.core.test.models.TestProxySanitizer; import com.azure.core.test.models.TestProxySanitizerType; import com.azure.core.util.Configuration; + +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.function.Consumer; @@ -26,6 +30,7 @@ import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; import static com.azure.ai.inference.TestUtils.FAKE_API_KEY; public abstract class ChatCompletionsClientTestBase extends TestProxyTestBase { @@ -83,6 +88,21 @@ void getChatCompletionsRunner(Consumer testRunner) { testRunner.accept("Say this is a test"); } + void getStreamingChatCompletionsRunner(Consumer> testRunner) { + List chatMessages = new ArrayList<>(); + chatMessages.add(ChatRequestUserMessage.fromString("Say this is a test")); + testRunner.accept(chatMessages); + } + + static void assertCompletionsStream(ChatCompletions chatCompletions) { + if (chatCompletions.getId() != null && !chatCompletions.getId().isEmpty()) { + assertNotNull(chatCompletions.getId()); + assertNotNull(chatCompletions.getChoices()); + assertFalse(chatCompletions.getChoices().isEmpty()); + assertNotNull(chatCompletions.getChoices().getFirst().getDelta()); + } + } + static void assertCompletions(int choicesPerPrompt, ChatCompletions actual) { assertNotNull(actual); assertInstanceOf(ChatCompletions.class, actual); diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java index a19a3c668725..c8adaeffab06 100644 --- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java +++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java @@ -2,13 +2,21 @@ // Licensed under the MIT License. package com.azure.ai.inference; +import com.azure.ai.inference.models.CompleteOptions; import com.azure.ai.inference.models.ChatCompletions; +import com.azure.ai.inference.models.ChatRequestMessage; +import com.azure.ai.inference.models.ChatRequestUserMessage; import com.azure.core.http.HttpClient; +import com.azure.core.util.IterableStream; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; +import java.util.ArrayList; +import java.util.List; + import static com.azure.ai.inference.TestUtils.DISPLAY_NAME_WITH_ARGUMENTS; +import static org.junit.jupiter.api.Assertions.assertTrue; public class ChatCompletionsSyncClientTest extends ChatCompletionsClientTestBase { private ChatCompletionsClient client; @@ -29,18 +37,20 @@ public void testGetChatCompletions(HttpClient httpClient) { }); } -/* @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.inference.TestUtils#getTestParameters") - public void testGetCompletionsStream(HttpClient httpClient, OpenAIServiceVersion serviceVersion) { - client = getModelClient(httpClient); - getCompletionsRunner((deploymentId, prompt) -> { - IterableStream resultCompletions = client.getCompletionsStream(deploymentId, new CompletionsOptions(prompt)); + public void testGetCompletionsStream(HttpClient httpClient) { + client = getChatCompletionsClient(httpClient); + getChatCompletionsRunner((prompt) -> { + List chatMessages = new ArrayList<>(); + chatMessages.add(ChatRequestUserMessage.fromString(prompt)); + IterableStream resultCompletions = client.completeStreaming(new CompleteOptions(chatMessages)); assertTrue(resultCompletions.stream().toArray().length > 1); - resultCompletions.forEach(OpenAIClientTestBase::assertCompletionsStream); + resultCompletions.forEach(ChatCompletionsClientTestBase::assertCompletionsStream); }); } +/* @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.openai.TestUtils#getTestParameters") public void testGetCompletionsFromPrompt(HttpClient httpClient, OpenAIServiceVersion serviceVersion) { From fa77eb6696ba9dac3173d52fd905415d9d240467 Mon Sep 17 00:00:00 2001 From: glenn Date: Fri, 9 Aug 2024 10:35:26 -0400 Subject: [PATCH 013/128] add streaming chat async sample and support code to async client --- .../inference/ChatCompletionsAsyncClient.java | 31 ++++++++ .../inference/usage/StreamingChatSample.java | 3 +- .../usage/StreamingChatSampleAsync.java | 79 +++++++++++++++++++ 3 files changed, 111 insertions(+), 2 deletions(-) create mode 100644 sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSampleAsync.java diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java index 74a33dbfa28b..1222b6cf4942 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java @@ -5,6 +5,7 @@ package com.azure.ai.inference; import com.azure.ai.inference.implementation.ChatCompletionsClientImpl; +import com.azure.ai.inference.implementation.InferenceServerSentEvents; import com.azure.ai.inference.models.CompleteOptions; import com.azure.ai.inference.implementation.models.CompleteRequest; import com.azure.ai.inference.implementation.models.ExtraParameters; @@ -23,8 +24,11 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import java.nio.ByteBuffer; + /** * Initializes a new instance of the asynchronous ChatCompletionsClient type. */ @@ -164,6 +168,33 @@ public Mono> getModelInfoWithResponse(RequestOptions reques return this.serviceClient.getModelInfoWithResponseAsync(requestOptions); } + /** + * 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. + * + * @param options The configuration information for a chat completions request. Completions support a + * wide variety of tasks and generate text that continues from or "completes" provided prompt data. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return chat completions stream for the provided chat messages. Completions support a wide variety of tasks and + * generate text that continues from or "completes" provided prompt data. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public Flux completeStreaming(CompleteOptions options) { + options.setStream(true); + RequestOptions requestOptions = new RequestOptions(); + Flux responseStream + = completeWithResponse(BinaryData.fromObject(options), + requestOptions).flatMapMany(response -> response.getValue().toFluxByteBuffer()); + InferenceServerSentEvents chatCompletionsStream + = new InferenceServerSentEvents<>(responseStream, ChatCompletions.class); + return chatCompletionsStream.getEvents(); + } + /** * Gets chat completions for the provided chat messages. * Completions support a wide variety of tasks and generate text that continues from or "completes" diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java index 3677dc618a67..264390f6d153 100644 --- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java @@ -6,7 +6,7 @@ import com.azure.ai.inference.ChatCompletionsClient; import com.azure.ai.inference.ChatCompletionsClientBuilder; -import com.azure.ai.inference.implementation.models.CompleteOptions; +import com.azure.ai.inference.models.CompleteOptions; import com.azure.ai.inference.models.*; import com.azure.core.credential.AzureKeyCredential; import com.azure.core.util.Configuration; @@ -15,7 +15,6 @@ import java.util.ArrayList; import java.util.List; -import java.util.concurrent.atomic.AtomicInteger; public final class StreamingChatSample { /** diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSampleAsync.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSampleAsync.java new file mode 100644 index 000000000000..ea0f9a184c79 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSampleAsync.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.usage; + +import com.azure.ai.inference.ChatCompletionsAsyncClient; +import com.azure.ai.inference.ChatCompletionsClient; +import com.azure.ai.inference.ChatCompletionsClientBuilder; +import com.azure.ai.inference.models.*; +import com.azure.core.credential.AzureKeyCredential; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.IterableStream; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; + +public final class StreamingChatSampleAsync { + /** + * @param args Unused. Arguments to the program. + */ + public static void main(String[] args) throws InterruptedException { + String key = Configuration.getGlobalConfiguration().get("AZURE_API_KEY"); + String endpoint = Configuration.getGlobalConfiguration().get("MODEL_ENDPOINT"); + ChatCompletionsAsyncClient client = new ChatCompletionsClientBuilder() + .credential(new AzureKeyCredential(key)) + .endpoint(endpoint) + .buildAsyncClient(); + + List chatMessages = new ArrayList<>(); + chatMessages.add(new ChatRequestSystemMessage("You are a helpful assistant. You will talk like a pirate.")); + chatMessages.add(ChatRequestUserMessage.fromString("Can you help me?")); + chatMessages.add(new ChatRequestAssistantMessage("Of course, me hearty! What can I do for ye?")); + chatMessages.add(ChatRequestUserMessage.fromString("What's the best way to train a parrot?")); + + + client.completeStreaming(new CompleteOptions(chatMessages)) + .map(chatCompletions -> { + /* The delta is the message content for a streaming response. + * Subsequence of streaming delta will be like: + * "delta": { + * "role": "assistant" + * }, + * "delta": { + * "content": "Why" + * }, + * "delta": { + * "content": " don" + * }, + * "delta": { + * "content": "'t" + * } + */ + + if (CoreUtils.isNullOrEmpty(chatCompletions.getChoices())) { + return ""; + } + + ChatResponseMessage delta = chatCompletions.getChoices().get(0).getDelta(); + + if (delta.getRole() != null) { + System.out.println("Role = " + delta.getRole()); + } + return delta.getContent() == null ? "" : delta.getContent(); + }) + .subscribe( + System.out::print, + error -> System.err.println("There was an error getting chat completions." + error), + () -> System.out.println("\nCompleted called completeStreaming.")); + + + // The .subscribe() creation and assignment is not a blocking call. For the purpose of this example, we sleep + // the thread so the program does not end before the send operation is complete. Using .block() instead of + // .subscribe() will turn this into a synchronous call. + TimeUnit.SECONDS.sleep(10); + } +} From e38cf9b70d301d0172f7a03046f197a190a8493a Mon Sep 17 00:00:00 2001 From: glenn Date: Fri, 9 Aug 2024 10:48:47 -0400 Subject: [PATCH 014/128] add convenience method for async complete, basic async chat sample --- .../inference/ChatCompletionsAsyncClient.java | 22 +++++++- .../inference/usage/BasicChatSampleAsync.java | 54 +++++++++++++++++++ 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatSampleAsync.java diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java index 1222b6cf4942..7738860afbc8 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java @@ -6,6 +6,7 @@ import com.azure.ai.inference.implementation.ChatCompletionsClientImpl; import com.azure.ai.inference.implementation.InferenceServerSentEvents; +import com.azure.ai.inference.implementation.ChatCompletionsUtils; import com.azure.ai.inference.models.CompleteOptions; import com.azure.ai.inference.implementation.models.CompleteRequest; import com.azure.ai.inference.implementation.models.ExtraParameters; @@ -195,6 +196,25 @@ public Flux completeStreaming(CompleteOptions options) { return chatCompletionsStream.getEvents(); } + /** + * Gets completions for the provided input prompt. Completions support a wide variety of tasks and generate text + * that continues from or "completes" provided prompt data. + * + * @param prompt The prompt to generate completion text from. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return completions for the provided input prompts. Completions support a wide variety of tasks and generate text + * that continues from or "completes" provided prompt data on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono complete(String prompt) { + return complete(ChatCompletionsUtils.defaultCompleteOptions(prompt)); + } + /** * Gets chat completions for the provided chat messages. * Completions support a wide variety of tasks and generate text that continues from or "completes" @@ -214,7 +234,7 @@ public Flux completeStreaming(CompleteOptions options) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Mono complete(CompleteOptions options) { + public Mono complete(CompleteOptions options) { // Generated convenience method for completeWithResponse RequestOptions requestOptions = new RequestOptions(); CompleteRequest completeRequestObj diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatSampleAsync.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatSampleAsync.java new file mode 100644 index 000000000000..1f6792992982 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatSampleAsync.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.usage; + +import com.azure.ai.inference.ChatCompletionsAsyncClient; +import com.azure.ai.inference.ChatCompletionsClientBuilder; +import com.azure.ai.inference.models.*; +import com.azure.core.credential.AzureKeyCredential; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; + +public final class BasicChatSampleAsync { + /** + * @param args Unused. Arguments to the program. + */ + public static void main(String[] args) throws InterruptedException { + String key = Configuration.getGlobalConfiguration().get("AZURE_API_KEY"); + String endpoint = Configuration.getGlobalConfiguration().get("MODEL_ENDPOINT"); + ChatCompletionsAsyncClient client = new ChatCompletionsClientBuilder() + .credential(new AzureKeyCredential(key)) + .endpoint(endpoint) + .buildAsyncClient(); + + client.complete("Tell me about Euler's Identity").subscribe( + chatCompletions -> { + System.out.printf("Model ID=%s.%n", chatCompletions.getId()); + for (ChatChoice choice : chatCompletions.getChoices()) { + ChatResponseMessage message = choice.getMessage(); + System.out.printf("Index: %d, Chat Role: %s.%n", choice.getIndex(), message.getRole()); + System.out.println("Message:"); + System.out.println(message.getContent()); + } + + System.out.println(); + CompletionsUsage usage = chatCompletions.getUsage(); + System.out.printf("Usage: number of prompt token is %d, " + + "number of completion token is %d, and number of total tokens in request and response is %d.%n", + usage.getPromptTokens(), usage.getCompletionTokens(), usage.getTotalTokens()); + }, + error -> System.err.println("There was an error getting chat completions." + error), + () -> System.out.println("\nCompleted calling complete.")); + + // The .subscribe() creation and assignment is not a blocking call. For the purpose of this example, we sleep + // the thread so the program does not end before the send operation is complete. Using .block() instead of + // .subscribe() will turn this into a synchronous call. + TimeUnit.SECONDS.sleep(10); + } +} From 60ecc443150091b662432d465388b79cdab90662 Mon Sep 17 00:00:00 2001 From: Glenn Harper Date: Tue, 13 Aug 2024 05:45:05 -0700 Subject: [PATCH 015/128] change options class name --- .../inference/ChatCompletionsAsyncClient.java | 6 +- .../ai/inference/ChatCompletionsClient.java | 10 ++-- .../implementation/ChatCompletionsUtils.java | 10 ++-- ...tions.java => ChatCompletionsOptions.java} | 58 +++++++++---------- .../inference/usage/StreamingChatSample.java | 4 +- .../usage/StreamingChatSampleAsync.java | 4 +- .../ChatCompletionsSyncClientTest.java | 4 +- 7 files changed, 47 insertions(+), 49 deletions(-) rename sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/{CompleteOptions.java => ChatCompletionsOptions.java} (89%) diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java index 7738860afbc8..092bcebc58e0 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java @@ -7,7 +7,7 @@ import com.azure.ai.inference.implementation.ChatCompletionsClientImpl; import com.azure.ai.inference.implementation.InferenceServerSentEvents; import com.azure.ai.inference.implementation.ChatCompletionsUtils; -import com.azure.ai.inference.models.CompleteOptions; +import com.azure.ai.inference.models.ChatCompletionsOptions; import com.azure.ai.inference.implementation.models.CompleteRequest; import com.azure.ai.inference.implementation.models.ExtraParameters; import com.azure.ai.inference.models.ChatCompletions; @@ -185,7 +185,7 @@ public Mono> getModelInfoWithResponse(RequestOptions reques * generate text that continues from or "completes" provided prompt data. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public Flux completeStreaming(CompleteOptions options) { + public Flux completeStreaming(ChatCompletionsOptions options) { options.setStream(true); RequestOptions requestOptions = new RequestOptions(); Flux responseStream @@ -234,7 +234,7 @@ public Mono complete(String prompt) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono complete(CompleteOptions options) { + public Mono complete(ChatCompletionsOptions options) { // Generated convenience method for completeWithResponse RequestOptions requestOptions = new RequestOptions(); CompleteRequest completeRequestObj diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java index 60cfacb7cc80..d522729307b2 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java @@ -6,7 +6,7 @@ import com.azure.ai.inference.implementation.ChatCompletionsClientImpl; import com.azure.ai.inference.implementation.InferenceServerSentEvents; -import com.azure.ai.inference.models.CompleteOptions; +import com.azure.ai.inference.models.ChatCompletionsOptions; import com.azure.ai.inference.implementation.models.CompleteRequest; import com.azure.ai.inference.implementation.models.ExtraParameters; import com.azure.ai.inference.implementation.ChatCompletionsUtils; @@ -186,7 +186,7 @@ public Response getModelInfoWithResponse(RequestOptions requestOptio */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - ChatCompletions complete(CompleteOptions options) { + ChatCompletions complete(ChatCompletionsOptions options) { // Generated convenience method for completeWithResponse RequestOptions requestOptions = new RequestOptions(); CompleteRequest completeRequestObj @@ -236,8 +236,8 @@ public ChatCompletions complete(String prompt) { * Code Samples *

* - * - * + * + * * * * @param options The configuration information for a chat completions request. Completions support a @@ -252,7 +252,7 @@ public ChatCompletions complete(String prompt) { * generate text that continues from or "completes" provided prompt data. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public IterableStream completeStreaming(CompleteOptions options) { + public IterableStream completeStreaming(ChatCompletionsOptions options) { options.setStream(true); RequestOptions requestOptions = new RequestOptions(); CompleteRequest completeRequestObj diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsUtils.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsUtils.java index 3b3d97d38def..566028346470 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsUtils.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsUtils.java @@ -3,7 +3,7 @@ package com.azure.ai.inference.implementation; -import com.azure.ai.inference.models.CompleteOptions; +import com.azure.ai.inference.models.ChatCompletionsOptions; import com.azure.ai.inference.models.ChatRequestMessage; import com.azure.ai.inference.models.ChatRequestUserMessage; @@ -20,14 +20,14 @@ private ChatCompletionsUtils() { } /** - * Convenience method for minimal initialization for the CompleteOptions class + * Convenience method for minimal initialization for the ChatCompletionsOptions class * @param prompt from which ChatCompletions will be generated - * @return A CompleteOptions object + * @return A ChatCompletionsOptions object * */ - public static CompleteOptions defaultCompleteOptions(String prompt) { + public static ChatCompletionsOptions defaultCompleteOptions(String prompt) { List messages = new ArrayList<>(); messages.add(ChatRequestUserMessage.fromString(prompt)); - return new CompleteOptions(messages); + return new ChatCompletionsOptions(messages); } } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/CompleteOptions.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsOptions.java similarity index 89% rename from sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/CompleteOptions.java rename to sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsOptions.java index 702d0c61e8ad..fa3d4e8e8b1d 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/CompleteOptions.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsOptions.java @@ -14,7 +14,7 @@ * Options for complete API. */ @Fluent -public final class CompleteOptions { +public final class ChatCompletionsOptions { /* * The collection of context messages associated with this chat completions request. * Typical usage begins with a chat message for the System role that provides instructions for @@ -127,12 +127,12 @@ public final class CompleteOptions { private ExtraParameters extraParams; /** - * Creates an instance of CompleteOptions class. + * Creates an instance of ChatCompletionsOptions class. * * @param messages the messages value to set. */ @Generated - public CompleteOptions(List messages) { + public ChatCompletionsOptions(List messages) { this.messages = messages; } @@ -173,10 +173,10 @@ public Double getFrequencyPenalty() { * Supported range is [-2, 2]. * * @param frequencyPenalty the frequencyPenalty value to set. - * @return the CompleteOptions object itself. + * @return the ChatCompletionsOptions object itself. */ @Generated - public CompleteOptions setFrequencyPenalty(Double frequencyPenalty) { + public ChatCompletionsOptions setFrequencyPenalty(Double frequencyPenalty) { this.frequencyPenalty = frequencyPenalty; return this; } @@ -195,10 +195,10 @@ public Boolean isStream() { * Set the stream property: A value indicating whether chat completions should be streamed for this request. * * @param stream the stream value to set. - * @return the CompleteOptions object itself. + * @return the ChatCompletionsOptions object itself. */ @Generated - public CompleteOptions setStream(Boolean stream) { + public ChatCompletionsOptions setStream(Boolean stream) { this.stream = stream; return this; } @@ -227,10 +227,10 @@ public Double getPresencePenalty() { * Supported range is [-2, 2]. * * @param presencePenalty the presencePenalty value to set. - * @return the CompleteOptions object itself. + * @return the ChatCompletionsOptions object itself. */ @Generated - public CompleteOptions setPresencePenalty(Double presencePenalty) { + public ChatCompletionsOptions setPresencePenalty(Double presencePenalty) { this.presencePenalty = presencePenalty; return this; } @@ -261,10 +261,10 @@ public Double getTemperature() { * Supported range is [0, 1]. * * @param temperature the temperature value to set. - * @return the CompleteOptions object itself. + * @return the ChatCompletionsOptions object itself. */ @Generated - public CompleteOptions setTemperature(Double temperature) { + public ChatCompletionsOptions setTemperature(Double temperature) { this.temperature = temperature; return this; } @@ -295,10 +295,10 @@ public Double getTopP() { * Supported range is [0, 1]. * * @param topP the topP value to set. - * @return the CompleteOptions object itself. + * @return the ChatCompletionsOptions object itself. */ @Generated - public CompleteOptions setTopP(Double topP) { + public ChatCompletionsOptions setTopP(Double topP) { this.topP = topP; return this; } @@ -317,10 +317,10 @@ public Integer getMaxTokens() { * Set the maxTokens property: The maximum number of tokens to generate. * * @param maxTokens the maxTokens value to set. - * @return the CompleteOptions object itself. + * @return the ChatCompletionsOptions object itself. */ @Generated - public CompleteOptions setMaxTokens(Integer maxTokens) { + public ChatCompletionsOptions setMaxTokens(Integer maxTokens) { this.maxTokens = maxTokens; return this; } @@ -345,10 +345,10 @@ public ChatCompletionsResponseFormat getResponseFormat() { * via a system or user message. * * @param responseFormat the responseFormat value to set. - * @return the CompleteOptions object itself. + * @return the ChatCompletionsOptions object itself. */ @Generated - public CompleteOptions setResponseFormat(ChatCompletionsResponseFormat responseFormat) { + public ChatCompletionsOptions setResponseFormat(ChatCompletionsResponseFormat responseFormat) { this.responseFormat = responseFormat; return this; } @@ -367,10 +367,10 @@ public List getStop() { * Set the stop property: A collection of textual sequences that will end completions generation. * * @param stop the stop value to set. - * @return the CompleteOptions object itself. + * @return the ChatCompletionsOptions object itself. */ @Generated - public CompleteOptions setStop(List stop) { + public ChatCompletionsOptions setStop(List stop) { this.stop = stop; return this; } @@ -391,10 +391,10 @@ public List getTools() { * caller-defined functions. * * @param tools the tools value to set. - * @return the CompleteOptions object itself. + * @return the ChatCompletionsOptions object itself. */ @Generated - public CompleteOptions setTools(List tools) { + public ChatCompletionsOptions setTools(List tools) { this.tools = tools; return this; } @@ -415,10 +415,10 @@ public BinaryData getToolChoice() { * the chat completions response. * * @param toolChoice the toolChoice value to set. - * @return the CompleteOptions object itself. + * @return the ChatCompletionsOptions object itself. */ @Generated - public CompleteOptions setToolChoice(BinaryData toolChoice) { + public ChatCompletionsOptions setToolChoice(BinaryData toolChoice) { this.toolChoice = toolChoice; return this; } @@ -441,10 +441,10 @@ public Long getSeed() { * same seed and parameters should return the same result. Determinism is not guaranteed. * * @param seed the seed value to set. - * @return the CompleteOptions object itself. + * @return the ChatCompletionsOptions object itself. */ @Generated - public CompleteOptions setSeed(Long seed) { + public ChatCompletionsOptions setSeed(Long seed) { this.seed = seed; return this; } @@ -463,10 +463,10 @@ public String getModel() { * Set the model property: ID of the specific AI model to use, if more than one model is available on the endpoint. * * @param model the model value to set. - * @return the CompleteOptions object itself. + * @return the ChatCompletionsOptions object itself. */ @Generated - public CompleteOptions setModel(String model) { + public ChatCompletionsOptions setModel(String model) { this.model = model; return this; } @@ -489,10 +489,10 @@ public ExtraParameters getExtraParams() { * This sets the HTTP request header `extra-parameters`. * * @param extraParams the extraParams value to set. - * @return the CompleteOptions object itself. + * @return the ChatCompletionsOptions object itself. */ @Generated - public CompleteOptions setExtraParams(ExtraParameters extraParams) { + public ChatCompletionsOptions setExtraParams(ExtraParameters extraParams) { this.extraParams = extraParams; return this; } diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java index 264390f6d153..9c10519c2914 100644 --- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java @@ -6,7 +6,7 @@ import com.azure.ai.inference.ChatCompletionsClient; import com.azure.ai.inference.ChatCompletionsClientBuilder; -import com.azure.ai.inference.models.CompleteOptions; +import com.azure.ai.inference.models.ChatCompletionsOptions; import com.azure.ai.inference.models.*; import com.azure.core.credential.AzureKeyCredential; import com.azure.core.util.Configuration; @@ -35,7 +35,7 @@ public static void main(String[] args) { chatMessages.add(ChatRequestUserMessage.fromString("What's the best way to train a parrot?")); IterableStream chatCompletionsStream = client.completeStreaming( - new CompleteOptions(chatMessages)); + new ChatCompletionsOptions(chatMessages)); // The delta is the message content for a streaming response. // Subsequence of streaming delta will be like: diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSampleAsync.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSampleAsync.java index ea0f9a184c79..0063e67b566b 100644 --- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSampleAsync.java +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSampleAsync.java @@ -5,13 +5,11 @@ package com.azure.ai.inference.usage; import com.azure.ai.inference.ChatCompletionsAsyncClient; -import com.azure.ai.inference.ChatCompletionsClient; import com.azure.ai.inference.ChatCompletionsClientBuilder; import com.azure.ai.inference.models.*; import com.azure.core.credential.AzureKeyCredential; import com.azure.core.util.Configuration; import com.azure.core.util.CoreUtils; -import com.azure.core.util.IterableStream; import java.util.ArrayList; import java.util.List; @@ -36,7 +34,7 @@ public static void main(String[] args) throws InterruptedException { chatMessages.add(ChatRequestUserMessage.fromString("What's the best way to train a parrot?")); - client.completeStreaming(new CompleteOptions(chatMessages)) + client.completeStreaming(new ChatCompletionsOptions(chatMessages)) .map(chatCompletions -> { /* The delta is the message content for a streaming response. * Subsequence of streaming delta will be like: diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java index c8adaeffab06..023635822bf6 100644 --- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java +++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. package com.azure.ai.inference; -import com.azure.ai.inference.models.CompleteOptions; +import com.azure.ai.inference.models.ChatCompletionsOptions; import com.azure.ai.inference.models.ChatCompletions; import com.azure.ai.inference.models.ChatRequestMessage; import com.azure.ai.inference.models.ChatRequestUserMessage; @@ -44,7 +44,7 @@ public void testGetCompletionsStream(HttpClient httpClient) { getChatCompletionsRunner((prompt) -> { List chatMessages = new ArrayList<>(); chatMessages.add(ChatRequestUserMessage.fromString(prompt)); - IterableStream resultCompletions = client.completeStreaming(new CompleteOptions(chatMessages)); + IterableStream resultCompletions = client.completeStreaming(new ChatCompletionsOptions(chatMessages)); assertTrue(resultCompletions.stream().toArray().length > 1); resultCompletions.forEach(ChatCompletionsClientTestBase::assertCompletionsStream); }); From c4c17f33e0d315fa4d1632e009a9782f7c698609 Mon Sep 17 00:00:00 2001 From: Glenn Harper Date: Tue, 13 Aug 2024 05:53:16 -0700 Subject: [PATCH 016/128] merge deletes --- ...tionConfigurationRuleDefinitionsTests.java | 54 - ...tByResourceGroupWithResponseMockTests.java | 84 - ...ntApplicationXWwwFormUrlencodedSchema.java | 220 -- ...eckProvisioningServiceNameAvailabilit.java | 26 - ...eateOrUpdatePrivateEndpointConnection.java | 35 - ...eletePrivateEndpointConnectionSamples.java | 26 - ...ResourcesListByCloudHsmClusterSamples.java | 26 - ...onnectionsCreateWithResponseMockTests.java | 71 - ...ntConnectionsGetWithResponseMockTests.java | 64 - ...istByInformaticaOrganizationResourceS.java | 26 - ...rverlessRuntimesWithResponseMockTests.java | 78 - ...rtFailedServerlessRuntimeWitMockTests.java | 34 - ...eNpbStaticRouteBfdAdministrativeState.java | 32 - ...LocationsExecuteWithResponseMockTests.java | 45 - ...eckNameAvailabilityResponseModelInner.java | 102 - ...heckNameAvailabilityResponseModelImpl.java | 43 - ...rotectedItemOperationStatusClientImpl.java | 254 -- ...oAzStackHciEventModelCustomProperties.java | 110 - ...oAzStackHciPlannedFailoverCustomProps.java | 56 - ...AzStackHciPolicyModelCustomProperties.java | 118 - ...temModelPropertiesLastTestFailoverJob.java | 25 - ...rCleanupWorkflowModelCustomProperties.java | 45 - ...oAzStackHciPlannedFailoverCustomProps.java | 56 - ...AzStackHciPolicyModelCustomProperties.java | 118 - ...rotectedItemOperationStatusGetSamples.java | 24 - ...esourceProviderCheckNameAvailabilityS.java | 28 - ...esourceProviderDeploymentPreflightSam.java | 39 - ...ligibilityResultsOperationsClientImpl.java | 348 -- ...ProtectionContainerMappingsClientImpl.java | 2039 ------------ ...onRecoveryServicesProvidersClientImpl.java | 1859 ----------- ...dOperatingSystemsOperationsClientImpl.java | 196 -- ...reUpdateReplicationProtectedItemInput.java | 340 -- ...ianceForReplicationProtectedItemInput.java | 61 - ...erSpecificUpdateContainerMappingInput.java | 39 - ...plicationProtectedItemInputProperties.java | 95 - .../proxy-config.json | 1 - .../reflect-config.json | 2816 ----------------- ...ecoveryPointsListByReplicationMigrati.java | 26 - ...intsListByReplicationProtectedItemsSa.java | 27 - ...EligibilityResultsOperationGetSamples.java | 26 - ...nEligibilityResultsOperationListSampl.java | 26 - ...nLogicalNetworksListByReplicationFabr.java | 26 - ...nMigrationItemsListByReplicationProte.java | 26 - ...MigrationItemsPauseReplicationSamples.java | 33 - ...nMigrationItemsResumeReplicationSampl.java | 34 - ...nMigrationItemsTestMigrateCleanupSamp.java | 32 - ...nNetworkMappingsListByReplicationNetw.java | 27 - ...nNetworksListByReplicationFabricsSamp.java | 26 - ...nProtectableItemsListByReplicationPro.java | 26 - ...nProtectedItemsApplyRecoveryPointSamp.java | 34 - ...onProtectedItemsFailoverCancelSamples.java | 27 - ...onProtectedItemsFailoverCommitSamples.java | 27 - ...nProtectedItemsListByReplicationProte.java | 26 - ...nProtectedItemsPlannedFailoverSamples.java | 34 - ...nProtectedItemsRepairReplicationSampl.java | 27 - ...nProtectedItemsResolveHealthErrorsSam.java | 34 - ...onProtectedItemsSwitchProviderSamples.java | 38 - ...nProtectedItemsTestFailoverCleanupSam.java | 32 - ...nProtectedItemsUnplannedFailoverSampl.java | 34 - ...nProtectedItemsUpdateApplianceSamples.java | 36 - ...nProtectedItemsUpdateMobilityServiceS.java | 32 - ...nProtectionContainerMappingsCreateSam.java | 36 - ...nProtectionContainerMappingsDeleteSam.java | 34 - ...ProtectionContainerMappingsGetSamples.java | 26 - ...nProtectionContainerMappingsListByRep.java | 27 - ...nProtectionContainerMappingsListSampl.java | 26 - ...nProtectionContainerMappingsPurgeSamp.java | 26 - ...nProtectionContainerMappingsUpdateSam.java | 38 - ...nProtectionContainersDiscoverProtecta.java | 32 - ...nProtectionContainersListByReplicatio.java | 26 - ...nProtectionContainersSwitchProtection.java | 34 - ...onRecoveryPlansPlannedFailoverSamples.java | 35 - ...nRecoveryPlansTestFailoverCleanupSamp.java | 31 - ...RecoveryPlansUnplannedFailoverSamples.java | 37 - ...nRecoveryServicesProvidersCreateSampl.java | 43 - ...nRecoveryServicesProvidersDeleteSampl.java | 29 - ...onRecoveryServicesProvidersGetSamples.java | 26 - ...nRecoveryServicesProvidersListByRepli.java | 26 - ...nRecoveryServicesProvidersListSamples.java | 26 - ...RecoveryServicesProvidersPurgeSamples.java | 26 - ...nRecoveryServicesProvidersRefreshProv.java | 26 - ...nvCentersListByReplicationFabricsSamp.java | 26 - ...ssificationMappingsListByReplicationS.java | 27 - ...ssificationsListByReplicationFabricsS.java | 26 - ...uteSizesListByReplicationProtectedIte.java | 27 - ...MigrationApplyRecoveryPointInputTests.java | 23 - ...rMigrationContainerCreationInputTests.java | 23 - ...erMigrationEnableProtectionInputTests.java | 29 - ...nContainerMappingInputPropertiesTests.java | 31 - ...ionIntentProviderSpecificDetailsTests.java | 23 - ...zurePlannedFailoverProviderInputTests.java | 34 - ...ateReplicationProtectedItemInputTests.java | 73 - ...eProtectionProviderSpecificInputTests.java | 27 - ...backDiscoveredProtectedVmDetailsTests.java | 23 - ...backPlannedFailoverProviderInputTests.java | 28 - ...ateReplicationProtectedItemInputTests.java | 75 - ...verProviderSpecificFailoverInputTests.java | 23 - ...erMappingProviderSpecificDetailsTests.java | 24 - ...stFailoverCleanupInputPropertiesTests.java | 26 - ...UnplannedFailoverInputPropertiesTests.java | 36 - ...tByReplicationProtectedItemsMockTests.java | 60 - ...imityPlacementGroupCustomDetailsTests.java | 23 - ...nContainerMappingInputPropertiesTests.java | 28 - ...rtSettingsCreateWithResponseMockTests.java | 64 - ...gicalNetworksGetWithResponseMockTests.java | 60 - ...tworkMappingsGetWithResponseMockTests.java | 64 - ...orksListByReplicationFabricsMockTests.java | 63 - ...tectableItemsGetWithResponseMockTests.java | 62 - ...ectionIntentsGetWithResponseMockTests.java | 57 - ...erSpecificContainerCreationInputTests.java | 24 - ...derSpecificContainerMappingInputTests.java | 23 - ...veryPlansTestFailoverCleanupMockTests.java | 84 - ...coveryPlansUnplannedFailoverMockTests.java | 92 - ...ationMappingsGetWithResponseMockTests.java | 58 - ...ForReplicationProtectedItemInputTests.java | 31 - ...nContainerMappingInputPropertiesTests.java | 25 - ...tionProtectedItemInputPropertiesTests.java | 188 -- .../reflect-config.json | 606 ---- ...iderSapAvailabilityZoneDetailsSamples.java | 50 - ...onServerInstancesStartInstanceSamples.java | 44 - 120 files changed, 13269 deletions(-) delete mode 100644 sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/test/java/com/azure/resourcemanager/applicationinsights/generated/ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitionsTests.java delete mode 100644 sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalStorageInstancesGetByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/containerregistry/azure-containers-containerregistry/src/main/java/com/azure/containers/containerregistry/implementation/models/Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema.java delete mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceCheckProvisioningServiceNameAvailabilit.java delete mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceCreateOrUpdatePrivateEndpointConnection.java delete mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceDeletePrivateEndpointConnectionSamples.java delete mode 100644 sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSamples.java delete mode 100644 sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsCreateWithResponseMockTests.java delete mode 100644 sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsGetWithResponseMockTests.java delete mode 100644 sdk/informaticadatamanagement/azure-resourcemanager-informaticadatamanagement/src/samples/java/com/azure/resourcemanager/informaticadatamanagement/generated/ServerlessRuntimesListByInformaticaOrganizationResourceS.java delete mode 100644 sdk/informaticadatamanagement/azure-resourcemanager-informaticadatamanagement/src/test/java/com/azure/resourcemanager/informaticadatamanagement/generated/OrganizationsGetAllServerlessRuntimesWithResponseMockTests.java delete mode 100644 sdk/informaticadatamanagement/azure-resourcemanager-informaticadatamanagement/src/test/java/com/azure/resourcemanager/informaticadatamanagement/generated/ServerlessRuntimesStartFailedServerlessRuntimeWitMockTests.java delete mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsUpdateNpbStaticRouteBfdAdministrativeState.java delete mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityWithLocationsExecuteWithResponseMockTests.java delete mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/CheckNameAvailabilityResponseModelInner.java delete mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/CheckNameAvailabilityResponseModelImpl.java delete mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ProtectedItemOperationStatusClientImpl.java delete mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciEventModelCustomProperties.java delete mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciPlannedFailoverCustomProps.java delete mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciPolicyModelCustomProperties.java delete mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelPropertiesLastTestFailoverJob.java delete mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TestFailoverCleanupWorkflowModelCustomProperties.java delete mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciPlannedFailoverCustomProps.java delete mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciPolicyModelCustomProperties.java delete mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemOperationStatusGetSamples.java delete mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ResourceProviderCheckNameAvailabilityS.java delete mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ResourceProviderDeploymentPreflightSam.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEligibilityResultsOperationsClientImpl.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionContainerMappingsClientImpl.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationRecoveryServicesProvidersClientImpl.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SupportedOperatingSystemsOperationsClientImpl.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureUpdateReplicationProtectedItemInput.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmUpdateApplianceForReplicationProtectedItemInput.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderSpecificUpdateContainerMappingInput.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateApplianceForReplicationProtectedItemInputProperties.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservicessiterecovery/proxy-config.json delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservicessiterecovery/reflect-config.json delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/MigrationRecoveryPointsListByReplicationMigrati.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPointsListByReplicationProtectedItemsSa.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEligibilityResultsOperationGetSamples.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEligibilityResultsOperationListSampl.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationLogicalNetworksListByReplicationFabr.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsListByReplicationProte.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsPauseReplicationSamples.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsResumeReplicationSampl.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsTestMigrateCleanupSamp.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsListByReplicationNetw.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworksListByReplicationFabricsSamp.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectableItemsListByReplicationPro.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsApplyRecoveryPointSamp.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsFailoverCancelSamples.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsFailoverCommitSamples.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsListByReplicationProte.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsPlannedFailoverSamples.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsRepairReplicationSampl.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsResolveHealthErrorsSam.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsSwitchProviderSamples.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsTestFailoverCleanupSam.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUnplannedFailoverSampl.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUpdateApplianceSamples.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUpdateMobilityServiceS.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsCreateSam.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsDeleteSam.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsGetSamples.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsListByRep.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsListSampl.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsPurgeSamp.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsUpdateSam.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersDiscoverProtecta.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersListByReplicatio.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersSwitchProtection.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansPlannedFailoverSamples.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansTestFailoverCleanupSamp.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansUnplannedFailoverSamples.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersCreateSampl.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersDeleteSampl.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersGetSamples.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersListByRepli.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersListSamples.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersPurgeSamples.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersRefreshProv.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersListByReplicationFabricsSamp.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/StorageClassificationMappingsListByReplicationS.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/StorageClassificationsListByReplicationFabricsS.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/TargetComputeSizesListByReplicationProtectedIte.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/A2ACrossClusterMigrationApplyRecoveryPointInputTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/A2ACrossClusterMigrationContainerCreationInputTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/A2ACrossClusterMigrationEnableProtectionInputTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/CreateProtectionContainerMappingInputPropertiesTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/CreateProtectionIntentProviderSpecificDetailsTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/HyperVReplicaAzurePlannedFailoverProviderInputTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageAzureV2UpdateReplicationProtectedItemInputTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageDisableProtectionProviderSpecificInputTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageRcmFailbackDiscoveredProtectedVmDetailsTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageRcmFailbackPlannedFailoverProviderInputTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageRcmUpdateReplicationProtectedItemInputTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/PlannedFailoverProviderSpecificFailoverInputTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ProtectionContainerMappingProviderSpecificDetailsTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPlanTestFailoverCleanupInputPropertiesTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPlanUnplannedFailoverInputPropertiesTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPointsListByReplicationProtectedItemsMockTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryProximityPlacementGroupCustomDetailsTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RemoveProtectionContainerMappingInputPropertiesTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationAlertSettingsCreateWithResponseMockTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationLogicalNetworksGetWithResponseMockTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsGetWithResponseMockTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworksListByReplicationFabricsMockTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectableItemsGetWithResponseMockTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionIntentsGetWithResponseMockTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProviderSpecificContainerCreationInputTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProviderSpecificContainerMappingInputTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansTestFailoverCleanupMockTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansUnplannedFailoverMockTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/StorageClassificationMappingsGetWithResponseMockTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/UpdateApplianceForReplicationProtectedItemInputTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/UpdateProtectionContainerMappingInputPropertiesTests.java delete mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/UpdateReplicationProtectedItemInputPropertiesTests.java delete mode 100644 sdk/workloadssapvirtualinstance/azure-resourcemanager-workloadssapvirtualinstance/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-workloadssapvirtualinstance/reflect-config.json delete mode 100644 sdk/workloadssapvirtualinstance/azure-resourcemanager-workloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadssapvirtualinstance/generated/ResourceProviderSapAvailabilityZoneDetailsSamples.java delete mode 100644 sdk/workloadssapvirtualinstance/azure-resourcemanager-workloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadssapvirtualinstance/generated/SapApplicationServerInstancesStartInstanceSamples.java diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/test/java/com/azure/resourcemanager/applicationinsights/generated/ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitionsTests.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/test/java/com/azure/resourcemanager/applicationinsights/generated/ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitionsTests.java deleted file mode 100644 index 2efe99b14245..000000000000 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/test/java/com/azure/resourcemanager/applicationinsights/generated/ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitionsTests.java +++ /dev/null @@ -1,54 +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.applicationinsights.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.applicationinsights.models.ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions; -import org.junit.jupiter.api.Assertions; - -public final class ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitionsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions model = - BinaryData - .fromString( - "{\"Name\":\"nmoc\",\"DisplayName\":\"ysh\",\"Description\":\"zafb\",\"HelpUrl\":\"j\",\"IsHidden\":true,\"IsEnabledByDefault\":false,\"IsInPreview\":false,\"SupportsEmailNotifications\":false}") - .toObject(ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions.class); - Assertions.assertEquals("nmoc", model.name()); - Assertions.assertEquals("ysh", model.displayName()); - Assertions.assertEquals("zafb", model.description()); - Assertions.assertEquals("j", model.helpUrl()); - Assertions.assertEquals(true, model.isHidden()); - Assertions.assertEquals(false, model.isEnabledByDefault()); - Assertions.assertEquals(false, model.isInPreview()); - Assertions.assertEquals(false, model.supportsEmailNotifications()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions model = - new ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions() - .withName("nmoc") - .withDisplayName("ysh") - .withDescription("zafb") - .withHelpUrl("j") - .withIsHidden(true) - .withIsEnabledByDefault(false) - .withIsInPreview(false) - .withSupportsEmailNotifications(false); - model = - BinaryData - .fromObject(model) - .toObject(ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions.class); - Assertions.assertEquals("nmoc", model.name()); - Assertions.assertEquals("ysh", model.displayName()); - Assertions.assertEquals("zafb", model.description()); - Assertions.assertEquals("j", model.helpUrl()); - Assertions.assertEquals(true, model.isHidden()); - Assertions.assertEquals(false, model.isEnabledByDefault()); - Assertions.assertEquals(false, model.isInPreview()); - Assertions.assertEquals(false, model.supportsEmailNotifications()); - } -} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalStorageInstancesGetByResourceGroupWithResponseMockTests.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalStorageInstancesGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 7cfcddcf6bea..000000000000 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalStorageInstancesGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.baremetalinfrastructure.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.baremetalinfrastructure.BareMetalInfrastructureManager; -import com.azure.resourcemanager.baremetalinfrastructure.models.AzureBareMetalStorageInstance; -import com.azure.resourcemanager.baremetalinfrastructure.models.ProvisioningState; -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 AzureBareMetalStorageInstancesGetByResourceGroupWithResponseMockTests { - @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 = - "{\"properties\":{\"azureBareMetalStorageInstanceUniqueIdentifier\":\"unmmq\",\"storageProperties\":{\"provisioningState\":\"Creating\",\"offeringType\":\"konocu\",\"storageType\":\"klyaxuconu\",\"generation\":\"zf\",\"hardwareType\":\"eyp\",\"workloadType\":\"rmjmwvvjektc\",\"storageBillingProperties\":{\"billingMode\":\"nhwlrsffrzpwvl\",\"azureBareMetalStorageInstanceSize\":\"q\"}}},\"location\":\"iqylihkaetck\",\"tags\":{\"jf\":\"civfsnkymuctq\",\"fuwutttxf\":\"ebrjcxe\",\"hfnljkyq\":\"jrbirphxepcyv\"},\"id\":\"j\",\"name\":\"uujqgidokgjljyo\",\"type\":\"gvcl\"}"; - - 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); - })); - - BareMetalInfrastructureManager manager = - BareMetalInfrastructureManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AzureBareMetalStorageInstance response = - manager - .azureBareMetalStorageInstances() - .getByResourceGroupWithResponse("qnwvlrya", "w", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("iqylihkaetck", response.location()); - Assertions.assertEquals("civfsnkymuctq", response.tags().get("jf")); - Assertions.assertEquals("unmmq", response.azureBareMetalStorageInstanceUniqueIdentifier()); - Assertions.assertEquals(ProvisioningState.CREATING, response.storageProperties().provisioningState()); - Assertions.assertEquals("konocu", response.storageProperties().offeringType()); - Assertions.assertEquals("klyaxuconu", response.storageProperties().storageType()); - Assertions.assertEquals("zf", response.storageProperties().generation()); - Assertions.assertEquals("eyp", response.storageProperties().hardwareType()); - Assertions.assertEquals("rmjmwvvjektc", response.storageProperties().workloadType()); - Assertions - .assertEquals("nhwlrsffrzpwvl", response.storageProperties().storageBillingProperties().billingMode()); - Assertions - .assertEquals( - "q", response.storageProperties().storageBillingProperties().azureBareMetalStorageInstanceSize()); - } -} diff --git a/sdk/containerregistry/azure-containers-containerregistry/src/main/java/com/azure/containers/containerregistry/implementation/models/Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema.java b/sdk/containerregistry/azure-containers-containerregistry/src/main/java/com/azure/containers/containerregistry/implementation/models/Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema.java deleted file mode 100644 index 2d87eef19115..000000000000 --- a/sdk/containerregistry/azure-containers-containerregistry/src/main/java/com/azure/containers/containerregistry/implementation/models/Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema.java +++ /dev/null @@ -1,220 +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.containers.containerregistry.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; -import java.util.Objects; - -/** The Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema model. */ -@Fluent -public final class Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema - implements JsonSerializable< - Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema> { - /* - * Can take a value of access_token_refresh_token, or access_token, or refresh_token - */ - private PostContentSchemaGrantType grantType; - - /* - * Indicates the name of your Azure container registry. - */ - private String service; - - /* - * AAD tenant associated to the AAD credentials. - */ - private String tenant; - - /* - * AAD refresh token, mandatory when grant_type is access_token_refresh_token or refresh_token - */ - private String refreshToken; - - /* - * AAD access token, mandatory when grant_type is access_token_refresh_token or access_token. - */ - private String aadAccessToken; - - /** - * Creates an instance of Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema class. - */ - public Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema() {} - - /** - * Get the grantType property: Can take a value of access_token_refresh_token, or access_token, or refresh_token. - * - * @return the grantType value. - */ - public PostContentSchemaGrantType getGrantType() { - return this.grantType; - } - - /** - * Set the grantType property: Can take a value of access_token_refresh_token, or access_token, or refresh_token. - * - * @param grantType the grantType value to set. - * @return the Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema object itself. - */ - public Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema setGrantType( - PostContentSchemaGrantType grantType) { - this.grantType = grantType; - return this; - } - - /** - * Get the service property: Indicates the name of your Azure container registry. - * - * @return the service value. - */ - public String getService() { - return this.service; - } - - /** - * Set the service property: Indicates the name of your Azure container registry. - * - * @param service the service value to set. - * @return the Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema object itself. - */ - public Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema setService( - String service) { - this.service = service; - return this; - } - - /** - * Get the tenant property: AAD tenant associated to the AAD credentials. - * - * @return the tenant value. - */ - public String getTenant() { - return this.tenant; - } - - /** - * Set the tenant property: AAD tenant associated to the AAD credentials. - * - * @param tenant the tenant value to set. - * @return the Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema object itself. - */ - public Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema setTenant( - String tenant) { - this.tenant = tenant; - return this; - } - - /** - * Get the refreshToken property: AAD refresh token, mandatory when grant_type is access_token_refresh_token or - * refresh_token. - * - * @return the refreshToken value. - */ - public String getRefreshToken() { - return this.refreshToken; - } - - /** - * Set the refreshToken property: AAD refresh token, mandatory when grant_type is access_token_refresh_token or - * refresh_token. - * - * @param refreshToken the refreshToken value to set. - * @return the Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema object itself. - */ - public Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema setRefreshToken( - String refreshToken) { - this.refreshToken = refreshToken; - return this; - } - - /** - * Get the aadAccessToken property: AAD access token, mandatory when grant_type is access_token_refresh_token or - * access_token. - * - * @return the aadAccessToken value. - */ - public String getAadAccessToken() { - return this.aadAccessToken; - } - - /** - * Set the aadAccessToken property: AAD access token, mandatory when grant_type is access_token_refresh_token or - * access_token. - * - * @param aadAccessToken the aadAccessToken value to set. - * @return the Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema object itself. - */ - public Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema setAadAccessToken( - String aadAccessToken) { - this.aadAccessToken = aadAccessToken; - return this; - } - - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("grant_type", Objects.toString(this.grantType, null)); - jsonWriter.writeStringField("service", this.service); - jsonWriter.writeStringField("tenant", this.tenant); - jsonWriter.writeStringField("refresh_token", this.refreshToken); - jsonWriter.writeStringField("access_token", this.aadAccessToken); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema from the - * JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema if the - * JsonReader was pointing to an instance of it, or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the - * Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema. - */ - public static Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema fromJson( - JsonReader jsonReader) throws IOException { - return jsonReader.readObject( - reader -> { - Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema - deserializedPaths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema = - new Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("grant_type".equals(fieldName)) { - deserializedPaths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema - .grantType = - PostContentSchemaGrantType.fromString(reader.getString()); - } else if ("service".equals(fieldName)) { - deserializedPaths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema - .service = - reader.getString(); - } else if ("tenant".equals(fieldName)) { - deserializedPaths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema - .tenant = - reader.getString(); - } else if ("refresh_token".equals(fieldName)) { - deserializedPaths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema - .refreshToken = - reader.getString(); - } else if ("access_token".equals(fieldName)) { - deserializedPaths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema - .aadAccessToken = - reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedPaths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema; - }); - } -} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceCheckProvisioningServiceNameAvailabilit.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceCheckProvisioningServiceNameAvailabilit.java deleted file mode 100644 index 43b776b1fb96..000000000000 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceCheckProvisioningServiceNameAvailabilit.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.deviceprovisioningservices.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.deviceprovisioningservices.models.OperationInputs; - -/** Samples for IotDpsResource CheckProvisioningServiceNameAvailability. */ -public final class IotDpsResourceCheckProvisioningServiceNameAvailabilit { - /* - * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSCheckNameAvailability.json - */ - /** - * Sample code: DPSCheckName. - * - * @param manager Entry point to IotDpsManager. - */ - public static void dPSCheckName(com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { - manager - .iotDpsResources() - .checkProvisioningServiceNameAvailabilityWithResponse( - new OperationInputs().withName("test213123"), Context.NONE); - } -} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceCreateOrUpdatePrivateEndpointConnection.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceCreateOrUpdatePrivateEndpointConnection.java deleted file mode 100644 index 5728f23ed58d..000000000000 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceCreateOrUpdatePrivateEndpointConnection.java +++ /dev/null @@ -1,35 +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.deviceprovisioningservices.generated; - -import com.azure.resourcemanager.deviceprovisioningservices.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.deviceprovisioningservices.models.PrivateLinkServiceConnectionState; -import com.azure.resourcemanager.deviceprovisioningservices.models.PrivateLinkServiceConnectionStatus; - -/** Samples for IotDpsResource CreateOrUpdatePrivateEndpointConnection. */ -public final class IotDpsResourceCreateOrUpdatePrivateEndpointConnection { - /* - * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSCreateOrUpdatePrivateEndpointConnection.json - */ - /** - * Sample code: PrivateEndpointConnection_CreateOrUpdate. - * - * @param manager Entry point to IotDpsManager. - */ - public static void privateEndpointConnectionCreateOrUpdate( - com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { - manager - .iotDpsResources() - .definePrivateEndpointConnection("myPrivateEndpointConnection") - .withExistingProvisioningService("myResourceGroup", "myFirstProvisioningService") - .withProperties( - new PrivateEndpointConnectionProperties() - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateLinkServiceConnectionStatus.APPROVED) - .withDescription("Approved by johndoe@contoso.com"))) - .create(); - } -} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceDeletePrivateEndpointConnectionSamples.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceDeletePrivateEndpointConnectionSamples.java deleted file mode 100644 index 1301de34dae8..000000000000 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceDeletePrivateEndpointConnectionSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.deviceprovisioningservices.generated; - -import com.azure.core.util.Context; - -/** Samples for IotDpsResource DeletePrivateEndpointConnection. */ -public final class IotDpsResourceDeletePrivateEndpointConnectionSamples { - /* - * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSDeletePrivateEndpointConnection.json - */ - /** - * Sample code: PrivateEndpointConnection_Delete. - * - * @param manager Entry point to IotDpsManager. - */ - public static void privateEndpointConnectionDelete( - com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { - manager - .iotDpsResources() - .deletePrivateEndpointConnection( - "myResourceGroup", "myFirstProvisioningService", "myPrivateEndpointConnection", Context.NONE); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSamples.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSamples.java deleted file mode 100644 index f4ec1ee01bdf..000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -/** - * Samples for CloudHsmClusterPrivateLinkResources ListByCloudHsmCluster. - */ -public final class CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10- - * preview/examples/CloudHsmClusterPrivateLinkResource_ListByCloudHsmCluster_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmClusterPrivateLinkResources_ListByResource_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterPrivateLinkResourcesListByResourceMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusterPrivateLinkResources().listByCloudHsmClusterWithResponse("rgcloudhsm", "chsm1", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsCreateWithResponseMockTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsCreateWithResponseMockTests.java deleted file mode 100644 index 5b209c4ea124..000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsCreateWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.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.hardwaresecuritymodules.HardwareSecurityModulesManager; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpoint; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointConnection; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateLinkServiceConnectionState; -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 CloudHsmClusterPrivateEndpointConnectionsCreateWithResponseMockTests { - @Test - public void testCreateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"properties\":{\"privateEndpoint\":{\"id\":\"gaifmvik\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"vkhbejdznx\",\"actionsRequired\":\"dsrhnjiv\"},\"provisioningState\":\"Canceled\",\"groupIds\":[\"ovqfzge\",\"jdftuljltd\"]},\"etag\":\"eamtmcz\",\"id\":\"m\",\"name\":\"jw\",\"type\":\"w\"}"; - - 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); - })); - - HardwareSecurityModulesManager manager = HardwareSecurityModulesManager.configure().withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnection response - = manager.cloudHsmClusterPrivateEndpointConnections().define("qhih") - .withExistingCloudHsmCluster("gxmrhublwp", "esutrgjupauutpw") - .withProperties(new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED).withDescription("qntcypsxjvfoimwk") - .withActionsRequired("ircizjxvy"))) - .withEtag("slbi").create(); - - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, - response.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("vkhbejdznx", response.properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("dsrhnjiv", - response.properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("eamtmcz", response.etag()); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsGetWithResponseMockTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsGetWithResponseMockTests.java deleted file mode 100644 index 22e51b1798fa..000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsGetWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.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.hardwaresecuritymodules.HardwareSecurityModulesManager; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointConnection; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointServiceConnectionStatus; -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 CloudHsmClusterPrivateEndpointConnectionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"properties\":{\"privateEndpoint\":{\"id\":\"iylwdshfssnr\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"frymsgaojfmwnc\",\"actionsRequired\":\"mrfhirctymox\"},\"provisioningState\":\"Failed\",\"groupIds\":[\"piwyczuhxacpqjl\",\"h\"]},\"etag\":\"usps\",\"id\":\"sdvlmfwdgzxulucv\",\"name\":\"amrsreuzv\",\"type\":\"urisjnhnytxifqj\"}"; - - 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); - })); - - HardwareSecurityModulesManager manager = HardwareSecurityModulesManager.configure().withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnection response = manager.cloudHsmClusterPrivateEndpointConnections() - .getWithResponse("cluyovwxnbkf", "zzxscyhwzdgiruj", "zbomvzzbtdcqvpni", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, - response.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("frymsgaojfmwnc", - response.properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("mrfhirctymox", - response.properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("usps", response.etag()); - } -} diff --git a/sdk/informaticadatamanagement/azure-resourcemanager-informaticadatamanagement/src/samples/java/com/azure/resourcemanager/informaticadatamanagement/generated/ServerlessRuntimesListByInformaticaOrganizationResourceS.java b/sdk/informaticadatamanagement/azure-resourcemanager-informaticadatamanagement/src/samples/java/com/azure/resourcemanager/informaticadatamanagement/generated/ServerlessRuntimesListByInformaticaOrganizationResourceS.java deleted file mode 100644 index 93cd37651dad..000000000000 --- a/sdk/informaticadatamanagement/azure-resourcemanager-informaticadatamanagement/src/samples/java/com/azure/resourcemanager/informaticadatamanagement/generated/ServerlessRuntimesListByInformaticaOrganizationResourceS.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.informaticadatamanagement.generated; - -/** - * Samples for ServerlessRuntimes ListByInformaticaOrganizationResource. - */ -public final class ServerlessRuntimesListByInformaticaOrganizationResourceS { - /* - * x-ms-original-file: - * specification/informatica/resource-manager/Informatica.DataManagement/stable/2024-05-08/examples/ - * ServerlessRuntimes_ListByInformaticaOrganizationResource_MaximumSet_Gen.json - */ - /** - * Sample code: ServerlessRuntimes_ListByInformaticaOrganizationResource. - * - * @param manager Entry point to InformaticaDataManagementManager. - */ - public static void serverlessRuntimesListByInformaticaOrganizationResource( - com.azure.resourcemanager.informaticadatamanagement.InformaticaDataManagementManager manager) { - manager.serverlessRuntimes() - .listByInformaticaOrganizationResource("rgopenapi", "orgName", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/informaticadatamanagement/azure-resourcemanager-informaticadatamanagement/src/test/java/com/azure/resourcemanager/informaticadatamanagement/generated/OrganizationsGetAllServerlessRuntimesWithResponseMockTests.java b/sdk/informaticadatamanagement/azure-resourcemanager-informaticadatamanagement/src/test/java/com/azure/resourcemanager/informaticadatamanagement/generated/OrganizationsGetAllServerlessRuntimesWithResponseMockTests.java deleted file mode 100644 index 85e179300f05..000000000000 --- a/sdk/informaticadatamanagement/azure-resourcemanager-informaticadatamanagement/src/test/java/com/azure/resourcemanager/informaticadatamanagement/generated/OrganizationsGetAllServerlessRuntimesWithResponseMockTests.java +++ /dev/null @@ -1,78 +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.informaticadatamanagement.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.informaticadatamanagement.InformaticaDataManagementManager; -import com.azure.resourcemanager.informaticadatamanagement.models.InformaticaServerlessRuntimeResourceList; -import com.azure.resourcemanager.informaticadatamanagement.models.RuntimeType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class OrganizationsGetAllServerlessRuntimesWithResponseMockTests { - @Test - public void testGetAllServerlessRuntimesWithResponse() throws Exception { - String responseStr - = "{\"informaticaRuntimeResources\":[{\"name\":\"tkfa\",\"createdTime\":\"nopqgikyzirtx\",\"updatedTime\":\"yuxzejntpsewgi\",\"createdBy\":\"ilqu\",\"updatedBy\":\"rydxtqm\",\"id\":\"eoxorggufhyao\",\"type\":\"SERVERLESS\",\"status\":\"bghhavgrvkf\",\"statusLocalized\":\"ovjzhpjbibgjmfx\",\"statusMessage\":\"mv\",\"serverlessConfigProperties\":{\"subnet\":\"luyovwxnbkfezzx\",\"applicationType\":\"yhwzdgiruj\",\"resourceGroupName\":\"bomvzzbtdcqv\",\"advancedCustomProperties\":\"iyujviylwdshfs\",\"supplementaryFileLocation\":\"rbgyefry\",\"platform\":\"gaojf\",\"tags\":\"nc\",\"vnet\":\"mrfhirctymox\",\"executionTimeout\":\"tpipiwyczuhx\",\"computeUnits\":\"pqjlihhyusps\",\"tenantId\":\"sdvlmfwdgzxulucv\",\"subscriptionId\":\"mrsreuzvxurisjnh\",\"region\":\"txifqj\",\"serverlessArmResourceId\":\"xmrhu\"},\"description\":\"wp\"},{\"name\":\"esutrgjupauutpw\",\"createdTime\":\"qhih\",\"updatedTime\":\"jqgwzp\",\"createdBy\":\"fqntcyp\",\"updatedBy\":\"xjvfoimwksl\",\"id\":\"rcizjxvyd\",\"type\":\"SERVERLESS\",\"status\":\"eacvl\",\"statusLocalized\":\"vygdyft\",\"statusMessage\":\"mrtwna\",\"serverlessConfigProperties\":{\"subnet\":\"slbi\",\"applicationType\":\"ojgcyzt\",\"resourceGroupName\":\"mznbaeqphch\",\"advancedCustomProperties\":\"rn\",\"supplementaryFileLocation\":\"x\",\"platform\":\"uwrykqgaifmvikl\",\"tags\":\"dvk\",\"vnet\":\"ejd\",\"executionTimeout\":\"xcv\",\"computeUnits\":\"rhnj\",\"tenantId\":\"olvtnovqfzge\",\"subscriptionId\":\"dftuljltduce\",\"region\":\"tmczuomejwcwwqi\",\"serverlessArmResourceId\":\"nssxmojmsvpk\"},\"description\":\"rvkwc\"},{\"name\":\"zqljyxgtczh\",\"createdTime\":\"ydbsd\",\"updatedTime\":\"hmkxmaehvbb\",\"createdBy\":\"uripltfnhtba\",\"updatedBy\":\"kgxywr\",\"id\":\"kpyklyhp\",\"type\":\"SERVERLESS\",\"status\":\"odpvruudlgzib\",\"statusLocalized\":\"hostgktstvdxecl\",\"statusMessage\":\"edqbc\",\"serverlessConfigProperties\":{\"subnet\":\"zlhp\",\"applicationType\":\"dqkdlwwqfbu\",\"resourceGroupName\":\"kxtrq\",\"advancedCustomProperties\":\"smlmbtxhwgfwsrta\",\"supplementaryFileLocation\":\"oezbrhubsk\",\"platform\":\"dyg\",\"tags\":\"okkqfqjbvleo\",\"vnet\":\"ml\",\"executionTimeout\":\"qtqzfavyv\",\"computeUnits\":\"qybaryeua\",\"tenantId\":\"kq\",\"subscriptionId\":\"qgzsles\",\"region\":\"bhernntiew\",\"serverlessArmResourceId\":\"cv\"},\"description\":\"uwrbehwagoh\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - InformaticaDataManagementManager manager = InformaticaDataManagementManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - InformaticaServerlessRuntimeResourceList response = manager.organizations() - .getAllServerlessRuntimesWithResponse("z", "ybycnunvj", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("tkfa", response.informaticaRuntimeResources().get(0).name()); - Assertions.assertEquals("nopqgikyzirtx", response.informaticaRuntimeResources().get(0).createdTime()); - Assertions.assertEquals("yuxzejntpsewgi", response.informaticaRuntimeResources().get(0).updatedTime()); - Assertions.assertEquals("ilqu", response.informaticaRuntimeResources().get(0).createdBy()); - Assertions.assertEquals("rydxtqm", response.informaticaRuntimeResources().get(0).updatedBy()); - Assertions.assertEquals("eoxorggufhyao", response.informaticaRuntimeResources().get(0).id()); - Assertions.assertEquals(RuntimeType.SERVERLESS, response.informaticaRuntimeResources().get(0).type()); - Assertions.assertEquals("bghhavgrvkf", response.informaticaRuntimeResources().get(0).status()); - Assertions.assertEquals("ovjzhpjbibgjmfx", response.informaticaRuntimeResources().get(0).statusLocalized()); - Assertions.assertEquals("mv", response.informaticaRuntimeResources().get(0).statusMessage()); - Assertions.assertEquals("luyovwxnbkfezzx", - response.informaticaRuntimeResources().get(0).serverlessConfigProperties().subnet()); - Assertions.assertEquals("yhwzdgiruj", - response.informaticaRuntimeResources().get(0).serverlessConfigProperties().applicationType()); - Assertions.assertEquals("bomvzzbtdcqv", - response.informaticaRuntimeResources().get(0).serverlessConfigProperties().resourceGroupName()); - Assertions.assertEquals("iyujviylwdshfs", - response.informaticaRuntimeResources().get(0).serverlessConfigProperties().advancedCustomProperties()); - Assertions.assertEquals("rbgyefry", - response.informaticaRuntimeResources().get(0).serverlessConfigProperties().supplementaryFileLocation()); - Assertions.assertEquals("gaojf", - response.informaticaRuntimeResources().get(0).serverlessConfigProperties().platform()); - Assertions.assertEquals("nc", - response.informaticaRuntimeResources().get(0).serverlessConfigProperties().tags()); - Assertions.assertEquals("mrfhirctymox", - response.informaticaRuntimeResources().get(0).serverlessConfigProperties().vnet()); - Assertions.assertEquals("tpipiwyczuhx", - response.informaticaRuntimeResources().get(0).serverlessConfigProperties().executionTimeout()); - Assertions.assertEquals("pqjlihhyusps", - response.informaticaRuntimeResources().get(0).serverlessConfigProperties().computeUnits()); - Assertions.assertEquals("sdvlmfwdgzxulucv", - response.informaticaRuntimeResources().get(0).serverlessConfigProperties().tenantId()); - Assertions.assertEquals("mrsreuzvxurisjnh", - response.informaticaRuntimeResources().get(0).serverlessConfigProperties().subscriptionId()); - Assertions.assertEquals("txifqj", - response.informaticaRuntimeResources().get(0).serverlessConfigProperties().region()); - Assertions.assertEquals("xmrhu", - response.informaticaRuntimeResources().get(0).serverlessConfigProperties().serverlessArmResourceId()); - Assertions.assertEquals("wp", response.informaticaRuntimeResources().get(0).description()); - } -} diff --git a/sdk/informaticadatamanagement/azure-resourcemanager-informaticadatamanagement/src/test/java/com/azure/resourcemanager/informaticadatamanagement/generated/ServerlessRuntimesStartFailedServerlessRuntimeWitMockTests.java b/sdk/informaticadatamanagement/azure-resourcemanager-informaticadatamanagement/src/test/java/com/azure/resourcemanager/informaticadatamanagement/generated/ServerlessRuntimesStartFailedServerlessRuntimeWitMockTests.java deleted file mode 100644 index 4c2f3b33e0f2..000000000000 --- a/sdk/informaticadatamanagement/azure-resourcemanager-informaticadatamanagement/src/test/java/com/azure/resourcemanager/informaticadatamanagement/generated/ServerlessRuntimesStartFailedServerlessRuntimeWitMockTests.java +++ /dev/null @@ -1,34 +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.informaticadatamanagement.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.informaticadatamanagement.InformaticaDataManagementManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServerlessRuntimesStartFailedServerlessRuntimeWitMockTests { - @Test - public void testStartFailedServerlessRuntimeWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 204, responseStr.getBytes(StandardCharsets.UTF_8))); - InformaticaDataManagementManager manager = InformaticaDataManagementManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.serverlessRuntimes() - .startFailedServerlessRuntimeWithResponse("epgfew", "twly", "gncxykxhdj", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsUpdateNpbStaticRouteBfdAdministrativeState.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsUpdateNpbStaticRouteBfdAdministrativeState.java deleted file mode 100644 index 78721ecefc51..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsUpdateNpbStaticRouteBfdAdministrativeState.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.managednetworkfabric.generated; - -import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableState; -import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; -import java.util.Arrays; - -/** Samples for NetworkToNetworkInterconnects UpdateNpbStaticRouteBfdAdministrativeState. */ -public final class NetworkToNetworkInterconnectsUpdateNpbStaticRouteBfdAdministrativeState { - /* - * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_updateNpbStaticRouteBfdAdministrativeState_MaximumSet_Gen.json - */ - /** - * Sample code: NetworkToNetworkInterconnects_updateNpbStaticRouteBfdAdministrativeState_MaximumSet_Gen. - * - * @param manager Entry point to ManagedNetworkFabricManager. - */ - public static void networkToNetworkInterconnectsUpdateNpbStaticRouteBfdAdministrativeStateMaximumSetGen( - com.azure.resourcemanager.managednetworkfabric.ManagedNetworkFabricManager manager) { - manager - .networkToNetworkInterconnects() - .updateNpbStaticRouteBfdAdministrativeState( - "example-rg", - "example-fabric", - "example-nni", - new UpdateAdministrativeState().withResourceIds(Arrays.asList("")).withState(EnableDisableState.ENABLE), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityWithLocationsExecuteWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityWithLocationsExecuteWithResponseMockTests.java deleted file mode 100644 index 1b8861e637ff..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityWithLocationsExecuteWithResponseMockTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityReason; -import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityRequest; -import com.azure.resourcemanager.postgresqlflexibleserver.models.NameAvailability; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CheckNameAvailabilityWithLocationsExecuteWithResponseMockTests { - @Test - public void testExecuteWithResponse() throws Exception { - String responseStr - = "{\"name\":\"edxihchrphkmcrj\",\"type\":\"nsdfzpbgtgky\",\"nameAvailable\":false,\"reason\":\"AlreadyExists\",\"message\":\"jeuut\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - PostgreSqlManager manager = PostgreSqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NameAvailability response = manager.checkNameAvailabilityWithLocations() - .executeWithResponse("t", - new CheckNameAvailabilityRequest().withName("lxgccknfnwmbtm").withType("dvjdhttza"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(false, response.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, response.reason()); - Assertions.assertEquals("jeuut", response.message()); - } -} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/CheckNameAvailabilityResponseModelInner.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/CheckNameAvailabilityResponseModelInner.java deleted file mode 100644 index 0b993bb11ea6..000000000000 --- a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/CheckNameAvailabilityResponseModelInner.java +++ /dev/null @@ -1,102 +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.recoveryservicesdatareplication.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Check name availability response model. */ -@Fluent -public final class CheckNameAvailabilityResponseModelInner { - /* - * Gets or sets a value indicating whether resource name is available or not. - */ - @JsonProperty(value = "nameAvailable") - private Boolean nameAvailable; - - /* - * Gets or sets the reason for resource name unavailability. - */ - @JsonProperty(value = "reason") - private String reason; - - /* - * Gets or sets the message for resource name unavailability. - */ - @JsonProperty(value = "message") - private String message; - - /** Creates an instance of CheckNameAvailabilityResponseModelInner class. */ - public CheckNameAvailabilityResponseModelInner() { - } - - /** - * Get the nameAvailable property: Gets or sets a value indicating whether resource name is available or not. - * - * @return the nameAvailable value. - */ - public Boolean nameAvailable() { - return this.nameAvailable; - } - - /** - * Set the nameAvailable property: Gets or sets a value indicating whether resource name is available or not. - * - * @param nameAvailable the nameAvailable value to set. - * @return the CheckNameAvailabilityResponseModelInner object itself. - */ - public CheckNameAvailabilityResponseModelInner withNameAvailable(Boolean nameAvailable) { - this.nameAvailable = nameAvailable; - return this; - } - - /** - * Get the reason property: Gets or sets the reason for resource name unavailability. - * - * @return the reason value. - */ - public String reason() { - return this.reason; - } - - /** - * Set the reason property: Gets or sets the reason for resource name unavailability. - * - * @param reason the reason value to set. - * @return the CheckNameAvailabilityResponseModelInner object itself. - */ - public CheckNameAvailabilityResponseModelInner withReason(String reason) { - this.reason = reason; - return this; - } - - /** - * Get the message property: Gets or sets the message for resource name unavailability. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Set the message property: Gets or sets the message for resource name unavailability. - * - * @param message the message value to set. - * @return the CheckNameAvailabilityResponseModelInner object itself. - */ - public CheckNameAvailabilityResponseModelInner withMessage(String message) { - this.message = message; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/CheckNameAvailabilityResponseModelImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/CheckNameAvailabilityResponseModelImpl.java deleted file mode 100644 index a2ba1d86b8ea..000000000000 --- a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/CheckNameAvailabilityResponseModelImpl.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.recoveryservicesdatareplication.implementation; - -import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.CheckNameAvailabilityResponseModelInner; -import com.azure.resourcemanager.recoveryservicesdatareplication.models.CheckNameAvailabilityResponseModel; - -public final class CheckNameAvailabilityResponseModelImpl implements CheckNameAvailabilityResponseModel { - private CheckNameAvailabilityResponseModelInner innerObject; - - private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager - serviceManager; - - CheckNameAvailabilityResponseModelImpl( - CheckNameAvailabilityResponseModelInner innerObject, - com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager - serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public Boolean nameAvailable() { - return this.innerModel().nameAvailable(); - } - - public String reason() { - return this.innerModel().reason(); - } - - public String message() { - return this.innerModel().message(); - } - - public CheckNameAvailabilityResponseModelInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ProtectedItemOperationStatusClientImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ProtectedItemOperationStatusClientImpl.java deleted file mode 100644 index a7f839198369..000000000000 --- a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ProtectedItemOperationStatusClientImpl.java +++ /dev/null @@ -1,254 +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.recoveryservicesdatareplication.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.recoveryservicesdatareplication.fluent.ProtectedItemOperationStatusClient; -import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.OperationStatusInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ProtectedItemOperationStatusClient. */ -public final class ProtectedItemOperationStatusClientImpl implements ProtectedItemOperationStatusClient { - /** The proxy service used to perform REST calls. */ - private final ProtectedItemOperationStatusService service; - - /** The service client containing this operation class. */ - private final DataReplicationMgmtClientImpl client; - - /** - * Initializes an instance of ProtectedItemOperationStatusClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ProtectedItemOperationStatusClientImpl(DataReplicationMgmtClientImpl client) { - this.service = - RestProxy - .create( - ProtectedItemOperationStatusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for DataReplicationMgmtClientProtectedItemOperationStatus to be used by - * the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "DataReplicationMgmtC") - public interface ProtectedItemOperationStatusService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/operations/{operationId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vaultName") String vaultName, - @PathParam("protectedItemName") String protectedItemName, - @PathParam("operationId") String operationId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the protected item operation status. - * - *

Tracks the results of an asynchronous operation on the protected item. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The vault name. - * @param protectedItemName The protected item name. - * @param operationId The ID of an ongoing async operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the operation status along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String vaultName, String protectedItemName, String operationId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - if (protectedItemName == null) { - return Mono - .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vaultName, - protectedItemName, - operationId, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the protected item operation status. - * - *

Tracks the results of an asynchronous operation on the protected item. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The vault name. - * @param protectedItemName The protected item name. - * @param operationId The ID of an ongoing async operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the operation status along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String vaultName, String protectedItemName, String operationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - if (protectedItemName == null) { - return Mono - .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vaultName, - protectedItemName, - operationId, - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the protected item operation status. - * - *

Tracks the results of an asynchronous operation on the protected item. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The vault name. - * @param protectedItemName The protected item name. - * @param operationId The ID of an ongoing async operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the operation status on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String vaultName, String protectedItemName, String operationId) { - return getWithResponseAsync(resourceGroupName, vaultName, protectedItemName, operationId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the protected item operation status. - * - *

Tracks the results of an asynchronous operation on the protected item. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The vault name. - * @param protectedItemName The protected item name. - * @param operationId The ID of an ongoing async operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the operation status along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String vaultName, String protectedItemName, String operationId, Context context) { - return getWithResponseAsync(resourceGroupName, vaultName, protectedItemName, operationId, context).block(); - } - - /** - * Gets the protected item operation status. - * - *

Tracks the results of an asynchronous operation on the protected item. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The vault name. - * @param protectedItemName The protected item name. - * @param operationId The ID of an ongoing async operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the operation status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusInner get( - String resourceGroupName, String vaultName, String protectedItemName, String operationId) { - return getWithResponse(resourceGroupName, vaultName, protectedItemName, operationId, Context.NONE).getValue(); - } -} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciEventModelCustomProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciEventModelCustomProperties.java deleted file mode 100644 index 9a56f27e75a8..000000000000 --- a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciEventModelCustomProperties.java +++ /dev/null @@ -1,110 +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.recoveryservicesdatareplication.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * HyperV to AzStackHCI event model custom properties. This class provides provider specific details for events of type - * DataContract.HealthEvents.HealthEventType.ProtectedItemHealth and - * DataContract.HealthEvents.HealthEventType.AgentHealth. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") -@JsonTypeName("HyperVToAzStackHCI") -@Immutable -public final class HyperVToAzStackHciEventModelCustomProperties extends EventModelCustomProperties { - /* - * Gets or sets the friendly name of the source which has raised this health event. - */ - @JsonProperty(value = "eventSourceFriendlyName", access = JsonProperty.Access.WRITE_ONLY) - private String eventSourceFriendlyName; - - /* - * Gets or sets the protected item friendly name. - */ - @JsonProperty(value = "protectedItemFriendlyName", access = JsonProperty.Access.WRITE_ONLY) - private String protectedItemFriendlyName; - - /* - * Gets or sets the source appliance name. - */ - @JsonProperty(value = "sourceApplianceName", access = JsonProperty.Access.WRITE_ONLY) - private String sourceApplianceName; - - /* - * Gets or sets the source target name. - */ - @JsonProperty(value = "targetApplianceName", access = JsonProperty.Access.WRITE_ONLY) - private String targetApplianceName; - - /* - * Gets or sets the server type. - */ - @JsonProperty(value = "serverType", access = JsonProperty.Access.WRITE_ONLY) - private String serverType; - - /** Creates an instance of HyperVToAzStackHciEventModelCustomProperties class. */ - public HyperVToAzStackHciEventModelCustomProperties() { - } - - /** - * Get the eventSourceFriendlyName property: Gets or sets the friendly name of the source which has raised this - * health event. - * - * @return the eventSourceFriendlyName value. - */ - public String eventSourceFriendlyName() { - return this.eventSourceFriendlyName; - } - - /** - * Get the protectedItemFriendlyName property: Gets or sets the protected item friendly name. - * - * @return the protectedItemFriendlyName value. - */ - public String protectedItemFriendlyName() { - return this.protectedItemFriendlyName; - } - - /** - * Get the sourceApplianceName property: Gets or sets the source appliance name. - * - * @return the sourceApplianceName value. - */ - public String sourceApplianceName() { - return this.sourceApplianceName; - } - - /** - * Get the targetApplianceName property: Gets or sets the source target name. - * - * @return the targetApplianceName value. - */ - public String targetApplianceName() { - return this.targetApplianceName; - } - - /** - * Get the serverType property: Gets or sets the server type. - * - * @return the serverType value. - */ - public String serverType() { - return this.serverType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciPlannedFailoverCustomProps.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciPlannedFailoverCustomProps.java deleted file mode 100644 index 3de28db94f3a..000000000000 --- a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciPlannedFailoverCustomProps.java +++ /dev/null @@ -1,56 +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.recoveryservicesdatareplication.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** HyperV to AzStackHCI planned failover model custom properties. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") -@JsonTypeName("HyperVToAzStackHCI") -@Fluent -public final class HyperVToAzStackHciPlannedFailoverCustomProps extends PlannedFailoverModelCustomProperties { - /* - * Gets or sets a value indicating whether VM needs to be shut down. - */ - @JsonProperty(value = "shutdownSourceVM", required = true) - private boolean shutdownSourceVM; - - /** Creates an instance of HyperVToAzStackHciPlannedFailoverCustomProps class. */ - public HyperVToAzStackHciPlannedFailoverCustomProps() { - } - - /** - * Get the shutdownSourceVM property: Gets or sets a value indicating whether VM needs to be shut down. - * - * @return the shutdownSourceVM value. - */ - public boolean shutdownSourceVM() { - return this.shutdownSourceVM; - } - - /** - * Set the shutdownSourceVM property: Gets or sets a value indicating whether VM needs to be shut down. - * - * @param shutdownSourceVM the shutdownSourceVM value to set. - * @return the HyperVToAzStackHciPlannedFailoverCustomProps object itself. - */ - public HyperVToAzStackHciPlannedFailoverCustomProps withShutdownSourceVM(boolean shutdownSourceVM) { - this.shutdownSourceVM = shutdownSourceVM; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciPolicyModelCustomProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciPolicyModelCustomProperties.java deleted file mode 100644 index e5bbcb9e3430..000000000000 --- a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciPolicyModelCustomProperties.java +++ /dev/null @@ -1,118 +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.recoveryservicesdatareplication.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** HyperV To AzStackHCI Policy model custom properties. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") -@JsonTypeName("HyperVToAzStackHCI") -@Fluent -public final class HyperVToAzStackHciPolicyModelCustomProperties extends PolicyModelCustomProperties { - /* - * Gets or sets the duration in minutes until which the recovery points need to be - * stored. - */ - @JsonProperty(value = "recoveryPointHistoryInMinutes", required = true) - private int recoveryPointHistoryInMinutes; - - /* - * Gets or sets the crash consistent snapshot frequency (in minutes). - */ - @JsonProperty(value = "crashConsistentFrequencyInMinutes", required = true) - private int crashConsistentFrequencyInMinutes; - - /* - * Gets or sets the app consistent snapshot frequency (in minutes). - */ - @JsonProperty(value = "appConsistentFrequencyInMinutes", required = true) - private int appConsistentFrequencyInMinutes; - - /** Creates an instance of HyperVToAzStackHciPolicyModelCustomProperties class. */ - public HyperVToAzStackHciPolicyModelCustomProperties() { - } - - /** - * Get the recoveryPointHistoryInMinutes property: Gets or sets the duration in minutes until which the recovery - * points need to be stored. - * - * @return the recoveryPointHistoryInMinutes value. - */ - public int recoveryPointHistoryInMinutes() { - return this.recoveryPointHistoryInMinutes; - } - - /** - * Set the recoveryPointHistoryInMinutes property: Gets or sets the duration in minutes until which the recovery - * points need to be stored. - * - * @param recoveryPointHistoryInMinutes the recoveryPointHistoryInMinutes value to set. - * @return the HyperVToAzStackHciPolicyModelCustomProperties object itself. - */ - public HyperVToAzStackHciPolicyModelCustomProperties withRecoveryPointHistoryInMinutes( - int recoveryPointHistoryInMinutes) { - this.recoveryPointHistoryInMinutes = recoveryPointHistoryInMinutes; - return this; - } - - /** - * Get the crashConsistentFrequencyInMinutes property: Gets or sets the crash consistent snapshot frequency (in - * minutes). - * - * @return the crashConsistentFrequencyInMinutes value. - */ - public int crashConsistentFrequencyInMinutes() { - return this.crashConsistentFrequencyInMinutes; - } - - /** - * Set the crashConsistentFrequencyInMinutes property: Gets or sets the crash consistent snapshot frequency (in - * minutes). - * - * @param crashConsistentFrequencyInMinutes the crashConsistentFrequencyInMinutes value to set. - * @return the HyperVToAzStackHciPolicyModelCustomProperties object itself. - */ - public HyperVToAzStackHciPolicyModelCustomProperties withCrashConsistentFrequencyInMinutes( - int crashConsistentFrequencyInMinutes) { - this.crashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; - return this; - } - - /** - * Get the appConsistentFrequencyInMinutes property: Gets or sets the app consistent snapshot frequency (in - * minutes). - * - * @return the appConsistentFrequencyInMinutes value. - */ - public int appConsistentFrequencyInMinutes() { - return this.appConsistentFrequencyInMinutes; - } - - /** - * Set the appConsistentFrequencyInMinutes property: Gets or sets the app consistent snapshot frequency (in - * minutes). - * - * @param appConsistentFrequencyInMinutes the appConsistentFrequencyInMinutes value to set. - * @return the HyperVToAzStackHciPolicyModelCustomProperties object itself. - */ - public HyperVToAzStackHciPolicyModelCustomProperties withAppConsistentFrequencyInMinutes( - int appConsistentFrequencyInMinutes) { - this.appConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelPropertiesLastTestFailoverJob.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelPropertiesLastTestFailoverJob.java deleted file mode 100644 index 8d5fedc7179d..000000000000 --- a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelPropertiesLastTestFailoverJob.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.recoveryservicesdatareplication.models; - -import com.azure.core.annotation.Immutable; - -/** The ProtectedItemModelPropertiesLastTestFailoverJob model. */ -@Immutable -public final class ProtectedItemModelPropertiesLastTestFailoverJob extends ProtectedItemJobProperties { - /** Creates an instance of ProtectedItemModelPropertiesLastTestFailoverJob class. */ - public ProtectedItemModelPropertiesLastTestFailoverJob() { - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TestFailoverCleanupWorkflowModelCustomProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TestFailoverCleanupWorkflowModelCustomProperties.java deleted file mode 100644 index 48b859e77c80..000000000000 --- a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TestFailoverCleanupWorkflowModelCustomProperties.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesdatareplication.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Test failover cleanup workflow model custom properties. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") -@JsonTypeName("TestFailoverCleanupWorkflowDetails") -@Immutable -public final class TestFailoverCleanupWorkflowModelCustomProperties extends WorkflowModelCustomProperties { - /* - * Gets or sets the test failover cleanup comments. - */ - @JsonProperty(value = "comments", access = JsonProperty.Access.WRITE_ONLY) - private String comments; - - /** Creates an instance of TestFailoverCleanupWorkflowModelCustomProperties class. */ - public TestFailoverCleanupWorkflowModelCustomProperties() { - } - - /** - * Get the comments property: Gets or sets the test failover cleanup comments. - * - * @return the comments value. - */ - public String comments() { - return this.comments; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciPlannedFailoverCustomProps.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciPlannedFailoverCustomProps.java deleted file mode 100644 index 81d3bc78ba68..000000000000 --- a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciPlannedFailoverCustomProps.java +++ /dev/null @@ -1,56 +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.recoveryservicesdatareplication.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** VMware to AzStackHCI planned failover model custom properties. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") -@JsonTypeName("VMwareToAzStackHCI") -@Fluent -public final class VMwareToAzStackHciPlannedFailoverCustomProps extends PlannedFailoverModelCustomProperties { - /* - * Gets or sets a value indicating whether VM needs to be shut down. - */ - @JsonProperty(value = "shutdownSourceVM", required = true) - private boolean shutdownSourceVM; - - /** Creates an instance of VMwareToAzStackHciPlannedFailoverCustomProps class. */ - public VMwareToAzStackHciPlannedFailoverCustomProps() { - } - - /** - * Get the shutdownSourceVM property: Gets or sets a value indicating whether VM needs to be shut down. - * - * @return the shutdownSourceVM value. - */ - public boolean shutdownSourceVM() { - return this.shutdownSourceVM; - } - - /** - * Set the shutdownSourceVM property: Gets or sets a value indicating whether VM needs to be shut down. - * - * @param shutdownSourceVM the shutdownSourceVM value to set. - * @return the VMwareToAzStackHciPlannedFailoverCustomProps object itself. - */ - public VMwareToAzStackHciPlannedFailoverCustomProps withShutdownSourceVM(boolean shutdownSourceVM) { - this.shutdownSourceVM = shutdownSourceVM; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciPolicyModelCustomProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciPolicyModelCustomProperties.java deleted file mode 100644 index 3e43cfb5aa57..000000000000 --- a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciPolicyModelCustomProperties.java +++ /dev/null @@ -1,118 +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.recoveryservicesdatareplication.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** VMware To AzStackHCI Policy model custom properties. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") -@JsonTypeName("VMwareToAzStackHCI") -@Fluent -public final class VMwareToAzStackHciPolicyModelCustomProperties extends PolicyModelCustomProperties { - /* - * Gets or sets the duration in minutes until which the recovery points need to be - * stored. - */ - @JsonProperty(value = "recoveryPointHistoryInMinutes", required = true) - private int recoveryPointHistoryInMinutes; - - /* - * Gets or sets the crash consistent snapshot frequency (in minutes). - */ - @JsonProperty(value = "crashConsistentFrequencyInMinutes", required = true) - private int crashConsistentFrequencyInMinutes; - - /* - * Gets or sets the app consistent snapshot frequency (in minutes). - */ - @JsonProperty(value = "appConsistentFrequencyInMinutes", required = true) - private int appConsistentFrequencyInMinutes; - - /** Creates an instance of VMwareToAzStackHciPolicyModelCustomProperties class. */ - public VMwareToAzStackHciPolicyModelCustomProperties() { - } - - /** - * Get the recoveryPointHistoryInMinutes property: Gets or sets the duration in minutes until which the recovery - * points need to be stored. - * - * @return the recoveryPointHistoryInMinutes value. - */ - public int recoveryPointHistoryInMinutes() { - return this.recoveryPointHistoryInMinutes; - } - - /** - * Set the recoveryPointHistoryInMinutes property: Gets or sets the duration in minutes until which the recovery - * points need to be stored. - * - * @param recoveryPointHistoryInMinutes the recoveryPointHistoryInMinutes value to set. - * @return the VMwareToAzStackHciPolicyModelCustomProperties object itself. - */ - public VMwareToAzStackHciPolicyModelCustomProperties withRecoveryPointHistoryInMinutes( - int recoveryPointHistoryInMinutes) { - this.recoveryPointHistoryInMinutes = recoveryPointHistoryInMinutes; - return this; - } - - /** - * Get the crashConsistentFrequencyInMinutes property: Gets or sets the crash consistent snapshot frequency (in - * minutes). - * - * @return the crashConsistentFrequencyInMinutes value. - */ - public int crashConsistentFrequencyInMinutes() { - return this.crashConsistentFrequencyInMinutes; - } - - /** - * Set the crashConsistentFrequencyInMinutes property: Gets or sets the crash consistent snapshot frequency (in - * minutes). - * - * @param crashConsistentFrequencyInMinutes the crashConsistentFrequencyInMinutes value to set. - * @return the VMwareToAzStackHciPolicyModelCustomProperties object itself. - */ - public VMwareToAzStackHciPolicyModelCustomProperties withCrashConsistentFrequencyInMinutes( - int crashConsistentFrequencyInMinutes) { - this.crashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; - return this; - } - - /** - * Get the appConsistentFrequencyInMinutes property: Gets or sets the app consistent snapshot frequency (in - * minutes). - * - * @return the appConsistentFrequencyInMinutes value. - */ - public int appConsistentFrequencyInMinutes() { - return this.appConsistentFrequencyInMinutes; - } - - /** - * Set the appConsistentFrequencyInMinutes property: Gets or sets the app consistent snapshot frequency (in - * minutes). - * - * @param appConsistentFrequencyInMinutes the appConsistentFrequencyInMinutes value to set. - * @return the VMwareToAzStackHciPolicyModelCustomProperties object itself. - */ - public VMwareToAzStackHciPolicyModelCustomProperties withAppConsistentFrequencyInMinutes( - int appConsistentFrequencyInMinutes) { - this.appConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemOperationStatusGetSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemOperationStatusGetSamples.java deleted file mode 100644 index 89aa4411f5ca..000000000000 --- a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemOperationStatusGetSamples.java +++ /dev/null @@ -1,24 +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.recoveryservicesdatareplication.generated; - -/** Samples for ProtectedItemOperationStatus Get. */ -public final class ProtectedItemOperationStatusGetSamples { - /* - * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/ProtectedItemOperationStatus_Get.json - */ - /** - * Sample code: ProtectedItemOperationStatus_Get. - * - * @param manager Entry point to RecoveryServicesDataReplicationManager. - */ - public static void protectedItemOperationStatusGet( - com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { - manager - .protectedItemOperationStatus() - .getWithResponse( - "rgrecoveryservicesdatareplication", "4", "d", "wdqacsc", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ResourceProviderCheckNameAvailabilityS.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ResourceProviderCheckNameAvailabilityS.java deleted file mode 100644 index 9dcb06d01810..000000000000 --- a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ResourceProviderCheckNameAvailabilityS.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicesdatareplication.generated; - -import com.azure.resourcemanager.recoveryservicesdatareplication.models.CheckNameAvailabilityModel; - -/** Samples for ResourceProvider CheckNameAvailability. */ -public final class ResourceProviderCheckNameAvailabilityS { - /* - * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/CheckNameAvailability.json - */ - /** - * Sample code: CheckNameAvailability. - * - * @param manager Entry point to RecoveryServicesDataReplicationManager. - */ - public static void checkNameAvailability( - com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { - manager - .resourceProviders() - .checkNameAvailabilityWithResponse( - "trfqtbtmusswpibw", - new CheckNameAvailabilityModel().withName("updkdcixs").withType("gngmcancdauwhdixjjvqnfkvqc"), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ResourceProviderDeploymentPreflightSam.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ResourceProviderDeploymentPreflightSam.java deleted file mode 100644 index ef57b8b94b1d..000000000000 --- a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ResourceProviderDeploymentPreflightSam.java +++ /dev/null @@ -1,39 +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.recoveryservicesdatareplication.generated; - -import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.DeploymentPreflightModelInner; -import com.azure.resourcemanager.recoveryservicesdatareplication.models.DeploymentPreflightResource; -import java.util.Arrays; - -/** Samples for ResourceProvider DeploymentPreflight. */ -public final class ResourceProviderDeploymentPreflightSam { - /* - * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/DeploymentPreflight.json - */ - /** - * Sample code: DeploymentPreflight. - * - * @param manager Entry point to RecoveryServicesDataReplicationManager. - */ - public static void deploymentPreflight( - com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { - manager - .resourceProviders() - .deploymentPreflightWithResponse( - "rgrecoveryservicesdatareplication", - "kjoiahxljomjcmvabaobumg", - new DeploymentPreflightModelInner() - .withResources( - Arrays - .asList( - new DeploymentPreflightResource() - .withName("xtgugoflfc") - .withType("nsnaptduolqcxsikrewvgjbxqpt") - .withLocation("cbsgtxkjdzwbyp") - .withApiVersion("otihymhvzblycdoxo"))), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEligibilityResultsOperationsClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEligibilityResultsOperationsClientImpl.java deleted file mode 100644 index 77f23d6e09ad..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEligibilityResultsOperationsClientImpl.java +++ /dev/null @@ -1,348 +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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationEligibilityResultsOperationsClient; -import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationEligibilityResultsCollectionInner; -import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationEligibilityResultsInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * ReplicationEligibilityResultsOperationsClient. - */ -public final class ReplicationEligibilityResultsOperationsClientImpl - implements ReplicationEligibilityResultsOperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ReplicationEligibilityResultsOperationsService service; - - /** - * The service client containing this operation class. - */ - private final SiteRecoveryManagementClientImpl client; - - /** - * Initializes an instance of ReplicationEligibilityResultsOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ReplicationEligibilityResultsOperationsClientImpl(SiteRecoveryManagementClientImpl client) { - this.service = RestProxy.create(ReplicationEligibilityResultsOperationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SiteRecoveryManagementClientReplicationEligibilityResultsOperations - * to be used by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SiteRecoveryManageme") - public interface ReplicationEligibilityResultsOperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}/providers/Microsoft.RecoveryServices/replicationEligibilityResults") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("virtualMachineName") String virtualMachineName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}/providers/Microsoft.RecoveryServices/replicationEligibilityResults/default") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("virtualMachineName") String virtualMachineName, @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the validation errors in case the VM is unsuitable for protection. - * - * Validates whether a given VM can be protected or not in which case returns list of errors. - * - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param virtualMachineName Virtual Machine 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 replication eligibility results collection response model along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String resourceGroupName, - String virtualMachineName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - resourceGroupName, this.client.getSubscriptionId(), virtualMachineName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the validation errors in case the VM is unsuitable for protection. - * - * Validates whether a given VM can be protected or not in which case returns list of errors. - * - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param virtualMachineName Virtual Machine 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 replication eligibility results collection response model along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String resourceGroupName, - String virtualMachineName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName 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(), resourceGroupName, - this.client.getSubscriptionId(), virtualMachineName, accept, context); - } - - /** - * Gets the validation errors in case the VM is unsuitable for protection. - * - * Validates whether a given VM can be protected or not in which case returns list of errors. - * - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param virtualMachineName Virtual Machine 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 replication eligibility results collection response model on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync(String resourceGroupName, - String virtualMachineName) { - return listWithResponseAsync(resourceGroupName, virtualMachineName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the validation errors in case the VM is unsuitable for protection. - * - * Validates whether a given VM can be protected or not in which case returns list of errors. - * - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param virtualMachineName Virtual Machine 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 replication eligibility results collection response model along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(String resourceGroupName, - String virtualMachineName, Context context) { - return listWithResponseAsync(resourceGroupName, virtualMachineName, context).block(); - } - - /** - * Gets the validation errors in case the VM is unsuitable for protection. - * - * Validates whether a given VM can be protected or not in which case returns list of errors. - * - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param virtualMachineName Virtual Machine 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 replication eligibility results collection response model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ReplicationEligibilityResultsCollectionInner list(String resourceGroupName, String virtualMachineName) { - return listWithResponse(resourceGroupName, virtualMachineName, Context.NONE).getValue(); - } - - /** - * Gets the validation errors in case the VM is unsuitable for protection. - * - * Validates whether a given VM can be protected or not in which case returns list of errors. - * - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param virtualMachineName Virtual Machine 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 replication eligibility results response model along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String virtualMachineName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - resourceGroupName, this.client.getSubscriptionId(), virtualMachineName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the validation errors in case the VM is unsuitable for protection. - * - * Validates whether a given VM can be protected or not in which case returns list of errors. - * - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param virtualMachineName Virtual Machine 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 replication eligibility results response model along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String virtualMachineName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceGroupName, - this.client.getSubscriptionId(), virtualMachineName, accept, context); - } - - /** - * Gets the validation errors in case the VM is unsuitable for protection. - * - * Validates whether a given VM can be protected or not in which case returns list of errors. - * - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param virtualMachineName Virtual Machine 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 replication eligibility results response model on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String virtualMachineName) { - return getWithResponseAsync(resourceGroupName, virtualMachineName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the validation errors in case the VM is unsuitable for protection. - * - * Validates whether a given VM can be protected or not in which case returns list of errors. - * - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param virtualMachineName Virtual Machine 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 replication eligibility results response model along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, - String virtualMachineName, Context context) { - return getWithResponseAsync(resourceGroupName, virtualMachineName, context).block(); - } - - /** - * Gets the validation errors in case the VM is unsuitable for protection. - * - * Validates whether a given VM can be protected or not in which case returns list of errors. - * - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param virtualMachineName Virtual Machine 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 replication eligibility results response model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ReplicationEligibilityResultsInner get(String resourceGroupName, String virtualMachineName) { - return getWithResponse(resourceGroupName, virtualMachineName, Context.NONE).getValue(); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionContainerMappingsClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionContainerMappingsClientImpl.java deleted file mode 100644 index 33944151acd5..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionContainerMappingsClientImpl.java +++ /dev/null @@ -1,2039 +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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationProtectionContainerMappingsClient; -import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ProtectionContainerMappingInner; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionContainerMappingInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainerMappingCollection; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveProtectionContainerMappingInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateProtectionContainerMappingInput; -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 - * ReplicationProtectionContainerMappingsClient. - */ -public final class ReplicationProtectionContainerMappingsClientImpl - implements ReplicationProtectionContainerMappingsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ReplicationProtectionContainerMappingsService service; - - /** - * The service client containing this operation class. - */ - private final SiteRecoveryManagementClientImpl client; - - /** - * Initializes an instance of ReplicationProtectionContainerMappingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ReplicationProtectionContainerMappingsClientImpl(SiteRecoveryManagementClientImpl client) { - this.service = RestProxy.create(ReplicationProtectionContainerMappingsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SiteRecoveryManagementClientReplicationProtectionContainerMappings - * to be used by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SiteRecoveryManageme") - public interface ReplicationProtectionContainerMappingsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByReplicationProtectionContainers( - @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("resourceName") String resourceName, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @PathParam("fabricName") String fabricName, - @PathParam("protectionContainerName") String protectionContainerName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("resourceName") String resourceName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @PathParam("fabricName") String fabricName, - @PathParam("protectionContainerName") String protectionContainerName, - @PathParam("mappingName") String mappingName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("resourceName") String resourceName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @PathParam("fabricName") String fabricName, - @PathParam("protectionContainerName") String protectionContainerName, - @PathParam("mappingName") String mappingName, - @BodyParam("application/json") CreateProtectionContainerMappingInput creationInput, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> purge(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("resourceName") String resourceName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @PathParam("fabricName") String fabricName, - @PathParam("protectionContainerName") String protectionContainerName, - @PathParam("mappingName") String mappingName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("resourceName") String resourceName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @PathParam("fabricName") String fabricName, - @PathParam("protectionContainerName") String protectionContainerName, - @PathParam("mappingName") String mappingName, - @BodyParam("application/json") UpdateProtectionContainerMappingInput updateInput, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}/remove") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("resourceName") String resourceName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @PathParam("fabricName") String fabricName, - @PathParam("protectionContainerName") String protectionContainerName, - @PathParam("mappingName") String mappingName, - @BodyParam("application/json") RemoveProtectionContainerMappingInput removalInput, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionContainerMappings") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("resourceName") String resourceName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByReplicationProtectionContainersNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the list of protection container mappings for a protection container. - * - * Lists the protection container mappings for a protection container. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container 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 protection container mapping collection class along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByReplicationProtectionContainersSinglePageAsync( - String resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fabricName == null) { - return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); - } - if (protectionContainerName == null) { - return Mono.error( - new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByReplicationProtectionContainers(this.client.getEndpoint(), - this.client.getApiVersion(), resourceName, resourceGroupName, this.client.getSubscriptionId(), - fabricName, protectionContainerName, accept, context)) - .>map(res -> new 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 protection container mappings for a protection container. - * - * Lists the protection container mappings for a protection container. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container 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 protection container mapping collection class along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByReplicationProtectionContainersSinglePageAsync( - String resourceName, String resourceGroupName, String fabricName, String protectionContainerName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fabricName == null) { - return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); - } - if (protectionContainerName == null) { - return Mono.error( - new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByReplicationProtectionContainers(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, - resourceGroupName, this.client.getSubscriptionId(), fabricName, protectionContainerName, accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets the list of protection container mappings for a protection container. - * - * Lists the protection container mappings for a protection container. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container 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 protection container mapping collection class as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByReplicationProtectionContainersAsync(String resourceName, - String resourceGroupName, String fabricName, String protectionContainerName) { - return new PagedFlux<>( - () -> listByReplicationProtectionContainersSinglePageAsync(resourceName, resourceGroupName, fabricName, - protectionContainerName), - nextLink -> listByReplicationProtectionContainersNextSinglePageAsync(nextLink)); - } - - /** - * Gets the list of protection container mappings for a protection container. - * - * Lists the protection container mappings for a protection container. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container 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 protection container mapping collection class as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByReplicationProtectionContainersAsync(String resourceName, - String resourceGroupName, String fabricName, String protectionContainerName, Context context) { - return new PagedFlux<>( - () -> listByReplicationProtectionContainersSinglePageAsync(resourceName, resourceGroupName, fabricName, - protectionContainerName, context), - nextLink -> listByReplicationProtectionContainersNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the list of protection container mappings for a protection container. - * - * Lists the protection container mappings for a protection container. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container 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 protection container mapping collection class as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByReplicationProtectionContainers(String resourceName, - String resourceGroupName, String fabricName, String protectionContainerName) { - return new PagedIterable<>(listByReplicationProtectionContainersAsync(resourceName, resourceGroupName, - fabricName, protectionContainerName)); - } - - /** - * Gets the list of protection container mappings for a protection container. - * - * Lists the protection container mappings for a protection container. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container 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 protection container mapping collection class as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByReplicationProtectionContainers(String resourceName, - String resourceGroupName, String fabricName, String protectionContainerName, Context context) { - return new PagedIterable<>(listByReplicationProtectionContainersAsync(resourceName, resourceGroupName, - fabricName, protectionContainerName, context)); - } - - /** - * Gets a protection container mapping. - * - * Gets the details of a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection Container mapping name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a protection container mapping along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceName, - String resourceGroupName, String fabricName, String protectionContainerName, String mappingName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fabricName == null) { - return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); - } - if (protectionContainerName == null) { - return Mono.error( - new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); - } - if (mappingName == null) { - return Mono.error(new IllegalArgumentException("Parameter mappingName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, - resourceGroupName, this.client.getSubscriptionId(), fabricName, protectionContainerName, mappingName, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a protection container mapping. - * - * Gets the details of a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection Container mapping name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a protection container mapping along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceName, - String resourceGroupName, String fabricName, String protectionContainerName, String mappingName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fabricName == null) { - return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); - } - if (protectionContainerName == null) { - return Mono.error( - new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); - } - if (mappingName == null) { - return Mono.error(new IllegalArgumentException("Parameter mappingName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, resourceGroupName, - this.client.getSubscriptionId(), fabricName, protectionContainerName, mappingName, accept, context); - } - - /** - * Gets a protection container mapping. - * - * Gets the details of a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection Container mapping name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a protection container mapping on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceName, String resourceGroupName, - String fabricName, String protectionContainerName, String mappingName) { - return getWithResponseAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a protection container mapping. - * - * Gets the details of a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection Container mapping name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a protection container mapping along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceName, String resourceGroupName, - String fabricName, String protectionContainerName, String mappingName, Context context) { - return getWithResponseAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, - context).block(); - } - - /** - * Gets a protection container mapping. - * - * Gets the details of a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection Container mapping name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a protection container mapping. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProtectionContainerMappingInner get(String resourceName, String resourceGroupName, String fabricName, - String protectionContainerName, String mappingName) { - return getWithResponse(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, - Context.NONE).getValue(); - } - - /** - * Create protection container mapping. - * - * The operation to create a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param creationInput Mapping creation input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return protection container mapping object along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String resourceName, String resourceGroupName, - String fabricName, String protectionContainerName, String mappingName, - CreateProtectionContainerMappingInput creationInput) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fabricName == null) { - return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); - } - if (protectionContainerName == null) { - return Mono.error( - new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); - } - if (mappingName == null) { - return Mono.error(new IllegalArgumentException("Parameter mappingName is required and cannot be null.")); - } - if (creationInput == null) { - return Mono.error(new IllegalArgumentException("Parameter creationInput is required and cannot be null.")); - } else { - creationInput.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, - resourceGroupName, this.client.getSubscriptionId(), fabricName, protectionContainerName, mappingName, - creationInput, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create protection container mapping. - * - * The operation to create a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param creationInput Mapping creation input. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return protection container mapping object along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String resourceName, String resourceGroupName, - String fabricName, String protectionContainerName, String mappingName, - CreateProtectionContainerMappingInput creationInput, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fabricName == null) { - return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); - } - if (protectionContainerName == null) { - return Mono.error( - new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); - } - if (mappingName == null) { - return Mono.error(new IllegalArgumentException("Parameter mappingName is required and cannot be null.")); - } - if (creationInput == null) { - return Mono.error(new IllegalArgumentException("Parameter creationInput is required and cannot be null.")); - } else { - creationInput.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, resourceGroupName, - this.client.getSubscriptionId(), fabricName, protectionContainerName, mappingName, creationInput, accept, - context); - } - - /** - * Create protection container mapping. - * - * The operation to create a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param creationInput Mapping creation input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 protection container mapping object. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ProtectionContainerMappingInner> beginCreateAsync( - String resourceName, String resourceGroupName, String fabricName, String protectionContainerName, - String mappingName, CreateProtectionContainerMappingInput creationInput) { - Mono>> mono = createWithResponseAsync(resourceName, resourceGroupName, fabricName, - protectionContainerName, mappingName, creationInput); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ProtectionContainerMappingInner.class, ProtectionContainerMappingInner.class, - this.client.getContext()); - } - - /** - * Create protection container mapping. - * - * The operation to create a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param creationInput Mapping creation input. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 protection container mapping object. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ProtectionContainerMappingInner> beginCreateAsync( - String resourceName, String resourceGroupName, String fabricName, String protectionContainerName, - String mappingName, CreateProtectionContainerMappingInput creationInput, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createWithResponseAsync(resourceName, resourceGroupName, fabricName, - protectionContainerName, mappingName, creationInput, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ProtectionContainerMappingInner.class, ProtectionContainerMappingInner.class, - context); - } - - /** - * Create protection container mapping. - * - * The operation to create a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param creationInput Mapping creation input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of protection container mapping object. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ProtectionContainerMappingInner> beginCreate( - String resourceName, String resourceGroupName, String fabricName, String protectionContainerName, - String mappingName, CreateProtectionContainerMappingInput creationInput) { - return this.beginCreateAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, - creationInput).getSyncPoller(); - } - - /** - * Create protection container mapping. - * - * The operation to create a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param creationInput Mapping creation input. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of protection container mapping object. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ProtectionContainerMappingInner> beginCreate( - String resourceName, String resourceGroupName, String fabricName, String protectionContainerName, - String mappingName, CreateProtectionContainerMappingInput creationInput, Context context) { - return this.beginCreateAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, - creationInput, context).getSyncPoller(); - } - - /** - * Create protection container mapping. - * - * The operation to create a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param creationInput Mapping creation input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return protection container mapping object on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceName, String resourceGroupName, - String fabricName, String protectionContainerName, String mappingName, - CreateProtectionContainerMappingInput creationInput) { - return beginCreateAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, - creationInput).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create protection container mapping. - * - * The operation to create a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param creationInput Mapping creation input. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return protection container mapping object on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceName, String resourceGroupName, - String fabricName, String protectionContainerName, String mappingName, - CreateProtectionContainerMappingInput creationInput, Context context) { - return beginCreateAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, - creationInput, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create protection container mapping. - * - * The operation to create a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param creationInput Mapping creation input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return protection container mapping object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProtectionContainerMappingInner create(String resourceName, String resourceGroupName, String fabricName, - String protectionContainerName, String mappingName, CreateProtectionContainerMappingInput creationInput) { - return createAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, - creationInput).block(); - } - - /** - * Create protection container mapping. - * - * The operation to create a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param creationInput Mapping creation input. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return protection container mapping object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProtectionContainerMappingInner create(String resourceName, String resourceGroupName, String fabricName, - String protectionContainerName, String mappingName, CreateProtectionContainerMappingInput creationInput, - Context context) { - return createAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, - creationInput, context).block(); - } - - /** - * Purge protection container mapping. - * - * The operation to purge(force delete) a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> purgeWithResponseAsync(String resourceName, String resourceGroupName, - String fabricName, String protectionContainerName, String mappingName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fabricName == null) { - return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); - } - if (protectionContainerName == null) { - return Mono.error( - new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); - } - if (mappingName == null) { - return Mono.error(new IllegalArgumentException("Parameter mappingName is required and cannot be null.")); - } - return FluxUtil - .withContext(context -> service.purge(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, - resourceGroupName, this.client.getSubscriptionId(), fabricName, protectionContainerName, mappingName, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Purge protection container mapping. - * - * The operation to purge(force delete) a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> purgeWithResponseAsync(String resourceName, String resourceGroupName, - String fabricName, String protectionContainerName, String mappingName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fabricName == null) { - return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); - } - if (protectionContainerName == null) { - return Mono.error( - new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); - } - if (mappingName == null) { - return Mono.error(new IllegalArgumentException("Parameter mappingName is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service.purge(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, resourceGroupName, - this.client.getSubscriptionId(), fabricName, protectionContainerName, mappingName, context); - } - - /** - * Purge protection container mapping. - * - * The operation to purge(force delete) a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginPurgeAsync(String resourceName, String resourceGroupName, - String fabricName, String protectionContainerName, String mappingName) { - Mono>> mono - = purgeWithResponseAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Purge protection container mapping. - * - * The operation to purge(force delete) a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginPurgeAsync(String resourceName, String resourceGroupName, - String fabricName, String protectionContainerName, String mappingName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = purgeWithResponseAsync(resourceName, resourceGroupName, fabricName, - protectionContainerName, mappingName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Purge protection container mapping. - * - * The operation to purge(force delete) a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginPurge(String resourceName, String resourceGroupName, - String fabricName, String protectionContainerName, String mappingName) { - return this.beginPurgeAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName) - .getSyncPoller(); - } - - /** - * Purge protection container mapping. - * - * The operation to purge(force delete) a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginPurge(String resourceName, String resourceGroupName, - String fabricName, String protectionContainerName, String mappingName, Context context) { - return this - .beginPurgeAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, context) - .getSyncPoller(); - } - - /** - * Purge protection container mapping. - * - * The operation to purge(force delete) a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono purgeAsync(String resourceName, String resourceGroupName, String fabricName, - String protectionContainerName, String mappingName) { - return beginPurgeAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Purge protection container mapping. - * - * The operation to purge(force delete) a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono purgeAsync(String resourceName, String resourceGroupName, String fabricName, - String protectionContainerName, String mappingName, Context context) { - return beginPurgeAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, - context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Purge protection container mapping. - * - * The operation to purge(force delete) a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void purge(String resourceName, String resourceGroupName, String fabricName, String protectionContainerName, - String mappingName) { - purgeAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName).block(); - } - - /** - * Purge protection container mapping. - * - * The operation to purge(force delete) a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void purge(String resourceName, String resourceGroupName, String fabricName, String protectionContainerName, - String mappingName, Context context) { - purgeAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, context).block(); - } - - /** - * Update protection container mapping. - * - * The operation to update protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param updateInput Mapping update input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return protection container mapping object along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceName, String resourceGroupName, - String fabricName, String protectionContainerName, String mappingName, - UpdateProtectionContainerMappingInput updateInput) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fabricName == null) { - return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); - } - if (protectionContainerName == null) { - return Mono.error( - new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); - } - if (mappingName == null) { - return Mono.error(new IllegalArgumentException("Parameter mappingName is required and cannot be null.")); - } - if (updateInput == null) { - return Mono.error(new IllegalArgumentException("Parameter updateInput is required and cannot be null.")); - } else { - updateInput.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, - resourceGroupName, this.client.getSubscriptionId(), fabricName, protectionContainerName, mappingName, - updateInput, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update protection container mapping. - * - * The operation to update protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param updateInput Mapping update input. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return protection container mapping object along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceName, String resourceGroupName, - String fabricName, String protectionContainerName, String mappingName, - UpdateProtectionContainerMappingInput updateInput, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fabricName == null) { - return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); - } - if (protectionContainerName == null) { - return Mono.error( - new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); - } - if (mappingName == null) { - return Mono.error(new IllegalArgumentException("Parameter mappingName is required and cannot be null.")); - } - if (updateInput == null) { - return Mono.error(new IllegalArgumentException("Parameter updateInput is required and cannot be null.")); - } else { - updateInput.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, resourceGroupName, - this.client.getSubscriptionId(), fabricName, protectionContainerName, mappingName, updateInput, accept, - context); - } - - /** - * Update protection container mapping. - * - * The operation to update protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param updateInput Mapping update input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 protection container mapping object. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ProtectionContainerMappingInner> beginUpdateAsync( - String resourceName, String resourceGroupName, String fabricName, String protectionContainerName, - String mappingName, UpdateProtectionContainerMappingInput updateInput) { - Mono>> mono = updateWithResponseAsync(resourceName, resourceGroupName, fabricName, - protectionContainerName, mappingName, updateInput); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ProtectionContainerMappingInner.class, ProtectionContainerMappingInner.class, - this.client.getContext()); - } - - /** - * Update protection container mapping. - * - * The operation to update protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param updateInput Mapping update input. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 protection container mapping object. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ProtectionContainerMappingInner> beginUpdateAsync( - String resourceName, String resourceGroupName, String fabricName, String protectionContainerName, - String mappingName, UpdateProtectionContainerMappingInput updateInput, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = updateWithResponseAsync(resourceName, resourceGroupName, fabricName, - protectionContainerName, mappingName, updateInput, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ProtectionContainerMappingInner.class, ProtectionContainerMappingInner.class, - context); - } - - /** - * Update protection container mapping. - * - * The operation to update protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param updateInput Mapping update input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of protection container mapping object. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ProtectionContainerMappingInner> beginUpdate( - String resourceName, String resourceGroupName, String fabricName, String protectionContainerName, - String mappingName, UpdateProtectionContainerMappingInput updateInput) { - return this.beginUpdateAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, - updateInput).getSyncPoller(); - } - - /** - * Update protection container mapping. - * - * The operation to update protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param updateInput Mapping update input. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of protection container mapping object. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ProtectionContainerMappingInner> beginUpdate( - String resourceName, String resourceGroupName, String fabricName, String protectionContainerName, - String mappingName, UpdateProtectionContainerMappingInput updateInput, Context context) { - return this.beginUpdateAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, - updateInput, context).getSyncPoller(); - } - - /** - * Update protection container mapping. - * - * The operation to update protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param updateInput Mapping update input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return protection container mapping object on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceName, String resourceGroupName, - String fabricName, String protectionContainerName, String mappingName, - UpdateProtectionContainerMappingInput updateInput) { - return beginUpdateAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, - updateInput).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update protection container mapping. - * - * The operation to update protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param updateInput Mapping update input. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return protection container mapping object on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceName, String resourceGroupName, - String fabricName, String protectionContainerName, String mappingName, - UpdateProtectionContainerMappingInput updateInput, Context context) { - return beginUpdateAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, - updateInput, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update protection container mapping. - * - * The operation to update protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param updateInput Mapping update input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return protection container mapping object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProtectionContainerMappingInner update(String resourceName, String resourceGroupName, String fabricName, - String protectionContainerName, String mappingName, UpdateProtectionContainerMappingInput updateInput) { - return updateAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, - updateInput).block(); - } - - /** - * Update protection container mapping. - * - * The operation to update protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param updateInput Mapping update input. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return protection container mapping object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProtectionContainerMappingInner update(String resourceName, String resourceGroupName, String fabricName, - String protectionContainerName, String mappingName, UpdateProtectionContainerMappingInput updateInput, - Context context) { - return updateAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, - updateInput, context).block(); - } - - /** - * Remove protection container mapping. - * - * The operation to delete or remove a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param removalInput Removal input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if 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 resourceName, String resourceGroupName, - String fabricName, String protectionContainerName, String mappingName, - RemoveProtectionContainerMappingInput removalInput) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fabricName == null) { - return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); - } - if (protectionContainerName == null) { - return Mono.error( - new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); - } - if (mappingName == null) { - return Mono.error(new IllegalArgumentException("Parameter mappingName is required and cannot be null.")); - } - if (removalInput == null) { - return Mono.error(new IllegalArgumentException("Parameter removalInput is required and cannot be null.")); - } else { - removalInput.validate(); - } - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, - resourceGroupName, this.client.getSubscriptionId(), fabricName, protectionContainerName, mappingName, - removalInput, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Remove protection container mapping. - * - * The operation to delete or remove a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param removalInput Removal input. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if 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 resourceName, String resourceGroupName, - String fabricName, String protectionContainerName, String mappingName, - RemoveProtectionContainerMappingInput removalInput, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fabricName == null) { - return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); - } - if (protectionContainerName == null) { - return Mono.error( - new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); - } - if (mappingName == null) { - return Mono.error(new IllegalArgumentException("Parameter mappingName is required and cannot be null.")); - } - if (removalInput == null) { - return Mono.error(new IllegalArgumentException("Parameter removalInput is required and cannot be null.")); - } else { - removalInput.validate(); - } - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, resourceGroupName, - this.client.getSubscriptionId(), fabricName, protectionContainerName, mappingName, removalInput, context); - } - - /** - * Remove protection container mapping. - * - * The operation to delete or remove a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param removalInput Removal input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 resourceName, String resourceGroupName, - String fabricName, String protectionContainerName, String mappingName, - RemoveProtectionContainerMappingInput removalInput) { - Mono>> mono = deleteWithResponseAsync(resourceName, resourceGroupName, fabricName, - protectionContainerName, mappingName, removalInput); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Remove protection container mapping. - * - * The operation to delete or remove a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param removalInput Removal input. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 resourceName, String resourceGroupName, - String fabricName, String protectionContainerName, String mappingName, - RemoveProtectionContainerMappingInput removalInput, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceName, resourceGroupName, fabricName, - protectionContainerName, mappingName, removalInput, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Remove protection container mapping. - * - * The operation to delete or remove a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param removalInput Removal input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is 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 resourceName, String resourceGroupName, - String fabricName, String protectionContainerName, String mappingName, - RemoveProtectionContainerMappingInput removalInput) { - return this.beginDeleteAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, - removalInput).getSyncPoller(); - } - - /** - * Remove protection container mapping. - * - * The operation to delete or remove a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param removalInput Removal input. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is 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 resourceName, String resourceGroupName, - String fabricName, String protectionContainerName, String mappingName, - RemoveProtectionContainerMappingInput removalInput, Context context) { - return this.beginDeleteAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, - removalInput, context).getSyncPoller(); - } - - /** - * Remove protection container mapping. - * - * The operation to delete or remove a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param removalInput Removal input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 resourceName, String resourceGroupName, String fabricName, - String protectionContainerName, String mappingName, RemoveProtectionContainerMappingInput removalInput) { - return beginDeleteAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, - removalInput).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Remove protection container mapping. - * - * The operation to delete or remove a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param removalInput Removal input. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 resourceName, String resourceGroupName, String fabricName, - String protectionContainerName, String mappingName, RemoveProtectionContainerMappingInput removalInput, - Context context) { - return beginDeleteAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, - removalInput, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Remove protection container mapping. - * - * The operation to delete or remove a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param removalInput Removal input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 resourceName, String resourceGroupName, String fabricName, String protectionContainerName, - String mappingName, RemoveProtectionContainerMappingInput removalInput) { - deleteAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, removalInput) - .block(); - } - - /** - * Remove protection container mapping. - * - * The operation to delete or remove a protection container mapping. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param protectionContainerName Protection container name. - * @param mappingName Protection container mapping name. - * @param removalInput Removal input. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 resourceName, String resourceGroupName, String fabricName, String protectionContainerName, - String mappingName, RemoveProtectionContainerMappingInput removalInput, Context context) { - deleteAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, removalInput, - context).block(); - } - - /** - * Gets the list of all protection container mappings in a vault. - * - * Lists the protection container mappings in the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return protection container mapping collection class along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceName, - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName 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.list(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, - resourceGroupName, this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the list of all protection container mappings in a vault. - * - * Lists the protection container mappings in the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return protection container mapping collection class along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceName, - 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 (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName 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 - .list(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, resourceGroupName, - this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets the list of all protection container mappings in a vault. - * - * Lists the protection container mappings in the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return protection container mapping collection class as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceName, String resourceGroupName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceName, resourceGroupName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the list of all protection container mappings in a vault. - * - * Lists the protection container mappings in the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return protection container mapping collection class as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceName, String resourceGroupName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceName, resourceGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the list of all protection container mappings in a vault. - * - * Lists the protection container mappings in the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return protection container mapping collection class as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceName, String resourceGroupName) { - return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); - } - - /** - * Gets the list of all protection container mappings in a vault. - * - * Lists the protection container mappings in the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return protection container mapping collection class as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceName, String resourceGroupName, - Context context) { - return new PagedIterable<>(listAsync(resourceName, resourceGroupName, 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 protection container mapping collection class along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByReplicationProtectionContainersNextSinglePageAsync(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.listByReplicationProtectionContainersNext(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 protection container mapping collection class along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByReplicationProtectionContainersNextSinglePageAsync(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.listByReplicationProtectionContainersNext(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 protection container mapping collection class 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 protection container mapping collection class 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationRecoveryServicesProvidersClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationRecoveryServicesProvidersClientImpl.java deleted file mode 100644 index fb35a8fad6c2..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationRecoveryServicesProvidersClientImpl.java +++ /dev/null @@ -1,1859 +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.recoveryservicessiterecovery.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.ReplicationRecoveryServicesProvidersClient; -import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.RecoveryServicesProviderInner; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.AddRecoveryServicesProviderInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryServicesProviderCollection; -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 - * ReplicationRecoveryServicesProvidersClient. - */ -public final class ReplicationRecoveryServicesProvidersClientImpl - implements ReplicationRecoveryServicesProvidersClient { - /** - * The proxy service used to perform REST calls. - */ - private final ReplicationRecoveryServicesProvidersService service; - - /** - * The service client containing this operation class. - */ - private final SiteRecoveryManagementClientImpl client; - - /** - * Initializes an instance of ReplicationRecoveryServicesProvidersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ReplicationRecoveryServicesProvidersClientImpl(SiteRecoveryManagementClientImpl client) { - this.service = RestProxy.create(ReplicationRecoveryServicesProvidersService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SiteRecoveryManagementClientReplicationRecoveryServicesProviders to - * be used by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SiteRecoveryManageme") - public interface ReplicationRecoveryServicesProvidersService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByReplicationFabrics(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("resourceName") String resourceName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @PathParam("fabricName") String fabricName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("resourceName") String resourceName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @PathParam("fabricName") String fabricName, - @PathParam("providerName") String providerName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("resourceName") String resourceName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @PathParam("fabricName") String fabricName, - @PathParam("providerName") String providerName, - @BodyParam("application/json") AddRecoveryServicesProviderInput addProviderInput, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> purge(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("resourceName") String resourceName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @PathParam("fabricName") String fabricName, - @PathParam("providerName") String providerName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/refreshProvider") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> refreshProvider(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("resourceName") String resourceName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @PathParam("fabricName") String fabricName, - @PathParam("providerName") String providerName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/remove") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("resourceName") String resourceName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @PathParam("fabricName") String fabricName, - @PathParam("providerName") String providerName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryServicesProviders") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("resourceName") String resourceName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByReplicationFabricsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the list of registered recovery services providers for the fabric. - * - * Lists the registered recovery services providers for the specified fabric. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric 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 collection of providers along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByReplicationFabricsSinglePageAsync(String resourceName, String resourceGroupName, String fabricName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fabricName == null) { - return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByReplicationFabrics(this.client.getEndpoint(), this.client.getApiVersion(), - resourceName, resourceGroupName, this.client.getSubscriptionId(), fabricName, accept, context)) - .>map(res -> new 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 registered recovery services providers for the fabric. - * - * Lists the registered recovery services providers for the specified fabric. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric 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 collection of providers along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByReplicationFabricsSinglePageAsync( - String resourceName, String resourceGroupName, String fabricName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fabricName == null) { - return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByReplicationFabrics(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, - resourceGroupName, this.client.getSubscriptionId(), fabricName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets the list of registered recovery services providers for the fabric. - * - * Lists the registered recovery services providers for the specified fabric. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric 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 collection of providers as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByReplicationFabricsAsync(String resourceName, - String resourceGroupName, String fabricName) { - return new PagedFlux<>( - () -> listByReplicationFabricsSinglePageAsync(resourceName, resourceGroupName, fabricName), - nextLink -> listByReplicationFabricsNextSinglePageAsync(nextLink)); - } - - /** - * Gets the list of registered recovery services providers for the fabric. - * - * Lists the registered recovery services providers for the specified fabric. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric 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 collection of providers as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByReplicationFabricsAsync(String resourceName, - String resourceGroupName, String fabricName, Context context) { - return new PagedFlux<>( - () -> listByReplicationFabricsSinglePageAsync(resourceName, resourceGroupName, fabricName, context), - nextLink -> listByReplicationFabricsNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the list of registered recovery services providers for the fabric. - * - * Lists the registered recovery services providers for the specified fabric. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric 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 collection of providers as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByReplicationFabrics(String resourceName, - String resourceGroupName, String fabricName) { - return new PagedIterable<>(listByReplicationFabricsAsync(resourceName, resourceGroupName, fabricName)); - } - - /** - * Gets the list of registered recovery services providers for the fabric. - * - * Lists the registered recovery services providers for the specified fabric. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric 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 collection of providers as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByReplicationFabrics(String resourceName, - String resourceGroupName, String fabricName, Context context) { - return new PagedIterable<>(listByReplicationFabricsAsync(resourceName, resourceGroupName, fabricName, context)); - } - - /** - * Gets the details of a recovery services provider. - * - * Gets the details of registered recovery services provider. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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 details of registered recovery services provider along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceName, - String resourceGroupName, String fabricName, String providerName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fabricName == null) { - return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); - } - if (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, - resourceGroupName, this.client.getSubscriptionId(), fabricName, providerName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the details of a recovery services provider. - * - * Gets the details of registered recovery services provider. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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 details of registered recovery services provider along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceName, - String resourceGroupName, String fabricName, String providerName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fabricName == null) { - return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); - } - if (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, resourceGroupName, - this.client.getSubscriptionId(), fabricName, providerName, accept, context); - } - - /** - * Gets the details of a recovery services provider. - * - * Gets the details of registered recovery services provider. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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 details of registered recovery services provider on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceName, String resourceGroupName, - String fabricName, String providerName) { - return getWithResponseAsync(resourceName, resourceGroupName, fabricName, providerName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the details of a recovery services provider. - * - * Gets the details of registered recovery services provider. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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 details of registered recovery services provider along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceName, String resourceGroupName, - String fabricName, String providerName, Context context) { - return getWithResponseAsync(resourceName, resourceGroupName, fabricName, providerName, context).block(); - } - - /** - * Gets the details of a recovery services provider. - * - * Gets the details of registered recovery services provider. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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 details of registered recovery services provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RecoveryServicesProviderInner get(String resourceName, String resourceGroupName, String fabricName, - String providerName) { - return getWithResponse(resourceName, resourceGroupName, fabricName, providerName, Context.NONE).getValue(); - } - - /** - * Adds a recovery services provider. - * - * The operation to add a recovery services provider. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider name. - * @param addProviderInput Add provider input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider details along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String resourceName, String resourceGroupName, - String fabricName, String providerName, AddRecoveryServicesProviderInput addProviderInput) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fabricName == null) { - return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); - } - if (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); - } - if (addProviderInput == null) { - return Mono - .error(new IllegalArgumentException("Parameter addProviderInput is required and cannot be null.")); - } else { - addProviderInput.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, - resourceGroupName, this.client.getSubscriptionId(), fabricName, providerName, addProviderInput, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Adds a recovery services provider. - * - * The operation to add a recovery services provider. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider name. - * @param addProviderInput Add provider input. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider details along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String resourceName, String resourceGroupName, - String fabricName, String providerName, AddRecoveryServicesProviderInput addProviderInput, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fabricName == null) { - return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); - } - if (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); - } - if (addProviderInput == null) { - return Mono - .error(new IllegalArgumentException("Parameter addProviderInput is required and cannot be null.")); - } else { - addProviderInput.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, resourceGroupName, - this.client.getSubscriptionId(), fabricName, providerName, addProviderInput, accept, context); - } - - /** - * Adds a recovery services provider. - * - * The operation to add a recovery services provider. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider name. - * @param addProviderInput Add provider input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 provider details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, RecoveryServicesProviderInner> beginCreateAsync( - String resourceName, String resourceGroupName, String fabricName, String providerName, - AddRecoveryServicesProviderInput addProviderInput) { - Mono>> mono - = createWithResponseAsync(resourceName, resourceGroupName, fabricName, providerName, addProviderInput); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), RecoveryServicesProviderInner.class, RecoveryServicesProviderInner.class, - this.client.getContext()); - } - - /** - * Adds a recovery services provider. - * - * The operation to add a recovery services provider. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider name. - * @param addProviderInput Add provider input. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 provider details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, RecoveryServicesProviderInner> beginCreateAsync( - String resourceName, String resourceGroupName, String fabricName, String providerName, - AddRecoveryServicesProviderInput addProviderInput, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createWithResponseAsync(resourceName, resourceGroupName, fabricName, - providerName, addProviderInput, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), RecoveryServicesProviderInner.class, RecoveryServicesProviderInner.class, - context); - } - - /** - * Adds a recovery services provider. - * - * The operation to add a recovery services provider. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider name. - * @param addProviderInput Add provider input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of provider details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, RecoveryServicesProviderInner> beginCreate( - String resourceName, String resourceGroupName, String fabricName, String providerName, - AddRecoveryServicesProviderInput addProviderInput) { - return this.beginCreateAsync(resourceName, resourceGroupName, fabricName, providerName, addProviderInput) - .getSyncPoller(); - } - - /** - * Adds a recovery services provider. - * - * The operation to add a recovery services provider. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider name. - * @param addProviderInput Add provider input. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of provider details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, RecoveryServicesProviderInner> beginCreate( - String resourceName, String resourceGroupName, String fabricName, String providerName, - AddRecoveryServicesProviderInput addProviderInput, Context context) { - return this - .beginCreateAsync(resourceName, resourceGroupName, fabricName, providerName, addProviderInput, context) - .getSyncPoller(); - } - - /** - * Adds a recovery services provider. - * - * The operation to add a recovery services provider. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider name. - * @param addProviderInput Add provider input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider details on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceName, String resourceGroupName, - String fabricName, String providerName, AddRecoveryServicesProviderInput addProviderInput) { - return beginCreateAsync(resourceName, resourceGroupName, fabricName, providerName, addProviderInput).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Adds a recovery services provider. - * - * The operation to add a recovery services provider. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider name. - * @param addProviderInput Add provider input. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider details on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceName, String resourceGroupName, - String fabricName, String providerName, AddRecoveryServicesProviderInput addProviderInput, Context context) { - return beginCreateAsync(resourceName, resourceGroupName, fabricName, providerName, addProviderInput, context) - .last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Adds a recovery services provider. - * - * The operation to add a recovery services provider. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider name. - * @param addProviderInput Add provider input. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RecoveryServicesProviderInner create(String resourceName, String resourceGroupName, String fabricName, - String providerName, AddRecoveryServicesProviderInput addProviderInput) { - return createAsync(resourceName, resourceGroupName, fabricName, providerName, addProviderInput).block(); - } - - /** - * Adds a recovery services provider. - * - * The operation to add a recovery services provider. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider name. - * @param addProviderInput Add provider input. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RecoveryServicesProviderInner create(String resourceName, String resourceGroupName, String fabricName, - String providerName, AddRecoveryServicesProviderInput addProviderInput, Context context) { - return createAsync(resourceName, resourceGroupName, fabricName, providerName, addProviderInput, context) - .block(); - } - - /** - * Purges recovery service provider from fabric. - * - * The operation to purge(force delete) a recovery services provider from the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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>> purgeWithResponseAsync(String resourceName, String resourceGroupName, - String fabricName, String providerName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fabricName == null) { - return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); - } - if (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); - } - return FluxUtil - .withContext(context -> service.purge(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, - resourceGroupName, this.client.getSubscriptionId(), fabricName, providerName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Purges recovery service provider from fabric. - * - * The operation to purge(force delete) a recovery services provider from the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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>> purgeWithResponseAsync(String resourceName, String resourceGroupName, - String fabricName, String providerName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fabricName == null) { - return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); - } - if (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service.purge(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, resourceGroupName, - this.client.getSubscriptionId(), fabricName, providerName, context); - } - - /** - * Purges recovery service provider from fabric. - * - * The operation to purge(force delete) a recovery services provider from the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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> beginPurgeAsync(String resourceName, String resourceGroupName, - String fabricName, String providerName) { - Mono>> mono - = purgeWithResponseAsync(resourceName, resourceGroupName, fabricName, providerName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Purges recovery service provider from fabric. - * - * The operation to purge(force delete) a recovery services provider from the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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> beginPurgeAsync(String resourceName, String resourceGroupName, - String fabricName, String providerName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = purgeWithResponseAsync(resourceName, resourceGroupName, fabricName, providerName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Purges recovery service provider from fabric. - * - * The operation to purge(force delete) a recovery services provider from the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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> beginPurge(String resourceName, String resourceGroupName, - String fabricName, String providerName) { - return this.beginPurgeAsync(resourceName, resourceGroupName, fabricName, providerName).getSyncPoller(); - } - - /** - * Purges recovery service provider from fabric. - * - * The operation to purge(force delete) a recovery services provider from the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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> beginPurge(String resourceName, String resourceGroupName, - String fabricName, String providerName, Context context) { - return this.beginPurgeAsync(resourceName, resourceGroupName, fabricName, providerName, context).getSyncPoller(); - } - - /** - * Purges recovery service provider from fabric. - * - * The operation to purge(force delete) a recovery services provider from the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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 purgeAsync(String resourceName, String resourceGroupName, String fabricName, - String providerName) { - return beginPurgeAsync(resourceName, resourceGroupName, fabricName, providerName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Purges recovery service provider from fabric. - * - * The operation to purge(force delete) a recovery services provider from the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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 purgeAsync(String resourceName, String resourceGroupName, String fabricName, String providerName, - Context context) { - return beginPurgeAsync(resourceName, resourceGroupName, fabricName, providerName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Purges recovery service provider from fabric. - * - * The operation to purge(force delete) a recovery services provider from the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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 purge(String resourceName, String resourceGroupName, String fabricName, String providerName) { - purgeAsync(resourceName, resourceGroupName, fabricName, providerName).block(); - } - - /** - * Purges recovery service provider from fabric. - * - * The operation to purge(force delete) a recovery services provider from the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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 purge(String resourceName, String resourceGroupName, String fabricName, String providerName, - Context context) { - purgeAsync(resourceName, resourceGroupName, fabricName, providerName, context).block(); - } - - /** - * Refresh details from the recovery services provider. - * - * The operation to refresh the information from the recovery services provider. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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 provider details along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> refreshProviderWithResponseAsync(String resourceName, - String resourceGroupName, String fabricName, String providerName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fabricName == null) { - return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); - } - if (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.refreshProvider(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, - resourceGroupName, this.client.getSubscriptionId(), fabricName, providerName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Refresh details from the recovery services provider. - * - * The operation to refresh the information from the recovery services provider. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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 provider details along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> refreshProviderWithResponseAsync(String resourceName, - String resourceGroupName, String fabricName, String providerName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fabricName == null) { - return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); - } - if (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.refreshProvider(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, - resourceGroupName, this.client.getSubscriptionId(), fabricName, providerName, accept, context); - } - - /** - * Refresh details from the recovery services provider. - * - * The operation to refresh the information from the recovery services provider. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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 provider details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, RecoveryServicesProviderInner> - beginRefreshProviderAsync(String resourceName, String resourceGroupName, String fabricName, - String providerName) { - Mono>> mono - = refreshProviderWithResponseAsync(resourceName, resourceGroupName, fabricName, providerName); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), RecoveryServicesProviderInner.class, RecoveryServicesProviderInner.class, - this.client.getContext()); - } - - /** - * Refresh details from the recovery services provider. - * - * The operation to refresh the information from the recovery services provider. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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 provider details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, RecoveryServicesProviderInner> - beginRefreshProviderAsync(String resourceName, String resourceGroupName, String fabricName, String providerName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = refreshProviderWithResponseAsync(resourceName, resourceGroupName, fabricName, providerName, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), RecoveryServicesProviderInner.class, RecoveryServicesProviderInner.class, - context); - } - - /** - * Refresh details from the recovery services provider. - * - * The operation to refresh the information from the recovery services provider. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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 provider details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, RecoveryServicesProviderInner> - beginRefreshProvider(String resourceName, String resourceGroupName, String fabricName, String providerName) { - return this.beginRefreshProviderAsync(resourceName, resourceGroupName, fabricName, providerName) - .getSyncPoller(); - } - - /** - * Refresh details from the recovery services provider. - * - * The operation to refresh the information from the recovery services provider. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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 provider details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, RecoveryServicesProviderInner> beginRefreshProvider( - String resourceName, String resourceGroupName, String fabricName, String providerName, Context context) { - return this.beginRefreshProviderAsync(resourceName, resourceGroupName, fabricName, providerName, context) - .getSyncPoller(); - } - - /** - * Refresh details from the recovery services provider. - * - * The operation to refresh the information from the recovery services provider. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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 provider details on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono refreshProviderAsync(String resourceName, String resourceGroupName, - String fabricName, String providerName) { - return beginRefreshProviderAsync(resourceName, resourceGroupName, fabricName, providerName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Refresh details from the recovery services provider. - * - * The operation to refresh the information from the recovery services provider. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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 provider details on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono refreshProviderAsync(String resourceName, String resourceGroupName, - String fabricName, String providerName, Context context) { - return beginRefreshProviderAsync(resourceName, resourceGroupName, fabricName, providerName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Refresh details from the recovery services provider. - * - * The operation to refresh the information from the recovery services provider. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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 provider details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RecoveryServicesProviderInner refreshProvider(String resourceName, String resourceGroupName, - String fabricName, String providerName) { - return refreshProviderAsync(resourceName, resourceGroupName, fabricName, providerName).block(); - } - - /** - * Refresh details from the recovery services provider. - * - * The operation to refresh the information from the recovery services provider. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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 provider details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RecoveryServicesProviderInner refreshProvider(String resourceName, String resourceGroupName, - String fabricName, String providerName, Context context) { - return refreshProviderAsync(resourceName, resourceGroupName, fabricName, providerName, context).block(); - } - - /** - * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To - * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty - * we assume that it is old client and continue the old behavior). - * - * The operation to removes/delete(unregister) a recovery services provider from the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, - String fabricName, String providerName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fabricName == null) { - return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); - } - if (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); - } - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, - resourceGroupName, this.client.getSubscriptionId(), fabricName, providerName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To - * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty - * we assume that it is old client and continue the old behavior). - * - * The operation to removes/delete(unregister) a recovery services provider from the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, - String fabricName, String providerName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fabricName == null) { - return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); - } - if (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, resourceGroupName, - this.client.getSubscriptionId(), fabricName, providerName, context); - } - - /** - * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To - * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty - * we assume that it is old client and continue the old behavior). - * - * The operation to removes/delete(unregister) a recovery services provider from the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, - String fabricName, String providerName) { - Mono>> mono - = deleteWithResponseAsync(resourceName, resourceGroupName, fabricName, providerName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To - * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty - * we assume that it is old client and continue the old behavior). - * - * The operation to removes/delete(unregister) a recovery services provider from the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, - String fabricName, String providerName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceName, resourceGroupName, fabricName, providerName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To - * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty - * we assume that it is old client and continue the old behavior). - * - * The operation to removes/delete(unregister) a recovery services provider from the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, - String fabricName, String providerName) { - return this.beginDeleteAsync(resourceName, resourceGroupName, fabricName, providerName).getSyncPoller(); - } - - /** - * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To - * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty - * we assume that it is old client and continue the old behavior). - * - * The operation to removes/delete(unregister) a recovery services provider from the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, - String fabricName, String providerName, Context context) { - return this.beginDeleteAsync(resourceName, resourceGroupName, fabricName, providerName, context) - .getSyncPoller(); - } - - /** - * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To - * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty - * we assume that it is old client and continue the old behavior). - * - * The operation to removes/delete(unregister) a recovery services provider from the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, String fabricName, - String providerName) { - return beginDeleteAsync(resourceName, resourceGroupName, fabricName, providerName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To - * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty - * we assume that it is old client and continue the old behavior). - * - * The operation to removes/delete(unregister) a recovery services provider from the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, String fabricName, - String providerName, Context context) { - return beginDeleteAsync(resourceName, resourceGroupName, fabricName, providerName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To - * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty - * we assume that it is old client and continue the old behavior). - * - * The operation to removes/delete(unregister) a recovery services provider from the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, String fabricName, String providerName) { - deleteAsync(resourceName, resourceGroupName, fabricName, providerName).block(); - } - - /** - * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To - * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty - * we assume that it is old client and continue the old behavior). - * - * The operation to removes/delete(unregister) a recovery services provider from the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param fabricName Fabric name. - * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, String fabricName, String providerName, - Context context) { - deleteAsync(resourceName, resourceGroupName, fabricName, providerName, context).block(); - } - - /** - * Gets the list of registered recovery services providers in the vault. This is a view only api. - * - * Lists the registered recovery services providers in the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of providers along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceName, - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName 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.list(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, - resourceGroupName, this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the list of registered recovery services providers in the vault. This is a view only api. - * - * Lists the registered recovery services providers in the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of providers along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceName, - 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 (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName 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 - .list(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, resourceGroupName, - this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets the list of registered recovery services providers in the vault. This is a view only api. - * - * Lists the registered recovery services providers in the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of providers as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceName, String resourceGroupName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceName, resourceGroupName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the list of registered recovery services providers in the vault. This is a view only api. - * - * Lists the registered recovery services providers in the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of providers as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceName, String resourceGroupName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceName, resourceGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the list of registered recovery services providers in the vault. This is a view only api. - * - * Lists the registered recovery services providers in the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of providers as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceName, String resourceGroupName) { - return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); - } - - /** - * Gets the list of registered recovery services providers in the vault. This is a view only api. - * - * Lists the registered recovery services providers in the vault. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of providers as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceName, String resourceGroupName, - Context context) { - return new PagedIterable<>(listAsync(resourceName, resourceGroupName, 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 collection of providers along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByReplicationFabricsNextSinglePageAsync(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.listByReplicationFabricsNext(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 collection of providers along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByReplicationFabricsNextSinglePageAsync(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.listByReplicationFabricsNext(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 collection of providers 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 collection of providers 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SupportedOperatingSystemsOperationsClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SupportedOperatingSystemsOperationsClientImpl.java deleted file mode 100644 index d8547f504c35..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SupportedOperatingSystemsOperationsClientImpl.java +++ /dev/null @@ -1,196 +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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.SupportedOperatingSystemsOperationsClient; -import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.SupportedOperatingSystemsInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * SupportedOperatingSystemsOperationsClient. - */ -public final class SupportedOperatingSystemsOperationsClientImpl implements SupportedOperatingSystemsOperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final SupportedOperatingSystemsOperationsService service; - - /** - * The service client containing this operation class. - */ - private final SiteRecoveryManagementClientImpl client; - - /** - * Initializes an instance of SupportedOperatingSystemsOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SupportedOperatingSystemsOperationsClientImpl(SiteRecoveryManagementClientImpl client) { - this.service = RestProxy.create(SupportedOperatingSystemsOperationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SiteRecoveryManagementClientSupportedOperatingSystemsOperations to - * be used by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SiteRecoveryManageme") - public interface SupportedOperatingSystemsOperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationSupportedOperatingSystems") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("resourceName") String resourceName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("instanceType") String instanceType, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the data of supported operating systems by SRS. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param instanceType The instance type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the data of supported operating systems by SRS along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceName, - String resourceGroupName, String instanceType) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName 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.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, - resourceGroupName, this.client.getSubscriptionId(), instanceType, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the data of supported operating systems by SRS. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param instanceType The instance type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the data of supported operating systems by SRS along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceName, - String resourceGroupName, String instanceType, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName 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.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, resourceGroupName, - this.client.getSubscriptionId(), instanceType, accept, context); - } - - /** - * Gets the data of supported operating systems by SRS. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the data of supported operating systems by SRS on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceName, String resourceGroupName) { - final String instanceType = null; - return getWithResponseAsync(resourceName, resourceGroupName, instanceType) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the data of supported operating systems by SRS. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @param instanceType The instance type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the data of supported operating systems by SRS along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceName, String resourceGroupName, - String instanceType, Context context) { - return getWithResponseAsync(resourceName, resourceGroupName, instanceType, context).block(); - } - - /** - * Gets the data of supported operating systems by SRS. - * - * @param resourceName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group where the recovery services vault is present. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the data of supported operating systems by SRS. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SupportedOperatingSystemsInner get(String resourceName, String resourceGroupName) { - final String instanceType = null; - return getWithResponse(resourceName, resourceGroupName, instanceType, Context.NONE).getValue(); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureUpdateReplicationProtectedItemInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureUpdateReplicationProtectedItemInput.java deleted file mode 100644 index ddfaa2ec3d9b..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureUpdateReplicationProtectedItemInput.java +++ /dev/null @@ -1,340 +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.recoveryservicessiterecovery.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; -import java.util.Map; - -/** - * HyperV replica Azure input to update replication protected item. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") -@JsonTypeName("HyperVReplicaAzure") -@Fluent -public final class HyperVReplicaAzureUpdateReplicationProtectedItemInput - extends UpdateReplicationProtectedItemProviderInput { - /* - * The recovery Azure resource group Id for classic deployment. - */ - @JsonProperty(value = "recoveryAzureV1ResourceGroupId") - private String recoveryAzureV1ResourceGroupId; - - /* - * The recovery Azure resource group Id for resource manager deployment. - */ - @JsonProperty(value = "recoveryAzureV2ResourceGroupId") - private String recoveryAzureV2ResourceGroupId; - - /* - * A value indicating whether managed disks should be used during failover. - */ - @JsonProperty(value = "useManagedDisks") - private String useManagedDisks; - - /* - * The dictionary of disk resource Id to disk encryption set ARM Id. - */ - @JsonProperty(value = "diskIdToDiskEncryptionMap") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map diskIdToDiskEncryptionMap; - - /* - * The target proximity placement group Id. - */ - @JsonProperty(value = "targetProximityPlacementGroupId") - private String targetProximityPlacementGroupId; - - /* - * The target availability zone. - */ - @JsonProperty(value = "targetAvailabilityZone") - private String targetAvailabilityZone; - - /* - * The target VM tags. - */ - @JsonProperty(value = "targetVmTags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map targetVmTags; - - /* - * The tags for the target managed disks. - */ - @JsonProperty(value = "targetManagedDiskTags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map targetManagedDiskTags; - - /* - * The tags for the target NICs. - */ - @JsonProperty(value = "targetNicTags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map targetNicTags; - - /* - * The SQL Server license type. - */ - @JsonProperty(value = "sqlServerLicenseType") - private SqlServerLicenseType sqlServerLicenseType; - - /* - * The list of disk update properties. - */ - @JsonProperty(value = "vmDisks") - private List vmDisks; - - /** - * Creates an instance of HyperVReplicaAzureUpdateReplicationProtectedItemInput class. - */ - public HyperVReplicaAzureUpdateReplicationProtectedItemInput() { - } - - /** - * Get the recoveryAzureV1ResourceGroupId property: The recovery Azure resource group Id for classic deployment. - * - * @return the recoveryAzureV1ResourceGroupId value. - */ - public String recoveryAzureV1ResourceGroupId() { - return this.recoveryAzureV1ResourceGroupId; - } - - /** - * Set the recoveryAzureV1ResourceGroupId property: The recovery Azure resource group Id for classic deployment. - * - * @param recoveryAzureV1ResourceGroupId the recoveryAzureV1ResourceGroupId value to set. - * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. - */ - public HyperVReplicaAzureUpdateReplicationProtectedItemInput - withRecoveryAzureV1ResourceGroupId(String recoveryAzureV1ResourceGroupId) { - this.recoveryAzureV1ResourceGroupId = recoveryAzureV1ResourceGroupId; - return this; - } - - /** - * Get the recoveryAzureV2ResourceGroupId property: The recovery Azure resource group Id for resource manager - * deployment. - * - * @return the recoveryAzureV2ResourceGroupId value. - */ - public String recoveryAzureV2ResourceGroupId() { - return this.recoveryAzureV2ResourceGroupId; - } - - /** - * Set the recoveryAzureV2ResourceGroupId property: The recovery Azure resource group Id for resource manager - * deployment. - * - * @param recoveryAzureV2ResourceGroupId the recoveryAzureV2ResourceGroupId value to set. - * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. - */ - public HyperVReplicaAzureUpdateReplicationProtectedItemInput - withRecoveryAzureV2ResourceGroupId(String recoveryAzureV2ResourceGroupId) { - this.recoveryAzureV2ResourceGroupId = recoveryAzureV2ResourceGroupId; - return this; - } - - /** - * Get the useManagedDisks property: A value indicating whether managed disks should be used during failover. - * - * @return the useManagedDisks value. - */ - public String useManagedDisks() { - return this.useManagedDisks; - } - - /** - * Set the useManagedDisks property: A value indicating whether managed disks should be used during failover. - * - * @param useManagedDisks the useManagedDisks value to set. - * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. - */ - public HyperVReplicaAzureUpdateReplicationProtectedItemInput withUseManagedDisks(String useManagedDisks) { - this.useManagedDisks = useManagedDisks; - return this; - } - - /** - * Get the diskIdToDiskEncryptionMap property: The dictionary of disk resource Id to disk encryption set ARM Id. - * - * @return the diskIdToDiskEncryptionMap value. - */ - public Map diskIdToDiskEncryptionMap() { - return this.diskIdToDiskEncryptionMap; - } - - /** - * Set the diskIdToDiskEncryptionMap property: The dictionary of disk resource Id to disk encryption set ARM Id. - * - * @param diskIdToDiskEncryptionMap the diskIdToDiskEncryptionMap value to set. - * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. - */ - public HyperVReplicaAzureUpdateReplicationProtectedItemInput - withDiskIdToDiskEncryptionMap(Map diskIdToDiskEncryptionMap) { - this.diskIdToDiskEncryptionMap = diskIdToDiskEncryptionMap; - return this; - } - - /** - * Get the targetProximityPlacementGroupId property: The target proximity placement group Id. - * - * @return the targetProximityPlacementGroupId value. - */ - public String targetProximityPlacementGroupId() { - return this.targetProximityPlacementGroupId; - } - - /** - * Set the targetProximityPlacementGroupId property: The target proximity placement group Id. - * - * @param targetProximityPlacementGroupId the targetProximityPlacementGroupId value to set. - * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. - */ - public HyperVReplicaAzureUpdateReplicationProtectedItemInput - withTargetProximityPlacementGroupId(String targetProximityPlacementGroupId) { - this.targetProximityPlacementGroupId = targetProximityPlacementGroupId; - return this; - } - - /** - * Get the targetAvailabilityZone property: The target availability zone. - * - * @return the targetAvailabilityZone value. - */ - public String targetAvailabilityZone() { - return this.targetAvailabilityZone; - } - - /** - * Set the targetAvailabilityZone property: The target availability zone. - * - * @param targetAvailabilityZone the targetAvailabilityZone value to set. - * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. - */ - public HyperVReplicaAzureUpdateReplicationProtectedItemInput - withTargetAvailabilityZone(String targetAvailabilityZone) { - this.targetAvailabilityZone = targetAvailabilityZone; - return this; - } - - /** - * Get the targetVmTags property: The target VM tags. - * - * @return the targetVmTags value. - */ - public Map targetVmTags() { - return this.targetVmTags; - } - - /** - * Set the targetVmTags property: The target VM tags. - * - * @param targetVmTags the targetVmTags value to set. - * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. - */ - public HyperVReplicaAzureUpdateReplicationProtectedItemInput withTargetVmTags(Map targetVmTags) { - this.targetVmTags = targetVmTags; - return this; - } - - /** - * Get the targetManagedDiskTags property: The tags for the target managed disks. - * - * @return the targetManagedDiskTags value. - */ - public Map targetManagedDiskTags() { - return this.targetManagedDiskTags; - } - - /** - * Set the targetManagedDiskTags property: The tags for the target managed disks. - * - * @param targetManagedDiskTags the targetManagedDiskTags value to set. - * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. - */ - public HyperVReplicaAzureUpdateReplicationProtectedItemInput - withTargetManagedDiskTags(Map targetManagedDiskTags) { - this.targetManagedDiskTags = targetManagedDiskTags; - return this; - } - - /** - * Get the targetNicTags property: The tags for the target NICs. - * - * @return the targetNicTags value. - */ - public Map targetNicTags() { - return this.targetNicTags; - } - - /** - * Set the targetNicTags property: The tags for the target NICs. - * - * @param targetNicTags the targetNicTags value to set. - * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. - */ - public HyperVReplicaAzureUpdateReplicationProtectedItemInput withTargetNicTags(Map targetNicTags) { - this.targetNicTags = targetNicTags; - return this; - } - - /** - * Get the sqlServerLicenseType property: The SQL Server license type. - * - * @return the sqlServerLicenseType value. - */ - public SqlServerLicenseType sqlServerLicenseType() { - return this.sqlServerLicenseType; - } - - /** - * Set the sqlServerLicenseType property: The SQL Server license type. - * - * @param sqlServerLicenseType the sqlServerLicenseType value to set. - * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. - */ - public HyperVReplicaAzureUpdateReplicationProtectedItemInput - withSqlServerLicenseType(SqlServerLicenseType sqlServerLicenseType) { - this.sqlServerLicenseType = sqlServerLicenseType; - return this; - } - - /** - * Get the vmDisks property: The list of disk update properties. - * - * @return the vmDisks value. - */ - public List vmDisks() { - return this.vmDisks; - } - - /** - * Set the vmDisks property: The list of disk update properties. - * - * @param vmDisks the vmDisks value to set. - * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. - */ - public HyperVReplicaAzureUpdateReplicationProtectedItemInput withVmDisks(List vmDisks) { - this.vmDisks = vmDisks; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (vmDisks() != null) { - vmDisks().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmUpdateApplianceForReplicationProtectedItemInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmUpdateApplianceForReplicationProtectedItemInput.java deleted file mode 100644 index c041e01a7024..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmUpdateApplianceForReplicationProtectedItemInput.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * InMageRcm provider specific input to update appliance for replication protected item. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") -@JsonTypeName("InMageRcm") -@Fluent -public final class InMageRcmUpdateApplianceForReplicationProtectedItemInput - extends UpdateReplicationProtectedItemProviderSpecificInput { - /* - * The run as account Id. - */ - @JsonProperty(value = "runAsAccountId") - private String runAsAccountId; - - /** - * Creates an instance of InMageRcmUpdateApplianceForReplicationProtectedItemInput class. - */ - public InMageRcmUpdateApplianceForReplicationProtectedItemInput() { - } - - /** - * Get the runAsAccountId property: The run as account Id. - * - * @return the runAsAccountId value. - */ - public String runAsAccountId() { - return this.runAsAccountId; - } - - /** - * Set the runAsAccountId property: The run as account Id. - * - * @param runAsAccountId the runAsAccountId value to set. - * @return the InMageRcmUpdateApplianceForReplicationProtectedItemInput object itself. - */ - public InMageRcmUpdateApplianceForReplicationProtectedItemInput withRunAsAccountId(String runAsAccountId) { - this.runAsAccountId = runAsAccountId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderSpecificUpdateContainerMappingInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderSpecificUpdateContainerMappingInput.java deleted file mode 100644 index 7fb68982f635..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderSpecificUpdateContainerMappingInput.java +++ /dev/null @@ -1,39 +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.recoveryservicessiterecovery.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Provider specific input for update pairing operations. - */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "instanceType", - defaultImpl = ReplicationProviderSpecificUpdateContainerMappingInput.class) -@JsonTypeName("ReplicationProviderSpecificUpdateContainerMappingInput") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "A2A", value = A2AUpdateContainerMappingInput.class), - @JsonSubTypes.Type(name = "InMageRcm", value = InMageRcmUpdateContainerMappingInput.class) }) -@Immutable -public class ReplicationProviderSpecificUpdateContainerMappingInput { - /** - * Creates an instance of ReplicationProviderSpecificUpdateContainerMappingInput class. - */ - public ReplicationProviderSpecificUpdateContainerMappingInput() { - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateApplianceForReplicationProtectedItemInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateApplianceForReplicationProtectedItemInputProperties.java deleted file mode 100644 index 9efc8e1f2b10..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateApplianceForReplicationProtectedItemInputProperties.java +++ /dev/null @@ -1,95 +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.recoveryservicessiterecovery.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Update appliance for protected item input properties. - */ -@Fluent -public final class UpdateApplianceForReplicationProtectedItemInputProperties { - /* - * The target appliance Id. - */ - @JsonProperty(value = "targetApplianceId", required = true) - private String targetApplianceId; - - /* - * The provider specific input to update replication protected item. - */ - @JsonProperty(value = "providerSpecificDetails", required = true) - private UpdateReplicationProtectedItemProviderSpecificInput providerSpecificDetails; - - /** - * Creates an instance of UpdateApplianceForReplicationProtectedItemInputProperties class. - */ - public UpdateApplianceForReplicationProtectedItemInputProperties() { - } - - /** - * Get the targetApplianceId property: The target appliance Id. - * - * @return the targetApplianceId value. - */ - public String targetApplianceId() { - return this.targetApplianceId; - } - - /** - * Set the targetApplianceId property: The target appliance Id. - * - * @param targetApplianceId the targetApplianceId value to set. - * @return the UpdateApplianceForReplicationProtectedItemInputProperties object itself. - */ - public UpdateApplianceForReplicationProtectedItemInputProperties withTargetApplianceId(String targetApplianceId) { - this.targetApplianceId = targetApplianceId; - return this; - } - - /** - * Get the providerSpecificDetails property: The provider specific input to update replication protected item. - * - * @return the providerSpecificDetails value. - */ - public UpdateReplicationProtectedItemProviderSpecificInput providerSpecificDetails() { - return this.providerSpecificDetails; - } - - /** - * Set the providerSpecificDetails property: The provider specific input to update replication protected item. - * - * @param providerSpecificDetails the providerSpecificDetails value to set. - * @return the UpdateApplianceForReplicationProtectedItemInputProperties object itself. - */ - public UpdateApplianceForReplicationProtectedItemInputProperties - withProviderSpecificDetails(UpdateReplicationProtectedItemProviderSpecificInput providerSpecificDetails) { - this.providerSpecificDetails = providerSpecificDetails; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (targetApplianceId() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property targetApplianceId in model UpdateApplianceForReplicationProtectedItemInputProperties")); - } - if (providerSpecificDetails() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property providerSpecificDetails in model UpdateApplianceForReplicationProtectedItemInputProperties")); - } else { - providerSpecificDetails().validate(); - } - } - - private static final ClientLogger LOGGER - = new ClientLogger(UpdateApplianceForReplicationProtectedItemInputProperties.class); -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservicessiterecovery/proxy-config.json b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservicessiterecovery/proxy-config.json deleted file mode 100644 index ee6b890b3a43..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservicessiterecovery/proxy-config.json +++ /dev/null @@ -1 +0,0 @@ -[ [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.OperationsClientImpl$OperationsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationAlertSettingsClientImpl$ReplicationAlertSettingsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationAppliancesClientImpl$ReplicationAppliancesService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationEligibilityResultsOperationsClientImpl$ReplicationEligibilityResultsOperationsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationEventsClientImpl$ReplicationEventsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationFabricsClientImpl$ReplicationFabricsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationLogicalNetworksClientImpl$ReplicationLogicalNetworksService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationNetworksClientImpl$ReplicationNetworksService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationNetworkMappingsClientImpl$ReplicationNetworkMappingsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationProtectionContainersClientImpl$ReplicationProtectionContainersService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationMigrationItemsClientImpl$ReplicationMigrationItemsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.MigrationRecoveryPointsClientImpl$MigrationRecoveryPointsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationProtectableItemsClientImpl$ReplicationProtectableItemsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationProtectedItemsClientImpl$ReplicationProtectedItemsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.RecoveryPointsClientImpl$RecoveryPointsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.TargetComputeSizesClientImpl$TargetComputeSizesService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationProtectionContainerMappingsClientImpl$ReplicationProtectionContainerMappingsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationRecoveryServicesProvidersClientImpl$ReplicationRecoveryServicesProvidersService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.StorageClassificationsClientImpl$StorageClassificationsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.StorageClassificationMappingsClientImpl$StorageClassificationMappingsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationvCentersClientImpl$ReplicationvCentersService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationJobsClientImpl$ReplicationJobsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationPoliciesClientImpl$ReplicationPoliciesService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationProtectionIntentsClientImpl$ReplicationProtectionIntentsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationRecoveryPlansClientImpl$ReplicationRecoveryPlansService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.SupportedOperatingSystemsOperationsClientImpl$SupportedOperatingSystemsOperationsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationVaultHealthsClientImpl$ReplicationVaultHealthsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationVaultSettingsClientImpl$ReplicationVaultSettingsService" ] ] \ No newline at end of file diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservicessiterecovery/reflect-config.json b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservicessiterecovery/reflect-config.json deleted file mode 100644 index 1f20b21f6b48..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservicessiterecovery/reflect-config.json +++ /dev/null @@ -1,2816 +0,0 @@ -[ { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.OperationsDiscoveryCollection", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.OperationsDiscoveryInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.Display", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AlertCollection", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.AlertInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AlertProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ConfigureAlertRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ConfigureAlertRequestProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ApplianceCollection", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationApplianceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationApplianceProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ApplianceSpecificDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationEligibilityResultsCollectionInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationEligibilityResultsInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationEligibilityResultsProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationEligibilityResultsErrorInfo", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.EventCollection", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.EventInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.EventProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.EventProviderSpecificDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.EventSpecificDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HealthError", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InnerHealthError", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.FabricCollection", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.FabricInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.FabricProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.EncryptionDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.FabricSpecificDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.FabricCreationInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.FabricCreationInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.FabricSpecificCreationInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.FailoverProcessServerRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.FailoverProcessServerRequestProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RenewCertificateInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RenewCertificateInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.LogicalNetworkCollection", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.LogicalNetworkInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.LogicalNetworkProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.NetworkCollection", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.NetworkInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.NetworkProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.Subnet", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.NetworkMappingCollection", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.NetworkMappingInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.NetworkMappingProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.NetworkMappingFabricSpecificSettings", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateNetworkMappingInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateNetworkMappingInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.FabricSpecificCreateNetworkMappingInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateNetworkMappingInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateNetworkMappingInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.FabricSpecificUpdateNetworkMappingInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainerCollection", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ProtectionContainerInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainerProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainerFabricSpecificDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionContainerInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionContainerInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProviderSpecificContainerCreationInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DiscoverProtectableItemRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DiscoverProtectableItemRequestProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationItemCollection", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.MigrationItemInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationItemProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CurrentJobDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CriticalJobHistoryDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationProviderSpecificSettings", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.EnableMigrationInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.EnableMigrationInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.EnableMigrationProviderSpecificInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateMigrationItemInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateMigrationItemInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateMigrationItemProviderSpecificInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrateInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrateInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrateProviderSpecificInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationRecoveryPointCollection", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.MigrationRecoveryPointInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationRecoveryPointProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.PauseReplicationInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.PauseReplicationInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ResumeReplicationInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ResumeReplicationInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ResumeReplicationProviderSpecificInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ResyncInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ResyncInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ResyncProviderSpecificInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateProviderSpecificInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateCleanupInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateCleanupInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectableItemCollection", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ProtectableItemInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectableItemProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ConfigurationSettings", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectedItemCollection", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationProtectedItemInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectedItemProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CurrentScenarioDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProviderSpecificSettings", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.EnableProtectionInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.EnableProtectionInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.EnableProtectionProviderSpecificInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateReplicationProtectedItemInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateReplicationProtectedItemInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMNicInputDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.IpConfigInputDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateReplicationProtectedItemProviderInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AddDisksInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AddDisksInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AddDisksProviderSpecificInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ApplyRecoveryPointInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ApplyRecoveryPointInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ApplyRecoveryPointProviderSpecificInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.PlannedFailoverInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.PlannedFailoverInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.PlannedFailoverProviderSpecificFailoverInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPointCollection", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.RecoveryPointInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPointProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ProviderSpecificRecoveryPointDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DisableProtectionInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DisableProtectionInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DisableProtectionProviderSpecificInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveDisksInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveDisksInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveDisksProviderSpecificInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReverseReplicationInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReverseReplicationInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReverseReplicationProviderSpecificInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ResolveHealthInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ResolveHealthInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ResolveHealthError", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProviderInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProviderInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProviderSpecificInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.TargetComputeSizeCollection", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.TargetComputeSizeInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.TargetComputeSizeProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ComputeSizeErrorDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverProviderSpecificInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverCleanupInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverCleanupInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UnplannedFailoverInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UnplannedFailoverInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UnplannedFailoverProviderSpecificInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateApplianceForReplicationProtectedItemInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateApplianceForReplicationProtectedItemInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateReplicationProtectedItemProviderSpecificInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateMobilityServiceRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateMobilityServiceRequestProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainerMappingCollection", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ProtectionContainerMappingInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainerMappingProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainerMappingProviderSpecificDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionContainerMappingInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionContainerMappingInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProviderSpecificContainerMappingInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateProtectionContainerMappingInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateProtectionContainerMappingInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProviderSpecificUpdateContainerMappingInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveProtectionContainerMappingInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveProtectionContainerMappingInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProviderContainerUnmappingInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProtectionInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProtectionInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProtectionProviderSpecificInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryServicesProviderCollection", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.RecoveryServicesProviderInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryServicesProviderProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.IdentityProviderDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VersionDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AddRecoveryServicesProviderInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AddRecoveryServicesProviderInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.IdentityProviderInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageClassificationCollection", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.StorageClassificationInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageClassificationProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageClassificationMappingCollection", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.StorageClassificationMappingInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageClassificationMappingProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageClassificationMappingInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageMappingInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VCenterCollection", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.VCenterInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VCenterProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AddVCenterRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AddVCenterRequestProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateVCenterRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateVCenterRequestProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.JobCollection", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.JobInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.JobProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AsrTask", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.TaskTypeDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.GroupTaskDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.JobErrorDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ServiceError", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ProviderError", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.JobDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ResumeJobParams", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ResumeJobParamsProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.JobQueryParameter", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.PolicyCollection", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.PolicyInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.PolicyProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.PolicyProviderSpecificDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CreatePolicyInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CreatePolicyInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.PolicyProviderSpecificInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdatePolicyInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdatePolicyInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectionIntentCollection", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationProtectionIntentInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectionIntentProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectionIntentProviderSpecificSettings", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionIntentInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionIntentProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionIntentProviderSpecificDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanCollection", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.RecoveryPlanInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanGroup", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanProtectedItem", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanAction", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanActionDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanProviderSpecificDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateRecoveryPlanInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateRecoveryPlanInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanProviderSpecificInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateRecoveryPlanInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateRecoveryPlanInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanPlannedFailoverInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanPlannedFailoverInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanProviderSpecificFailoverInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverCleanupInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverCleanupInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanUnplannedFailoverInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanUnplannedFailoverInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.SupportedOperatingSystemsInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.SupportedOSProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.SupportedOSProperty", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.SupportedOSDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.OSVersionWrapper", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.VaultHealthDetailsInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VaultHealthProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ResourceHealthSummary", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HealthErrorSummary", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VaultSettingCollection", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.VaultSettingInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VaultSettingProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VaultSettingCreationInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VaultSettingCreationInputProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AAddDisksInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AVmDiskInputDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AVmManagedDiskInputDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DiskEncryptionInfo", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DiskEncryptionKeyInfo", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.KeyEncryptionKeyInfo", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AApplyRecoveryPointInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AContainerCreationInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AContainerMappingInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ACreateProtectionIntentInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionProfileCustomDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageAccountCustomDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryAvailabilitySetCustomDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryVirtualNetworkCustomDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryProximityPlacementGroupCustomDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AProtectionIntentDiskInputDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AProtectionIntentManagedDiskInputDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryResourceGroupCustomDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ACrossClusterMigrationApplyRecoveryPointInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ACrossClusterMigrationContainerCreationInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ACrossClusterMigrationEnableProtectionInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ACrossClusterMigrationPolicyCreationInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ACrossClusterMigrationReplicationDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AEnableProtectionInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ExtendedLocation", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AEventDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AExtendedLocationDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AFabricSpecificLocationDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2APolicyCreationInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2APolicyDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AProtectedDiskDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AProtectedManagedDiskDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AProtectionContainerMappingDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ARecoveryPointDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ARemoveDisksInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AReplicationDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AUnprotectedDiskDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMNicDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.IpConfigDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AzureToAzureVmSyncedConfigDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InputEndpoint", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AReplicationIntentDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AReprotectInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ASwitchProtectionInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ATestFailoverInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AUnplannedFailoverInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AUpdateContainerMappingInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AUpdateReplicationProtectedItemInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AVmManagedDiskUpdateDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AZoneDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AgentDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AgentDiskDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ApplianceMonitoringDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ApplianceResourceDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DataStoreUtilizationDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AsrJobDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AutomationRunbookTaskDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AzureFabricCreationInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AzureFabricSpecificDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AzureToAzureCreateNetworkMappingInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AzureToAzureNetworkMappingSettings", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AzureToAzureUpdateNetworkMappingInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AzureVmDiskDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ConsistencyCheckTaskDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InconsistentVmDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DataStore", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DiskDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DiskVolumeDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DraDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ExistingProtectionProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ExistingRecoveryAvailabilitySet", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ExistingRecoveryProximityPlacementGroup", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ExistingRecoveryResourceGroup", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ExistingRecoveryVirtualNetwork", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ExistingStorageAccount", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ExportJobDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.FabricReplicationGroupTaskDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.JobTaskDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.JobEntity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.FailoverJobDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.FailoverReplicationProtectedItemDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.GatewayOperationDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVHostDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplica2012EventDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplica2012R2EventDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureApplyRecoveryPointInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureDiskInputDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureEnableProtectionInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureEventDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureFailbackProviderInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureManagedDiskDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzurePlannedFailoverProviderInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzurePolicyDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzurePolicyInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureReplicationDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InitialReplicationDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.OSDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.OSUpgradeSupportedVersions", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureReprotectInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureTestFailoverInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureUnplannedFailoverInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureUpdateReplicationProtectedItemInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateDiskInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaBaseEventDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaBasePolicyDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaBaseReplicationDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaBluePolicyDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaBluePolicyInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaPolicyInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaBlueReplicationDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaPolicyDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaReplicationDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVSiteDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVVirtualMachineDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InlineWorkflowTaskDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAgentDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2ApplyRecoveryPointInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2DiskInputDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2EnableProtectionInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2EventDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2ManagedDiskDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2PolicyDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2PolicyInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2ProtectedDiskDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2RecoveryPointDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2ReplicationDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2SwitchProviderBlockingErrorDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2SwitchProviderDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2ReprotectInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2SwitchProviderInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2TestFailoverInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2UnplannedFailoverInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2UpdateReplicationProtectedItemInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageBasePolicyDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageDisableProtectionProviderSpecificInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageDiskDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageDiskExclusionInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageVolumeExclusionOptions", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageDiskSignatureExclusionOptions", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageEnableProtectionInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageFabricSwitchProviderBlockingErrorDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMagePolicyDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMagePolicyInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageProtectedDiskDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmAgentUpgradeBlockingErrorDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmApplianceDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ProcessServerDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RcmProxyDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.PushInstallerDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationAgentDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReprotectAgentDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MarsAgentDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFabricSwitchProviderBlockingErrorDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmApplianceSpecificDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmApplyRecoveryPointInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmDiscoveredProtectedVmDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmDiskInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmDisksDefaultInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmEnableProtectionInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmEventDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFabricCreationInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFabricSpecificDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFailbackDiscoveredProtectedVmDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFailbackEventDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFailbackMobilityAgentDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFailbackNicDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFailbackPlannedFailoverProviderInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFailbackPolicyCreationInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFailbackPolicyDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFailbackProtectedDiskDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFailbackSyncDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFailbackReplicationDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFailbackReprotectInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmLastAgentUpgradeErrorDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmMobilityAgentDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmNicDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmNicInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmPolicyCreationInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmPolicyDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmProtectedDiskDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmSyncDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmProtectionContainerMappingDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmRecoveryPointDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmReplicationDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmReprotectInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmTestFailoverInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmUnplannedFailoverInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmUpdateApplianceForReplicationProtectedItemInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmUpdateContainerMappingInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmUpdateReplicationProtectedItemInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageReplicationDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.OSDiskDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageReprotectInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageTestFailoverInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageUnplannedFailoverInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.JobStatusEventDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ManualActionTaskDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MasterTargetServer", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RetentionVolume", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MobilityServiceUpdate", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.NewProtectionProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.NewRecoveryVirtualNetwork", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ProcessServer", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanA2ADetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanA2AFailoverInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanA2AInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanAutomationRunbookActionDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanGroupTaskDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanHyperVReplicaAzureFailbackInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanHyperVReplicaAzureFailoverInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanInMageAzureV2FailoverInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanInMageFailoverInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanInMageRcmFailbackFailoverInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanInMageRcmFailoverInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanManualActionDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanScriptActionDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanShutdownGroupTaskDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationGroupDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RunAsAccount", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ScriptActionTaskDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProtectionJobDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverJobDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VirtualMachineTaskDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VmmDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VmmToAzureCreateNetworkMappingInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VmmToAzureNetworkMappingSettings", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VmmToAzureUpdateNetworkMappingInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VmmToVmmCreateNetworkMappingInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VmmToVmmNetworkMappingSettings", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VmmToVmmUpdateNetworkMappingInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VmmVirtualMachineDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VmNicUpdatesTaskDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtContainerCreationInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtContainerMappingInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtDiskInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtEnableMigrationInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtSecurityProfileProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtEventDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtMigrateInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtMigrationDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtProtectedDiskDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtNicDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtNicInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtPolicyCreationInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VmwareCbtPolicyDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtProtectionContainerMappingDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtResumeReplicationInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtResyncInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtTestMigrateInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtUpdateDiskInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtUpdateMigrationItemInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareV2FabricCreationInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareV2FabricSpecificDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareVirtualMachineDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HealthErrorCustomerResolvability", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrationState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionHealth", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationItemOperation", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationRecoveryPointType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.LicenseType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DisableProtectionReason", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AgentVersionStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ExportJobOutputSerializationType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanGroupType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectedItemOperation", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.PossibleOperationsDirections", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.FailoverDeploymentModel", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.SourceSiteOperations", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HealthErrorCategory", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.Severity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AgentAutoUpdateStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AutomationAccountAuthenticationType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ARecoveryAvailabilityType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AutoProtectionOfDataDisk", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ExtendedLocationType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.SetMultiVmSyncStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPointSyncType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MultiVmGroupCreateOption", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VmEncryptionType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ChurnOptionSelected", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DiskAccountType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.SqlServerLicenseType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.PresenceStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RcmComponentStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AgentUpgradeBlockedReason", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFailbackRecoveryPointType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DiskReplicationProgressHealth", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VmReplicationProgressHealth", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ResyncState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.PlannedFailoverStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.EthernetAddressType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MobilityAgentUpgradeState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPointType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ARpRecoveryPointType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MultiVmSyncPointOption", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanActionLocation", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DataSyncStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AlternateLocationRecoveryOption", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureRpRecoveryPointType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageV2RpRecoveryPointType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RpInMageRecoveryPointType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanPointType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.SecurityType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -} ] \ No newline at end of file diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/MigrationRecoveryPointsListByReplicationMigrati.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/MigrationRecoveryPointsListByReplicationMigrati.java deleted file mode 100644 index b2ac18a15f29..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/MigrationRecoveryPointsListByReplicationMigrati.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -/** - * Samples for MigrationRecoveryPoints ListByReplicationMigrationItems. - */ -public final class MigrationRecoveryPointsListByReplicationMigrati { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /MigrationRecoveryPoints_ListByReplicationMigrationItems.json - */ - /** - * Sample code: Gets the recovery points for a migration item. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void getsTheRecoveryPointsForAMigrationItem( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.migrationRecoveryPoints().listByReplicationMigrationItems("migrationvault", "resourcegroup1", - "vmwarefabric1", "vmwareContainer1", "virtualmachine1", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPointsListByReplicationProtectedItemsSa.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPointsListByReplicationProtectedItemsSa.java deleted file mode 100644 index 0e2e49f3a295..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPointsListByReplicationProtectedItemsSa.java +++ /dev/null @@ -1,27 +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.recoveryservicessiterecovery.generated; - -/** - * Samples for RecoveryPoints ListByReplicationProtectedItems. - */ -public final class RecoveryPointsListByReplicationProtectedItemsSa { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /RecoveryPoints_ListByReplicationProtectedItems.json - */ - /** - * Sample code: Gets the list of recovery points for a replication protected item. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void getsTheListOfRecoveryPointsForAReplicationProtectedItem( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.recoveryPoints().listByReplicationProtectedItems("vault1", "resourceGroupPS1", "cloud1", - "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEligibilityResultsOperationGetSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEligibilityResultsOperationGetSamples.java deleted file mode 100644 index c6905f4d26a1..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEligibilityResultsOperationGetSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -/** - * Samples for ReplicationEligibilityResultsOperation Get. - */ -public final class ReplicationEligibilityResultsOperationGetSamples { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationEligibilityResults_Get.json - */ - /** - * Sample code: Gets the validation errors in case the VM is unsuitable for protection. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void getsTheValidationErrorsInCaseTheVMIsUnsuitableForProtection( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationEligibilityResultsOperations().getWithResponse("testRg1", "testVm1", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEligibilityResultsOperationListSampl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEligibilityResultsOperationListSampl.java deleted file mode 100644 index 80373c255233..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEligibilityResultsOperationListSampl.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -/** - * Samples for ReplicationEligibilityResultsOperation List. - */ -public final class ReplicationEligibilityResultsOperationListSampl { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationEligibilityResults_List.json - */ - /** - * Sample code: Gets the validation errors in case the VM is unsuitable for protection. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void getsTheValidationErrorsInCaseTheVMIsUnsuitableForProtection( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationEligibilityResultsOperations().listWithResponse("testRg1", "testVm2", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationLogicalNetworksListByReplicationFabr.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationLogicalNetworksListByReplicationFabr.java deleted file mode 100644 index 7bca9e48acb8..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationLogicalNetworksListByReplicationFabr.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -/** - * Samples for ReplicationLogicalNetworks ListByReplicationFabrics. - */ -public final class ReplicationLogicalNetworksListByReplicationFabr { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationLogicalNetworks_ListByReplicationFabrics.json - */ - /** - * Sample code: Gets the list of logical networks under a fabric. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void getsTheListOfLogicalNetworksUnderAFabric( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationLogicalNetworks().listByReplicationFabrics("vault1", "resourceGroupPS1", "cloud1", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsListByReplicationProte.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsListByReplicationProte.java deleted file mode 100644 index eeb34dbe9b27..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsListByReplicationProte.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -/** - * Samples for ReplicationMigrationItems ListByReplicationProtectionContainers. - */ -public final class ReplicationMigrationItemsListByReplicationProte { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationMigrationItems_ListByReplicationProtectionContainers.json - */ - /** - * Sample code: Gets the list of migration items in the protection container. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void getsTheListOfMigrationItemsInTheProtectionContainer( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationMigrationItems().listByReplicationProtectionContainers("migrationvault", "resourcegroup1", - "vmwarefabric1", "vmwareContainer1", null, null, null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsPauseReplicationSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsPauseReplicationSamples.java deleted file mode 100644 index c8ac7e863011..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsPauseReplicationSamples.java +++ /dev/null @@ -1,33 +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.recoveryservicessiterecovery.generated; - -import com.azure.resourcemanager.recoveryservicessiterecovery.models.PauseReplicationInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.PauseReplicationInputProperties; - -/** - * Samples for ReplicationMigrationItems PauseReplication. - */ -public final class ReplicationMigrationItemsPauseReplicationSamples { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationMigrationItems_PauseReplication.json - */ - /** - * Sample code: Pause replication. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void - pauseReplication(com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationMigrationItems() - .pauseReplication("migrationvault", "resourcegroup1", "vmwarefabric1", "vmwareContainer1", - "virtualmachine1", - new PauseReplicationInput() - .withProperties(new PauseReplicationInputProperties().withInstanceType("VMwareCbt")), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsResumeReplicationSampl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsResumeReplicationSampl.java deleted file mode 100644 index 27cf3507fa4c..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsResumeReplicationSampl.java +++ /dev/null @@ -1,34 +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.recoveryservicessiterecovery.generated; - -import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResumeReplicationInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResumeReplicationInputProperties; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtResumeReplicationInput; - -/** - * Samples for ReplicationMigrationItems ResumeReplication. - */ -public final class ReplicationMigrationItemsResumeReplicationSampl { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationMigrationItems_ResumeReplication.json - */ - /** - * Sample code: Resume replication. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void - resumeReplication(com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationMigrationItems().resumeReplication("migrationvault", "resourcegroup1", "vmwarefabric1", - "vmwareContainer1", "virtualmachine1", - new ResumeReplicationInput() - .withProperties(new ResumeReplicationInputProperties().withProviderSpecificDetails( - new VMwareCbtResumeReplicationInput().withDeleteMigrationResources("false"))), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsTestMigrateCleanupSamp.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsTestMigrateCleanupSamp.java deleted file mode 100644 index 7ef9ee6cd1ab..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsTestMigrateCleanupSamp.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.recoveryservicessiterecovery.generated; - -import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateCleanupInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateCleanupInputProperties; - -/** - * Samples for ReplicationMigrationItems TestMigrateCleanup. - */ -public final class ReplicationMigrationItemsTestMigrateCleanupSamp { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationMigrationItems_TestMigrateCleanup.json - */ - /** - * Sample code: Test migrate cleanup. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void - testMigrateCleanup(com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationMigrationItems().testMigrateCleanup("migrationvault", "resourcegroup1", "vmwarefabric1", - "vmwareContainer1", "virtualmachine1", - new TestMigrateCleanupInput() - .withProperties(new TestMigrateCleanupInputProperties().withComments("Test Failover Cleanup")), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsListByReplicationNetw.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsListByReplicationNetw.java deleted file mode 100644 index 9366b61075e4..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsListByReplicationNetw.java +++ /dev/null @@ -1,27 +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.recoveryservicessiterecovery.generated; - -/** - * Samples for ReplicationNetworkMappings ListByReplicationNetworks. - */ -public final class ReplicationNetworkMappingsListByReplicationNetw { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationNetworkMappings_ListByReplicationNetworks.json - */ - /** - * Sample code: Gets all the network mappings under a network. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void getsAllTheNetworkMappingsUnderANetwork( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationNetworkMappings().listByReplicationNetworks("srce2avaultbvtaC27", "srcBvte2a14C27", - "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac", "e2267b5c-2650-49bd-ab3f-d66aae694c06", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworksListByReplicationFabricsSamp.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworksListByReplicationFabricsSamp.java deleted file mode 100644 index ce76768b4222..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworksListByReplicationFabricsSamp.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -/** - * Samples for ReplicationNetworks ListByReplicationFabrics. - */ -public final class ReplicationNetworksListByReplicationFabricsSamp { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationNetworks_ListByReplicationFabrics.json - */ - /** - * Sample code: Gets the list of networks under a fabric. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void getsTheListOfNetworksUnderAFabric( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationNetworks().listByReplicationFabrics("srce2avaultbvtaC27", "srcBvte2a14C27", - "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectableItemsListByReplicationPro.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectableItemsListByReplicationPro.java deleted file mode 100644 index 94a420670541..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectableItemsListByReplicationPro.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -/** - * Samples for ReplicationProtectableItems ListByReplicationProtectionContainers. - */ -public final class ReplicationProtectableItemsListByReplicationPro { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationProtectableItems_ListByReplicationProtectionContainers.json - */ - /** - * Sample code: Gets the list of protectable items. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void getsTheListOfProtectableItems( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationProtectableItems().listByReplicationProtectionContainers("vault1", "resourceGroupPS1", - "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", null, null, null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsApplyRecoveryPointSamp.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsApplyRecoveryPointSamp.java deleted file mode 100644 index ec3508276026..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsApplyRecoveryPointSamp.java +++ /dev/null @@ -1,34 +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.recoveryservicessiterecovery.generated; - -import com.azure.resourcemanager.recoveryservicessiterecovery.models.ApplyRecoveryPointInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.ApplyRecoveryPointInputProperties; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureApplyRecoveryPointInput; - -/** - * Samples for ReplicationProtectedItems ApplyRecoveryPoint. - */ -public final class ReplicationProtectedItemsApplyRecoveryPointSamp { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationProtectedItems_ApplyRecoveryPoint.json - */ - /** - * Sample code: Change or apply recovery point. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void - changeOrApplyRecoveryPoint(com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationProtectedItems().applyRecoveryPoint("vault1", "resourceGroupPS1", "cloud1", - "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", - new ApplyRecoveryPointInput().withProperties(new ApplyRecoveryPointInputProperties().withRecoveryPointId( - "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b/recoveryPoints/e4d05fe9-5dfd-47be-b50b-aad306b2802d") - .withProviderSpecificDetails(new HyperVReplicaAzureApplyRecoveryPointInput())), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsFailoverCancelSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsFailoverCancelSamples.java deleted file mode 100644 index 0bcd8a5ce48d..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsFailoverCancelSamples.java +++ /dev/null @@ -1,27 +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.recoveryservicessiterecovery.generated; - -/** - * Samples for ReplicationProtectedItems FailoverCancel. - */ -public final class ReplicationProtectedItemsFailoverCancelSamples { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationProtectedItems_FailoverCancel.json - */ - /** - * Sample code: Execute cancel failover. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void - executeCancelFailover(com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationProtectedItems().failoverCancel("vault1", "resourceGroupPS1", "cloud1", - "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsFailoverCommitSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsFailoverCommitSamples.java deleted file mode 100644 index 1b24329884fc..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsFailoverCommitSamples.java +++ /dev/null @@ -1,27 +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.recoveryservicessiterecovery.generated; - -/** - * Samples for ReplicationProtectedItems FailoverCommit. - */ -public final class ReplicationProtectedItemsFailoverCommitSamples { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationProtectedItems_FailoverCommit.json - */ - /** - * Sample code: Execute commit failover. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void - executeCommitFailover(com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationProtectedItems().failoverCommit("vault1", "resourceGroupPS1", "cloud1", - "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsListByReplicationProte.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsListByReplicationProte.java deleted file mode 100644 index d3d821778e3f..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsListByReplicationProte.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -/** - * Samples for ReplicationProtectedItems ListByReplicationProtectionContainers. - */ -public final class ReplicationProtectedItemsListByReplicationProte { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationProtectedItems_ListByReplicationProtectionContainers.json - */ - /** - * Sample code: Gets the list of Replication protected items. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void getsTheListOfReplicationProtectedItems( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationProtectedItems().listByReplicationProtectionContainers("vault1", "resourceGroupPS1", - "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsPlannedFailoverSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsPlannedFailoverSamples.java deleted file mode 100644 index 3352864e3eaa..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsPlannedFailoverSamples.java +++ /dev/null @@ -1,34 +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.recoveryservicessiterecovery.generated; - -import com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzurePlannedFailoverProviderInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.PlannedFailoverInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.PlannedFailoverInputProperties; - -/** - * Samples for ReplicationProtectedItems PlannedFailover. - */ -public final class ReplicationProtectedItemsPlannedFailoverSamples { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationProtectedItems_PlannedFailover.json - */ - /** - * Sample code: Execute planned failover. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void - executePlannedFailover(com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationProtectedItems().plannedFailover("vault1", "resourceGroupPS1", "cloud1", - "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", - new PlannedFailoverInput() - .withProperties(new PlannedFailoverInputProperties().withFailoverDirection("PrimaryToRecovery") - .withProviderSpecificDetails(new HyperVReplicaAzurePlannedFailoverProviderInput())), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsRepairReplicationSampl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsRepairReplicationSampl.java deleted file mode 100644 index e0b038b958c3..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsRepairReplicationSampl.java +++ /dev/null @@ -1,27 +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.recoveryservicessiterecovery.generated; - -/** - * Samples for ReplicationProtectedItems RepairReplication. - */ -public final class ReplicationProtectedItemsRepairReplicationSampl { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationProtectedItems_RepairReplication.json - */ - /** - * Sample code: Resynchronize or repair replication. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void resynchronizeOrRepairReplication( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationProtectedItems().repairReplication("vault1", "resourceGroupPS1", "cloud1", - "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsResolveHealthErrorsSam.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsResolveHealthErrorsSam.java deleted file mode 100644 index 763a0b082d39..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsResolveHealthErrorsSam.java +++ /dev/null @@ -1,34 +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.recoveryservicessiterecovery.generated; - -import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResolveHealthError; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResolveHealthInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResolveHealthInputProperties; -import java.util.Arrays; - -/** - * Samples for ReplicationProtectedItems ResolveHealthErrors. - */ -public final class ReplicationProtectedItemsResolveHealthErrorsSam { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationProtectedItems_ResolveHealthErrors.json - */ - /** - * Sample code: Resolve health errors. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void - resolveHealthErrors(com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationProtectedItems().resolveHealthErrors("vault1", "resourceGroupPS1", "cloud1", - "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", - new ResolveHealthInput().withProperties(new ResolveHealthInputProperties() - .withHealthErrors(Arrays.asList(new ResolveHealthError().withHealthErrorId("3:8020")))), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsSwitchProviderSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsSwitchProviderSamples.java deleted file mode 100644 index e5f31bac9164..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsSwitchProviderSamples.java +++ /dev/null @@ -1,38 +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.recoveryservicessiterecovery.generated; - -import com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2SwitchProviderInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProviderInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProviderInputProperties; - -/** - * Samples for ReplicationProtectedItems SwitchProvider. - */ -public final class ReplicationProtectedItemsSwitchProviderSamples { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationProtectedItems_SwitchProvider.json - */ - /** - * Sample code: Execute switch provider. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void - executeSwitchProvider(com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationProtectedItems().switchProvider("vault1", "resourceGroupPS1", "cloud1", - "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", - new SwitchProviderInput().withProperties(new SwitchProviderInputProperties() - .withTargetInstanceType("InMageRcm") - .withProviderSpecificDetails(new InMageAzureV2SwitchProviderInput().withTargetVaultId( - "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault2") - .withTargetFabricId( - "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud2") - .withTargetApplianceId("5efaa202-e958-435e-8171-706bf735fcc4"))), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsTestFailoverCleanupSam.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsTestFailoverCleanupSam.java deleted file mode 100644 index 38d7d1c25465..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsTestFailoverCleanupSam.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.recoveryservicessiterecovery.generated; - -import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverCleanupInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverCleanupInputProperties; - -/** - * Samples for ReplicationProtectedItems TestFailoverCleanup. - */ -public final class ReplicationProtectedItemsTestFailoverCleanupSam { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationProtectedItems_TestFailoverCleanup.json - */ - /** - * Sample code: Execute test failover cleanup. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void - executeTestFailoverCleanup(com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationProtectedItems().testFailoverCleanup("vault1", "resourceGroupPS1", "cloud1", - "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", - new TestFailoverCleanupInput() - .withProperties(new TestFailoverCleanupInputProperties().withComments("Test Failover Cleanup")), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUnplannedFailoverSampl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUnplannedFailoverSampl.java deleted file mode 100644 index 26bb538e0472..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUnplannedFailoverSampl.java +++ /dev/null @@ -1,34 +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.recoveryservicessiterecovery.generated; - -import com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureUnplannedFailoverInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.UnplannedFailoverInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.UnplannedFailoverInputProperties; - -/** - * Samples for ReplicationProtectedItems UnplannedFailover. - */ -public final class ReplicationProtectedItemsUnplannedFailoverSampl { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationProtectedItems_UnplannedFailover.json - */ - /** - * Sample code: Execute unplanned failover. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void - executeUnplannedFailover(com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationProtectedItems().unplannedFailover("vault1", "resourceGroupPS1", "cloud1", - "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", - new UnplannedFailoverInput().withProperties(new UnplannedFailoverInputProperties() - .withFailoverDirection("PrimaryToRecovery").withSourceSiteOperations("NotRequired") - .withProviderSpecificDetails(new HyperVReplicaAzureUnplannedFailoverInput())), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUpdateApplianceSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUpdateApplianceSamples.java deleted file mode 100644 index 29774ec78e10..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUpdateApplianceSamples.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -import com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmUpdateApplianceForReplicationProtectedItemInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateApplianceForReplicationProtectedItemInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateApplianceForReplicationProtectedItemInputProperties; - -/** - * Samples for ReplicationProtectedItems UpdateAppliance. - */ -public final class ReplicationProtectedItemsUpdateApplianceSamples { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationProtectedItems_UpdateAppliance.json - */ - /** - * Sample code: Updates appliance for replication protected Item. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void updatesApplianceForReplicationProtectedItem( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationProtectedItems().updateAppliance("Ayan-0106-SA-Vault", "Ayan-0106-SA-RG", - "Ayan-0106-SA-Vaultreplicationfabric", "Ayan-0106-SA-Vaultreplicationcontainer", - "idclab-vcen67_50158124-8857-3e08-0893-2ddf8ebb8c1f", - new UpdateApplianceForReplicationProtectedItemInput() - .withProperties(new UpdateApplianceForReplicationProtectedItemInputProperties() - .withTargetApplianceId("").withProviderSpecificDetails( - new InMageRcmUpdateApplianceForReplicationProtectedItemInput().withRunAsAccountId(""))), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUpdateMobilityServiceS.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUpdateMobilityServiceS.java deleted file mode 100644 index 0327ef7dfce6..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUpdateMobilityServiceS.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.recoveryservicessiterecovery.generated; - -import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateMobilityServiceRequest; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateMobilityServiceRequestProperties; - -/** - * Samples for ReplicationProtectedItems UpdateMobilityService. - */ -public final class ReplicationProtectedItemsUpdateMobilityServiceS { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationProtectedItems_UpdateMobilityService.json - */ - /** - * Sample code: Update the mobility service on a protected item. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void updateTheMobilityServiceOnAProtectedItem( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationProtectedItems().updateMobilityService("WCUSVault", "wcusValidations", "WIN-JKKJ31QI8U2", - "cloud_c6780228-83bd-4f3e-a70e-cb46b7da33a0", "79dd20ab-2b40-11e7-9791-0050568f387e", - new UpdateMobilityServiceRequest() - .withProperties(new UpdateMobilityServiceRequestProperties().withRunAsAccountId("2")), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsCreateSam.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsCreateSam.java deleted file mode 100644 index 86f26bdf905b..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsCreateSam.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionContainerMappingInputProperties; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProviderSpecificContainerMappingInput; - -/** - * Samples for ReplicationProtectionContainerMappings Create. - */ -public final class ReplicationProtectionContainerMappingsCreateSam { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationProtectionContainerMappings_Create.json - */ - /** - * Sample code: Create protection container mapping. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void createProtectionContainerMapping( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationProtectionContainerMappings().define("cloud1protectionprofile1") - .withExistingReplicationProtectionContainer("vault1", "resourceGroupPS1", "cloud1", - "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179") - .withProperties(new CreateProtectionContainerMappingInputProperties() - .withTargetProtectionContainerId("Microsoft Azure") - .withPolicyId( - "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1") - .withProviderSpecificInput(new ReplicationProviderSpecificContainerMappingInput())) - .create(); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsDeleteSam.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsDeleteSam.java deleted file mode 100644 index c4af1d145053..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsDeleteSam.java +++ /dev/null @@ -1,34 +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.recoveryservicessiterecovery.generated; - -import com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveProtectionContainerMappingInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveProtectionContainerMappingInputProperties; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProviderContainerUnmappingInput; - -/** - * Samples for ReplicationProtectionContainerMappings Delete. - */ -public final class ReplicationProtectionContainerMappingsDeleteSam { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationProtectionContainerMappings_Delete.json - */ - /** - * Sample code: Remove protection container mapping. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void removeProtectionContainerMapping( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationProtectionContainerMappings().delete("vault1", "resourceGroupPS1", "cloud1", - "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "cloud1protectionprofile1", - new RemoveProtectionContainerMappingInput() - .withProperties(new RemoveProtectionContainerMappingInputProperties() - .withProviderSpecificInput(new ReplicationProviderContainerUnmappingInput())), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsGetSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsGetSamples.java deleted file mode 100644 index 58facbe36663..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsGetSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -/** - * Samples for ReplicationProtectionContainerMappings Get. - */ -public final class ReplicationProtectionContainerMappingsGetSamples { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationProtectionContainerMappings_Get.json - */ - /** - * Sample code: Gets a protection container mapping. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void getsAProtectionContainerMapping( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationProtectionContainerMappings().getWithResponse("vault1", "resourceGroupPS1", "cloud1", - "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "cloud1protectionprofile1", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsListByRep.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsListByRep.java deleted file mode 100644 index 18d0ba76bb81..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsListByRep.java +++ /dev/null @@ -1,27 +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.recoveryservicessiterecovery.generated; - -/** - * Samples for ReplicationProtectionContainerMappings ListByReplicationProtectionContainers. - */ -public final class ReplicationProtectionContainerMappingsListByRep { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationProtectionContainerMappings_ListByReplicationProtectionContainers.json - */ - /** - * Sample code: Gets the list of protection container mappings for a protection container. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void getsTheListOfProtectionContainerMappingsForAProtectionContainer( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationProtectionContainerMappings().listByReplicationProtectionContainers("vault1", - "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsListSampl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsListSampl.java deleted file mode 100644 index 909ffae683ea..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsListSampl.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -/** - * Samples for ReplicationProtectionContainerMappings List. - */ -public final class ReplicationProtectionContainerMappingsListSampl { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationProtectionContainerMappings_List.json - */ - /** - * Sample code: Gets the list of all protection container mappings in a vault. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void getsTheListOfAllProtectionContainerMappingsInAVault( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationProtectionContainerMappings().list("vault1", "resourceGroupPS1", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsPurgeSamp.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsPurgeSamp.java deleted file mode 100644 index cc4ec37b70ee..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsPurgeSamp.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -/** - * Samples for ReplicationProtectionContainerMappings Purge. - */ -public final class ReplicationProtectionContainerMappingsPurgeSamp { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationProtectionContainerMappings_Purge.json - */ - /** - * Sample code: Purge protection container mapping. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void purgeProtectionContainerMapping( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationProtectionContainerMappings().purge("vault1", "resourceGroupPS1", "cloud1", - "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "cloud1protectionprofile1", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsUpdateSam.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsUpdateSam.java deleted file mode 100644 index 00fa3ad52ae2..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsUpdateSam.java +++ /dev/null @@ -1,38 +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.recoveryservicessiterecovery.generated; - -import com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AUpdateContainerMappingInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.AgentAutoUpdateStatus; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainerMapping; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateProtectionContainerMappingInputProperties; - -/** - * Samples for ReplicationProtectionContainerMappings Update. - */ -public final class ReplicationProtectionContainerMappingsUpdateSam { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationProtectionContainerMappings_Update.json - */ - /** - * Sample code: Update protection container mapping. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void updateProtectionContainerMapping( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - ProtectionContainerMapping resource = manager.replicationProtectionContainerMappings() - .getWithResponse("vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", - "cloud1protectionprofile1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withProperties(new UpdateProtectionContainerMappingInputProperties() - .withProviderSpecificInput(new A2AUpdateContainerMappingInput() - .withAgentAutoUpdateStatus(AgentAutoUpdateStatus.ENABLED).withAutomationAccountArmId( - "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/automationrg1/providers/Microsoft.Automation/automationAccounts/automationaccount1"))) - .apply(); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersDiscoverProtecta.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersDiscoverProtecta.java deleted file mode 100644 index ed71103f1ac0..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersDiscoverProtecta.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.recoveryservicessiterecovery.generated; - -import com.azure.resourcemanager.recoveryservicessiterecovery.models.DiscoverProtectableItemRequest; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.DiscoverProtectableItemRequestProperties; - -/** - * Samples for ReplicationProtectionContainers DiscoverProtectableItem. - */ -public final class ReplicationProtectionContainersDiscoverProtecta { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationProtectionContainers_DiscoverProtectableItem.json - */ - /** - * Sample code: Adds a protectable item to the replication protection container. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void addsAProtectableItemToTheReplicationProtectionContainer( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationProtectionContainers().discoverProtectableItem("MadhaviVault", "MadhaviVRG", "V2A-W2K12-660", - "cloud_7328549c-5c37-4459-a3c2-e35f9ef6893c", - new DiscoverProtectableItemRequest().withProperties(new DiscoverProtectableItemRequestProperties() - .withFriendlyName("Test").withIpAddress("10.150.2.3").withOsType("Windows")), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersListByReplicatio.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersListByReplicatio.java deleted file mode 100644 index 508f8c0d70b1..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersListByReplicatio.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -/** - * Samples for ReplicationProtectionContainers ListByReplicationFabrics. - */ -public final class ReplicationProtectionContainersListByReplicatio { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationProtectionContainers_ListByReplicationFabrics.json - */ - /** - * Sample code: Gets the list of protection container for a fabric. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void getsTheListOfProtectionContainerForAFabric( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationProtectionContainers().listByReplicationFabrics("vault1", "resourceGroupPS1", "cloud1", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersSwitchProtection.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersSwitchProtection.java deleted file mode 100644 index 4eb8b13a428f..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersSwitchProtection.java +++ /dev/null @@ -1,34 +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.recoveryservicessiterecovery.generated; - -import com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ASwitchProtectionInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProtectionInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProtectionInputProperties; - -/** - * Samples for ReplicationProtectionContainers SwitchProtection. - */ -public final class ReplicationProtectionContainersSwitchProtection { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationProtectionContainers_SwitchProtection.json - */ - /** - * Sample code: Switches protection from one container to another or one replication provider to another. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void switchesProtectionFromOneContainerToAnotherOrOneReplicationProviderToAnother( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationProtectionContainers().switchProtection("priyanponeboxvault", "priyanprg", - "CentralUSCanSite", "CentralUSCancloud", - new SwitchProtectionInput() - .withProperties(new SwitchProtectionInputProperties().withReplicationProtectedItemName("a2aSwapOsVm") - .withProviderSpecificDetails(new A2ASwitchProtectionInput())), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansPlannedFailoverSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansPlannedFailoverSamples.java deleted file mode 100644 index 2c00c8930351..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansPlannedFailoverSamples.java +++ /dev/null @@ -1,35 +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.recoveryservicessiterecovery.generated; - -import com.azure.resourcemanager.recoveryservicessiterecovery.models.PossibleOperationsDirections; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanHyperVReplicaAzureFailoverInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanPlannedFailoverInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanPlannedFailoverInputProperties; -import java.util.Arrays; - -/** - * Samples for ReplicationRecoveryPlans PlannedFailover. - */ -public final class ReplicationRecoveryPlansPlannedFailoverSamples { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationRecoveryPlans_PlannedFailover.json - */ - /** - * Sample code: Execute planned failover of the recovery plan. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void executePlannedFailoverOfTheRecoveryPlan( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationRecoveryPlans().plannedFailover("vault1", "resourceGroupPS1", "RPtest1", - new RecoveryPlanPlannedFailoverInput().withProperties(new RecoveryPlanPlannedFailoverInputProperties() - .withFailoverDirection(PossibleOperationsDirections.PRIMARY_TO_RECOVERY) - .withProviderSpecificDetails(Arrays.asList(new RecoveryPlanHyperVReplicaAzureFailoverInput()))), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansTestFailoverCleanupSamp.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansTestFailoverCleanupSamp.java deleted file mode 100644 index 92dcc0ecf6e0..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansTestFailoverCleanupSamp.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverCleanupInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverCleanupInputProperties; - -/** - * Samples for ReplicationRecoveryPlans TestFailoverCleanup. - */ -public final class ReplicationRecoveryPlansTestFailoverCleanupSamp { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationRecoveryPlans_TestFailoverCleanup.json - */ - /** - * Sample code: Execute test failover cleanup of the recovery plan. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void executeTestFailoverCleanupOfTheRecoveryPlan( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationRecoveryPlans().testFailoverCleanup("vault1", "resourceGroupPS1", "RPtest1", - new RecoveryPlanTestFailoverCleanupInput().withProperties( - new RecoveryPlanTestFailoverCleanupInputProperties().withComments("Test Failover Cleanup")), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansUnplannedFailoverSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansUnplannedFailoverSamples.java deleted file mode 100644 index 6b633653a291..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansUnplannedFailoverSamples.java +++ /dev/null @@ -1,37 +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.recoveryservicessiterecovery.generated; - -import com.azure.resourcemanager.recoveryservicessiterecovery.models.PossibleOperationsDirections; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanHyperVReplicaAzureFailoverInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanUnplannedFailoverInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanUnplannedFailoverInputProperties; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.SourceSiteOperations; -import java.util.Arrays; - -/** - * Samples for ReplicationRecoveryPlans UnplannedFailover. - */ -public final class ReplicationRecoveryPlansUnplannedFailoverSamples { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationRecoveryPlans_UnplannedFailover.json - */ - /** - * Sample code: Execute unplanned failover of the recovery plan. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void executeUnplannedFailoverOfTheRecoveryPlan( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationRecoveryPlans().unplannedFailover("vault1", "resourceGroupPS1", "RPtest1", - new RecoveryPlanUnplannedFailoverInput().withProperties(new RecoveryPlanUnplannedFailoverInputProperties() - .withFailoverDirection(PossibleOperationsDirections.PRIMARY_TO_RECOVERY) - .withSourceSiteOperations(SourceSiteOperations.REQUIRED) - .withProviderSpecificDetails(Arrays.asList(new RecoveryPlanHyperVReplicaAzureFailoverInput()))), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersCreateSampl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersCreateSampl.java deleted file mode 100644 index 441f132e50e3..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersCreateSampl.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.recoveryservicessiterecovery.generated; - -import com.azure.resourcemanager.recoveryservicessiterecovery.models.AddRecoveryServicesProviderInputProperties; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.IdentityProviderInput; - -/** - * Samples for ReplicationRecoveryServicesProviders Create. - */ -public final class ReplicationRecoveryServicesProvidersCreateSampl { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationRecoveryServicesProviders_Create.json - */ - /** - * Sample code: Adds a recovery services provider. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void addsARecoveryServicesProvider( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationRecoveryServicesProviders().define("vmwareprovider1") - .withExistingReplicationFabric("migrationvault", "resourcegroup1", "vmwarefabric1") - .withProperties(new AddRecoveryServicesProviderInputProperties().withMachineName("vmwareprovider1") - .withAuthenticationIdentityInput( - new IdentityProviderInput().withTenantId("72f988bf-86f1-41af-91ab-2d7cd011db47") - .withApplicationId("f66fce08-c0c6-47a1-beeb-0ede5ea94f90") - .withObjectId("141360b8-5686-4240-a027-5e24e6affeba") - .withAudience("https://microsoft.onmicrosoft.com/cf19e349-644c-4c6a-bcae-9c8f35357874") - .withAadAuthority("https://login.microsoftonline.com")) - .withResourceAccessIdentityInput( - new IdentityProviderInput().withTenantId("72f988bf-86f1-41af-91ab-2d7cd011db47") - .withApplicationId("f66fce08-c0c6-47a1-beeb-0ede5ea94f90") - .withObjectId("141360b8-5686-4240-a027-5e24e6affeba") - .withAudience("https://microsoft.onmicrosoft.com/cf19e349-644c-4c6a-bcae-9c8f35357874") - .withAadAuthority("https://login.microsoftonline.com"))) - .create(); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersDeleteSampl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersDeleteSampl.java deleted file mode 100644 index 33f3a703b620..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersDeleteSampl.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -/** - * Samples for ReplicationRecoveryServicesProviders Delete. - */ -public final class ReplicationRecoveryServicesProvidersDeleteSampl { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationRecoveryServicesProviders_Delete.json - */ - /** - * Sample code: Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is - * unsupported. To maintain backward compatibility for released clients the object "deleteRspInput" is used (if the - * object is empty we assume that it is old client and continue the old behavior). - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void - deletesProviderFromFabricNoteDeletingProviderForAnyFabricOtherThanSingleHostIsUnsupportedToMaintainBackwardCompatibilityForReleasedClientsTheObjectDeleteRspInputIsUsedIfTheObjectIsEmptyWeAssumeThatItIsOldClientAndContinueTheOldBehavior( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationRecoveryServicesProviders().delete("vault1", "resourceGroupPS1", "cloud1", - "241641e6-ee7b-4ee4-8141-821fadda43fa", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersGetSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersGetSamples.java deleted file mode 100644 index cc1aada06d5e..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersGetSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -/** - * Samples for ReplicationRecoveryServicesProviders Get. - */ -public final class ReplicationRecoveryServicesProvidersGetSamples { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationRecoveryServicesProviders_Get.json - */ - /** - * Sample code: Gets the details of a recovery services provider. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void getsTheDetailsOfARecoveryServicesProvider( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationRecoveryServicesProviders().getWithResponse("vault1", "resourceGroupPS1", "cloud1", - "241641e6-ee7b-4ee4-8141-821fadda43fa", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersListByRepli.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersListByRepli.java deleted file mode 100644 index b075a140af16..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersListByRepli.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -/** - * Samples for ReplicationRecoveryServicesProviders ListByReplicationFabrics. - */ -public final class ReplicationRecoveryServicesProvidersListByRepli { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationRecoveryServicesProviders_ListByReplicationFabrics.json - */ - /** - * Sample code: Gets the list of registered recovery services providers for the fabric. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void getsTheListOfRegisteredRecoveryServicesProvidersForTheFabric( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationRecoveryServicesProviders().listByReplicationFabrics("vault1", "resourceGroupPS1", "cloud1", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersListSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersListSamples.java deleted file mode 100644 index 1f8d2a0c21d9..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersListSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -/** - * Samples for ReplicationRecoveryServicesProviders List. - */ -public final class ReplicationRecoveryServicesProvidersListSamples { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationRecoveryServicesProviders_List.json - */ - /** - * Sample code: Gets the list of registered recovery services providers in the vault. This is a view only api. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void getsTheListOfRegisteredRecoveryServicesProvidersInTheVaultThisIsAViewOnlyApi( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationRecoveryServicesProviders().list("vault1", "resourceGroupPS1", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersPurgeSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersPurgeSamples.java deleted file mode 100644 index 8661210581b0..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersPurgeSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -/** - * Samples for ReplicationRecoveryServicesProviders Purge. - */ -public final class ReplicationRecoveryServicesProvidersPurgeSamples { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationRecoveryServicesProviders_Purge.json - */ - /** - * Sample code: Purges recovery service provider from fabric. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void purgesRecoveryServiceProviderFromFabric( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationRecoveryServicesProviders().purge("vault1", "resourceGroupPS1", "cloud1", - "241641e6-ee7b-4ee4-8141-821fadda43fa", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersRefreshProv.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersRefreshProv.java deleted file mode 100644 index b4e81583005c..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersRefreshProv.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -/** - * Samples for ReplicationRecoveryServicesProviders RefreshProvider. - */ -public final class ReplicationRecoveryServicesProvidersRefreshProv { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationRecoveryServicesProviders_RefreshProvider.json - */ - /** - * Sample code: Refresh details from the recovery services provider. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void refreshDetailsFromTheRecoveryServicesProvider( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationRecoveryServicesProviders().refreshProvider("vault1", "resourceGroupPS1", "cloud1", - "241641e6-ee7b-4ee4-8141-821fadda43fa", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersListByReplicationFabricsSamp.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersListByReplicationFabricsSamp.java deleted file mode 100644 index 0da26d648fa9..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersListByReplicationFabricsSamp.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -/** - * Samples for ReplicationvCenters ListByReplicationFabrics. - */ -public final class ReplicationvCentersListByReplicationFabricsSamp { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationvCenters_ListByReplicationFabrics.json - */ - /** - * Sample code: Gets the list of vCenter registered under a fabric. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void getsTheListOfVCenterRegisteredUnderAFabric( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.replicationvCenters().listByReplicationFabrics("MadhaviVault", "MadhaviVRG", "MadhaviFabric", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/StorageClassificationMappingsListByReplicationS.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/StorageClassificationMappingsListByReplicationS.java deleted file mode 100644 index 985242c2818f..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/StorageClassificationMappingsListByReplicationS.java +++ /dev/null @@ -1,27 +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.recoveryservicessiterecovery.generated; - -/** - * Samples for StorageClassificationMappings ListByReplicationStorageClassifications. - */ -public final class StorageClassificationMappingsListByReplicationS { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationStorageClassificationMappings_ListByReplicationStorageClassifications.json - */ - /** - * Sample code: Gets the list of storage classification mappings objects under a storage. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void getsTheListOfStorageClassificationMappingsObjectsUnderAStorage( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.storageClassificationMappings().listByReplicationStorageClassifications("vault1", "resourceGroupPS1", - "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0", "8891569e-aaef-4a46-a4a0-78c14f2d7b09", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/StorageClassificationsListByReplicationFabricsS.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/StorageClassificationsListByReplicationFabricsS.java deleted file mode 100644 index 1196306a3371..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/StorageClassificationsListByReplicationFabricsS.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -/** - * Samples for StorageClassifications ListByReplicationFabrics. - */ -public final class StorageClassificationsListByReplicationFabricsS { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /ReplicationStorageClassifications_ListByReplicationFabrics.json - */ - /** - * Sample code: Gets the list of storage classification objects under a fabric. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void getsTheListOfStorageClassificationObjectsUnderAFabric( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.storageClassifications().listByReplicationFabrics("vault1", "resourceGroupPS1", - "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/TargetComputeSizesListByReplicationProtectedIte.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/TargetComputeSizesListByReplicationProtectedIte.java deleted file mode 100644 index a651d56cee6c..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/TargetComputeSizesListByReplicationProtectedIte.java +++ /dev/null @@ -1,27 +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.recoveryservicessiterecovery.generated; - -/** - * Samples for TargetComputeSizes ListByReplicationProtectedItems. - */ -public final class TargetComputeSizesListByReplicationProtectedIte { - /* - * x-ms-original-file: - * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples - * /TargetComputeSizes_ListByReplicationProtectedItems.json - */ - /** - * Sample code: Gets the list of target compute sizes for the replication protected item. - * - * @param manager Entry point to SiteRecoveryManager. - */ - public static void getsTheListOfTargetComputeSizesForTheReplicationProtectedItem( - com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { - manager.targetComputeSizes().listByReplicationProtectedItems("avraiMgDiskVault", "avraiMgDiskVaultRG", - "asr-a2a-default-centraluseuap", "asr-a2a-default-centraluseuap-container", - "468c912d-b1ab-4ea2-97eb-4b5095155db2", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/A2ACrossClusterMigrationApplyRecoveryPointInputTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/A2ACrossClusterMigrationApplyRecoveryPointInputTests.java deleted file mode 100644 index 85b7b8eaf0d8..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/A2ACrossClusterMigrationApplyRecoveryPointInputTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ACrossClusterMigrationApplyRecoveryPointInput; - -public final class A2ACrossClusterMigrationApplyRecoveryPointInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - A2ACrossClusterMigrationApplyRecoveryPointInput model - = BinaryData.fromString("{\"instanceType\":\"A2ACrossClusterMigration\"}") - .toObject(A2ACrossClusterMigrationApplyRecoveryPointInput.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - A2ACrossClusterMigrationApplyRecoveryPointInput model = new A2ACrossClusterMigrationApplyRecoveryPointInput(); - model = BinaryData.fromObject(model).toObject(A2ACrossClusterMigrationApplyRecoveryPointInput.class); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/A2ACrossClusterMigrationContainerCreationInputTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/A2ACrossClusterMigrationContainerCreationInputTests.java deleted file mode 100644 index 61eda4fc31b8..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/A2ACrossClusterMigrationContainerCreationInputTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ACrossClusterMigrationContainerCreationInput; - -public final class A2ACrossClusterMigrationContainerCreationInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - A2ACrossClusterMigrationContainerCreationInput model - = BinaryData.fromString("{\"instanceType\":\"A2ACrossClusterMigration\"}") - .toObject(A2ACrossClusterMigrationContainerCreationInput.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - A2ACrossClusterMigrationContainerCreationInput model = new A2ACrossClusterMigrationContainerCreationInput(); - model = BinaryData.fromObject(model).toObject(A2ACrossClusterMigrationContainerCreationInput.class); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/A2ACrossClusterMigrationEnableProtectionInputTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/A2ACrossClusterMigrationEnableProtectionInputTests.java deleted file mode 100644 index 96b7033609cb..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/A2ACrossClusterMigrationEnableProtectionInputTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ACrossClusterMigrationEnableProtectionInput; -import org.junit.jupiter.api.Assertions; - -public final class A2ACrossClusterMigrationEnableProtectionInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - A2ACrossClusterMigrationEnableProtectionInput model = BinaryData.fromString( - "{\"instanceType\":\"A2ACrossClusterMigration\",\"fabricObjectId\":\"lickduoi\",\"recoveryContainerId\":\"amt\"}") - .toObject(A2ACrossClusterMigrationEnableProtectionInput.class); - Assertions.assertEquals("lickduoi", model.fabricObjectId()); - Assertions.assertEquals("amt", model.recoveryContainerId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - A2ACrossClusterMigrationEnableProtectionInput model = new A2ACrossClusterMigrationEnableProtectionInput() - .withFabricObjectId("lickduoi").withRecoveryContainerId("amt"); - model = BinaryData.fromObject(model).toObject(A2ACrossClusterMigrationEnableProtectionInput.class); - Assertions.assertEquals("lickduoi", model.fabricObjectId()); - Assertions.assertEquals("amt", model.recoveryContainerId()); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/CreateProtectionContainerMappingInputPropertiesTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/CreateProtectionContainerMappingInputPropertiesTests.java deleted file mode 100644 index fc6302e55e41..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/CreateProtectionContainerMappingInputPropertiesTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionContainerMappingInputProperties; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProviderSpecificContainerMappingInput; -import org.junit.jupiter.api.Assertions; - -public final class CreateProtectionContainerMappingInputPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CreateProtectionContainerMappingInputProperties model = BinaryData.fromString( - "{\"targetProtectionContainerId\":\"qbmfpjbabwidf\",\"policyId\":\"sspuunnoxyhkx\",\"providerSpecificInput\":{\"instanceType\":\"ReplicationProviderSpecificContainerMappingInput\"}}") - .toObject(CreateProtectionContainerMappingInputProperties.class); - Assertions.assertEquals("qbmfpjbabwidf", model.targetProtectionContainerId()); - Assertions.assertEquals("sspuunnoxyhkx", model.policyId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CreateProtectionContainerMappingInputProperties model = new CreateProtectionContainerMappingInputProperties() - .withTargetProtectionContainerId("qbmfpjbabwidf").withPolicyId("sspuunnoxyhkx") - .withProviderSpecificInput(new ReplicationProviderSpecificContainerMappingInput()); - model = BinaryData.fromObject(model).toObject(CreateProtectionContainerMappingInputProperties.class); - Assertions.assertEquals("qbmfpjbabwidf", model.targetProtectionContainerId()); - Assertions.assertEquals("sspuunnoxyhkx", model.policyId()); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/CreateProtectionIntentProviderSpecificDetailsTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/CreateProtectionIntentProviderSpecificDetailsTests.java deleted file mode 100644 index 8f3bbf17f1d9..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/CreateProtectionIntentProviderSpecificDetailsTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionIntentProviderSpecificDetails; - -public final class CreateProtectionIntentProviderSpecificDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CreateProtectionIntentProviderSpecificDetails model - = BinaryData.fromString("{\"instanceType\":\"CreateProtectionIntentProviderSpecificDetails\"}") - .toObject(CreateProtectionIntentProviderSpecificDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CreateProtectionIntentProviderSpecificDetails model = new CreateProtectionIntentProviderSpecificDetails(); - model = BinaryData.fromObject(model).toObject(CreateProtectionIntentProviderSpecificDetails.class); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/HyperVReplicaAzurePlannedFailoverProviderInputTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/HyperVReplicaAzurePlannedFailoverProviderInputTests.java deleted file mode 100644 index a7e1de51cd31..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/HyperVReplicaAzurePlannedFailoverProviderInputTests.java +++ /dev/null @@ -1,34 +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.recoveryservicessiterecovery.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzurePlannedFailoverProviderInput; -import org.junit.jupiter.api.Assertions; - -public final class HyperVReplicaAzurePlannedFailoverProviderInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HyperVReplicaAzurePlannedFailoverProviderInput model = BinaryData.fromString( - "{\"instanceType\":\"HyperVReplicaAzure\",\"primaryKekCertificatePfx\":\"fsbw\",\"secondaryKekCertificatePfx\":\"ivbvzi\",\"recoveryPointId\":\"wxgoooxzpra\",\"osUpgradeVersion\":\"s\"}") - .toObject(HyperVReplicaAzurePlannedFailoverProviderInput.class); - Assertions.assertEquals("fsbw", model.primaryKekCertificatePfx()); - Assertions.assertEquals("ivbvzi", model.secondaryKekCertificatePfx()); - Assertions.assertEquals("wxgoooxzpra", model.recoveryPointId()); - Assertions.assertEquals("s", model.osUpgradeVersion()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HyperVReplicaAzurePlannedFailoverProviderInput model - = new HyperVReplicaAzurePlannedFailoverProviderInput().withPrimaryKekCertificatePfx("fsbw") - .withSecondaryKekCertificatePfx("ivbvzi").withRecoveryPointId("wxgoooxzpra").withOsUpgradeVersion("s"); - model = BinaryData.fromObject(model).toObject(HyperVReplicaAzurePlannedFailoverProviderInput.class); - Assertions.assertEquals("fsbw", model.primaryKekCertificatePfx()); - Assertions.assertEquals("ivbvzi", model.secondaryKekCertificatePfx()); - Assertions.assertEquals("wxgoooxzpra", model.recoveryPointId()); - Assertions.assertEquals("s", model.osUpgradeVersion()); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageAzureV2UpdateReplicationProtectedItemInputTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageAzureV2UpdateReplicationProtectedItemInputTests.java deleted file mode 100644 index 4170b0db073c..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageAzureV2UpdateReplicationProtectedItemInputTests.java +++ /dev/null @@ -1,73 +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.recoveryservicessiterecovery.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2UpdateReplicationProtectedItemInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.SqlServerLicenseType; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateDiskInput; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class InMageAzureV2UpdateReplicationProtectedItemInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InMageAzureV2UpdateReplicationProtectedItemInput model = BinaryData.fromString( - "{\"instanceType\":\"InMageAzureV2\",\"recoveryAzureV1ResourceGroupId\":\"llrqmtlpbyxro\",\"recoveryAzureV2ResourceGroupId\":\"uyqyp\",\"useManagedDisks\":\"mnoiicsudy\",\"targetProximityPlacementGroupId\":\"rjjtalxrdsjrho\",\"targetAvailabilityZone\":\"qwgusxxhdo\",\"targetVmTags\":{\"bdmvsby\":\"wyblv\",\"kmkwjfbo\":\"daelqpv\",\"v\":\"loggdusxursu\",\"qrizfwihvaan\":\"xcjkcoqwczsy\"},\"targetManagedDiskTags\":{\"bbaex\":\"nhjrfdmfd\",\"vmuafmc\":\"jfwtgdfkkaui\",\"vpltidajjvy\":\"fedyuep\"},\"targetNicTags\":{\"yelsyasvfnk\":\"cfkumcfjxo\",\"jekrknfd\":\"myg\",\"lcr\":\"ugjqyckgtxkrdt\",\"tcsubmzoo\":\"jdkl\"},\"sqlServerLicenseType\":\"NotSpecified\",\"vmDisks\":[{\"diskId\":\"chkxfpwhdysl\",\"targetDiskName\":\"lglmnnkkwayqsh\"}]}") - .toObject(InMageAzureV2UpdateReplicationProtectedItemInput.class); - Assertions.assertEquals("llrqmtlpbyxro", model.recoveryAzureV1ResourceGroupId()); - Assertions.assertEquals("uyqyp", model.recoveryAzureV2ResourceGroupId()); - Assertions.assertEquals("mnoiicsudy", model.useManagedDisks()); - Assertions.assertEquals("rjjtalxrdsjrho", model.targetProximityPlacementGroupId()); - Assertions.assertEquals("qwgusxxhdo", model.targetAvailabilityZone()); - Assertions.assertEquals("wyblv", model.targetVmTags().get("bdmvsby")); - Assertions.assertEquals("nhjrfdmfd", model.targetManagedDiskTags().get("bbaex")); - Assertions.assertEquals("cfkumcfjxo", model.targetNicTags().get("yelsyasvfnk")); - Assertions.assertEquals(SqlServerLicenseType.NOT_SPECIFIED, model.sqlServerLicenseType()); - Assertions.assertEquals("chkxfpwhdysl", model.vmDisks().get(0).diskId()); - Assertions.assertEquals("lglmnnkkwayqsh", model.vmDisks().get(0).targetDiskName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InMageAzureV2UpdateReplicationProtectedItemInput model = new InMageAzureV2UpdateReplicationProtectedItemInput() - .withRecoveryAzureV1ResourceGroupId("llrqmtlpbyxro").withRecoveryAzureV2ResourceGroupId("uyqyp") - .withUseManagedDisks("mnoiicsudy").withTargetProximityPlacementGroupId("rjjtalxrdsjrho") - .withTargetAvailabilityZone("qwgusxxhdo") - .withTargetVmTags( - mapOf("bdmvsby", "wyblv", "kmkwjfbo", "daelqpv", "v", "loggdusxursu", "qrizfwihvaan", "xcjkcoqwczsy")) - .withTargetManagedDiskTags(mapOf("bbaex", "nhjrfdmfd", "vmuafmc", "jfwtgdfkkaui", "vpltidajjvy", "fedyuep")) - .withTargetNicTags( - mapOf("yelsyasvfnk", "cfkumcfjxo", "jekrknfd", "myg", "lcr", "ugjqyckgtxkrdt", "tcsubmzoo", "jdkl")) - .withSqlServerLicenseType(SqlServerLicenseType.NOT_SPECIFIED).withVmDisks( - Arrays.asList(new UpdateDiskInput().withDiskId("chkxfpwhdysl").withTargetDiskName("lglmnnkkwayqsh"))); - model = BinaryData.fromObject(model).toObject(InMageAzureV2UpdateReplicationProtectedItemInput.class); - Assertions.assertEquals("llrqmtlpbyxro", model.recoveryAzureV1ResourceGroupId()); - Assertions.assertEquals("uyqyp", model.recoveryAzureV2ResourceGroupId()); - Assertions.assertEquals("mnoiicsudy", model.useManagedDisks()); - Assertions.assertEquals("rjjtalxrdsjrho", model.targetProximityPlacementGroupId()); - Assertions.assertEquals("qwgusxxhdo", model.targetAvailabilityZone()); - Assertions.assertEquals("wyblv", model.targetVmTags().get("bdmvsby")); - Assertions.assertEquals("nhjrfdmfd", model.targetManagedDiskTags().get("bbaex")); - Assertions.assertEquals("cfkumcfjxo", model.targetNicTags().get("yelsyasvfnk")); - Assertions.assertEquals(SqlServerLicenseType.NOT_SPECIFIED, model.sqlServerLicenseType()); - Assertions.assertEquals("chkxfpwhdysl", model.vmDisks().get(0).diskId()); - Assertions.assertEquals("lglmnnkkwayqsh", model.vmDisks().get(0).targetDiskName()); - } - - // 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageDisableProtectionProviderSpecificInputTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageDisableProtectionProviderSpecificInputTests.java deleted file mode 100644 index 1463a5e79fb1..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageDisableProtectionProviderSpecificInputTests.java +++ /dev/null @@ -1,27 +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.recoveryservicessiterecovery.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageDisableProtectionProviderSpecificInput; -import org.junit.jupiter.api.Assertions; - -public final class InMageDisableProtectionProviderSpecificInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InMageDisableProtectionProviderSpecificInput model - = BinaryData.fromString("{\"instanceType\":\"InMage\",\"replicaVmDeletionStatus\":\"q\"}") - .toObject(InMageDisableProtectionProviderSpecificInput.class); - Assertions.assertEquals("q", model.replicaVmDeletionStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InMageDisableProtectionProviderSpecificInput model - = new InMageDisableProtectionProviderSpecificInput().withReplicaVmDeletionStatus("q"); - model = BinaryData.fromObject(model).toObject(InMageDisableProtectionProviderSpecificInput.class); - Assertions.assertEquals("q", model.replicaVmDeletionStatus()); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageRcmFailbackDiscoveredProtectedVmDetailsTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageRcmFailbackDiscoveredProtectedVmDetailsTests.java deleted file mode 100644 index 2a2fff902f03..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageRcmFailbackDiscoveredProtectedVmDetailsTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFailbackDiscoveredProtectedVmDetails; - -public final class InMageRcmFailbackDiscoveredProtectedVmDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InMageRcmFailbackDiscoveredProtectedVmDetails model = BinaryData.fromString( - "{\"vCenterId\":\"zkdolrndwdbvxvza\",\"vCenterFqdn\":\"doyqx\",\"datastores\":[\"kft\",\"mcxqqxmyzklao\",\"n\",\"ohrvmz\"],\"ipAddresses\":[\"azad\",\"vznllaslkskhjqj\",\"vbaihxjt\",\"zgtai\"],\"vmwareToolsStatus\":\"b\",\"powerStatus\":\"roigbsfsgsaenwld\",\"vmFqdn\":\"hljqlxsp\",\"osName\":\"jc\",\"createdTimestamp\":\"2021-06-14T00:46:05Z\",\"updatedTimestamp\":\"2021-03-22T03:50:23Z\",\"isDeleted\":true,\"lastDiscoveryTimeInUtc\":\"2021-08-20T07:36Z\"}") - .toObject(InMageRcmFailbackDiscoveredProtectedVmDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InMageRcmFailbackDiscoveredProtectedVmDetails model = new InMageRcmFailbackDiscoveredProtectedVmDetails(); - model = BinaryData.fromObject(model).toObject(InMageRcmFailbackDiscoveredProtectedVmDetails.class); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageRcmFailbackPlannedFailoverProviderInputTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageRcmFailbackPlannedFailoverProviderInputTests.java deleted file mode 100644 index 1114198d4bbc..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageRcmFailbackPlannedFailoverProviderInputTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFailbackPlannedFailoverProviderInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFailbackRecoveryPointType; -import org.junit.jupiter.api.Assertions; - -public final class InMageRcmFailbackPlannedFailoverProviderInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InMageRcmFailbackPlannedFailoverProviderInput model = BinaryData - .fromString("{\"instanceType\":\"InMageRcmFailback\",\"recoveryPointType\":\"CrashConsistent\"}") - .toObject(InMageRcmFailbackPlannedFailoverProviderInput.class); - Assertions.assertEquals(InMageRcmFailbackRecoveryPointType.CRASH_CONSISTENT, model.recoveryPointType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InMageRcmFailbackPlannedFailoverProviderInput model = new InMageRcmFailbackPlannedFailoverProviderInput() - .withRecoveryPointType(InMageRcmFailbackRecoveryPointType.CRASH_CONSISTENT); - model = BinaryData.fromObject(model).toObject(InMageRcmFailbackPlannedFailoverProviderInput.class); - Assertions.assertEquals(InMageRcmFailbackRecoveryPointType.CRASH_CONSISTENT, model.recoveryPointType()); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageRcmUpdateReplicationProtectedItemInputTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageRcmUpdateReplicationProtectedItemInputTests.java deleted file mode 100644 index eb87c97e577a..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageRcmUpdateReplicationProtectedItemInputTests.java +++ /dev/null @@ -1,75 +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.recoveryservicessiterecovery.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmNicInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmUpdateReplicationProtectedItemInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.LicenseType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class InMageRcmUpdateReplicationProtectedItemInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InMageRcmUpdateReplicationProtectedItemInput model = BinaryData.fromString( - "{\"instanceType\":\"InMageRcm\",\"targetVmName\":\"tuxy\",\"targetVmSize\":\"hfcaeo\",\"targetResourceGroupId\":\"fqd\",\"targetAvailabilitySetId\":\"jflobhahqmomf\",\"targetAvailabilityZone\":\"o\",\"targetProximityPlacementGroupId\":\"fr\",\"targetBootDiagnosticsStorageAccountId\":\"gbmxldjmz\",\"targetNetworkId\":\"bjesylslur\",\"testNetworkId\":\"fygpnyhgd\",\"vmNics\":[{\"nicId\":\"sc\",\"isPrimaryNic\":\"gqyvouprsytqzss\",\"isSelectedForFailover\":\"mgw\",\"targetSubnetName\":\"ivrxpfduiol\",\"targetStaticIPAddress\":\"yqvpbfjpo\",\"testSubnetName\":\"ucfzluczdquu\",\"testStaticIPAddress\":\"ormvh\"},{\"nicId\":\"zielbprnq\",\"isPrimaryNic\":\"jywzcqyg\",\"isSelectedForFailover\":\"nwsvhbngqiwye\",\"targetSubnetName\":\"ob\",\"targetStaticIPAddress\":\"rpnrehkunsbfjh\",\"testSubnetName\":\"w\",\"testStaticIPAddress\":\"kvegeattbzkgtzq\"}],\"licenseType\":\"NoLicenseType\"}") - .toObject(InMageRcmUpdateReplicationProtectedItemInput.class); - Assertions.assertEquals("tuxy", model.targetVmName()); - Assertions.assertEquals("hfcaeo", model.targetVmSize()); - Assertions.assertEquals("fqd", model.targetResourceGroupId()); - Assertions.assertEquals("jflobhahqmomf", model.targetAvailabilitySetId()); - Assertions.assertEquals("o", model.targetAvailabilityZone()); - Assertions.assertEquals("fr", model.targetProximityPlacementGroupId()); - Assertions.assertEquals("gbmxldjmz", model.targetBootDiagnosticsStorageAccountId()); - Assertions.assertEquals("bjesylslur", model.targetNetworkId()); - Assertions.assertEquals("fygpnyhgd", model.testNetworkId()); - Assertions.assertEquals("sc", model.vmNics().get(0).nicId()); - Assertions.assertEquals("gqyvouprsytqzss", model.vmNics().get(0).isPrimaryNic()); - Assertions.assertEquals("mgw", model.vmNics().get(0).isSelectedForFailover()); - Assertions.assertEquals("ivrxpfduiol", model.vmNics().get(0).targetSubnetName()); - Assertions.assertEquals("yqvpbfjpo", model.vmNics().get(0).targetStaticIpAddress()); - Assertions.assertEquals("ucfzluczdquu", model.vmNics().get(0).testSubnetName()); - Assertions.assertEquals("ormvh", model.vmNics().get(0).testStaticIpAddress()); - Assertions.assertEquals(LicenseType.NO_LICENSE_TYPE, model.licenseType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InMageRcmUpdateReplicationProtectedItemInput model = new InMageRcmUpdateReplicationProtectedItemInput() - .withTargetVmName("tuxy").withTargetVmSize("hfcaeo").withTargetResourceGroupId("fqd") - .withTargetAvailabilitySetId("jflobhahqmomf").withTargetAvailabilityZone("o") - .withTargetProximityPlacementGroupId("fr").withTargetBootDiagnosticsStorageAccountId("gbmxldjmz") - .withTargetNetworkId("bjesylslur").withTestNetworkId("fygpnyhgd") - .withVmNics(Arrays.asList( - new InMageRcmNicInput().withNicId("sc").withIsPrimaryNic("gqyvouprsytqzss") - .withIsSelectedForFailover("mgw").withTargetSubnetName("ivrxpfduiol") - .withTargetStaticIpAddress("yqvpbfjpo").withTestSubnetName("ucfzluczdquu") - .withTestStaticIpAddress("ormvh"), - new InMageRcmNicInput().withNicId("zielbprnq").withIsPrimaryNic("jywzcqyg") - .withIsSelectedForFailover("nwsvhbngqiwye").withTargetSubnetName("ob") - .withTargetStaticIpAddress("rpnrehkunsbfjh").withTestSubnetName("w") - .withTestStaticIpAddress("kvegeattbzkgtzq"))) - .withLicenseType(LicenseType.NO_LICENSE_TYPE); - model = BinaryData.fromObject(model).toObject(InMageRcmUpdateReplicationProtectedItemInput.class); - Assertions.assertEquals("tuxy", model.targetVmName()); - Assertions.assertEquals("hfcaeo", model.targetVmSize()); - Assertions.assertEquals("fqd", model.targetResourceGroupId()); - Assertions.assertEquals("jflobhahqmomf", model.targetAvailabilitySetId()); - Assertions.assertEquals("o", model.targetAvailabilityZone()); - Assertions.assertEquals("fr", model.targetProximityPlacementGroupId()); - Assertions.assertEquals("gbmxldjmz", model.targetBootDiagnosticsStorageAccountId()); - Assertions.assertEquals("bjesylslur", model.targetNetworkId()); - Assertions.assertEquals("fygpnyhgd", model.testNetworkId()); - Assertions.assertEquals("sc", model.vmNics().get(0).nicId()); - Assertions.assertEquals("gqyvouprsytqzss", model.vmNics().get(0).isPrimaryNic()); - Assertions.assertEquals("mgw", model.vmNics().get(0).isSelectedForFailover()); - Assertions.assertEquals("ivrxpfduiol", model.vmNics().get(0).targetSubnetName()); - Assertions.assertEquals("yqvpbfjpo", model.vmNics().get(0).targetStaticIpAddress()); - Assertions.assertEquals("ucfzluczdquu", model.vmNics().get(0).testSubnetName()); - Assertions.assertEquals("ormvh", model.vmNics().get(0).testStaticIpAddress()); - Assertions.assertEquals(LicenseType.NO_LICENSE_TYPE, model.licenseType()); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/PlannedFailoverProviderSpecificFailoverInputTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/PlannedFailoverProviderSpecificFailoverInputTests.java deleted file mode 100644 index ce88dc844299..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/PlannedFailoverProviderSpecificFailoverInputTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.PlannedFailoverProviderSpecificFailoverInput; - -public final class PlannedFailoverProviderSpecificFailoverInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PlannedFailoverProviderSpecificFailoverInput model - = BinaryData.fromString("{\"instanceType\":\"PlannedFailoverProviderSpecificFailoverInput\"}") - .toObject(PlannedFailoverProviderSpecificFailoverInput.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PlannedFailoverProviderSpecificFailoverInput model = new PlannedFailoverProviderSpecificFailoverInput(); - model = BinaryData.fromObject(model).toObject(PlannedFailoverProviderSpecificFailoverInput.class); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ProtectionContainerMappingProviderSpecificDetailsTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ProtectionContainerMappingProviderSpecificDetailsTests.java deleted file mode 100644 index 182e475e00df..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ProtectionContainerMappingProviderSpecificDetailsTests.java +++ /dev/null @@ -1,24 +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.recoveryservicessiterecovery.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainerMappingProviderSpecificDetails; - -public final class ProtectionContainerMappingProviderSpecificDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProtectionContainerMappingProviderSpecificDetails model - = BinaryData.fromString("{\"instanceType\":\"ProtectionContainerMappingProviderSpecificDetails\"}") - .toObject(ProtectionContainerMappingProviderSpecificDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProtectionContainerMappingProviderSpecificDetails model - = new ProtectionContainerMappingProviderSpecificDetails(); - model = BinaryData.fromObject(model).toObject(ProtectionContainerMappingProviderSpecificDetails.class); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPlanTestFailoverCleanupInputPropertiesTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPlanTestFailoverCleanupInputPropertiesTests.java deleted file mode 100644 index 3efd91189356..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPlanTestFailoverCleanupInputPropertiesTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverCleanupInputProperties; -import org.junit.jupiter.api.Assertions; - -public final class RecoveryPlanTestFailoverCleanupInputPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RecoveryPlanTestFailoverCleanupInputProperties model = BinaryData.fromString("{\"comments\":\"d\"}") - .toObject(RecoveryPlanTestFailoverCleanupInputProperties.class); - Assertions.assertEquals("d", model.comments()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RecoveryPlanTestFailoverCleanupInputProperties model - = new RecoveryPlanTestFailoverCleanupInputProperties().withComments("d"); - model = BinaryData.fromObject(model).toObject(RecoveryPlanTestFailoverCleanupInputProperties.class); - Assertions.assertEquals("d", model.comments()); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPlanUnplannedFailoverInputPropertiesTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPlanUnplannedFailoverInputPropertiesTests.java deleted file mode 100644 index 33cd2774a55c..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPlanUnplannedFailoverInputPropertiesTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.PossibleOperationsDirections; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanProviderSpecificFailoverInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanUnplannedFailoverInputProperties; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.SourceSiteOperations; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RecoveryPlanUnplannedFailoverInputPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RecoveryPlanUnplannedFailoverInputProperties model = BinaryData.fromString( - "{\"failoverDirection\":\"RecoveryToPrimary\",\"sourceSiteOperations\":\"NotRequired\",\"providerSpecificDetails\":[{\"instanceType\":\"RecoveryPlanProviderSpecificFailoverInput\"},{\"instanceType\":\"RecoveryPlanProviderSpecificFailoverInput\"},{\"instanceType\":\"RecoveryPlanProviderSpecificFailoverInput\"}]}") - .toObject(RecoveryPlanUnplannedFailoverInputProperties.class); - Assertions.assertEquals(PossibleOperationsDirections.RECOVERY_TO_PRIMARY, model.failoverDirection()); - Assertions.assertEquals(SourceSiteOperations.NOT_REQUIRED, model.sourceSiteOperations()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RecoveryPlanUnplannedFailoverInputProperties model = new RecoveryPlanUnplannedFailoverInputProperties() - .withFailoverDirection(PossibleOperationsDirections.RECOVERY_TO_PRIMARY) - .withSourceSiteOperations(SourceSiteOperations.NOT_REQUIRED) - .withProviderSpecificDetails(Arrays.asList(new RecoveryPlanProviderSpecificFailoverInput(), - new RecoveryPlanProviderSpecificFailoverInput(), new RecoveryPlanProviderSpecificFailoverInput())); - model = BinaryData.fromObject(model).toObject(RecoveryPlanUnplannedFailoverInputProperties.class); - Assertions.assertEquals(PossibleOperationsDirections.RECOVERY_TO_PRIMARY, model.failoverDirection()); - Assertions.assertEquals(SourceSiteOperations.NOT_REQUIRED, model.sourceSiteOperations()); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPointsListByReplicationProtectedItemsMockTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPointsListByReplicationProtectedItemsMockTests.java deleted file mode 100644 index 67bffbfbff86..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPointsListByReplicationProtectedItemsMockTests.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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.SiteRecoveryManager; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPoint; -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 RecoveryPointsListByReplicationProtectedItemsMockTests { - @Test - public void testListByReplicationProtectedItems() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"value\":[{\"properties\":{\"recoveryPointTime\":\"2021-08-10T18:08:27Z\",\"recoveryPointType\":\"utyjukkedputocr\",\"providerSpecificDetails\":{\"instanceType\":\"ProviderSpecificRecoveryPointDetails\"}},\"location\":\"qicmdrgcuzjmvk\",\"id\":\"wrjcqhgcmljzk\",\"name\":\"qimybqjvfio\",\"type\":\"hcaqpv\"}]}"; - - 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); - })); - - SiteRecoveryManager manager = SiteRecoveryManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.recoveryPoints().listByReplicationProtectedItems("ehdhjofywwna", - "oxlorxgsl", "c", "u", "hvpaglyyhrgma", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(OffsetDateTime.parse("2021-08-10T18:08:27Z"), - response.iterator().next().properties().recoveryPointTime()); - Assertions.assertEquals("utyjukkedputocr", response.iterator().next().properties().recoveryPointType()); - Assertions.assertEquals("qicmdrgcuzjmvk", response.iterator().next().location()); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryProximityPlacementGroupCustomDetailsTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryProximityPlacementGroupCustomDetailsTests.java deleted file mode 100644 index 4dcc3d7ca9be..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryProximityPlacementGroupCustomDetailsTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryProximityPlacementGroupCustomDetails; - -public final class RecoveryProximityPlacementGroupCustomDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RecoveryProximityPlacementGroupCustomDetails model - = BinaryData.fromString("{\"resourceType\":\"RecoveryProximityPlacementGroupCustomDetails\"}") - .toObject(RecoveryProximityPlacementGroupCustomDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RecoveryProximityPlacementGroupCustomDetails model = new RecoveryProximityPlacementGroupCustomDetails(); - model = BinaryData.fromObject(model).toObject(RecoveryProximityPlacementGroupCustomDetails.class); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RemoveProtectionContainerMappingInputPropertiesTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RemoveProtectionContainerMappingInputPropertiesTests.java deleted file mode 100644 index fd032ad6019e..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RemoveProtectionContainerMappingInputPropertiesTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveProtectionContainerMappingInputProperties; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProviderContainerUnmappingInput; -import org.junit.jupiter.api.Assertions; - -public final class RemoveProtectionContainerMappingInputPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RemoveProtectionContainerMappingInputProperties model - = BinaryData.fromString("{\"providerSpecificInput\":{\"instanceType\":\"dao\"}}") - .toObject(RemoveProtectionContainerMappingInputProperties.class); - Assertions.assertEquals("dao", model.providerSpecificInput().instanceType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RemoveProtectionContainerMappingInputProperties model = new RemoveProtectionContainerMappingInputProperties() - .withProviderSpecificInput(new ReplicationProviderContainerUnmappingInput().withInstanceType("dao")); - model = BinaryData.fromObject(model).toObject(RemoveProtectionContainerMappingInputProperties.class); - Assertions.assertEquals("dao", model.providerSpecificInput().instanceType()); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationAlertSettingsCreateWithResponseMockTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationAlertSettingsCreateWithResponseMockTests.java deleted file mode 100644 index 594712c0301a..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationAlertSettingsCreateWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.SiteRecoveryManager; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.Alert; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.ConfigureAlertRequestProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ReplicationAlertSettingsCreateWithResponseMockTests { - @Test - public void testCreateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"properties\":{\"sendToOwners\":\"xbvkvwzdmvdd\",\"customEmailAddresses\":[\"rugyozzzawnjdv\"],\"locale\":\"rho\"},\"location\":\"kkvxu\",\"id\":\"dqzbvbpsuvqhx\",\"name\":\"ozf\",\"type\":\"dkwbkurklpiig\"}"; - - 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); - })); - - SiteRecoveryManager manager = SiteRecoveryManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Alert response - = manager.replicationAlertSettings().define("derjennmk").withExistingVault("ustihtgrafjajvky", "mmjczvog") - .withProperties(new ConfigureAlertRequestProperties().withSendToOwners("uwqdwxhhlbmyphf") - .withCustomEmailAddresses(Arrays.asList("pdhewokyqs", "kx", "sy")).withLocale("ihqbtod")) - .create(); - - Assertions.assertEquals("xbvkvwzdmvdd", response.properties().sendToOwners()); - Assertions.assertEquals("rugyozzzawnjdv", response.properties().customEmailAddresses().get(0)); - Assertions.assertEquals("rho", response.properties().locale()); - Assertions.assertEquals("kkvxu", response.location()); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationLogicalNetworksGetWithResponseMockTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationLogicalNetworksGetWithResponseMockTests.java deleted file mode 100644 index 5ec2e7da5312..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationLogicalNetworksGetWithResponseMockTests.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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.SiteRecoveryManager; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.LogicalNetwork; -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 ReplicationLogicalNetworksGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"properties\":{\"friendlyName\":\"xwvegenlrj\",\"networkVirtualizationStatus\":\"mwevguyflnxel\",\"logicalNetworkUsage\":\"kfzcdetowwezhy\",\"logicalNetworkDefinitionsStatus\":\"di\"},\"location\":\"wqlqacs\",\"id\":\"qb\",\"name\":\"rtybcel\",\"type\":\"jnxodnjyhzfax\"}"; - - 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); - })); - - SiteRecoveryManager manager = SiteRecoveryManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - LogicalNetwork response = manager.replicationLogicalNetworks() - .getWithResponse("kwwnq", "qlq", "pwxtvc", "bav", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("xwvegenlrj", response.properties().friendlyName()); - Assertions.assertEquals("mwevguyflnxel", response.properties().networkVirtualizationStatus()); - Assertions.assertEquals("kfzcdetowwezhy", response.properties().logicalNetworkUsage()); - Assertions.assertEquals("di", response.properties().logicalNetworkDefinitionsStatus()); - Assertions.assertEquals("wqlqacs", response.location()); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsGetWithResponseMockTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsGetWithResponseMockTests.java deleted file mode 100644 index 16d287c86cf0..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsGetWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.SiteRecoveryManager; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.NetworkMapping; -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 ReplicationNetworkMappingsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"properties\":{\"state\":\"ciagvkdlhu\",\"primaryNetworkFriendlyName\":\"klbjoafmjfe\",\"primaryNetworkId\":\"lvoepknarse\",\"primaryFabricFriendlyName\":\"ncsqoacbuqd\",\"recoveryNetworkFriendlyName\":\"apleq\",\"recoveryNetworkId\":\"kxen\",\"recoveryFabricArmId\":\"z\",\"recoveryFabricFriendlyName\":\"vya\",\"fabricSpecificSettings\":{\"instanceType\":\"NetworkMappingFabricSpecificSettings\"}},\"location\":\"z\",\"id\":\"uuvu\",\"name\":\"aqcwggchxvlqgf\",\"type\":\"rvecica\"}"; - - 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); - })); - - SiteRecoveryManager manager = SiteRecoveryManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NetworkMapping response = manager.replicationNetworkMappings().getWithResponse("jbvyezjwjkqo", "bwh", - "ieyozvrcwfpucwnb", "gqefgzjvbxqcb", "oarx", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("ciagvkdlhu", response.properties().state()); - Assertions.assertEquals("klbjoafmjfe", response.properties().primaryNetworkFriendlyName()); - Assertions.assertEquals("lvoepknarse", response.properties().primaryNetworkId()); - Assertions.assertEquals("ncsqoacbuqd", response.properties().primaryFabricFriendlyName()); - Assertions.assertEquals("apleq", response.properties().recoveryNetworkFriendlyName()); - Assertions.assertEquals("kxen", response.properties().recoveryNetworkId()); - Assertions.assertEquals("z", response.properties().recoveryFabricArmId()); - Assertions.assertEquals("vya", response.properties().recoveryFabricFriendlyName()); - Assertions.assertEquals("z", response.location()); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworksListByReplicationFabricsMockTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworksListByReplicationFabricsMockTests.java deleted file mode 100644 index b42d062978f5..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworksListByReplicationFabricsMockTests.java +++ /dev/null @@ -1,63 +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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.SiteRecoveryManager; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.Network; -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 ReplicationNetworksListByReplicationFabricsMockTests { - @Test - public void testListByReplicationFabrics() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"value\":[{\"properties\":{\"fabricType\":\"sorch\",\"subnets\":[{\"name\":\"o\",\"friendlyName\":\"yhl\",\"addressList\":[\"vhs\",\"b\",\"pwxslaj\"]},{\"name\":\"fzga\",\"friendlyName\":\"hawkmibuydwi\",\"addressList\":[\"icupdyt\",\"qmiuvjpl\"]},{\"name\":\"ebmhhtuq\",\"friendlyName\":\"xynof\",\"addressList\":[\"bfix\",\"gxebihexhnk\",\"ng\"]},{\"name\":\"cdolrpgupsjlbsmn\",\"friendlyName\":\"fbncuyje\",\"addressList\":[\"nhpplzhcfzxjzi\",\"ucrln\",\"wnuwkkfzzetl\",\"hdyxz\"]}],\"friendlyName\":\"wywjvrlgqpwwlzp\",\"networkType\":\"arcbcdwhslxebaja\"},\"location\":\"n\",\"id\":\"stbdoprwkampyh\",\"name\":\"pbldz\",\"type\":\"iudrcycmwhuzym\"}]}"; - - 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); - })); - - SiteRecoveryManager manager = SiteRecoveryManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.replicationNetworks().listByReplicationFabrics("kdv", "el", "modpe", - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("sorch", response.iterator().next().properties().fabricType()); - Assertions.assertEquals("o", response.iterator().next().properties().subnets().get(0).name()); - Assertions.assertEquals("yhl", response.iterator().next().properties().subnets().get(0).friendlyName()); - Assertions.assertEquals("vhs", response.iterator().next().properties().subnets().get(0).addressList().get(0)); - Assertions.assertEquals("wywjvrlgqpwwlzp", response.iterator().next().properties().friendlyName()); - Assertions.assertEquals("arcbcdwhslxebaja", response.iterator().next().properties().networkType()); - Assertions.assertEquals("n", response.iterator().next().location()); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectableItemsGetWithResponseMockTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectableItemsGetWithResponseMockTests.java deleted file mode 100644 index ccfe23d31667..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectableItemsGetWithResponseMockTests.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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.SiteRecoveryManager; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectableItem; -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 ReplicationProtectableItemsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"properties\":{\"friendlyName\":\"dahyclxrsidoeb\",\"protectionStatus\":\"poiaffjkrtn\",\"replicationProtectedItemId\":\"evimxmaxcj\",\"recoveryServicesProviderId\":\"itygvdwds\",\"protectionReadinessErrors\":[\"bf\"],\"supportedReplicationProviders\":[\"ozbzchnqekwan\"],\"customDetails\":{\"instanceType\":\"ConfigurationSettings\"}},\"location\":\"urlcydjhtkjs\",\"id\":\"rwiyndurdonkgobx\",\"name\":\"lr\",\"type\":\"olenrswknpdr\"}"; - - 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); - })); - - SiteRecoveryManager manager = SiteRecoveryManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ProtectableItem response = manager.replicationProtectableItems() - .getWithResponse("wdalisd", "qngca", "dz", "nloou", "p", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("dahyclxrsidoeb", response.properties().friendlyName()); - Assertions.assertEquals("poiaffjkrtn", response.properties().protectionStatus()); - Assertions.assertEquals("evimxmaxcj", response.properties().replicationProtectedItemId()); - Assertions.assertEquals("itygvdwds", response.properties().recoveryServicesProviderId()); - Assertions.assertEquals("bf", response.properties().protectionReadinessErrors().get(0)); - Assertions.assertEquals("ozbzchnqekwan", response.properties().supportedReplicationProviders().get(0)); - Assertions.assertEquals("urlcydjhtkjs", response.location()); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionIntentsGetWithResponseMockTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionIntentsGetWithResponseMockTests.java deleted file mode 100644 index 6b5e089ea68c..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionIntentsGetWithResponseMockTests.java +++ /dev/null @@ -1,57 +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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.SiteRecoveryManager; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectionIntent; -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 ReplicationProtectionIntentsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"properties\":{\"friendlyName\":\"cacwaaqakv\",\"jobId\":\"y\",\"jobState\":\"xra\",\"isActive\":false,\"creationTimeUTC\":\"eqbrcmmdtsh\",\"providerSpecificDetails\":{\"instanceType\":\"ReplicationProtectionIntentProviderSpecificSettings\"}},\"location\":\"xucznb\",\"id\":\"bowr\",\"name\":\"yrnmjw\",\"type\":\"owxqzkk\"}"; - - 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); - })); - - SiteRecoveryManager manager = SiteRecoveryManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ReplicationProtectionIntent response = manager.replicationProtectionIntents() - .getWithResponse("ilzvxotno", "lqcdvhye", "qhxytsq", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("cacwaaqakv", response.properties().friendlyName()); - Assertions.assertEquals("xucznb", response.location()); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProviderSpecificContainerCreationInputTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProviderSpecificContainerCreationInputTests.java deleted file mode 100644 index 0818dcc1aa4a..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProviderSpecificContainerCreationInputTests.java +++ /dev/null @@ -1,24 +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.recoveryservicessiterecovery.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProviderSpecificContainerCreationInput; - -public final class ReplicationProviderSpecificContainerCreationInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReplicationProviderSpecificContainerCreationInput model - = BinaryData.fromString("{\"instanceType\":\"ReplicationProviderSpecificContainerCreationInput\"}") - .toObject(ReplicationProviderSpecificContainerCreationInput.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReplicationProviderSpecificContainerCreationInput model - = new ReplicationProviderSpecificContainerCreationInput(); - model = BinaryData.fromObject(model).toObject(ReplicationProviderSpecificContainerCreationInput.class); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProviderSpecificContainerMappingInputTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProviderSpecificContainerMappingInputTests.java deleted file mode 100644 index 5b5f27aae03f..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProviderSpecificContainerMappingInputTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProviderSpecificContainerMappingInput; - -public final class ReplicationProviderSpecificContainerMappingInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReplicationProviderSpecificContainerMappingInput model - = BinaryData.fromString("{\"instanceType\":\"ReplicationProviderSpecificContainerMappingInput\"}") - .toObject(ReplicationProviderSpecificContainerMappingInput.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReplicationProviderSpecificContainerMappingInput model = new ReplicationProviderSpecificContainerMappingInput(); - model = BinaryData.fromObject(model).toObject(ReplicationProviderSpecificContainerMappingInput.class); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansTestFailoverCleanupMockTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansTestFailoverCleanupMockTests.java deleted file mode 100644 index b2ff6927a4d7..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansTestFailoverCleanupMockTests.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.SiteRecoveryManager; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlan; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanGroupType; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverCleanupInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverCleanupInputProperties; -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 ReplicationRecoveryPlansTestFailoverCleanupMockTests { - @Test - public void testTestFailoverCleanup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"properties\":{\"friendlyName\":\"lbiqq\",\"primaryFabricId\":\"arxknfvbsym\",\"primaryFabricFriendlyName\":\"bahdbtjm\",\"recoveryFabricId\":\"zonrklbizrxh\",\"recoveryFabricFriendlyName\":\"fvpanloqovvcxgq\",\"failoverDeploymentModel\":\"uirgopgzatucu\",\"replicationProviders\":[\"uzvyjxuxchquoqhq\",\"csksxqf\",\"lrvuvdagv\"],\"allowedOperations\":[\"d\"],\"lastPlannedFailoverTime\":\"2021-04-28T08:18:31Z\",\"lastUnplannedFailoverTime\":\"2021-02-19T21:32:29Z\",\"lastTestFailoverTime\":\"2020-12-25T04:39:30Z\",\"currentScenario\":{\"scenarioName\":\"odiijcsapqhip\",\"jobId\":\"snivnmevljbcu\",\"startTime\":\"2021-08-10T00:42:25Z\"},\"currentScenarioStatus\":\"pjf\",\"currentScenarioStatusDescription\":\"wkseodvlmd\",\"groups\":[{\"groupType\":\"Failover\",\"replicationProtectedItems\":[{},{},{}],\"startGroupActions\":[{\"actionName\":\"u\",\"failoverTypes\":[],\"failoverDirections\":[],\"customDetails\":{\"instanceType\":\"RecoveryPlanActionDetails\"}}],\"endGroupActions\":[{\"actionName\":\"yg\",\"failoverTypes\":[],\"failoverDirections\":[],\"customDetails\":{\"instanceType\":\"RecoveryPlanActionDetails\"}},{\"actionName\":\"bmum\",\"failoverTypes\":[],\"failoverDirections\":[],\"customDetails\":{\"instanceType\":\"RecoveryPlanActionDetails\"}},{\"actionName\":\"jvvcrsmwojm\",\"failoverTypes\":[],\"failoverDirections\":[],\"customDetails\":{\"instanceType\":\"RecoveryPlanActionDetails\"}},{\"actionName\":\"wcvumnrut\",\"failoverTypes\":[],\"failoverDirections\":[],\"customDetails\":{\"instanceType\":\"RecoveryPlanActionDetails\"}}]},{\"groupType\":\"Boot\",\"replicationProtectedItems\":[{}],\"startGroupActions\":[{\"actionName\":\"f\",\"failoverTypes\":[],\"failoverDirections\":[],\"customDetails\":{\"instanceType\":\"RecoveryPlanActionDetails\"}},{\"actionName\":\"vltjo\",\"failoverTypes\":[],\"failoverDirections\":[],\"customDetails\":{\"instanceType\":\"RecoveryPlanActionDetails\"}}],\"endGroupActions\":[{\"actionName\":\"vpkbz\",\"failoverTypes\":[],\"failoverDirections\":[],\"customDetails\":{\"instanceType\":\"RecoveryPlanActionDetails\"}},{\"actionName\":\"tnowpajfhxsmu\",\"failoverTypes\":[],\"failoverDirections\":[],\"customDetails\":{\"instanceType\":\"RecoveryPlanActionDetails\"}}]}],\"providerSpecificDetails\":[{\"instanceType\":\"RecoveryPlanProviderSpecificDetails\"},{\"instanceType\":\"RecoveryPlanProviderSpecificDetails\"},{\"instanceType\":\"RecoveryPlanProviderSpecificDetails\"}]},\"location\":\"dzglmuuzpsuhsyp\",\"id\":\"muldhfr\",\"name\":\"rkqpyfjxkby\",\"type\":\"sbuqfm\"}"; - - 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); - })); - - SiteRecoveryManager manager = SiteRecoveryManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RecoveryPlan response = manager.replicationRecoveryPlans().testFailoverCleanup("p", "addpxqrxipe", "rplf", - new RecoveryPlanTestFailoverCleanupInput() - .withProperties(new RecoveryPlanTestFailoverCleanupInputProperties().withComments("vmjjfz")), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("lbiqq", response.properties().friendlyName()); - Assertions.assertEquals("arxknfvbsym", response.properties().primaryFabricId()); - Assertions.assertEquals("bahdbtjm", response.properties().primaryFabricFriendlyName()); - Assertions.assertEquals("zonrklbizrxh", response.properties().recoveryFabricId()); - Assertions.assertEquals("fvpanloqovvcxgq", response.properties().recoveryFabricFriendlyName()); - Assertions.assertEquals("uirgopgzatucu", response.properties().failoverDeploymentModel()); - Assertions.assertEquals("uzvyjxuxchquoqhq", response.properties().replicationProviders().get(0)); - Assertions.assertEquals("d", response.properties().allowedOperations().get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-28T08:18:31Z"), - response.properties().lastPlannedFailoverTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-19T21:32:29Z"), - response.properties().lastUnplannedFailoverTime()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-25T04:39:30Z"), - response.properties().lastTestFailoverTime()); - Assertions.assertEquals("odiijcsapqhip", response.properties().currentScenario().scenarioName()); - Assertions.assertEquals("snivnmevljbcu", response.properties().currentScenario().jobId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-10T00:42:25Z"), - response.properties().currentScenario().startTime()); - Assertions.assertEquals("pjf", response.properties().currentScenarioStatus()); - Assertions.assertEquals("wkseodvlmd", response.properties().currentScenarioStatusDescription()); - Assertions.assertEquals(RecoveryPlanGroupType.FAILOVER, response.properties().groups().get(0).groupType()); - Assertions.assertEquals("u", response.properties().groups().get(0).startGroupActions().get(0).actionName()); - Assertions.assertEquals("yg", response.properties().groups().get(0).endGroupActions().get(0).actionName()); - Assertions.assertEquals("dzglmuuzpsuhsyp", response.location()); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansUnplannedFailoverMockTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansUnplannedFailoverMockTests.java deleted file mode 100644 index e1378dbe3cb3..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansUnplannedFailoverMockTests.java +++ /dev/null @@ -1,92 +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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.SiteRecoveryManager; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.PossibleOperationsDirections; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlan; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanGroupType; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanProviderSpecificFailoverInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanUnplannedFailoverInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanUnplannedFailoverInputProperties; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.SourceSiteOperations; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ReplicationRecoveryPlansUnplannedFailoverMockTests { - @Test - public void testUnplannedFailover() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"properties\":{\"friendlyName\":\"ikh\",\"primaryFabricId\":\"thypepxshmrd\",\"primaryFabricFriendlyName\":\"csdvkymktc\",\"recoveryFabricId\":\"ivoxgzegnglafnf\",\"recoveryFabricFriendlyName\":\"zaghddc\",\"failoverDeploymentModel\":\"wxuxor\",\"replicationProviders\":[\"uhvemgxlss\",\"lqypvwxl\"],\"allowedOperations\":[\"vrkqv\",\"vgdojcvzfcmxmjp\"],\"lastPlannedFailoverTime\":\"2021-11-18T03:57:06Z\",\"lastUnplannedFailoverTime\":\"2021-01-12T06:14:49Z\",\"lastTestFailoverTime\":\"2021-06-13T19:20:39Z\",\"currentScenario\":{\"scenarioName\":\"ocgquqx\",\"jobId\":\"xp\",\"startTime\":\"2021-08-14T00:33Z\"},\"currentScenarioStatus\":\"qniiontqikdipk\",\"currentScenarioStatusDescription\":\"qkuzabrsoihataj\",\"groups\":[{\"groupType\":\"Shutdown\",\"replicationProtectedItems\":[{},{}],\"startGroupActions\":[{\"actionName\":\"ssxylsu\",\"failoverTypes\":[],\"failoverDirections\":[],\"customDetails\":{\"instanceType\":\"RecoveryPlanActionDetails\"}},{\"actionName\":\"oadoh\",\"failoverTypes\":[],\"failoverDirections\":[],\"customDetails\":{\"instanceType\":\"RecoveryPlanActionDetails\"}},{\"actionName\":\"jyiehkxgfuzqqnz\",\"failoverTypes\":[],\"failoverDirections\":[],\"customDetails\":{\"instanceType\":\"RecoveryPlanActionDetails\"}}],\"endGroupActions\":[{\"actionName\":\"xqds\",\"failoverTypes\":[],\"failoverDirections\":[],\"customDetails\":{\"instanceType\":\"RecoveryPlanActionDetails\"}},{\"actionName\":\"ipdnl\",\"failoverTypes\":[],\"failoverDirections\":[],\"customDetails\":{\"instanceType\":\"RecoveryPlanActionDetails\"}}]}],\"providerSpecificDetails\":[{\"instanceType\":\"RecoveryPlanProviderSpecificDetails\"},{\"instanceType\":\"RecoveryPlanProviderSpecificDetails\"},{\"instanceType\":\"RecoveryPlanProviderSpecificDetails\"},{\"instanceType\":\"RecoveryPlanProviderSpecificDetails\"}]},\"location\":\"f\",\"id\":\"pwwgzeylzp\",\"name\":\"imxacrkt\",\"type\":\"o\"}"; - - 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); - })); - - SiteRecoveryManager manager = SiteRecoveryManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RecoveryPlan response = manager.replicationRecoveryPlans().unplannedFailover("bdjkmnxsggnow", "hyvdbrdvsv", - "hbtyc", - new RecoveryPlanUnplannedFailoverInput().withProperties(new RecoveryPlanUnplannedFailoverInputProperties() - .withFailoverDirection(PossibleOperationsDirections.PRIMARY_TO_RECOVERY) - .withSourceSiteOperations(SourceSiteOperations.REQUIRED).withProviderSpecificDetails(Arrays.asList( - new RecoveryPlanProviderSpecificFailoverInput(), new RecoveryPlanProviderSpecificFailoverInput()))), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ikh", response.properties().friendlyName()); - Assertions.assertEquals("thypepxshmrd", response.properties().primaryFabricId()); - Assertions.assertEquals("csdvkymktc", response.properties().primaryFabricFriendlyName()); - Assertions.assertEquals("ivoxgzegnglafnf", response.properties().recoveryFabricId()); - Assertions.assertEquals("zaghddc", response.properties().recoveryFabricFriendlyName()); - Assertions.assertEquals("wxuxor", response.properties().failoverDeploymentModel()); - Assertions.assertEquals("uhvemgxlss", response.properties().replicationProviders().get(0)); - Assertions.assertEquals("vrkqv", response.properties().allowedOperations().get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-18T03:57:06Z"), - response.properties().lastPlannedFailoverTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-12T06:14:49Z"), - response.properties().lastUnplannedFailoverTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-13T19:20:39Z"), - response.properties().lastTestFailoverTime()); - Assertions.assertEquals("ocgquqx", response.properties().currentScenario().scenarioName()); - Assertions.assertEquals("xp", response.properties().currentScenario().jobId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-14T00:33Z"), - response.properties().currentScenario().startTime()); - Assertions.assertEquals("qniiontqikdipk", response.properties().currentScenarioStatus()); - Assertions.assertEquals("qkuzabrsoihataj", response.properties().currentScenarioStatusDescription()); - Assertions.assertEquals(RecoveryPlanGroupType.SHUTDOWN, response.properties().groups().get(0).groupType()); - Assertions.assertEquals("ssxylsu", - response.properties().groups().get(0).startGroupActions().get(0).actionName()); - Assertions.assertEquals("xqds", response.properties().groups().get(0).endGroupActions().get(0).actionName()); - Assertions.assertEquals("f", response.location()); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/StorageClassificationMappingsGetWithResponseMockTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/StorageClassificationMappingsGetWithResponseMockTests.java deleted file mode 100644 index 6fcec1124431..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/StorageClassificationMappingsGetWithResponseMockTests.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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.SiteRecoveryManager; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageClassificationMapping; -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 StorageClassificationMappingsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"properties\":{\"targetStorageClassificationId\":\"sxaqqjhdfhfa\"},\"location\":\"qnjcsbozvcdqwssy\",\"id\":\"vwr\",\"name\":\"bivyw\",\"type\":\"tjnjuvtz\"}"; - - 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); - })); - - SiteRecoveryManager manager = SiteRecoveryManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - StorageClassificationMapping response = manager.storageClassificationMappings() - .getWithResponse("sobggva", "crqaxlmbrtvtgolm", "p", "gtla", "yxhxj", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("sxaqqjhdfhfa", response.properties().targetStorageClassificationId()); - Assertions.assertEquals("qnjcsbozvcdqwssy", response.location()); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/UpdateApplianceForReplicationProtectedItemInputTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/UpdateApplianceForReplicationProtectedItemInputTests.java deleted file mode 100644 index 0c7c21b9d53e..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/UpdateApplianceForReplicationProtectedItemInputTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservicessiterecovery.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateApplianceForReplicationProtectedItemInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateApplianceForReplicationProtectedItemInputProperties; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateReplicationProtectedItemProviderSpecificInput; -import org.junit.jupiter.api.Assertions; - -public final class UpdateApplianceForReplicationProtectedItemInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateApplianceForReplicationProtectedItemInput model = BinaryData.fromString( - "{\"properties\":{\"targetApplianceId\":\"xsffgcviz\",\"providerSpecificDetails\":{\"instanceType\":\"UpdateApplianceForReplicationProtectedItemProviderSpecificInput\"}}}") - .toObject(UpdateApplianceForReplicationProtectedItemInput.class); - Assertions.assertEquals("xsffgcviz", model.properties().targetApplianceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateApplianceForReplicationProtectedItemInput model - = new UpdateApplianceForReplicationProtectedItemInput().withProperties( - new UpdateApplianceForReplicationProtectedItemInputProperties().withTargetApplianceId("xsffgcviz") - .withProviderSpecificDetails(new UpdateReplicationProtectedItemProviderSpecificInput())); - model = BinaryData.fromObject(model).toObject(UpdateApplianceForReplicationProtectedItemInput.class); - Assertions.assertEquals("xsffgcviz", model.properties().targetApplianceId()); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/UpdateProtectionContainerMappingInputPropertiesTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/UpdateProtectionContainerMappingInputPropertiesTests.java deleted file mode 100644 index b9dd6eefcbcb..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/UpdateProtectionContainerMappingInputPropertiesTests.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.recoveryservicessiterecovery.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProviderSpecificUpdateContainerMappingInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateProtectionContainerMappingInputProperties; - -public final class UpdateProtectionContainerMappingInputPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateProtectionContainerMappingInputProperties model = BinaryData.fromString( - "{\"providerSpecificInput\":{\"instanceType\":\"ReplicationProviderSpecificUpdateContainerMappingInput\"}}") - .toObject(UpdateProtectionContainerMappingInputProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateProtectionContainerMappingInputProperties model = new UpdateProtectionContainerMappingInputProperties() - .withProviderSpecificInput(new ReplicationProviderSpecificUpdateContainerMappingInput()); - model = BinaryData.fromObject(model).toObject(UpdateProtectionContainerMappingInputProperties.class); - } -} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/UpdateReplicationProtectedItemInputPropertiesTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/UpdateReplicationProtectedItemInputPropertiesTests.java deleted file mode 100644 index d7c07f96c0ef..000000000000 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/UpdateReplicationProtectedItemInputPropertiesTests.java +++ /dev/null @@ -1,188 +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.recoveryservicessiterecovery.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.IpConfigInputDetails; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.LicenseType; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateReplicationProtectedItemInputProperties; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateReplicationProtectedItemProviderInput; -import com.azure.resourcemanager.recoveryservicessiterecovery.models.VMNicInputDetails; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class UpdateReplicationProtectedItemInputPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateReplicationProtectedItemInputProperties model = BinaryData.fromString( - "{\"recoveryAzureVMName\":\"lpqblylsyxk\",\"recoveryAzureVMSize\":\"nsj\",\"selectedRecoveryAzureNetworkId\":\"vti\",\"selectedTfoAzureNetworkId\":\"xsdszuempsb\",\"selectedSourceNicId\":\"f\",\"enableRdpOnTargetOption\":\"eyvpnqicvinvkj\",\"vmNics\":[{\"nicId\":\"rbuukzclewyhmlwp\",\"ipConfigs\":[{\"ipConfigName\":\"pofncck\",\"isPrimary\":false,\"isSeletedForFailover\":true,\"recoverySubnetName\":\"hxx\",\"recoveryStaticIPAddress\":\"yq\",\"recoveryPublicIPAddressId\":\"zfeqztppri\",\"recoveryLBBackendAddressPoolIds\":[\"or\",\"altol\",\"ncwsob\",\"wcsdbnwdcfhucq\"],\"tfoSubnetName\":\"fuvglsbjjca\",\"tfoStaticIPAddress\":\"xbvtvudu\",\"tfoPublicIPAddressId\":\"cormr\",\"tfoLBBackendAddressPoolIds\":[\"tvcof\",\"dflvkg\",\"u\",\"gdknnqv\"]},{\"ipConfigName\":\"znqntoru\",\"isPrimary\":true,\"isSeletedForFailover\":false,\"recoverySubnetName\":\"mkycgra\",\"recoveryStaticIPAddress\":\"juetaebur\",\"recoveryPublicIPAddressId\":\"dmovsm\",\"recoveryLBBackendAddressPoolIds\":[\"wabm\",\"oefki\"],\"tfoSubnetName\":\"vtpuqujmqlgk\",\"tfoStaticIPAddress\":\"tndoaongbjc\",\"tfoPublicIPAddressId\":\"ujitcjedftww\",\"tfoLBBackendAddressPoolIds\":[\"kojvd\"]},{\"ipConfigName\":\"zfoqouicybxar\",\"isPrimary\":true,\"isSeletedForFailover\":false,\"recoverySubnetName\":\"oxciqopidoamcio\",\"recoveryStaticIPAddress\":\"khazxkhnzbonlwn\",\"recoveryPublicIPAddressId\":\"egokdwbwhkszzcmr\",\"recoveryLBBackendAddressPoolIds\":[\"ztvbtqgsfr\",\"oyzko\",\"wtl\",\"nguxawqaldsy\"],\"tfoSubnetName\":\"ximerqfobwyznk\",\"tfoStaticIPAddress\":\"kutwpf\",\"tfoPublicIPAddressId\":\"a\",\"tfoLBBackendAddressPoolIds\":[\"r\",\"kdsnfdsdoakgtdl\",\"kkze\"]},{\"ipConfigName\":\"l\",\"isPrimary\":true,\"isSeletedForFailover\":false,\"recoverySubnetName\":\"dsttwvo\",\"recoveryStaticIPAddress\":\"bbejdcngqqm\",\"recoveryPublicIPAddressId\":\"kufgmj\",\"recoveryLBBackendAddressPoolIds\":[\"rdgrtw\"],\"tfoSubnetName\":\"nuuzkopbm\",\"tfoStaticIPAddress\":\"rfdwoyu\",\"tfoPublicIPAddressId\":\"ziuiefozbhdm\",\"tfoLBBackendAddressPoolIds\":[\"mzqhoftrmaequi\"]}],\"selectionType\":\"xicslfao\",\"recoveryNetworkSecurityGroupId\":\"piyylhalnswhccsp\",\"enableAcceleratedNetworkingOnRecovery\":true,\"tfoNetworkSecurityGroupId\":\"vwitqscyw\",\"enableAcceleratedNetworkingOnTfo\":false,\"recoveryNicName\":\"oluhczbwemh\",\"recoveryNicResourceGroupName\":\"rsbrgzdwm\",\"reuseExistingNic\":true,\"tfoNicName\":\"pqwd\",\"tfoNicResourceGroupName\":\"gicccnxqhuex\",\"tfoReuseExistingNic\":true,\"targetNicName\":\"lstvlzywe\"},{\"nicId\":\"zrncsdt\",\"ipConfigs\":[{\"ipConfigName\":\"iypbsfgytgusl\",\"isPrimary\":false,\"isSeletedForFailover\":false,\"recoverySubnetName\":\"gq\",\"recoveryStaticIPAddress\":\"yhejhzisxgfp\",\"recoveryPublicIPAddressId\":\"olppvksrpqvujz\",\"recoveryLBBackendAddressPoolIds\":[\"htwdwrftswibyrcd\",\"bhshfwpracstwity\",\"hevxcced\"],\"tfoSubnetName\":\"nmdyodnwzxl\",\"tfoStaticIPAddress\":\"cvnhltiugc\",\"tfoPublicIPAddressId\":\"avvwxqi\",\"tfoLBBackendAddressPoolIds\":[\"unyowxwl\",\"djrkvfgbvfvpd\",\"odacizs\",\"q\"]}],\"selectionType\":\"krribdeibqi\",\"recoveryNetworkSecurityGroupId\":\"kghv\",\"enableAcceleratedNetworkingOnRecovery\":true,\"tfoNetworkSecurityGroupId\":\"wm\",\"enableAcceleratedNetworkingOnTfo\":false,\"recoveryNicName\":\"ajpjo\",\"recoveryNicResourceGroupName\":\"kqnyh\",\"reuseExistingNic\":false,\"tfoNicName\":\"tjivfxzsjabib\",\"tfoNicResourceGroupName\":\"stawfsdjpvkv\",\"tfoReuseExistingNic\":true,\"targetNicName\":\"bkzbzkd\"},{\"nicId\":\"cjabudurgkakmo\",\"ipConfigs\":[{\"ipConfigName\":\"jk\",\"isPrimary\":false,\"isSeletedForFailover\":true,\"recoverySubnetName\":\"uwqlgzrfzeey\",\"recoveryStaticIPAddress\":\"izikayuhq\",\"recoveryPublicIPAddressId\":\"jbsybbqw\",\"recoveryLBBackendAddressPoolIds\":[\"ldgmfpgvmpip\"],\"tfoSubnetName\":\"ltha\",\"tfoStaticIPAddress\":\"x\",\"tfoPublicIPAddressId\":\"mwutwbdsre\",\"tfoLBBackendAddressPoolIds\":[\"rhneuyowq\",\"d\",\"ytisibir\"]},{\"ipConfigName\":\"pikpz\",\"isPrimary\":false,\"isSeletedForFailover\":false,\"recoverySubnetName\":\"nlfzxiavrmbz\",\"recoveryStaticIPAddress\":\"okixrjqcir\",\"recoveryPublicIPAddressId\":\"pfrlazsz\",\"recoveryLBBackendAddressPoolIds\":[\"oiindfpwpjy\",\"wbtlhflsjcdh\"],\"tfoSubnetName\":\"fjvfbgofeljagr\",\"tfoStaticIPAddress\":\"qhl\",\"tfoPublicIPAddressId\":\"riiiojnalghfkv\",\"tfoLBBackendAddressPoolIds\":[\"ex\",\"owueluqh\"]}],\"selectionType\":\"hhxvrhmzkwpj\",\"recoveryNetworkSecurityGroupId\":\"wspughftqsxhqx\",\"enableAcceleratedNetworkingOnRecovery\":true,\"tfoNetworkSecurityGroupId\":\"kndxdigrjgu\",\"enableAcceleratedNetworkingOnTfo\":true,\"recoveryNicName\":\"msyqtfi\",\"recoveryNicResourceGroupName\":\"hbotzingamvppho\",\"reuseExistingNic\":false,\"tfoNicName\":\"udphqamvdkfwyn\",\"tfoNicResourceGroupName\":\"vtbvkayh\",\"tfoReuseExistingNic\":false,\"targetNicName\":\"yqiatkzwp\"}],\"licenseType\":\"WindowsServer\",\"recoveryAvailabilitySetId\":\"zcjaesgvvsccy\",\"providerSpecificDetails\":{\"instanceType\":\"UpdateReplicationProtectedItemProviderInput\"}}") - .toObject(UpdateReplicationProtectedItemInputProperties.class); - Assertions.assertEquals("lpqblylsyxk", model.recoveryAzureVMName()); - Assertions.assertEquals("nsj", model.recoveryAzureVMSize()); - Assertions.assertEquals("vti", model.selectedRecoveryAzureNetworkId()); - Assertions.assertEquals("xsdszuempsb", model.selectedTfoAzureNetworkId()); - Assertions.assertEquals("f", model.selectedSourceNicId()); - Assertions.assertEquals("eyvpnqicvinvkj", model.enableRdpOnTargetOption()); - Assertions.assertEquals("rbuukzclewyhmlwp", model.vmNics().get(0).nicId()); - Assertions.assertEquals("pofncck", model.vmNics().get(0).ipConfigs().get(0).ipConfigName()); - Assertions.assertEquals(false, model.vmNics().get(0).ipConfigs().get(0).isPrimary()); - Assertions.assertEquals(true, model.vmNics().get(0).ipConfigs().get(0).isSeletedForFailover()); - Assertions.assertEquals("hxx", model.vmNics().get(0).ipConfigs().get(0).recoverySubnetName()); - Assertions.assertEquals("yq", model.vmNics().get(0).ipConfigs().get(0).recoveryStaticIpAddress()); - Assertions.assertEquals("zfeqztppri", model.vmNics().get(0).ipConfigs().get(0).recoveryPublicIpAddressId()); - Assertions.assertEquals("or", - model.vmNics().get(0).ipConfigs().get(0).recoveryLBBackendAddressPoolIds().get(0)); - Assertions.assertEquals("fuvglsbjjca", model.vmNics().get(0).ipConfigs().get(0).tfoSubnetName()); - Assertions.assertEquals("xbvtvudu", model.vmNics().get(0).ipConfigs().get(0).tfoStaticIpAddress()); - Assertions.assertEquals("cormr", model.vmNics().get(0).ipConfigs().get(0).tfoPublicIpAddressId()); - Assertions.assertEquals("tvcof", model.vmNics().get(0).ipConfigs().get(0).tfoLBBackendAddressPoolIds().get(0)); - Assertions.assertEquals("xicslfao", model.vmNics().get(0).selectionType()); - Assertions.assertEquals("piyylhalnswhccsp", model.vmNics().get(0).recoveryNetworkSecurityGroupId()); - Assertions.assertEquals(true, model.vmNics().get(0).enableAcceleratedNetworkingOnRecovery()); - Assertions.assertEquals("vwitqscyw", model.vmNics().get(0).tfoNetworkSecurityGroupId()); - Assertions.assertEquals(false, model.vmNics().get(0).enableAcceleratedNetworkingOnTfo()); - Assertions.assertEquals("oluhczbwemh", model.vmNics().get(0).recoveryNicName()); - Assertions.assertEquals("rsbrgzdwm", model.vmNics().get(0).recoveryNicResourceGroupName()); - Assertions.assertEquals(true, model.vmNics().get(0).reuseExistingNic()); - Assertions.assertEquals("pqwd", model.vmNics().get(0).tfoNicName()); - Assertions.assertEquals("gicccnxqhuex", model.vmNics().get(0).tfoNicResourceGroupName()); - Assertions.assertEquals(true, model.vmNics().get(0).tfoReuseExistingNic()); - Assertions.assertEquals("lstvlzywe", model.vmNics().get(0).targetNicName()); - Assertions.assertEquals(LicenseType.WINDOWS_SERVER, model.licenseType()); - Assertions.assertEquals("zcjaesgvvsccy", model.recoveryAvailabilitySetId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateReplicationProtectedItemInputProperties model - = new UpdateReplicationProtectedItemInputProperties() - .withRecoveryAzureVMName( - "lpqblylsyxk") - .withRecoveryAzureVMSize("nsj").withSelectedRecoveryAzureNetworkId("vti") - .withSelectedTfoAzureNetworkId("xsdszuempsb").withSelectedSourceNicId( - "f") - .withEnableRdpOnTargetOption( - "eyvpnqicvinvkj") - .withVmNics(Arrays.asList( - new VMNicInputDetails().withNicId("rbuukzclewyhmlwp") - .withIpConfigs(Arrays.asList( - new IpConfigInputDetails().withIpConfigName("pofncck").withIsPrimary(false) - .withIsSeletedForFailover(true).withRecoverySubnetName("hxx") - .withRecoveryStaticIpAddress("yq").withRecoveryPublicIpAddressId("zfeqztppri") - .withRecoveryLBBackendAddressPoolIds( - Arrays.asList("or", "altol", "ncwsob", "wcsdbnwdcfhucq")) - .withTfoSubnetName("fuvglsbjjca").withTfoStaticIpAddress("xbvtvudu") - .withTfoPublicIpAddressId("cormr") - .withTfoLBBackendAddressPoolIds(Arrays.asList("tvcof", "dflvkg", "u", "gdknnqv")), - new IpConfigInputDetails().withIpConfigName("znqntoru").withIsPrimary(true) - .withIsSeletedForFailover(false).withRecoverySubnetName("mkycgra") - .withRecoveryStaticIpAddress("juetaebur").withRecoveryPublicIpAddressId("dmovsm") - .withRecoveryLBBackendAddressPoolIds(Arrays.asList("wabm", "oefki")) - .withTfoSubnetName("vtpuqujmqlgk").withTfoStaticIpAddress("tndoaongbjc") - .withTfoPublicIpAddressId("ujitcjedftww") - .withTfoLBBackendAddressPoolIds(Arrays.asList("kojvd")), - new IpConfigInputDetails().withIpConfigName("zfoqouicybxar").withIsPrimary(true) - .withIsSeletedForFailover(false).withRecoverySubnetName("oxciqopidoamcio") - .withRecoveryStaticIpAddress("khazxkhnzbonlwn") - .withRecoveryPublicIpAddressId("egokdwbwhkszzcmr") - .withRecoveryLBBackendAddressPoolIds( - Arrays.asList("ztvbtqgsfr", "oyzko", "wtl", "nguxawqaldsy")) - .withTfoSubnetName("ximerqfobwyznk").withTfoStaticIpAddress("kutwpf") - .withTfoPublicIpAddressId("a") - .withTfoLBBackendAddressPoolIds(Arrays.asList("r", "kdsnfdsdoakgtdl", "kkze")), - new IpConfigInputDetails().withIpConfigName("l").withIsPrimary(true) - .withIsSeletedForFailover(false).withRecoverySubnetName("dsttwvo") - .withRecoveryStaticIpAddress("bbejdcngqqm").withRecoveryPublicIpAddressId("kufgmj") - .withRecoveryLBBackendAddressPoolIds(Arrays.asList("rdgrtw")) - .withTfoSubnetName("nuuzkopbm").withTfoStaticIpAddress("rfdwoyu") - .withTfoPublicIpAddressId("ziuiefozbhdm") - .withTfoLBBackendAddressPoolIds(Arrays.asList("mzqhoftrmaequi")))) - .withSelectionType("xicslfao").withRecoveryNetworkSecurityGroupId("piyylhalnswhccsp") - .withEnableAcceleratedNetworkingOnRecovery(true).withTfoNetworkSecurityGroupId("vwitqscyw") - .withEnableAcceleratedNetworkingOnTfo(false).withRecoveryNicName("oluhczbwemh") - .withRecoveryNicResourceGroupName("rsbrgzdwm").withReuseExistingNic(true).withTfoNicName("pqwd") - .withTfoNicResourceGroupName("gicccnxqhuex").withTfoReuseExistingNic(true) - .withTargetNicName("lstvlzywe"), - new VMNicInputDetails().withNicId("zrncsdt") - .withIpConfigs(Arrays.asList(new IpConfigInputDetails().withIpConfigName("iypbsfgytgusl") - .withIsPrimary(false).withIsSeletedForFailover(false).withRecoverySubnetName("gq") - .withRecoveryStaticIpAddress("yhejhzisxgfp").withRecoveryPublicIpAddressId("olppvksrpqvujz") - .withRecoveryLBBackendAddressPoolIds( - Arrays.asList("htwdwrftswibyrcd", "bhshfwpracstwity", "hevxcced")) - .withTfoSubnetName("nmdyodnwzxl").withTfoStaticIpAddress("cvnhltiugc") - .withTfoPublicIpAddressId("avvwxqi").withTfoLBBackendAddressPoolIds( - Arrays.asList("unyowxwl", "djrkvfgbvfvpd", "odacizs", "q")))) - .withSelectionType("krribdeibqi").withRecoveryNetworkSecurityGroupId("kghv") - .withEnableAcceleratedNetworkingOnRecovery(true).withTfoNetworkSecurityGroupId("wm") - .withEnableAcceleratedNetworkingOnTfo(false).withRecoveryNicName("ajpjo") - .withRecoveryNicResourceGroupName( - "kqnyh") - .withReuseExistingNic( - false) - .withTfoNicName( - "tjivfxzsjabib") - .withTfoNicResourceGroupName( - "stawfsdjpvkv") - .withTfoReuseExistingNic(true).withTargetNicName("bkzbzkd"), - new VMNicInputDetails().withNicId("cjabudurgkakmo") - .withIpConfigs(Arrays.asList( - new IpConfigInputDetails().withIpConfigName("jk").withIsPrimary(false) - .withIsSeletedForFailover(true).withRecoverySubnetName("uwqlgzrfzeey") - .withRecoveryStaticIpAddress("izikayuhq").withRecoveryPublicIpAddressId("jbsybbqw") - .withRecoveryLBBackendAddressPoolIds(Arrays.asList("ldgmfpgvmpip")) - .withTfoSubnetName("ltha").withTfoStaticIpAddress("x") - .withTfoPublicIpAddressId("mwutwbdsre") - .withTfoLBBackendAddressPoolIds(Arrays.asList("rhneuyowq", "d", "ytisibir")), - new IpConfigInputDetails().withIpConfigName("pikpz").withIsPrimary(false) - .withIsSeletedForFailover(false).withRecoverySubnetName("nlfzxiavrmbz") - .withRecoveryStaticIpAddress("okixrjqcir").withRecoveryPublicIpAddressId("pfrlazsz") - .withRecoveryLBBackendAddressPoolIds(Arrays.asList("oiindfpwpjy", "wbtlhflsjcdh")) - .withTfoSubnetName("fjvfbgofeljagr").withTfoStaticIpAddress("qhl") - .withTfoPublicIpAddressId("riiiojnalghfkv") - .withTfoLBBackendAddressPoolIds(Arrays.asList("ex", "owueluqh")))) - .withSelectionType("hhxvrhmzkwpj").withRecoveryNetworkSecurityGroupId("wspughftqsxhqx") - .withEnableAcceleratedNetworkingOnRecovery(true).withTfoNetworkSecurityGroupId("kndxdigrjgu") - .withEnableAcceleratedNetworkingOnTfo(true).withRecoveryNicName("msyqtfi") - .withRecoveryNicResourceGroupName("hbotzingamvppho").withReuseExistingNic(false) - .withTfoNicName("udphqamvdkfwyn").withTfoNicResourceGroupName("vtbvkayh") - .withTfoReuseExistingNic(false).withTargetNicName("yqiatkzwp"))) - .withLicenseType(LicenseType.WINDOWS_SERVER).withRecoveryAvailabilitySetId("zcjaesgvvsccy") - .withProviderSpecificDetails(new UpdateReplicationProtectedItemProviderInput()); - model = BinaryData.fromObject(model).toObject(UpdateReplicationProtectedItemInputProperties.class); - Assertions.assertEquals("lpqblylsyxk", model.recoveryAzureVMName()); - Assertions.assertEquals("nsj", model.recoveryAzureVMSize()); - Assertions.assertEquals("vti", model.selectedRecoveryAzureNetworkId()); - Assertions.assertEquals("xsdszuempsb", model.selectedTfoAzureNetworkId()); - Assertions.assertEquals("f", model.selectedSourceNicId()); - Assertions.assertEquals("eyvpnqicvinvkj", model.enableRdpOnTargetOption()); - Assertions.assertEquals("rbuukzclewyhmlwp", model.vmNics().get(0).nicId()); - Assertions.assertEquals("pofncck", model.vmNics().get(0).ipConfigs().get(0).ipConfigName()); - Assertions.assertEquals(false, model.vmNics().get(0).ipConfigs().get(0).isPrimary()); - Assertions.assertEquals(true, model.vmNics().get(0).ipConfigs().get(0).isSeletedForFailover()); - Assertions.assertEquals("hxx", model.vmNics().get(0).ipConfigs().get(0).recoverySubnetName()); - Assertions.assertEquals("yq", model.vmNics().get(0).ipConfigs().get(0).recoveryStaticIpAddress()); - Assertions.assertEquals("zfeqztppri", model.vmNics().get(0).ipConfigs().get(0).recoveryPublicIpAddressId()); - Assertions.assertEquals("or", - model.vmNics().get(0).ipConfigs().get(0).recoveryLBBackendAddressPoolIds().get(0)); - Assertions.assertEquals("fuvglsbjjca", model.vmNics().get(0).ipConfigs().get(0).tfoSubnetName()); - Assertions.assertEquals("xbvtvudu", model.vmNics().get(0).ipConfigs().get(0).tfoStaticIpAddress()); - Assertions.assertEquals("cormr", model.vmNics().get(0).ipConfigs().get(0).tfoPublicIpAddressId()); - Assertions.assertEquals("tvcof", model.vmNics().get(0).ipConfigs().get(0).tfoLBBackendAddressPoolIds().get(0)); - Assertions.assertEquals("xicslfao", model.vmNics().get(0).selectionType()); - Assertions.assertEquals("piyylhalnswhccsp", model.vmNics().get(0).recoveryNetworkSecurityGroupId()); - Assertions.assertEquals(true, model.vmNics().get(0).enableAcceleratedNetworkingOnRecovery()); - Assertions.assertEquals("vwitqscyw", model.vmNics().get(0).tfoNetworkSecurityGroupId()); - Assertions.assertEquals(false, model.vmNics().get(0).enableAcceleratedNetworkingOnTfo()); - Assertions.assertEquals("oluhczbwemh", model.vmNics().get(0).recoveryNicName()); - Assertions.assertEquals("rsbrgzdwm", model.vmNics().get(0).recoveryNicResourceGroupName()); - Assertions.assertEquals(true, model.vmNics().get(0).reuseExistingNic()); - Assertions.assertEquals("pqwd", model.vmNics().get(0).tfoNicName()); - Assertions.assertEquals("gicccnxqhuex", model.vmNics().get(0).tfoNicResourceGroupName()); - Assertions.assertEquals(true, model.vmNics().get(0).tfoReuseExistingNic()); - Assertions.assertEquals("lstvlzywe", model.vmNics().get(0).targetNicName()); - Assertions.assertEquals(LicenseType.WINDOWS_SERVER, model.licenseType()); - Assertions.assertEquals("zcjaesgvvsccy", model.recoveryAvailabilitySetId()); - } -} diff --git a/sdk/workloadssapvirtualinstance/azure-resourcemanager-workloadssapvirtualinstance/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-workloadssapvirtualinstance/reflect-config.json b/sdk/workloadssapvirtualinstance/azure-resourcemanager-workloadssapvirtualinstance/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-workloadssapvirtualinstance/reflect-config.json deleted file mode 100644 index ab96128bed0d..000000000000 --- a/sdk/workloadssapvirtualinstance/azure-resourcemanager-workloadssapvirtualinstance/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-workloadssapvirtualinstance/reflect-config.json +++ /dev/null @@ -1,606 +0,0 @@ -[ { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapSizingRecommendationRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.fluent.models.SapSizingRecommendationResultInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapSupportedSkusRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.fluent.models.SapSupportedResourceSkusResultInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapSupportedSku", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapDiskConfigurationsRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.fluent.models.SapDiskConfigurationsResultInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapDiskConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.DiskVolumeConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.DiskSku", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.DiskDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapAvailabilityZoneDetailsRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.fluent.models.SapAvailabilityZoneDetailsResultInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapAvailabilityZonePair", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.fluent.models.SapVirtualInstanceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.UserAssignedServiceIdentity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.UserAssignedIdentity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapVirtualInstanceProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ManagedRGConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapVirtualInstanceError", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ErrorDefinition", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.UpdateSapVirtualInstanceRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.UpdateSapVirtualInstanceProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapVirtualInstanceList", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.fluent.models.SapCentralServerInstanceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapCentralServerProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.MessageServerProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.EnqueueServerProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.GatewayServerProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.EnqueueReplicationServerProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.LoadBalancerDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.CentralServerVmDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.StorageInformation", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.UpdateSapCentralInstanceRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapCentralInstanceList", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.fluent.models.SapDatabaseInstanceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapDatabaseProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.DatabaseVmDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.UpdateSapDatabaseInstanceRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapDatabaseInstanceList", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.fluent.models.SapApplicationServerInstanceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapApplicationServerProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ApplicationServerVmDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.UpdateSapApplicationInstanceRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapApplicationServerInstanceList", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.StartRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.fluent.models.OperationStatusResultInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.StopRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.OperationListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.fluent.models.OperationInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.OperationDisplay", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ImageReference", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.WindowsConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.OSConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SshPublicKey", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SshConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.LinuxConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SshKeyPair", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.OSProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SingleServerRecommendationResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ThreeTierRecommendationResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.DiskConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.VirtualMachineConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SingleServerConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.NetworkConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SingleServerCustomResourceNames", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.InfrastructureConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.CentralServerConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.DatabaseConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ApplicationServerConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.HighAvailabilityConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SkipFileShareConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.FileShareConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.CreateAndMountFileShareConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.MountFileShareConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.StorageConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ThreeTierConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ThreeTierCustomResourceNames", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SingleServerFullResourceNames", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.VirtualMachineResourceNames", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.NetworkInterfaceResourceNames", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ThreeTierFullResourceNames", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.CentralServerFullResourceNames", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.LoadBalancerResourceNames", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ApplicationServerFullResourceNames", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.DatabaseServerFullResourceNames", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SharedStorageResourceNames", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SoftwareConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ServiceInitiatedSoftwareConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.HighAvailabilitySoftwareConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapInstallWithoutOSConfigSoftwareConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ExternalInstallationSoftwareConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.DiscoveryConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.DeploymentConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.DeploymentWithOSConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.OsSapConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.DeployerVmPackages", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapEnvironmentType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapProductType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapDeploymentType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapDatabaseType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapDatabaseScaleMethod", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapHighAvailabilityType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.DiskSkuName", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ManagedServiceIdentityType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ManagedResourcesNetworkAccessType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapConfigurationType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapVirtualInstanceStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapHealthState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapVirtualInstanceState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapVirtualInstanceProvisioningState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.EnqueueReplicationServerType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.CentralServerVirtualMachineType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ApplicationServerVirtualMachineType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.Origin", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ActionType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.OSType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.NamingPatternType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ConfigurationType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapSoftwareInstallationType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -} ] \ No newline at end of file diff --git a/sdk/workloadssapvirtualinstance/azure-resourcemanager-workloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadssapvirtualinstance/generated/ResourceProviderSapAvailabilityZoneDetailsSamples.java b/sdk/workloadssapvirtualinstance/azure-resourcemanager-workloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadssapvirtualinstance/generated/ResourceProviderSapAvailabilityZoneDetailsSamples.java deleted file mode 100644 index af174c9edc1f..000000000000 --- a/sdk/workloadssapvirtualinstance/azure-resourcemanager-workloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadssapvirtualinstance/generated/ResourceProviderSapAvailabilityZoneDetailsSamples.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.workloadssapvirtualinstance.generated; - -import com.azure.resourcemanager.workloadssapvirtualinstance.models.SapAvailabilityZoneDetailsRequest; -import com.azure.resourcemanager.workloadssapvirtualinstance.models.SapDatabaseType; -import com.azure.resourcemanager.workloadssapvirtualinstance.models.SapProductType; - -/** - * Samples for ResourceProvider SapAvailabilityZoneDetails. - */ -public final class ResourceProviderSapAvailabilityZoneDetailsSamples { - /* - * x-ms-original-file: - * specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/ - * examples/sapvirtualinstances/SAPAvailabilityZoneDetails_northeurope.json - */ - /** - * Sample code: SAPAvailabilityZoneDetails_northeurope. - * - * @param manager Entry point to WorkloadsSapVirtualInstanceManager. - */ - public static void sAPAvailabilityZoneDetailsNortheurope( - com.azure.resourcemanager.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceManager manager) { - manager.resourceProviders().sapAvailabilityZoneDetailsWithResponse( - "centralus", new SapAvailabilityZoneDetailsRequest().withAppLocation("northeurope") - .withSapProduct(SapProductType.S4HANA).withDatabaseType(SapDatabaseType.HANA), - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/ - * examples/sapvirtualinstances/SAPAvailabilityZoneDetails_eastus.json - */ - /** - * Sample code: SAPAvailabilityZoneDetails_eastus. - * - * @param manager Entry point to WorkloadsSapVirtualInstanceManager. - */ - public static void sAPAvailabilityZoneDetailsEastus( - com.azure.resourcemanager.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceManager manager) { - manager.resourceProviders().sapAvailabilityZoneDetailsWithResponse( - "centralus", new SapAvailabilityZoneDetailsRequest().withAppLocation("eastus") - .withSapProduct(SapProductType.S4HANA).withDatabaseType(SapDatabaseType.HANA), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/workloadssapvirtualinstance/azure-resourcemanager-workloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadssapvirtualinstance/generated/SapApplicationServerInstancesStartInstanceSamples.java b/sdk/workloadssapvirtualinstance/azure-resourcemanager-workloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadssapvirtualinstance/generated/SapApplicationServerInstancesStartInstanceSamples.java deleted file mode 100644 index 097140891ab0..000000000000 --- a/sdk/workloadssapvirtualinstance/azure-resourcemanager-workloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadssapvirtualinstance/generated/SapApplicationServerInstancesStartInstanceSamples.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloadssapvirtualinstance.generated; - -import com.azure.resourcemanager.workloadssapvirtualinstance.models.StartRequest; - -/** - * Samples for SapApplicationServerInstances StartInstance. - */ -public final class SapApplicationServerInstancesStartInstanceSamples { - /* - * x-ms-original-file: - * specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/ - * examples/sapapplicationinstances/SAPApplicationServerInstances_StartInstance_WithInfraOperations.json - */ - /** - * Sample code: Start Virtual Machine and the SAP Application Server Instance on it. - * - * @param manager Entry point to WorkloadsSapVirtualInstanceManager. - */ - public static void startVirtualMachineAndTheSAPApplicationServerInstanceOnIt( - com.azure.resourcemanager.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceManager manager) { - manager.sapApplicationServerInstances().startInstance("test-rg", "X00", "app01", - new StartRequest().withStartVm(true), com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/ - * examples/sapapplicationinstances/SAPApplicationServerInstances_StartInstance.json - */ - /** - * Sample code: Start the SAP Application Server Instance. - * - * @param manager Entry point to WorkloadsSapVirtualInstanceManager. - */ - public static void startTheSAPApplicationServerInstance( - com.azure.resourcemanager.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceManager manager) { - manager.sapApplicationServerInstances().startInstance("test-rg", "X00", "app01", null, - com.azure.core.util.Context.NONE); - } -} From 704a93210dd35f1e55bbe491f2f142718d88db15 Mon Sep 17 00:00:00 2001 From: glenn Date: Tue, 13 Aug 2024 13:34:07 -0400 Subject: [PATCH 017/128] add async tests for complete and completeStreaming --- sdk/ai/azure-ai-inference/pom.xml | 7 +- .../models/ChatCompletionsOptions.java | 104 ++++++++++++++++++ .../src/main/java/module-info.java | 5 +- .../ChatCompletionsAsyncClientTest.java | 56 ++++++++++ .../ChatCompletionsClientTestBase.java | 14 ++- 5 files changed, 180 insertions(+), 6 deletions(-) create mode 100644 sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsAsyncClientTest.java diff --git a/sdk/ai/azure-ai-inference/pom.xml b/sdk/ai/azure-ai-inference/pom.xml index 186aaf776aaf..db5c38d7616e 100644 --- a/sdk/ai/azure-ai-inference/pom.xml +++ b/sdk/ai/azure-ai-inference/pom.xml @@ -67,11 +67,16 @@ + + com.fasterxml.jackson.core + jackson-databind + 2.17.2 + test + com.azure azure-core-test 1.26.1 - test com.azure diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsOptions.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsOptions.java index fa3d4e8e8b1d..32590d28d0fc 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsOptions.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsOptions.java @@ -8,6 +8,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.azure.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; + +import java.io.IOException; import java.util.List; /** @@ -496,4 +501,103 @@ public ChatCompletionsOptions setExtraParams(ExtraParameters extraParams) { this.extraParams = extraParams; return this; } + + /** + * {@inheritDoc} + */ + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("messages", this.messages, JsonWriter::writeJson); + jsonWriter.writeNumberField("max_tokens", this.maxTokens); + jsonWriter.writeNumberField("temperature", this.temperature); + jsonWriter.writeNumberField("top_p", this.topP); + jsonWriter.writeArrayField("stop", this.stop, JsonWriter::writeString); + jsonWriter.writeNumberField("presence_penalty", this.presencePenalty); + jsonWriter.writeNumberField("frequency_penalty", this.frequencyPenalty); + jsonWriter.writeBooleanField("stream", this.stream); + jsonWriter.writeStringField("model", this.model); + jsonWriter.writeNumberField("seed", this.seed); + jsonWriter.writeJsonField("response_format", this.responseFormat); + jsonWriter.writeArrayField("tools", this.tools, JsonWriter::writeJson); + if (this.toolChoice != null) { + jsonWriter.writeRawField("tool_choice", this.toolChoice.toString()); + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChatCompletionsOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChatCompletionsOptions if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ChatCompletionsOptions. + */ + @Generated + public static ChatCompletionsOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List messages = null; + Integer maxTokens = null; + Double temperature = null; + Double topP = null; + List stop = null; + Double presencePenalty = null; + Double frequencyPenalty = null; + Boolean stream = null; + String model = null; + Long seed = null; + ChatCompletionsResponseFormat responseFormat = null; + List tools = null; + BinaryData toolChoice = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("messages".equals(fieldName)) { + messages = reader.readArray(ChatRequestMessage::fromJson); + } else if ("max_tokens".equals(fieldName)) { + maxTokens = reader.getNullable(JsonReader::getInt); + } else if ("temperature".equals(fieldName)) { + temperature = reader.getNullable(JsonReader::getDouble); + } else if ("top_p".equals(fieldName)) { + topP = reader.getNullable(JsonReader::getDouble); + } else if ("stop".equals(fieldName)) { + stop = reader.readArray(JsonReader::getString); + } else if ("presence_penalty".equals(fieldName)) { + presencePenalty = reader.getNullable(JsonReader::getDouble); + } else if ("frequency_penalty".equals(fieldName)) { + frequencyPenalty = reader.getNullable(JsonReader::getDouble); + } else if ("stream".equals(fieldName)) { + stream = reader.getNullable(JsonReader::getBoolean); + } else if ("model".equals(fieldName)) { + model = reader.getString(); + } else if ("seed".equals(fieldName)) { + seed = reader.getNullable(JsonReader::getLong); + } else if ("response_format".equals(fieldName)) { + responseFormat = ChatCompletionsResponseFormat.fromJson(reader); + } else if ("tools".equals(fieldName)) { + tools = reader.readArray(ChatCompletionsToolDefinition::fromJson); + } else if ("tool_choice".equals(fieldName)) { + toolChoice + = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); + } else { + reader.skipChildren(); + } + } + ChatCompletionsOptions deserializedChatCompletionsOptions = new ChatCompletionsOptions(messages); + deserializedChatCompletionsOptions.maxTokens = maxTokens; + deserializedChatCompletionsOptions.temperature = temperature; + deserializedChatCompletionsOptions.topP = topP; + deserializedChatCompletionsOptions.stop = stop; + deserializedChatCompletionsOptions.presencePenalty = presencePenalty; + deserializedChatCompletionsOptions.frequencyPenalty = frequencyPenalty; + deserializedChatCompletionsOptions.stream = stream; + deserializedChatCompletionsOptions.model = model; + deserializedChatCompletionsOptions.seed = seed; + deserializedChatCompletionsOptions.responseFormat = responseFormat; + deserializedChatCompletionsOptions.tools = tools; + deserializedChatCompletionsOptions.toolChoice = toolChoice; + return deserializedChatCompletionsOptions; + }); + } } diff --git a/sdk/ai/azure-ai-inference/src/main/java/module-info.java b/sdk/ai/azure-ai-inference/src/main/java/module-info.java index 20f5ec8d9d92..039d72472103 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/module-info.java +++ b/sdk/ai/azure-ai-inference/src/main/java/module-info.java @@ -4,8 +4,9 @@ module com.azure.ai.inference { requires transitive com.azure.core; + requires com.fasterxml.jackson.databind; exports com.azure.ai.inference; exports com.azure.ai.inference.models; - opens com.azure.ai.inference.models to com.azure.core; + opens com.azure.ai.inference.models; opens com.azure.ai.inference.implementation.models to com.azure.core; -} \ No newline at end of file +} diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsAsyncClientTest.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsAsyncClientTest.java new file mode 100644 index 000000000000..fcb3ee76621c --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsAsyncClientTest.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.ai.inference; + +import com.azure.ai.inference.models.*; +import com.azure.core.http.HttpClient; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; +import reactor.test.StepVerifier; + +import java.util.ArrayList; +import java.util.concurrent.TimeUnit; + +import static com.azure.ai.inference.TestUtils.DISPLAY_NAME_WITH_ARGUMENTS; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +public class ChatCompletionsAsyncClientTest extends ChatCompletionsClientTestBase { + private ChatCompletionsAsyncClient client; + + private ChatCompletionsAsyncClient getChatCompletionsAsyncClient (HttpClient httpClient) { + return getChatCompletionsClientBuilder( + interceptorManager.isPlaybackMode() ? interceptorManager.getPlaybackClient() : httpClient) + .buildAsyncClient(); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.inference.TestUtils#getTestParameters") + public void testGetChatCompletions(HttpClient httpClient) { + client = getChatCompletionsAsyncClient(httpClient); + getChatCompletionsRunner((prompt) -> { + StepVerifier.create(client.complete(prompt)) + .assertNext(resultCompletions -> { + assertNotNull(resultCompletions.getUsage()); + assertCompletions(1, resultCompletions); + }) + .verifyComplete(); + }); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.inference.TestUtils#getTestParameters") + public void testGetCompletionsStream(HttpClient httpClient) { + client = getChatCompletionsAsyncClient(httpClient); + getStreamingChatCompletionsRunner((chatMessages) -> { + StepVerifier.create(client.completeStreaming(new ChatCompletionsOptions(chatMessages))) + .recordWith(ArrayList::new) + .thenConsumeWhile(chatCompletions -> { + assertCompletionsStream(chatCompletions); + return true; + }) + .consumeRecordedWith(messageList -> assertTrue(messageList.size() > 1)) + .verifyComplete(); + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java index d0e1d094d8d9..9ba6e2461abb 100644 --- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java +++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java @@ -12,6 +12,8 @@ import com.azure.ai.inference.models.ChatCompletions; import com.azure.ai.inference.models.ChatRequestMessage; import com.azure.ai.inference.models.ChatRequestUserMessage; +import com.azure.ai.inference.models.ChatRequestSystemMessage; +import com.azure.ai.inference.models.ChatRequestAssistantMessage; import com.azure.core.credential.AzureKeyCredential; import com.azure.core.http.HttpClient; import com.azure.core.test.TestMode; @@ -89,9 +91,7 @@ void getChatCompletionsRunner(Consumer testRunner) { } void getStreamingChatCompletionsRunner(Consumer> testRunner) { - List chatMessages = new ArrayList<>(); - chatMessages.add(ChatRequestUserMessage.fromString("Say this is a test")); - testRunner.accept(chatMessages); + testRunner.accept(getChatMessages()); } static void assertCompletionsStream(ChatCompletions chatCompletions) { @@ -123,4 +123,12 @@ static void assertChoice(int index, ChatChoice actual) { assertNotNull(actual.getFinishReason()); } + private List getChatMessages() { + List chatMessages = new ArrayList<>(); + chatMessages.add(new ChatRequestSystemMessage("You are a helpful assistant. You will talk like a pirate.")); + chatMessages.add(ChatRequestUserMessage.fromString("Can you help me?")); + chatMessages.add(new ChatRequestAssistantMessage("Of course, me hearty! What can I do for ye?")); + chatMessages.add(ChatRequestUserMessage.fromString("What's the best way to train a parrot?")); + return chatMessages; + } } From c40edc22153673961b7c232139f7873574d798d4 Mon Sep 17 00:00:00 2001 From: glenn Date: Wed, 14 Aug 2024 10:56:58 -0400 Subject: [PATCH 018/128] remove refs to jackson package --- sdk/ai/azure-ai-inference/pom.xml | 6 ------ .../azure/ai/inference/models/ChatCompletionsOptions.java | 3 ++- sdk/ai/azure-ai-inference/src/main/java/module-info.java | 3 +-- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/sdk/ai/azure-ai-inference/pom.xml b/sdk/ai/azure-ai-inference/pom.xml index db5c38d7616e..7cfb18f01d4a 100644 --- a/sdk/ai/azure-ai-inference/pom.xml +++ b/sdk/ai/azure-ai-inference/pom.xml @@ -67,12 +67,6 @@ - - com.fasterxml.jackson.core - jackson-databind - 2.17.2 - test - com.azure azure-core-test diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsOptions.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsOptions.java index 32590d28d0fc..f0aaac4349b9 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsOptions.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsOptions.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.util.BinaryData; import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -19,7 +20,7 @@ * Options for complete API. */ @Fluent -public final class ChatCompletionsOptions { +public final class ChatCompletionsOptions implements JsonSerializable { /* * The collection of context messages associated with this chat completions request. * Typical usage begins with a chat message for the System role that provides instructions for diff --git a/sdk/ai/azure-ai-inference/src/main/java/module-info.java b/sdk/ai/azure-ai-inference/src/main/java/module-info.java index 039d72472103..49816749e27a 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/module-info.java +++ b/sdk/ai/azure-ai-inference/src/main/java/module-info.java @@ -4,9 +4,8 @@ module com.azure.ai.inference { requires transitive com.azure.core; - requires com.fasterxml.jackson.databind; exports com.azure.ai.inference; exports com.azure.ai.inference.models; - opens com.azure.ai.inference.models; + opens com.azure.ai.inference.models to com.azure.core; opens com.azure.ai.inference.implementation.models to com.azure.core; } From eb66988c41973d74230dda3440abce8fb030a2d4 Mon Sep 17 00:00:00 2001 From: glenn Date: Wed, 14 Aug 2024 12:46:32 -0400 Subject: [PATCH 019/128] add chat completions code to README (links needed) --- sdk/ai/azure-ai-inference/README.md | 137 +++++++++++++++++++++++++++- 1 file changed, 136 insertions(+), 1 deletion(-) diff --git a/sdk/ai/azure-ai-inference/README.md b/sdk/ai/azure-ai-inference/README.md index 877c737a1409..4c5e7ceb33ef 100644 --- a/sdk/ai/azure-ai-inference/README.md +++ b/sdk/ai/azure-ai-inference/README.md @@ -32,11 +32,146 @@ Various documentation is available to help you get started ### Authentication -[Azure Identity][azure_identity] package provides the default implementation for authenticating the client. +In order to interact with the Azure AI Inference Service you'll need to create an instance of client class, +[ChatCompletionsAsyncClient][chat_completions_client_async] or [ChatCompletionsClient][chat_completions_client_sync] by using +[ChatCompletionsClientBuilder][chat_completions_client_builder]. To configure a client for use with +Azure Inference, provide a valid endpoint URI to an Azure Model resource along with a corresponding key credential, +token credential, or [Azure Identity][azure_identity] credential that's authorized to use the Azure Model resource. + +#### Create a Chat Completions client with key credential +Get Azure Model `key` credential from the Azure Portal. + +```java readme-sample-createSyncClientKeyCredential +ChatCompletionsClient client = new ChatCompletionsClientBuilder() + .credential(new AzureKeyCredential("{key}")) + .endpoint("{endpoint}") + .buildClient(); +``` +or +```java readme-sample-createAsyncClientKeyCredential +ChatCompletionsAsyncClient client = new ChatCompletionsClientBuilder() + .credential(new AzureKeyCredential("{key}")) + .endpoint("{endpoint}") + .buildAsyncClient(); +``` + +#### Create a client with Azure Active Directory credential +Azure SDK for Java supports an Azure Identity package, making it easy to get credentials from Microsoft identity +platform. + +Authentication with AAD requires some initial setup: +* Add the Azure Identity package + +[//]: # ({x-version-update-start;com.azure:azure-identity;dependency}) +```xml + + com.azure + azure-identity + 1.13.1 + +``` +[//]: # ({x-version-update-end}) + +After setup, you can choose which type of [credential][azure_identity_credential_type] from azure.identity to use. +As an example, [DefaultAzureCredential][wiki_identity] can be used to authenticate the client: +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: +`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. + +Authorization is easiest using [DefaultAzureCredential][wiki_identity]. It finds the best credential to use in its +running environment. For more information about using Azure Active Directory authorization with OpenAI service, please +refer to [the associated documentation][aad_authorization]. + +```java readme-sample-createChatCompletionsClientWithAAD +TokenCredential defaultCredential = new DefaultAzureCredentialBuilder().build(); +ChatCompletionsClient client = new ChatCompletionsClientBuilder() + .credential(defaultCredential) + .endpoint("{endpoint}") + .buildClient(); +``` ## Key concepts ## Examples +The following sections provide several code snippets covering some of the most common OpenAI service tasks, including: + +* [Chat completions sample](#chat-completions "Chat completions") +* [Streaming chat completions sample](#streaming-chat-completions "Streaming chat completions") + + +## Examples + +### Chat completions + +```java readme-sample-getChatCompletions +List chatMessages = new ArrayList<>(); +chatMessages.add(new ChatRequestSystemMessage("You are a helpful assistant. You will talk like a pirate.")); +chatMessages.add(ChatRequestUserMessage.fromString("Can you help me?")); +chatMessages.add(new ChatRequestAssistantMessage("Of course, me hearty! What can I do for ye?")); +chatMessages.add(ChatRequestUserMessage.fromString("What's the best way to train a parrot?")); + +ChatCompletions chatCompletions = client.complete(new ChatCompletionsOptions(chatMessages)); + +System.out.printf("Model ID=%s is created at %s.%n", chatCompletions.getId(), chatCompletions.getCreatedAt()); +for (ChatChoice choice : chatCompletions.getChoices()) { + ChatResponseMessage message = choice.getMessage(); + System.out.printf("Index: %d, Chat Role: %s.%n", choice.getIndex(), message.getRole()); + System.out.println("Message:"); + System.out.println(message.getContent()); +} +``` +For a complete sample example, see sample [Chat Completions][sample_get_chat_completions]. + +Please refer to the service documentation for a conceptual discussion of [text completion][microsoft_docs_openai_completion]. + +### Streaming chat completions + +```java readme-sample-getChatCompletionsStream +List chatMessages = new ArrayList<>(); +chatMessages.add(new ChatRequestSystemMessage("You are a helpful assistant. You will talk like a pirate.")); +chatMessages.add(ChatRequestUserMessage.fromString("Can you help me?")); +chatMessages.add(new ChatRequestAssistantMessage("Of course, me hearty! What can I do for ye?")); +chatMessages.add(ChatRequestUserMessage.fromString("What's the best way to train a parrot?")); + +client.completeStreaming(new ChatCompletionsOptions(chatMessages)) + .forEach(chatCompletions -> { + if (CoreUtils.isNullOrEmpty(chatCompletions.getChoices())) { + return; + } + ChatResponseMessage delta = chatCompletions.getChoices().getFirst().getDelta(); + if (delta.getRole() != null) { + System.out.println("Role = " + delta.getRole()); + } + if (delta.getContent() != null) { + String content = delta.getContent(); + System.out.print(content); + } + }); +``` + +To compute tokens in streaming chat completions, see sample [Streaming Chat Completions][sample_get_chat_completions_streaming]. + + ```java com.azure.ai.inference.readme ``` From 6db0a2009cbfad3d7a42e07c20caaf7e580acad4 Mon Sep 17 00:00:00 2001 From: glenn Date: Thu, 15 Aug 2024 09:57:00 -0400 Subject: [PATCH 020/128] add troubleshooting file, links in README --- sdk/ai/azure-ai-inference/README.md | 30 ++++ sdk/ai/azure-ai-inference/TROUBLESHOOTING.md | 141 +++++++++++++++++++ 2 files changed, 171 insertions(+) create mode 100644 sdk/ai/azure-ai-inference/TROUBLESHOOTING.md diff --git a/sdk/ai/azure-ai-inference/README.md b/sdk/ai/azure-ai-inference/README.md index 4c5e7ceb33ef..946d9b1e35c5 100644 --- a/sdk/ai/azure-ai-inference/README.md +++ b/sdk/ai/azure-ai-inference/README.md @@ -192,6 +192,23 @@ If there are significant differences, API calls may fail due to incompatibility. Always ensure that the chosen API version is fully supported and operational for your specific use case and that it aligns with the service's versioning policy. ## Troubleshooting +### Enable client logging +You can set the `AZURE_LOG_LEVEL` environment variable to view logging statements made in the client library. For +example, setting `AZURE_LOG_LEVEL=2` would show all informational, warning, and error log messages. The log levels can +be found here: [log levels][logLevels]. + +### Default HTTP Client +All client libraries by default use the Netty HTTP client. Adding the above dependency will automatically configure +the client library to use the Netty HTTP client. Configuring or changing the HTTP client is detailed in the +[HTTP clients wiki](https://github.com/Azure/azure-sdk-for-java/wiki/HTTP-clients). + +### Default SSL library +All client libraries, by default, use the Tomcat-native Boring SSL library to enable native-level performance for SSL +operations. The Boring SSL library is an uber jar containing native libraries for Linux / macOS / Windows, and provides +better performance compared to the default SSL implementation within the JDK. For more information, including how to +reduce the dependency size, refer to the [performance tuning][performance_tuning] section of the wiki. + +For more details, see [TROUBLESHOOTING][troubleshooting] guideline. ## Next steps @@ -209,7 +226,20 @@ For details on contributing to this repository, see the [contributing guide](htt [product_documentation]: https://azure.microsoft.com/services/ [docs]: https://azure.github.io/azure-sdk-for-java/ [jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ +[azure_identity_credential_type]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials +[aad_authorization]: https://docs.microsoft.com/azure/cognitive-services/authentication#authenticate-with-azure-active-directory [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[sample_get_chat_completions]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/openai/azure-ai-openai/src/samples/java/com/azure/ai/openai/usage/GetChatCompletionsSample.java +[sample_get_chat_completions_streaming]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/openai/azure-ai-openai/src/samples/java/com/azure/ai/openai/usage/GetChatCompletionsStreamSample.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 +[chat_completions_client_async]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIAsyncClient.java +[chat_completions_client_builder]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIClientBuilder.java +[chat_completions_client_sync]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIClient.java +[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 +[performance_tuning]: https://github.com/Azure/azure-sdk-for-java/wiki/Performance-Tuning +[troubleshooting]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/openai/azure-ai-openai/TROUBLESHOOTING.md +[wiki_identity]: https://github.com/Azure/azure-sdk-for-java/wiki/Identity-and-Authentication ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fai%2Fazure-ai-inference%2FREADME.png) diff --git a/sdk/ai/azure-ai-inference/TROUBLESHOOTING.md b/sdk/ai/azure-ai-inference/TROUBLESHOOTING.md new file mode 100644 index 000000000000..1cbfd3650502 --- /dev/null +++ b/sdk/ai/azure-ai-inference/TROUBLESHOOTING.md @@ -0,0 +1,141 @@ +# Troubleshooting AI Inference issues + +This troubleshooting guide covers failure investigation techniques, common errors for the credential types in the Azure +AI Inference Java client library, and mitigation steps to resolve these errors. The common best practice sample can be found +in [Best Practice Samples][best_practice_samples]. + +## Table of Contents + +* [General Troubleshooting](#general-troubleshooting) + * [Enable client logging](#enable-client-logging) + * [Enable HTTP request/response logging](#enable-http-requestresponse-logging) + * [Troubleshooting Exceptions](#troubleshooting-exceptions) + * [Troubleshooting NoSuchMethodError or NoClassDefFoundError](#dependency-conflicts) + * [Network Issues](#network-issues) +* [Get additional help](#get-additional-help) + +## General Troubleshooting + +### Enable client logging + +To troubleshoot issues with Azure Inference library, it is important to first enable logging to monitor the +behavior of the application. The errors and warnings in the logs generally provide useful insights into what went wrong +and sometimes include corrective actions to fix issues. The Azure client libraries for Java have two logging options: + +* A built-in logging framework. +* Support for logging using the [SLF4J](https://www.slf4j.org/) interface. + +Refer to the instructions in this reference document on how to [configure logging in Azure SDK for Java][logging_overview]. + +### Enable HTTP request/response logging + +Reviewing the HTTP request sent or response received over the wire to/from the Azure Model service can be +useful in troubleshooting issues. To enable logging the HTTP request and response payload, the [ChatCompletionsClient][chat_completions_client] +can be configured as shown below. If there is no SLF4J's `Logger` on the class path, set an environment variable +[AZURE_LOG_LEVEL][azure_log_level] in your machine to enable logging. + +```java readme-sample-enablehttplogging +ChatCompletionsClient openAIClient = new ChatCompletionsClientBuilder() + .endpoint("{endpoint}") + .credential(new AzureKeyCredential("{key}")) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)) + .buildClient(); +// or +DefaultAzureCredential credential = new DefaultAzureCredentialBuilder().build(); +ChatCompletionsClient configurationClientAad = new ChatCompletionsClientBuilder() + .credential(credential) + .endpoint("{endpoint}") + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)) + .buildClient(); +``` + +Alternatively, you can configure logging HTTP requests and responses for your entire application by setting the +following environment variable. Note that this change will enable logging for every Azure client that supports logging +HTTP request/response. + +Environment variable name: `AZURE_HTTP_LOG_DETAIL_LEVEL` + +| Value | Logging level | +|------------------|----------------------------------------------------------------------| +| none | HTTP request/response logging is disabled | +| basic | Logs only URLs, HTTP methods, and time to finish the request. | +| headers | Logs everything in BASIC, plus all the request and response headers. | +| body | Logs everything in BASIC, plus all the request and response body. | +| body_and_headers | Logs everything in HEADERS and BODY. | + +**NOTE**: When logging the body of request and response, please ensure that they do not contain confidential +information. When logging headers, the client library has a default set of headers that are considered safe to log +but this set can be updated by updating the log options in the builder as shown below: + +```java +clientBuilder.httpLogOptions(new HttpLogOptions().addAllowedHeaderName("safe-to-log-header-name")) +``` + +### Troubleshooting exceptions +Azure Inference service methods throw a [HttpResponseException][http_response_exception] or its subclass on failure. +The `HttpResponseException` thrown by the chat completions client library includes detailed response error object +that provides specific useful insights into what went wrong and includes corrective actions to fix common issues. +This error information can be found inside the message property of the `HttpResponseException` object. + +Here's the example of how to catch it with synchronous client + +```java readme-sample-troubleshootingExceptions +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?")); + +try { + ChatCompletions chatCompletions = client.complete(new ChatCompletionsOptions(chatMessages)); +} catch (HttpResponseException e) { + System.out.println(e.getMessage()); + // Do something with the exception +} +``` + +With async clients, you can catch and handle exceptions in the error callbacks: + +```java readme-sample-troubleshootingExceptions-async +asyncClient.complete(new ChatCompletionsOptions(chatMessages)) + .doOnSuccess(ignored -> System.out.println("Success!")) + .doOnError( + error -> error instanceof ResourceNotFoundException, + error -> System.out.println("Exception: 'getChatCompletions' could not be performed.")); +``` + +### Authentication errors + +Azure Inference supports Azure Active Directory authentication. [ChatCompletionsClientBuilder][chat_completions_client_builder] +has method to set the `credential`. To provide a valid credential, you can use `azure-identity` dependency. For more +details on getting started, refer to the [README][how_to_create_chat_completions_client] of Azure Inference library. +You can also refer to the [Azure Identity documentation][identity_doc] for more details on the various types of +credential supported in `azure-identity`. + +### Dependency conflicts + +If you see `NoSuchMethodError` or `NoClassDefFoundError` during your application runtime, this is due to a +dependency version conflict. Please take a look at [troubleshooting dependency version conflicts][troubleshooting_dependency_conflict] +for more information on why this happens and [ways to mitigate this issue][troubleshooting_mitigate_version_mismatch]. + +### Network issues + +If you have network issues, please take a look at [troubleshooting network issues][troubleshooting_network_issues]. + +## Get additional help + +Additional information on ways to reach out for support can be found in the [SUPPORT.md][support] at the root of the repo. + + +[azure_log_level]: https://learn.microsoft.com/azure/developer/java/sdk/logging-overview#default-logger-for-temporary-debugging +[best_practice_samples]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/openai/azure-ai-openai/src/samples/README.md +[chat_completions_client]: https://learn.microsoft.com/java/api/overview/azure/ai-openai-readme?view=azure-java-preview +[chat_completions_client_builder]: https://learn.microsoft.com/java/api/overview/azure/ai-openai-readme?view=azure-java-preview#authentication +[how_to_create_chat_completions_client]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/openai/azure-ai-openai/README.md#authentication +[http_response_exception]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core/src/main/java/com/azure/core/exception/HttpResponseException.java +[identity_doc]: https://docs.microsoft.com/azure/developer/java/sdk/identity +[logging_overview]: https://docs.microsoft.com/azure/developer/java/sdk/logging-overview +[support]: https://github.com/Azure/azure-sdk-for-java/blob/main/SUPPORT.md +[troubleshooting_network_issues]: https://learn.microsoft.com/azure/developer/java/sdk/troubleshooting-network +[troubleshooting_dependency_conflict]: https://docs.microsoft.com/azure/developer/java/sdk/troubleshooting-dependency-version-conflict +[troubleshooting_mitigate_version_mismatch]: https://docs.microsoft.com/azure/developer/java/sdk/troubleshooting-dependency-version-conflict#mitigate-version-mismatch-issues From 87fe50bf42ea43b1266eb12d0cde3009a4e04504 Mon Sep 17 00:00:00 2001 From: glenn Date: Thu, 15 Aug 2024 11:06:42 -0400 Subject: [PATCH 021/128] add readmeSamples class for readme code sample auto gen --- sdk/ai/azure-ai-inference/README.md | 18 +- sdk/ai/azure-ai-inference/TROUBLESHOOTING.md | 40 ++--- .../ai/inference/ChatCompletionsClient.java | 7 - .../com/azure/ai/inference/ReadmeSamples.java | 163 ++++++++++++++++++ .../inference/usage/StreamingChatSample.java | 2 +- .../ChatCompletionsClientTestBase.java | 2 +- 6 files changed, 187 insertions(+), 45 deletions(-) create mode 100644 sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/ReadmeSamples.java diff --git a/sdk/ai/azure-ai-inference/README.md b/sdk/ai/azure-ai-inference/README.md index 946d9b1e35c5..b4d63f765cd0 100644 --- a/sdk/ai/azure-ai-inference/README.md +++ b/sdk/ai/azure-ai-inference/README.md @@ -113,7 +113,7 @@ chatMessages.add(ChatRequestUserMessage.fromString("What's the best way to train ChatCompletions chatCompletions = client.complete(new ChatCompletionsOptions(chatMessages)); -System.out.printf("Model ID=%s is created at %s.%n", chatCompletions.getId(), chatCompletions.getCreatedAt()); +System.out.printf("Model ID=%s is created at %s.%n", chatCompletions.getId(), chatCompletions.getCreated()); for (ChatChoice choice : chatCompletions.getChoices()) { ChatResponseMessage message = choice.getMessage(); System.out.printf("Index: %d, Chat Role: %s.%n", choice.getIndex(), message.getRole()); @@ -139,7 +139,7 @@ client.completeStreaming(new ChatCompletionsOptions(chatMessages)) if (CoreUtils.isNullOrEmpty(chatCompletions.getChoices())) { return; } - ChatResponseMessage delta = chatCompletions.getChoices().getFirst().getDelta(); + ChatResponseMessage delta = chatCompletions.getChoices().get(0).getDelta(); if (delta.getRole() != null) { System.out.println("Role = " + delta.getRole()); } @@ -156,26 +156,12 @@ To compute tokens in streaming chat completions, see sample [Streaming Chat Comp ### Text embeddings ```java readme-sample-getEmbedding -EmbeddingsOptions embeddingsOptions = new EmbeddingsOptions( - Arrays.asList("Your text string goes here")); - -Embeddings embeddings = client.getEmbeddings(embeddingsOptions); - -for (EmbeddingItem item : embeddings.getData()) { - System.out.printf("Index: %d.%n", item.getPromptIndex()); - for (Float embedding : item.getEmbedding()) { - System.out.printf("%f;", embedding); - } -} ``` For a complete sample example, see sample [Embedding][sample_get_embedding]. Please refer to the service documentation for a conceptual discussion of [openAI embedding][microsoft_docs_openai_embedding]. --> -```java com.azure.ai.inference.readme -``` - ### Service API versions The client library targets the latest service API version by default. diff --git a/sdk/ai/azure-ai-inference/TROUBLESHOOTING.md b/sdk/ai/azure-ai-inference/TROUBLESHOOTING.md index 1cbfd3650502..4c34e5c038f1 100644 --- a/sdk/ai/azure-ai-inference/TROUBLESHOOTING.md +++ b/sdk/ai/azure-ai-inference/TROUBLESHOOTING.md @@ -35,18 +35,18 @@ can be configured as shown below. If there is no SLF4J's `Logger` on the class p [AZURE_LOG_LEVEL][azure_log_level] in your machine to enable logging. ```java readme-sample-enablehttplogging -ChatCompletionsClient openAIClient = new ChatCompletionsClientBuilder() - .endpoint("{endpoint}") - .credential(new AzureKeyCredential("{key}")) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)) - .buildClient(); + ChatCompletionsClient chatCompletionsClient = new ChatCompletionsClientBuilder() + .endpoint("{endpoint}") + .credential(new AzureKeyCredential("{key}")) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)) + .buildClient(); // or -DefaultAzureCredential credential = new DefaultAzureCredentialBuilder().build(); -ChatCompletionsClient configurationClientAad = new ChatCompletionsClientBuilder() - .credential(credential) - .endpoint("{endpoint}") - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)) - .buildClient(); + DefaultAzureCredential credential = new DefaultAzureCredentialBuilder().build(); + ChatCompletionsClient configurationClientAad = new ChatCompletionsClientBuilder() + .credential(credential) + .endpoint("{endpoint}") + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)) + .buildClient(); ``` Alternatively, you can configure logging HTTP requests and responses for your entire application by setting the @@ -82,16 +82,16 @@ Here's the example of how to catch it with synchronous client ```java readme-sample-troubleshootingExceptions 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(ChatRequestUserMessage.fromString("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?")); +chatMessages.add(ChatRequestUserMessage.fromString("What's the best way to train a parrot?")); try { - ChatCompletions chatCompletions = client.complete(new ChatCompletionsOptions(chatMessages)); -} catch (HttpResponseException e) { - System.out.println(e.getMessage()); - // Do something with the exception -} + ChatCompletions chatCompletions = client.complete(new ChatCompletionsOptions(chatMessages)); + } catch (HttpResponseException e) { + System.out.println(e.getMessage()); + // Do something with the exception + } ``` With async clients, you can catch and handle exceptions in the error callbacks: @@ -100,8 +100,8 @@ With async clients, you can catch and handle exceptions in the error callbacks: asyncClient.complete(new ChatCompletionsOptions(chatMessages)) .doOnSuccess(ignored -> System.out.println("Success!")) .doOnError( - error -> error instanceof ResourceNotFoundException, - error -> System.out.println("Exception: 'getChatCompletions' could not be performed.")); + error -> error instanceof ResourceNotFoundException, + error -> System.out.println("Exception: 'getChatCompletions' could not be performed.")); ``` ### Authentication errors diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java index d522729307b2..905138d58706 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java @@ -232,13 +232,6 @@ public ChatCompletions complete(String prompt) { /** * 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 - *

- * - * - * - * * * @param options The configuration information for a chat completions request. Completions support a * wide variety of tasks and generate text that continues from or "completes" provided prompt data. diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/ReadmeSamples.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/ReadmeSamples.java new file mode 100644 index 000000000000..82079c7302b6 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/ReadmeSamples.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference; + +import com.azure.ai.inference.ChatCompletionsClient; +import com.azure.ai.inference.ChatCompletionsClientBuilder; +import com.azure.ai.inference.models.ChatCompletionsOptions; +import com.azure.ai.inference.models.*; +import com.azure.core.credential.AzureKeyCredential; +import com.azure.core.credential.TokenCredential; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.policy.HttpLogDetailLevel; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.IterableStream; +import com.azure.identity.DefaultAzureCredential; +import com.azure.identity.DefaultAzureCredentialBuilder; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public final class ReadmeSamples { + + private ChatCompletionsClient client = new ChatCompletionsClientBuilder().buildClient(); + public void createSyncClientKeyCredential() { + // BEGIN: readme-sample-createSyncClientKeyCredential + ChatCompletionsClient client = new ChatCompletionsClientBuilder() + .credential(new AzureKeyCredential("{key}")) + .endpoint("{endpoint}") + .buildClient(); + // END: readme-sample-createSyncClientKeyCredential + } + + public void createAsyncClientKeyCredential() { + // BEGIN: readme-sample-createAsyncClientKeyCredential + ChatCompletionsAsyncClient client = new ChatCompletionsClientBuilder() + .credential(new AzureKeyCredential("{key}")) + .endpoint("{endpoint}") + .buildAsyncClient(); + // END: readme-sample-createAsyncClientKeyCredential + } + + public void createChatCompletionsClientWithAAD() { + // BEGIN: readme-sample-createChatCompletionsClientWithAAD + TokenCredential defaultCredential = new DefaultAzureCredentialBuilder().build(); + ChatCompletionsClient client = new ChatCompletionsClientBuilder() + .credential(defaultCredential) + .endpoint("{endpoint}") + .buildClient(); + // END: readme-sample-createChatCompletionsClientWithAAD + } + + public void getChatCompletions() { + // BEGIN: readme-sample-getChatCompletions + List chatMessages = new ArrayList<>(); + chatMessages.add(new ChatRequestSystemMessage("You are a helpful assistant. You will talk like a pirate.")); + chatMessages.add(ChatRequestUserMessage.fromString("Can you help me?")); + chatMessages.add(new ChatRequestAssistantMessage("Of course, me hearty! What can I do for ye?")); + chatMessages.add(ChatRequestUserMessage.fromString("What's the best way to train a parrot?")); + + ChatCompletions chatCompletions = client.complete(new ChatCompletionsOptions(chatMessages)); + + System.out.printf("Model ID=%s is created at %s.%n", chatCompletions.getId(), chatCompletions.getCreated()); + for (ChatChoice choice : chatCompletions.getChoices()) { + ChatResponseMessage message = choice.getMessage(); + System.out.printf("Index: %d, Chat Role: %s.%n", choice.getIndex(), message.getRole()); + System.out.println("Message:"); + System.out.println(message.getContent()); + } + // END: readme-sample-getChatCompletions + } + + public void getChatCompletionsStream() { + // BEGIN: readme-sample-getChatCompletionsStream + List chatMessages = new ArrayList<>(); + chatMessages.add(new ChatRequestSystemMessage("You are a helpful assistant. You will talk like a pirate.")); + chatMessages.add(ChatRequestUserMessage.fromString("Can you help me?")); + chatMessages.add(new ChatRequestAssistantMessage("Of course, me hearty! What can I do for ye?")); + chatMessages.add(ChatRequestUserMessage.fromString("What's the best way to train a parrot?")); + + client.completeStreaming(new ChatCompletionsOptions(chatMessages)) + .forEach(chatCompletions -> { + if (CoreUtils.isNullOrEmpty(chatCompletions.getChoices())) { + return; + } + 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: readme-sample-getChatCompletionsStream + } + + public void getEmbedding() { + // BEGIN: readme-sample-getEmbedding + // END: readme-sample-getEmbedding + } + + public void enableHttpLogging() { + // BEGIN: readme-sample-enablehttplogging + ChatCompletionsClient chatCompletionsClient = new ChatCompletionsClientBuilder() + .endpoint("{endpoint}") + .credential(new AzureKeyCredential("{key}")) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)) + .buildClient(); +// or + DefaultAzureCredential credential = new DefaultAzureCredentialBuilder().build(); + ChatCompletionsClient configurationClientAad = new ChatCompletionsClientBuilder() + .credential(credential) + .endpoint("{endpoint}") + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)) + .buildClient(); + // END: readme-sample-enablehttplogging + } + + public void troubleshootingExceptions() { + // BEGIN: readme-sample-troubleshootingExceptions + List chatMessages = new ArrayList<>(); + chatMessages.add(new ChatRequestSystemMessage("You are a helpful assistant. You will talk like a pirate.")); + chatMessages.add(ChatRequestUserMessage.fromString("Can you help me?")); + chatMessages.add(new ChatRequestAssistantMessage("Of course, me hearty! What can I do for ye?")); + chatMessages.add(ChatRequestUserMessage.fromString("What's the best way to train a parrot?")); + + try { + ChatCompletions chatCompletions = client.complete(new ChatCompletionsOptions(chatMessages)); + } catch (HttpResponseException e) { + System.out.println(e.getMessage()); + // Do something with the exception + } + // END: readme-sample-troubleshootingExceptions + } + + public void troubleshootingExceptionsAsync() { + ChatCompletionsAsyncClient asyncClient = new ChatCompletionsClientBuilder() + .credential(new AzureKeyCredential("{key}")) + .endpoint("{endpoint}") + .buildAsyncClient(); + + List chatMessages = new ArrayList<>(); + chatMessages.add(new ChatRequestSystemMessage("You are a helpful assistant. You will talk like a pirate.")); + chatMessages.add(ChatRequestUserMessage.fromString("Can you help me?")); + chatMessages.add(new ChatRequestAssistantMessage("Of course, me hearty! What can I do for ye?")); + chatMessages.add(ChatRequestUserMessage.fromString("What's the best way to train a parrot?")); + + // BEGIN: readme-sample-troubleshootingExceptions-async + asyncClient.complete(new ChatCompletionsOptions(chatMessages)) + .doOnSuccess(ignored -> System.out.println("Success!")) + .doOnError( + error -> error instanceof ResourceNotFoundException, + error -> System.out.println("Exception: 'getChatCompletions' could not be performed.")); + // END: readme-sample-troubleshootingExceptions-async + } + +} diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java index 9c10519c2914..093b626d389b 100644 --- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java @@ -58,7 +58,7 @@ public static void main(String[] args) { return; } - ChatResponseMessage delta = chatCompletions.getChoices().getFirst().getDelta(); + ChatResponseMessage delta = chatCompletions.getChoices().get(0).getDelta(); if (delta.getRole() != null) { System.out.println("Role = " + delta.getRole()); diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java index 9ba6e2461abb..1328c2fbc2ae 100644 --- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java +++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java @@ -99,7 +99,7 @@ static void assertCompletionsStream(ChatCompletions chatCompletions) { assertNotNull(chatCompletions.getId()); assertNotNull(chatCompletions.getChoices()); assertFalse(chatCompletions.getChoices().isEmpty()); - assertNotNull(chatCompletions.getChoices().getFirst().getDelta()); + assertNotNull(chatCompletions.getChoices().get(0).getDelta()); } } From b5f7dd0ebbdcc04774f519f057dbd7d0f42542d8 Mon Sep 17 00:00:00 2001 From: glenn Date: Thu, 15 Aug 2024 21:36:51 -0400 Subject: [PATCH 022/128] update genned code with embeddingsClient, imageEmbeddingsClient --- .../inference/ChatCompletionsAsyncClient.java | 34 +- .../ai/inference/ChatCompletionsClient.java | 34 +- .../ai/inference/EmbeddingsAsyncClient.java | 232 +++++++++++ .../azure/ai/inference/EmbeddingsClient.java | 225 +++++++++++ .../ai/inference/EmbeddingsClientBuilder.java | 355 ++++++++++++++++ .../inference/ImageEmbeddingsAsyncClient.java | 236 +++++++++++ .../ai/inference/ImageEmbeddingsClient.java | 229 +++++++++++ .../ImageEmbeddingsClientBuilder.java | 355 ++++++++++++++++ .../ChatCompletionsClientImpl.java | 32 +- .../implementation/EmbeddingsClientImpl.java | 375 +++++++++++++++++ .../ImageEmbeddingsClientImpl.java | 382 ++++++++++++++++++ .../models/CompleteRequest.java | 56 ++- .../implementation/models/EmbedRequest.java | 275 +++++++++++++ .../implementation/models/EmbedRequest1.java | 280 +++++++++++++ .../ChatCompletionsFunctionToolCall.java | 12 +- ...ChatCompletionsFunctionToolDefinition.java | 4 +- ...CompletionsNamedFunctionToolSelection.java | 4 +- .../ChatCompletionsNamedToolSelection.java | 67 ++- .../models/ChatCompletionsToolCall.java | 79 ++-- .../models/ChatCompletionsToolDefinition.java | 67 ++- .../models/EmbeddingEncodingFormat.java | 82 ++++ .../ai/inference/models/EmbeddingInput.java | 121 ++++++ .../inference/models/EmbeddingInputType.java | 63 +++ .../ai/inference/models/EmbeddingItem.java | 108 +++++ .../ai/inference/models/EmbeddingsResult.java | 130 ++++++ .../ai/inference/models/EmbeddingsUsage.java | 107 +++++ .../inference/models/FunctionDefinition.java | 13 +- .../models/StreamingChatChoiceUpdate.java | 131 ++++++ .../StreamingChatCompletionsUpdate.java | 191 +++++++++ .../StreamingChatResponseMessageUpdate.java | 125 ++++++ .../StreamingChatResponseToolCallUpdate.java | 106 +++++ .../src/main/java/module-info.java | 2 +- ...azure-ai-inference_apiview_properties.json | 43 +- .../ChatCompletionsClientTestBase.java | 64 +++ sdk/ai/azure-ai-inference/tsp-location.yaml | 2 +- 35 files changed, 4446 insertions(+), 175 deletions(-) create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClientBuilder.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClient.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClientBuilder.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/EmbeddingsClientImpl.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ImageEmbeddingsClientImpl.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/EmbedRequest.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/EmbedRequest1.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingEncodingFormat.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingInput.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingInputType.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingItem.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingsResult.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingsUsage.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/StreamingChatChoiceUpdate.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/StreamingChatCompletionsUpdate.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/StreamingChatResponseMessageUpdate.java create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/StreamingChatResponseToolCallUpdate.java diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java index 092bcebc58e0..d5ce3e289cca 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java @@ -40,7 +40,7 @@ public final class ChatCompletionsAsyncClient { /** * Initializes an instance of ChatCompletionsAsyncClient class. - * + * * @param serviceClient the service client implementation. */ @Generated @@ -64,7 +64,7 @@ public final class ChatCompletionsAsyncClient { * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

- * + * *
{@code
      * {
      *     messages (Required): [
@@ -87,16 +87,26 @@ public final class ChatCompletionsAsyncClient {
      *     tools (Optional): [
      *          (Optional){
      *             type: String (Required)
+     *             function (Required): {
+     *                 name: String (Required)
+     *                 description: String (Optional)
+     *                 parameters (Optional): {
+     *                     String: Object (Required)
+     *                 }
+     *             }
      *         }
      *     ]
      *     tool_choice: BinaryData (Optional)
      *     seed: Long (Optional)
      *     model: String (Optional)
+     *      (Optional): {
+     *         String: Object (Required)
+     *     }
      * }
      * }
- * + * *

Response Body Schema

- * + * *
{@code
      * {
      *     id: String (Required)
@@ -116,8 +126,12 @@ public final class ChatCompletionsAsyncClient {
      *                 content: String (Required)
      *                 tool_calls (Optional): [
      *                      (Optional){
-     *                         type: String (Required)
      *                         id: String (Required)
+     *                         type: String (Required)
+     *                         function (Required): {
+     *                             name: String (Required)
+     *                             arguments: String (Required)
+     *                         }
      *                     }
      *                 ]
      *             }
@@ -125,7 +139,7 @@ public final class ChatCompletionsAsyncClient {
      *     ]
      * }
      * }
- * + * * @param completeRequest The completeRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -146,7 +160,7 @@ Mono> completeWithResponse(BinaryData completeRequest, Requ * Returns information about the AI model. * The method makes a REST API call to the `/info` route on the given endpoint. *

Response Body Schema

- * + * *
{@code
      * {
      *     model_name: String (Required)
@@ -154,7 +168,7 @@ Mono> completeWithResponse(BinaryData completeRequest, Requ
      *     model_provider_name: String (Required)
      * }
      * }
- * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -220,7 +234,7 @@ public Mono complete(String prompt) { * Completions support a wide variety of tasks and generate text that continues from or "completes" * provided prompt data. The method makes a REST API call to the `/chat/completions` route * on the given endpoint. - * + * * @param options Options for complete API. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -262,7 +276,7 @@ public Mono complete(ChatCompletionsOptions options) { /** * Returns information about the AI model. * The method makes a REST API call to the `/info` route on the given endpoint. - * + * * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java index 905138d58706..b9b5df151f54 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java @@ -39,7 +39,7 @@ public final class ChatCompletionsClient { /** * Initializes an instance of ChatCompletionsClient class. - * + * * @param serviceClient the service client implementation. */ @Generated @@ -63,7 +63,7 @@ public final class ChatCompletionsClient { * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

- * + * *
{@code
      * {
      *     messages (Required): [
@@ -86,16 +86,26 @@ public final class ChatCompletionsClient {
      *     tools (Optional): [
      *          (Optional){
      *             type: String (Required)
+     *             function (Required): {
+     *                 name: String (Required)
+     *                 description: String (Optional)
+     *                 parameters (Optional): {
+     *                     String: Object (Required)
+     *                 }
+     *             }
      *         }
      *     ]
      *     tool_choice: BinaryData (Optional)
      *     seed: Long (Optional)
      *     model: String (Optional)
+     *      (Optional): {
+     *         String: Object (Required)
+     *     }
      * }
      * }
- * + * *

Response Body Schema

- * + * *
{@code
      * {
      *     id: String (Required)
@@ -115,8 +125,12 @@ public final class ChatCompletionsClient {
      *                 content: String (Required)
      *                 tool_calls (Optional): [
      *                      (Optional){
-     *                         type: String (Required)
      *                         id: String (Required)
+     *                         type: String (Required)
+     *                         function (Required): {
+     *                             name: String (Required)
+     *                             arguments: String (Required)
+     *                         }
      *                     }
      *                 ]
      *             }
@@ -124,7 +138,7 @@ public final class ChatCompletionsClient {
      *     ]
      * }
      * }
- * + * * @param completeRequest The completeRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -145,7 +159,7 @@ Response completeWithResponse(BinaryData completeRequest, RequestOpt * Returns information about the AI model. * The method makes a REST API call to the `/info` route on the given endpoint. *

Response Body Schema

- * + * *
{@code
      * {
      *     model_name: String (Required)
@@ -153,7 +167,7 @@ Response completeWithResponse(BinaryData completeRequest, RequestOpt
      *     model_provider_name: String (Required)
      * }
      * }
- * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -172,7 +186,7 @@ public Response getModelInfoWithResponse(RequestOptions requestOptio * Completions support a wide variety of tasks and generate text that continues from or "completes" * provided prompt data. The method makes a REST API call to the `/chat/completions` route * on the given endpoint. - * + * * @param options Options for complete API. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -354,7 +368,7 @@ public Response completeStreamingWithResponse(BinaryData chatComplet /** * Returns information about the AI model. * The method makes a REST API call to the `/info` route on the given endpoint. - * + * * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java new file mode 100644 index 000000000000..9b0ba5b4fbd6 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference; + +import com.azure.ai.inference.implementation.EmbeddingsClientImpl; +import com.azure.ai.inference.implementation.models.EmbedRequest; +import com.azure.ai.inference.implementation.models.ExtraParameters; +import com.azure.ai.inference.models.EmbeddingEncodingFormat; +import com.azure.ai.inference.models.EmbeddingInputType; +import com.azure.ai.inference.models.EmbeddingsResult; +import com.azure.ai.inference.models.ModelInfo; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import java.util.List; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous EmbeddingsClient type. + */ +@ServiceClient(builder = EmbeddingsClientBuilder.class, isAsync = true) +public final class EmbeddingsAsyncClient { + @Generated + private final EmbeddingsClientImpl serviceClient; + + /** + * Initializes an instance of EmbeddingsAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + EmbeddingsAsyncClient(EmbeddingsClientImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Return the embedding vectors for given text prompts. + * The method makes a REST API call to the `/embeddings` route on the given endpoint. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
extra-parametersStringNoControls what happens if extra parameters, undefined + * by the REST API, + * are passed in the JSON request payload. + * This sets the HTTP request header `extra-parameters`. Allowed values: "error", "drop", "pass-through".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     input (Required): [
+     *         String (Required)
+     *     ]
+     *     dimensions: Integer (Optional)
+     *     encoding_format: String(base64/binary/float/int8/ubinary/uint8) (Optional)
+     *     input_type: String(text/query/document) (Optional)
+     *     model: String (Optional)
+     *      (Optional): {
+     *         String: Object (Required)
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     data (Required): [
+     *          (Required){
+     *             embedding: BinaryData (Required)
+     *             index: int (Required)
+     *         }
+     *     ]
+     *     usage (Required): {
+     *         prompt_tokens: int (Required)
+     *         total_tokens: int (Required)
+     *     }
+     *     model: String (Required)
+     * }
+     * }
+ * + * @param embedRequest The embedRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return representation of the response data from an embeddings request. + * Embeddings measure the relatedness of text strings and are commonly used for search, clustering, + * recommendations, and other similar scenarios along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> embedWithResponse(BinaryData embedRequest, RequestOptions requestOptions) { + return this.serviceClient.embedWithResponseAsync(embedRequest, requestOptions); + } + + /** + * Returns information about the AI model. + * The method makes a REST API call to the `/info` route on the given endpoint. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     model_name: String (Required)
+     *     model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat) (Required)
+     *     model_provider_name: String (Required)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents some basic information about the AI model along with {@link Response} on successful completion + * of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getModelInfoWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getModelInfoWithResponseAsync(requestOptions); + } + + /** + * Return the embedding vectors for given text prompts. + * The method makes a REST API call to the `/embeddings` route on the given endpoint. + * + * @param input Input text to embed, encoded as a string or array of tokens. + * To embed multiple inputs in a single request, pass an array + * of strings or array of token arrays. + * @param dimensions Optional. The number of dimensions the resulting output embeddings should have. + * Passing null causes the model to use its default value. + * Returns a 422 error if the model doesn't support the value or parameter. + * @param encodingFormat Optional. The desired format for the returned embeddings. + * @param inputType Optional. The type of the input. + * Returns a 422 error if the model doesn't support the value or parameter. + * @param model ID of the specific AI model to use, if more than one model is available on the endpoint. + * @param extraParams Controls what happens if extra parameters, undefined by the REST API, + * are passed in the JSON request payload. + * This sets the HTTP request header `extra-parameters`. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return representation of the response data from an embeddings request. + * Embeddings measure the relatedness of text strings and are commonly used for search, clustering, + * recommendations, and other similar scenarios on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono embed(List input, Integer dimensions, EmbeddingEncodingFormat encodingFormat, + EmbeddingInputType inputType, String model, ExtraParameters extraParams) { + // Generated convenience method for embedWithResponse + RequestOptions requestOptions = new RequestOptions(); + EmbedRequest embedRequestObj = new EmbedRequest(input).setDimensions(dimensions) + .setEncodingFormat(encodingFormat) + .setInputType(inputType) + .setModel(model); + BinaryData embedRequest = BinaryData.fromObject(embedRequestObj); + if (extraParams != null) { + requestOptions.setHeader(HttpHeaderName.fromString("extra-parameters"), extraParams.toString()); + } + return embedWithResponse(embedRequest, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(EmbeddingsResult.class)); + } + + /** + * Return the embedding vectors for given text prompts. + * The method makes a REST API call to the `/embeddings` route on the given endpoint. + * + * @param input Input text to embed, encoded as a string or array of tokens. + * To embed multiple inputs in a single request, pass an array + * of strings or array of token arrays. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return representation of the response data from an embeddings request. + * Embeddings measure the relatedness of text strings and are commonly used for search, clustering, + * recommendations, and other similar scenarios on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono embed(List input) { + // Generated convenience method for embedWithResponse + RequestOptions requestOptions = new RequestOptions(); + EmbedRequest embedRequestObj = new EmbedRequest(input); + BinaryData embedRequest = BinaryData.fromObject(embedRequestObj); + return embedWithResponse(embedRequest, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(EmbeddingsResult.class)); + } + + /** + * Returns information about the AI model. + * The method makes a REST API call to the `/info` route on the given endpoint. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents some basic information about the AI model on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getModelInfo() { + // Generated convenience method for getModelInfoWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getModelInfoWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelInfo.class)); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java new file mode 100644 index 000000000000..cea9d176cfc8 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference; + +import com.azure.ai.inference.implementation.EmbeddingsClientImpl; +import com.azure.ai.inference.implementation.models.EmbedRequest; +import com.azure.ai.inference.implementation.models.ExtraParameters; +import com.azure.ai.inference.models.EmbeddingEncodingFormat; +import com.azure.ai.inference.models.EmbeddingInputType; +import com.azure.ai.inference.models.EmbeddingsResult; +import com.azure.ai.inference.models.ModelInfo; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import java.util.List; + +/** + * Initializes a new instance of the synchronous EmbeddingsClient type. + */ +@ServiceClient(builder = EmbeddingsClientBuilder.class) +public final class EmbeddingsClient { + @Generated + private final EmbeddingsClientImpl serviceClient; + + /** + * Initializes an instance of EmbeddingsClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + EmbeddingsClient(EmbeddingsClientImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Return the embedding vectors for given text prompts. + * The method makes a REST API call to the `/embeddings` route on the given endpoint. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
extra-parametersStringNoControls what happens if extra parameters, undefined + * by the REST API, + * are passed in the JSON request payload. + * This sets the HTTP request header `extra-parameters`. Allowed values: "error", "drop", "pass-through".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     input (Required): [
+     *         String (Required)
+     *     ]
+     *     dimensions: Integer (Optional)
+     *     encoding_format: String(base64/binary/float/int8/ubinary/uint8) (Optional)
+     *     input_type: String(text/query/document) (Optional)
+     *     model: String (Optional)
+     *      (Optional): {
+     *         String: Object (Required)
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     data (Required): [
+     *          (Required){
+     *             embedding: BinaryData (Required)
+     *             index: int (Required)
+     *         }
+     *     ]
+     *     usage (Required): {
+     *         prompt_tokens: int (Required)
+     *         total_tokens: int (Required)
+     *     }
+     *     model: String (Required)
+     * }
+     * }
+ * + * @param embedRequest The embedRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return representation of the response data from an embeddings request. + * Embeddings measure the relatedness of text strings and are commonly used for search, clustering, + * recommendations, and other similar scenarios along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Response embedWithResponse(BinaryData embedRequest, RequestOptions requestOptions) { + return this.serviceClient.embedWithResponse(embedRequest, requestOptions); + } + + /** + * Returns information about the AI model. + * The method makes a REST API call to the `/info` route on the given endpoint. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     model_name: String (Required)
+     *     model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat) (Required)
+     *     model_provider_name: String (Required)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents some basic information about the AI model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Response getModelInfoWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getModelInfoWithResponse(requestOptions); + } + + /** + * Return the embedding vectors for given text prompts. + * The method makes a REST API call to the `/embeddings` route on the given endpoint. + * + * @param input Input text to embed, encoded as a string or array of tokens. + * To embed multiple inputs in a single request, pass an array + * of strings or array of token arrays. + * @param dimensions Optional. The number of dimensions the resulting output embeddings should have. + * Passing null causes the model to use its default value. + * Returns a 422 error if the model doesn't support the value or parameter. + * @param encodingFormat Optional. The desired format for the returned embeddings. + * @param inputType Optional. The type of the input. + * Returns a 422 error if the model doesn't support the value or parameter. + * @param model ID of the specific AI model to use, if more than one model is available on the endpoint. + * @param extraParams Controls what happens if extra parameters, undefined by the REST API, + * are passed in the JSON request payload. + * This sets the HTTP request header `extra-parameters`. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return representation of the response data from an embeddings request. + * Embeddings measure the relatedness of text strings and are commonly used for search, clustering, + * recommendations, and other similar scenarios. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + EmbeddingsResult embed(List input, Integer dimensions, EmbeddingEncodingFormat encodingFormat, + EmbeddingInputType inputType, String model, ExtraParameters extraParams) { + // Generated convenience method for embedWithResponse + RequestOptions requestOptions = new RequestOptions(); + EmbedRequest embedRequestObj = new EmbedRequest(input).setDimensions(dimensions) + .setEncodingFormat(encodingFormat) + .setInputType(inputType) + .setModel(model); + BinaryData embedRequest = BinaryData.fromObject(embedRequestObj); + if (extraParams != null) { + requestOptions.setHeader(HttpHeaderName.fromString("extra-parameters"), extraParams.toString()); + } + return embedWithResponse(embedRequest, requestOptions).getValue().toObject(EmbeddingsResult.class); + } + + /** + * Return the embedding vectors for given text prompts. + * The method makes a REST API call to the `/embeddings` route on the given endpoint. + * + * @param input Input text to embed, encoded as a string or array of tokens. + * To embed multiple inputs in a single request, pass an array + * of strings or array of token arrays. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return representation of the response data from an embeddings request. + * Embeddings measure the relatedness of text strings and are commonly used for search, clustering, + * recommendations, and other similar scenarios. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + EmbeddingsResult embed(List input) { + // Generated convenience method for embedWithResponse + RequestOptions requestOptions = new RequestOptions(); + EmbedRequest embedRequestObj = new EmbedRequest(input); + BinaryData embedRequest = BinaryData.fromObject(embedRequestObj); + return embedWithResponse(embedRequest, requestOptions).getValue().toObject(EmbeddingsResult.class); + } + + /** + * Returns information about the AI model. + * The method makes a REST API call to the `/info` route on the given endpoint. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents some basic information about the AI model. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + ModelInfo getModelInfo() { + // Generated convenience method for getModelInfoWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getModelInfoWithResponse(requestOptions).getValue().toObject(ModelInfo.class); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClientBuilder.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClientBuilder.java new file mode 100644 index 000000000000..4afc1480d68f --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClientBuilder.java @@ -0,0 +1,355 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference; + +import com.azure.ai.inference.implementation.EmbeddingsClientImpl; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; +import com.azure.core.client.traits.HttpTrait; +import com.azure.core.client.traits.KeyCredentialTrait; +import com.azure.core.client.traits.TokenCredentialTrait; +import com.azure.core.credential.KeyCredential; +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.KeyCredentialPolicy; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.ClientOptions; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.builder.ClientBuilderUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.serializer.JacksonAdapter; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * A builder for creating a new instance of the EmbeddingsClient type. + */ +@ServiceClientBuilder(serviceClients = { EmbeddingsClient.class, EmbeddingsAsyncClient.class }) +public final class EmbeddingsClientBuilder implements HttpTrait, + ConfigurationTrait, TokenCredentialTrait, + KeyCredentialTrait, EndpointTrait { + @Generated + private static final String SDK_NAME = "name"; + + @Generated + private static final String SDK_VERSION = "version"; + + @Generated + private static final String[] DEFAULT_SCOPES = new String[] { "https://ml.azure.com/.default" }; + + @Generated + private static final Map PROPERTIES = CoreUtils.getProperties("azure-ai-inference.properties"); + + @Generated + private final List pipelinePolicies; + + /** + * Create an instance of the EmbeddingsClientBuilder. + */ + @Generated + public EmbeddingsClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * The HTTP pipeline to send requests through. + */ + @Generated + private HttpPipeline pipeline; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public EmbeddingsClientBuilder pipeline(HttpPipeline pipeline) { + if (this.pipeline != null && pipeline == null) { + LOGGER.atInfo().log("HttpPipeline is being set to 'null' when it was previously configured."); + } + this.pipeline = pipeline; + return this; + } + + /* + * The HTTP client used to send the request. + */ + @Generated + private HttpClient httpClient; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public EmbeddingsClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The logging configuration for HTTP requests and responses. + */ + @Generated + private HttpLogOptions httpLogOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public EmbeddingsClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = httpLogOptions; + return this; + } + + /* + * The client options such as application ID and custom headers to set on a request. + */ + @Generated + private ClientOptions clientOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public EmbeddingsClientBuilder clientOptions(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + return this; + } + + /* + * The retry options to configure retry policy for failed requests. + */ + @Generated + private RetryOptions retryOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public EmbeddingsClientBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public EmbeddingsClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); + pipelinePolicies.add(customPolicy); + return this; + } + + /* + * The configuration store that is used during construction of the service client. + */ + @Generated + private Configuration configuration; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public EmbeddingsClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The TokenCredential used for authentication. + */ + @Generated + private TokenCredential tokenCredential; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public EmbeddingsClientBuilder credential(TokenCredential tokenCredential) { + this.tokenCredential = tokenCredential; + return this; + } + + /* + * The KeyCredential used for authentication. + */ + @Generated + private KeyCredential keyCredential; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public EmbeddingsClientBuilder credential(KeyCredential keyCredential) { + this.keyCredential = keyCredential; + return this; + } + + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public EmbeddingsClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * Service version + */ + @Generated + private ModelServiceVersion serviceVersion; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the EmbeddingsClientBuilder. + */ + @Generated + public EmbeddingsClientBuilder serviceVersion(ModelServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } + + /* + * The retry policy that will attempt to retry failed requests, if applicable. + */ + @Generated + private RetryPolicy retryPolicy; + + /** + * Sets The retry policy that will attempt to retry failed requests, if applicable. + * + * @param retryPolicy the retryPolicy value. + * @return the EmbeddingsClientBuilder. + */ + @Generated + public EmbeddingsClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Builds an instance of EmbeddingsClientImpl with the provided parameters. + * + * @return an instance of EmbeddingsClientImpl. + */ + @Generated + private EmbeddingsClientImpl buildInnerClient() { + this.validateClient(); + HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + ModelServiceVersion localServiceVersion + = (serviceVersion != null) ? serviceVersion : ModelServiceVersion.getLatest(); + EmbeddingsClientImpl client = new EmbeddingsClientImpl(localPipeline, + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); + return client; + } + + @Generated + private void validateClient() { + // This method is invoked from 'buildInnerClient'/'buildClient' method. + // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + } + + @Generated + private HttpPipeline createHttpPipeline() { + Configuration buildConfiguration + = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; + ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; + List policies = new ArrayList<>(); + String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); + policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); + policies.add(new RequestIdPolicy()); + policies.add(new AddHeadersFromContextPolicy()); + HttpHeaders headers = CoreUtils.createHttpHeadersFromClientOptions(localClientOptions); + if (headers != null) { + policies.add(new AddHeadersPolicy(headers)); + } + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .forEach(p -> policies.add(p)); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); + policies.add(new AddDatePolicy()); + if (keyCredential != null) { + policies.add(new KeyCredentialPolicy("api-key", keyCredential)); + } + if (tokenCredential != null) { + policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); + } + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .forEach(p -> policies.add(p)); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(localHttpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(localClientOptions) + .build(); + return httpPipeline; + } + + /** + * Builds an instance of EmbeddingsAsyncClient class. + * + * @return an instance of EmbeddingsAsyncClient. + */ + @Generated + public EmbeddingsAsyncClient buildAsyncClient() { + return new EmbeddingsAsyncClient(buildInnerClient()); + } + + /** + * Builds an instance of EmbeddingsClient class. + * + * @return an instance of EmbeddingsClient. + */ + @Generated + public EmbeddingsClient buildClient() { + return new EmbeddingsClient(buildInnerClient()); + } + + private static final ClientLogger LOGGER = new ClientLogger(EmbeddingsClientBuilder.class); +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java new file mode 100644 index 000000000000..9b90ef7ac8c6 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference; + +import com.azure.ai.inference.implementation.ImageEmbeddingsClientImpl; +import com.azure.ai.inference.implementation.models.EmbedRequest1; +import com.azure.ai.inference.implementation.models.ExtraParameters; +import com.azure.ai.inference.models.EmbeddingEncodingFormat; +import com.azure.ai.inference.models.EmbeddingInput; +import com.azure.ai.inference.models.EmbeddingInputType; +import com.azure.ai.inference.models.EmbeddingsResult; +import com.azure.ai.inference.models.ModelInfo; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import java.util.List; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous ImageEmbeddingsClient type. + */ +@ServiceClient(builder = ImageEmbeddingsClientBuilder.class, isAsync = true) +public final class ImageEmbeddingsAsyncClient { + @Generated + private final ImageEmbeddingsClientImpl serviceClient; + + /** + * Initializes an instance of ImageEmbeddingsAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ImageEmbeddingsAsyncClient(ImageEmbeddingsClientImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Return the embedding vectors for given images. + * The method makes a REST API call to the `/images/embeddings` route on the given endpoint. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
extra-parametersStringNoControls what happens if extra parameters, undefined + * by the REST API, + * are passed in the JSON request payload. + * This sets the HTTP request header `extra-parameters`. Allowed values: "error", "drop", "pass-through".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     input (Required): [
+     *          (Required){
+     *             image: String (Required)
+     *             text: String (Optional)
+     *         }
+     *     ]
+     *     dimensions: Integer (Optional)
+     *     encoding_format: String(base64/binary/float/int8/ubinary/uint8) (Optional)
+     *     input_type: String(text/query/document) (Optional)
+     *     model: String (Optional)
+     *      (Optional): {
+     *         String: Object (Required)
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     data (Required): [
+     *          (Required){
+     *             embedding: BinaryData (Required)
+     *             index: int (Required)
+     *         }
+     *     ]
+     *     usage (Required): {
+     *         prompt_tokens: int (Required)
+     *         total_tokens: int (Required)
+     *     }
+     *     model: String (Required)
+     * }
+     * }
+ * + * @param embedRequest1 The embedRequest1 parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return representation of the response data from an embeddings request. + * Embeddings measure the relatedness of text strings and are commonly used for search, clustering, + * recommendations, and other similar scenarios along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> embedWithResponse(BinaryData embedRequest1, RequestOptions requestOptions) { + return this.serviceClient.embedWithResponseAsync(embedRequest1, requestOptions); + } + + /** + * Returns information about the AI model. + * The method makes a REST API call to the `/info` route on the given endpoint. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     model_name: String (Required)
+     *     model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat) (Required)
+     *     model_provider_name: String (Required)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents some basic information about the AI model along with {@link Response} on successful completion + * of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getModelInfoWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getModelInfoWithResponseAsync(requestOptions); + } + + /** + * Return the embedding vectors for given images. + * The method makes a REST API call to the `/images/embeddings` route on the given endpoint. + * + * @param input Input image to embed. To embed multiple inputs in a single request, pass an array. + * The input must not exceed the max input tokens for the model. + * @param dimensions Optional. The number of dimensions the resulting output embeddings should have. + * Passing null causes the model to use its default value. + * Returns a 422 error if the model doesn't support the value or parameter. + * @param encodingFormat Optional. The number of dimensions the resulting output embeddings should have. + * Passing null causes the model to use its default value. + * Returns a 422 error if the model doesn't support the value or parameter. + * @param inputType Optional. The type of the input. + * Returns a 422 error if the model doesn't support the value or parameter. + * @param model ID of the specific AI model to use, if more than one model is available on the endpoint. + * @param extraParams Controls what happens if extra parameters, undefined by the REST API, + * are passed in the JSON request payload. + * This sets the HTTP request header `extra-parameters`. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return representation of the response data from an embeddings request. + * Embeddings measure the relatedness of text strings and are commonly used for search, clustering, + * recommendations, and other similar scenarios on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono embed(List input, Integer dimensions, EmbeddingEncodingFormat encodingFormat, + EmbeddingInputType inputType, String model, ExtraParameters extraParams) { + // Generated convenience method for embedWithResponse + RequestOptions requestOptions = new RequestOptions(); + EmbedRequest1 embedRequest1Obj = new EmbedRequest1(input).setDimensions(dimensions) + .setEncodingFormat(encodingFormat) + .setInputType(inputType) + .setModel(model); + BinaryData embedRequest1 = BinaryData.fromObject(embedRequest1Obj); + if (extraParams != null) { + requestOptions.setHeader(HttpHeaderName.fromString("extra-parameters"), extraParams.toString()); + } + return embedWithResponse(embedRequest1, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(EmbeddingsResult.class)); + } + + /** + * Return the embedding vectors for given images. + * The method makes a REST API call to the `/images/embeddings` route on the given endpoint. + * + * @param input Input image to embed. To embed multiple inputs in a single request, pass an array. + * The input must not exceed the max input tokens for the model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return representation of the response data from an embeddings request. + * Embeddings measure the relatedness of text strings and are commonly used for search, clustering, + * recommendations, and other similar scenarios on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono embed(List input) { + // Generated convenience method for embedWithResponse + RequestOptions requestOptions = new RequestOptions(); + EmbedRequest1 embedRequest1Obj = new EmbedRequest1(input); + BinaryData embedRequest1 = BinaryData.fromObject(embedRequest1Obj); + return embedWithResponse(embedRequest1, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(EmbeddingsResult.class)); + } + + /** + * Returns information about the AI model. + * The method makes a REST API call to the `/info` route on the given endpoint. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents some basic information about the AI model on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getModelInfo() { + // Generated convenience method for getModelInfoWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getModelInfoWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelInfo.class)); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClient.java new file mode 100644 index 000000000000..e90344df9bab --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClient.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference; + +import com.azure.ai.inference.implementation.ImageEmbeddingsClientImpl; +import com.azure.ai.inference.implementation.models.EmbedRequest1; +import com.azure.ai.inference.implementation.models.ExtraParameters; +import com.azure.ai.inference.models.EmbeddingEncodingFormat; +import com.azure.ai.inference.models.EmbeddingInput; +import com.azure.ai.inference.models.EmbeddingInputType; +import com.azure.ai.inference.models.EmbeddingsResult; +import com.azure.ai.inference.models.ModelInfo; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import java.util.List; + +/** + * Initializes a new instance of the synchronous ImageEmbeddingsClient type. + */ +@ServiceClient(builder = ImageEmbeddingsClientBuilder.class) +public final class ImageEmbeddingsClient { + @Generated + private final ImageEmbeddingsClientImpl serviceClient; + + /** + * Initializes an instance of ImageEmbeddingsClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ImageEmbeddingsClient(ImageEmbeddingsClientImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Return the embedding vectors for given images. + * The method makes a REST API call to the `/images/embeddings` route on the given endpoint. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
extra-parametersStringNoControls what happens if extra parameters, undefined + * by the REST API, + * are passed in the JSON request payload. + * This sets the HTTP request header `extra-parameters`. Allowed values: "error", "drop", "pass-through".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     input (Required): [
+     *          (Required){
+     *             image: String (Required)
+     *             text: String (Optional)
+     *         }
+     *     ]
+     *     dimensions: Integer (Optional)
+     *     encoding_format: String(base64/binary/float/int8/ubinary/uint8) (Optional)
+     *     input_type: String(text/query/document) (Optional)
+     *     model: String (Optional)
+     *      (Optional): {
+     *         String: Object (Required)
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     data (Required): [
+     *          (Required){
+     *             embedding: BinaryData (Required)
+     *             index: int (Required)
+     *         }
+     *     ]
+     *     usage (Required): {
+     *         prompt_tokens: int (Required)
+     *         total_tokens: int (Required)
+     *     }
+     *     model: String (Required)
+     * }
+     * }
+ * + * @param embedRequest1 The embedRequest1 parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return representation of the response data from an embeddings request. + * Embeddings measure the relatedness of text strings and are commonly used for search, clustering, + * recommendations, and other similar scenarios along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Response embedWithResponse(BinaryData embedRequest1, RequestOptions requestOptions) { + return this.serviceClient.embedWithResponse(embedRequest1, requestOptions); + } + + /** + * Returns information about the AI model. + * The method makes a REST API call to the `/info` route on the given endpoint. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     model_name: String (Required)
+     *     model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat) (Required)
+     *     model_provider_name: String (Required)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents some basic information about the AI model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Response getModelInfoWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getModelInfoWithResponse(requestOptions); + } + + /** + * Return the embedding vectors for given images. + * The method makes a REST API call to the `/images/embeddings` route on the given endpoint. + * + * @param input Input image to embed. To embed multiple inputs in a single request, pass an array. + * The input must not exceed the max input tokens for the model. + * @param dimensions Optional. The number of dimensions the resulting output embeddings should have. + * Passing null causes the model to use its default value. + * Returns a 422 error if the model doesn't support the value or parameter. + * @param encodingFormat Optional. The number of dimensions the resulting output embeddings should have. + * Passing null causes the model to use its default value. + * Returns a 422 error if the model doesn't support the value or parameter. + * @param inputType Optional. The type of the input. + * Returns a 422 error if the model doesn't support the value or parameter. + * @param model ID of the specific AI model to use, if more than one model is available on the endpoint. + * @param extraParams Controls what happens if extra parameters, undefined by the REST API, + * are passed in the JSON request payload. + * This sets the HTTP request header `extra-parameters`. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return representation of the response data from an embeddings request. + * Embeddings measure the relatedness of text strings and are commonly used for search, clustering, + * recommendations, and other similar scenarios. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + EmbeddingsResult embed(List input, Integer dimensions, EmbeddingEncodingFormat encodingFormat, + EmbeddingInputType inputType, String model, ExtraParameters extraParams) { + // Generated convenience method for embedWithResponse + RequestOptions requestOptions = new RequestOptions(); + EmbedRequest1 embedRequest1Obj = new EmbedRequest1(input).setDimensions(dimensions) + .setEncodingFormat(encodingFormat) + .setInputType(inputType) + .setModel(model); + BinaryData embedRequest1 = BinaryData.fromObject(embedRequest1Obj); + if (extraParams != null) { + requestOptions.setHeader(HttpHeaderName.fromString("extra-parameters"), extraParams.toString()); + } + return embedWithResponse(embedRequest1, requestOptions).getValue().toObject(EmbeddingsResult.class); + } + + /** + * Return the embedding vectors for given images. + * The method makes a REST API call to the `/images/embeddings` route on the given endpoint. + * + * @param input Input image to embed. To embed multiple inputs in a single request, pass an array. + * The input must not exceed the max input tokens for the model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return representation of the response data from an embeddings request. + * Embeddings measure the relatedness of text strings and are commonly used for search, clustering, + * recommendations, and other similar scenarios. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + EmbeddingsResult embed(List input) { + // Generated convenience method for embedWithResponse + RequestOptions requestOptions = new RequestOptions(); + EmbedRequest1 embedRequest1Obj = new EmbedRequest1(input); + BinaryData embedRequest1 = BinaryData.fromObject(embedRequest1Obj); + return embedWithResponse(embedRequest1, requestOptions).getValue().toObject(EmbeddingsResult.class); + } + + /** + * Returns information about the AI model. + * The method makes a REST API call to the `/info` route on the given endpoint. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents some basic information about the AI model. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + ModelInfo getModelInfo() { + // Generated convenience method for getModelInfoWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getModelInfoWithResponse(requestOptions).getValue().toObject(ModelInfo.class); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClientBuilder.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClientBuilder.java new file mode 100644 index 000000000000..231d2c1b0acc --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClientBuilder.java @@ -0,0 +1,355 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference; + +import com.azure.ai.inference.implementation.ImageEmbeddingsClientImpl; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; +import com.azure.core.client.traits.HttpTrait; +import com.azure.core.client.traits.KeyCredentialTrait; +import com.azure.core.client.traits.TokenCredentialTrait; +import com.azure.core.credential.KeyCredential; +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.KeyCredentialPolicy; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.ClientOptions; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.builder.ClientBuilderUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.serializer.JacksonAdapter; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * A builder for creating a new instance of the ImageEmbeddingsClient type. + */ +@ServiceClientBuilder(serviceClients = { ImageEmbeddingsClient.class, ImageEmbeddingsAsyncClient.class }) +public final class ImageEmbeddingsClientBuilder implements HttpTrait, + ConfigurationTrait, TokenCredentialTrait, + KeyCredentialTrait, EndpointTrait { + @Generated + private static final String SDK_NAME = "name"; + + @Generated + private static final String SDK_VERSION = "version"; + + @Generated + private static final String[] DEFAULT_SCOPES = new String[] { "https://ml.azure.com/.default" }; + + @Generated + private static final Map PROPERTIES = CoreUtils.getProperties("azure-ai-inference.properties"); + + @Generated + private final List pipelinePolicies; + + /** + * Create an instance of the ImageEmbeddingsClientBuilder. + */ + @Generated + public ImageEmbeddingsClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * The HTTP pipeline to send requests through. + */ + @Generated + private HttpPipeline pipeline; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public ImageEmbeddingsClientBuilder pipeline(HttpPipeline pipeline) { + if (this.pipeline != null && pipeline == null) { + LOGGER.atInfo().log("HttpPipeline is being set to 'null' when it was previously configured."); + } + this.pipeline = pipeline; + return this; + } + + /* + * The HTTP client used to send the request. + */ + @Generated + private HttpClient httpClient; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public ImageEmbeddingsClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The logging configuration for HTTP requests and responses. + */ + @Generated + private HttpLogOptions httpLogOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public ImageEmbeddingsClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = httpLogOptions; + return this; + } + + /* + * The client options such as application ID and custom headers to set on a request. + */ + @Generated + private ClientOptions clientOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public ImageEmbeddingsClientBuilder clientOptions(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + return this; + } + + /* + * The retry options to configure retry policy for failed requests. + */ + @Generated + private RetryOptions retryOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public ImageEmbeddingsClientBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public ImageEmbeddingsClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); + pipelinePolicies.add(customPolicy); + return this; + } + + /* + * The configuration store that is used during construction of the service client. + */ + @Generated + private Configuration configuration; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public ImageEmbeddingsClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The TokenCredential used for authentication. + */ + @Generated + private TokenCredential tokenCredential; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public ImageEmbeddingsClientBuilder credential(TokenCredential tokenCredential) { + this.tokenCredential = tokenCredential; + return this; + } + + /* + * The KeyCredential used for authentication. + */ + @Generated + private KeyCredential keyCredential; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public ImageEmbeddingsClientBuilder credential(KeyCredential keyCredential) { + this.keyCredential = keyCredential; + return this; + } + + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public ImageEmbeddingsClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * Service version + */ + @Generated + private ModelServiceVersion serviceVersion; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the ImageEmbeddingsClientBuilder. + */ + @Generated + public ImageEmbeddingsClientBuilder serviceVersion(ModelServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } + + /* + * The retry policy that will attempt to retry failed requests, if applicable. + */ + @Generated + private RetryPolicy retryPolicy; + + /** + * Sets The retry policy that will attempt to retry failed requests, if applicable. + * + * @param retryPolicy the retryPolicy value. + * @return the ImageEmbeddingsClientBuilder. + */ + @Generated + public ImageEmbeddingsClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Builds an instance of ImageEmbeddingsClientImpl with the provided parameters. + * + * @return an instance of ImageEmbeddingsClientImpl. + */ + @Generated + private ImageEmbeddingsClientImpl buildInnerClient() { + this.validateClient(); + HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + ModelServiceVersion localServiceVersion + = (serviceVersion != null) ? serviceVersion : ModelServiceVersion.getLatest(); + ImageEmbeddingsClientImpl client = new ImageEmbeddingsClientImpl(localPipeline, + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); + return client; + } + + @Generated + private void validateClient() { + // This method is invoked from 'buildInnerClient'/'buildClient' method. + // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + } + + @Generated + private HttpPipeline createHttpPipeline() { + Configuration buildConfiguration + = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; + ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; + List policies = new ArrayList<>(); + String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); + policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); + policies.add(new RequestIdPolicy()); + policies.add(new AddHeadersFromContextPolicy()); + HttpHeaders headers = CoreUtils.createHttpHeadersFromClientOptions(localClientOptions); + if (headers != null) { + policies.add(new AddHeadersPolicy(headers)); + } + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .forEach(p -> policies.add(p)); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); + policies.add(new AddDatePolicy()); + if (keyCredential != null) { + policies.add(new KeyCredentialPolicy("api-key", keyCredential)); + } + if (tokenCredential != null) { + policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); + } + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .forEach(p -> policies.add(p)); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(localHttpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(localClientOptions) + .build(); + return httpPipeline; + } + + /** + * Builds an instance of ImageEmbeddingsAsyncClient class. + * + * @return an instance of ImageEmbeddingsAsyncClient. + */ + @Generated + public ImageEmbeddingsAsyncClient buildAsyncClient() { + return new ImageEmbeddingsAsyncClient(buildInnerClient()); + } + + /** + * Builds an instance of ImageEmbeddingsClient class. + * + * @return an instance of ImageEmbeddingsClient. + */ + @Generated + public ImageEmbeddingsClient buildClient() { + return new ImageEmbeddingsClient(buildInnerClient()); + } + + private static final ClientLogger LOGGER = new ClientLogger(ImageEmbeddingsClientBuilder.class); +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsClientImpl.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsClientImpl.java index f8dd0a0d45d3..6d867fce9584 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsClientImpl.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsClientImpl.java @@ -227,11 +227,21 @@ Response getModelInfoSync(@HostParam("endpoint") String endpoint, * tools (Optional): [ * (Optional){ * type: String (Required) + * function (Required): { + * name: String (Required) + * description: String (Optional) + * parameters (Optional): { + * String: Object (Required) + * } + * } * } * ] * tool_choice: BinaryData (Optional) * seed: Long (Optional) * model: String (Optional) + * (Optional): { + * String: Object (Required) + * } * } * } * @@ -256,8 +266,12 @@ Response getModelInfoSync(@HostParam("endpoint") String endpoint, * content: String (Required) * tool_calls (Optional): [ * (Optional){ - * type: String (Required) * id: String (Required) + * type: String (Required) + * function (Required): { + * name: String (Required) + * arguments: String (Required) + * } * } * ] * } @@ -323,11 +337,21 @@ public Mono> completeWithResponseAsync(BinaryData completeR * tools (Optional): [ * (Optional){ * type: String (Required) + * function (Required): { + * name: String (Required) + * description: String (Optional) + * parameters (Optional): { + * String: Object (Required) + * } + * } * } * ] * tool_choice: BinaryData (Optional) * seed: Long (Optional) * model: String (Optional) + * (Optional): { + * String: Object (Required) + * } * } * } * @@ -352,8 +376,12 @@ public Mono> completeWithResponseAsync(BinaryData completeR * content: String (Required) * tool_calls (Optional): [ * (Optional){ - * type: String (Required) * id: String (Required) + * type: String (Required) + * function (Required): { + * name: String (Required) + * arguments: String (Required) + * } * } * ] * } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/EmbeddingsClientImpl.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/EmbeddingsClientImpl.java new file mode 100644 index 000000000000..d8033974f126 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/EmbeddingsClientImpl.java @@ -0,0 +1,375 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.implementation; + +import com.azure.ai.inference.ModelServiceVersion; +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.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerAdapter; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the EmbeddingsClient type. + */ +public final class EmbeddingsClientImpl { + /** + * The proxy service used to perform REST calls. + */ + private final EmbeddingsClientService service; + + /** + * Server parameter. + */ + private final String endpoint; + + /** + * Gets Server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Service version. + */ + private final ModelServiceVersion serviceVersion; + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public ModelServiceVersion getServiceVersion() { + return this.serviceVersion; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + public SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * Initializes an instance of EmbeddingsClient client. + * + * @param endpoint Server parameter. + * @param serviceVersion Service version. + */ + public EmbeddingsClientImpl(String endpoint, ModelServiceVersion serviceVersion) { + this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + } + + /** + * Initializes an instance of EmbeddingsClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Server parameter. + * @param serviceVersion Service version. + */ + public EmbeddingsClientImpl(HttpPipeline httpPipeline, String endpoint, ModelServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + } + + /** + * Initializes an instance of EmbeddingsClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Server parameter. + * @param serviceVersion Service version. + */ + public EmbeddingsClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, + ModelServiceVersion serviceVersion) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; + this.serviceVersion = serviceVersion; + this.service = RestProxy.create(EmbeddingsClientService.class, this.httpPipeline, this.getSerializerAdapter()); + } + + /** + * The interface defining all the services for EmbeddingsClient to be used by the proxy service to perform REST + * calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "EmbeddingsClient") + public interface EmbeddingsClientService { + @Post("/embeddings") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> embed(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData embedRequest, RequestOptions requestOptions, Context context); + + @Post("/embeddings") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response embedSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData embedRequest, RequestOptions requestOptions, Context context); + + @Get("/info") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getModelInfo(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/info") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getModelInfoSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + } + + /** + * Return the embedding vectors for given text prompts. + * The method makes a REST API call to the `/embeddings` route on the given endpoint. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
extra-parametersStringNoControls what happens if extra parameters, undefined + * by the REST API, + * are passed in the JSON request payload. + * This sets the HTTP request header `extra-parameters`. Allowed values: "error", "drop", "pass-through".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     input (Required): [
+     *         String (Required)
+     *     ]
+     *     dimensions: Integer (Optional)
+     *     encoding_format: String(base64/binary/float/int8/ubinary/uint8) (Optional)
+     *     input_type: String(text/query/document) (Optional)
+     *     model: String (Optional)
+     *      (Optional): {
+     *         String: Object (Required)
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     data (Required): [
+     *          (Required){
+     *             embedding: BinaryData (Required)
+     *             index: int (Required)
+     *         }
+     *     ]
+     *     usage (Required): {
+     *         prompt_tokens: int (Required)
+     *         total_tokens: int (Required)
+     *     }
+     *     model: String (Required)
+     * }
+     * }
+ * + * @param embedRequest The embedRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return representation of the response data from an embeddings request. + * Embeddings measure the relatedness of text strings and are commonly used for search, clustering, + * recommendations, and other similar scenarios along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> embedWithResponseAsync(BinaryData embedRequest, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.embed(this.getEndpoint(), this.getServiceVersion().getVersion(), + accept, embedRequest, requestOptions, context)); + } + + /** + * Return the embedding vectors for given text prompts. + * The method makes a REST API call to the `/embeddings` route on the given endpoint. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
extra-parametersStringNoControls what happens if extra parameters, undefined + * by the REST API, + * are passed in the JSON request payload. + * This sets the HTTP request header `extra-parameters`. Allowed values: "error", "drop", "pass-through".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     input (Required): [
+     *         String (Required)
+     *     ]
+     *     dimensions: Integer (Optional)
+     *     encoding_format: String(base64/binary/float/int8/ubinary/uint8) (Optional)
+     *     input_type: String(text/query/document) (Optional)
+     *     model: String (Optional)
+     *      (Optional): {
+     *         String: Object (Required)
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     data (Required): [
+     *          (Required){
+     *             embedding: BinaryData (Required)
+     *             index: int (Required)
+     *         }
+     *     ]
+     *     usage (Required): {
+     *         prompt_tokens: int (Required)
+     *         total_tokens: int (Required)
+     *     }
+     *     model: String (Required)
+     * }
+     * }
+ * + * @param embedRequest The embedRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return representation of the response data from an embeddings request. + * Embeddings measure the relatedness of text strings and are commonly used for search, clustering, + * recommendations, and other similar scenarios along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response embedWithResponse(BinaryData embedRequest, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.embedSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, embedRequest, + requestOptions, Context.NONE); + } + + /** + * Returns information about the AI model. + * The method makes a REST API call to the `/info` route on the given endpoint. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     model_name: String (Required)
+     *     model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat) (Required)
+     *     model_provider_name: String (Required)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents some basic information about the AI model along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getModelInfoWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getModelInfo(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * Returns information about the AI model. + * The method makes a REST API call to the `/info` route on the given endpoint. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     model_name: String (Required)
+     *     model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat) (Required)
+     *     model_provider_name: String (Required)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents some basic information about the AI model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getModelInfoWithResponse(RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getModelInfoSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + requestOptions, Context.NONE); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ImageEmbeddingsClientImpl.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ImageEmbeddingsClientImpl.java new file mode 100644 index 000000000000..c003b11b5b0e --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ImageEmbeddingsClientImpl.java @@ -0,0 +1,382 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.implementation; + +import com.azure.ai.inference.ModelServiceVersion; +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.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerAdapter; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the ImageEmbeddingsClient type. + */ +public final class ImageEmbeddingsClientImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ImageEmbeddingsClientService service; + + /** + * Server parameter. + */ + private final String endpoint; + + /** + * Gets Server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Service version. + */ + private final ModelServiceVersion serviceVersion; + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public ModelServiceVersion getServiceVersion() { + return this.serviceVersion; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + public SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * Initializes an instance of ImageEmbeddingsClient client. + * + * @param endpoint Server parameter. + * @param serviceVersion Service version. + */ + public ImageEmbeddingsClientImpl(String endpoint, ModelServiceVersion serviceVersion) { + this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + } + + /** + * Initializes an instance of ImageEmbeddingsClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Server parameter. + * @param serviceVersion Service version. + */ + public ImageEmbeddingsClientImpl(HttpPipeline httpPipeline, String endpoint, ModelServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + } + + /** + * Initializes an instance of ImageEmbeddingsClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Server parameter. + * @param serviceVersion Service version. + */ + public ImageEmbeddingsClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, + ModelServiceVersion serviceVersion) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; + this.serviceVersion = serviceVersion; + this.service + = RestProxy.create(ImageEmbeddingsClientService.class, this.httpPipeline, this.getSerializerAdapter()); + } + + /** + * The interface defining all the services for ImageEmbeddingsClient to be used by the proxy service to perform REST + * calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ImageEmbeddingsClien") + public interface ImageEmbeddingsClientService { + @Post("/images/embeddings") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> embed(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData embedRequest1, RequestOptions requestOptions, Context context); + + @Post("/images/embeddings") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response embedSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData embedRequest1, RequestOptions requestOptions, Context context); + + @Get("/info") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getModelInfo(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/info") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getModelInfoSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + } + + /** + * Return the embedding vectors for given images. + * The method makes a REST API call to the `/images/embeddings` route on the given endpoint. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
extra-parametersStringNoControls what happens if extra parameters, undefined + * by the REST API, + * are passed in the JSON request payload. + * This sets the HTTP request header `extra-parameters`. Allowed values: "error", "drop", "pass-through".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     input (Required): [
+     *          (Required){
+     *             image: String (Required)
+     *             text: String (Optional)
+     *         }
+     *     ]
+     *     dimensions: Integer (Optional)
+     *     encoding_format: String(base64/binary/float/int8/ubinary/uint8) (Optional)
+     *     input_type: String(text/query/document) (Optional)
+     *     model: String (Optional)
+     *      (Optional): {
+     *         String: Object (Required)
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     data (Required): [
+     *          (Required){
+     *             embedding: BinaryData (Required)
+     *             index: int (Required)
+     *         }
+     *     ]
+     *     usage (Required): {
+     *         prompt_tokens: int (Required)
+     *         total_tokens: int (Required)
+     *     }
+     *     model: String (Required)
+     * }
+     * }
+ * + * @param embedRequest1 The embedRequest1 parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return representation of the response data from an embeddings request. + * Embeddings measure the relatedness of text strings and are commonly used for search, clustering, + * recommendations, and other similar scenarios along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> embedWithResponseAsync(BinaryData embedRequest1, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.embed(this.getEndpoint(), this.getServiceVersion().getVersion(), + accept, embedRequest1, requestOptions, context)); + } + + /** + * Return the embedding vectors for given images. + * The method makes a REST API call to the `/images/embeddings` route on the given endpoint. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
extra-parametersStringNoControls what happens if extra parameters, undefined + * by the REST API, + * are passed in the JSON request payload. + * This sets the HTTP request header `extra-parameters`. Allowed values: "error", "drop", "pass-through".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     input (Required): [
+     *          (Required){
+     *             image: String (Required)
+     *             text: String (Optional)
+     *         }
+     *     ]
+     *     dimensions: Integer (Optional)
+     *     encoding_format: String(base64/binary/float/int8/ubinary/uint8) (Optional)
+     *     input_type: String(text/query/document) (Optional)
+     *     model: String (Optional)
+     *      (Optional): {
+     *         String: Object (Required)
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     data (Required): [
+     *          (Required){
+     *             embedding: BinaryData (Required)
+     *             index: int (Required)
+     *         }
+     *     ]
+     *     usage (Required): {
+     *         prompt_tokens: int (Required)
+     *         total_tokens: int (Required)
+     *     }
+     *     model: String (Required)
+     * }
+     * }
+ * + * @param embedRequest1 The embedRequest1 parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return representation of the response data from an embeddings request. + * Embeddings measure the relatedness of text strings and are commonly used for search, clustering, + * recommendations, and other similar scenarios along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response embedWithResponse(BinaryData embedRequest1, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.embedSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, embedRequest1, + requestOptions, Context.NONE); + } + + /** + * Returns information about the AI model. + * The method makes a REST API call to the `/info` route on the given endpoint. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     model_name: String (Required)
+     *     model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat) (Required)
+     *     model_provider_name: String (Required)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents some basic information about the AI model along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getModelInfoWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getModelInfo(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * Returns information about the AI model. + * The method makes a REST API call to the `/info` route on the given endpoint. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     model_name: String (Required)
+     *     model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat) (Required)
+     *     model_provider_name: String (Required)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents some basic information about the AI model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getModelInfoWithResponse(RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getModelInfoSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + requestOptions, Context.NONE); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/CompleteRequest.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/CompleteRequest.java index d0e37318e1b4..3ff00d964d8f 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/CompleteRequest.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/CompleteRequest.java @@ -15,7 +15,9 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; +import java.util.Map; /** * The CompleteRequest model. @@ -101,7 +103,8 @@ public final class CompleteRequest implements JsonSerializable private List stop; /* - * The available tool definitions that the chat completions request can use, including caller-defined functions. + * A list of tools the model may request to call. Currently, only functions are supported as a tool. The model + * may response with a function call request and provide the input arguments in JSON format for that function. */ @Generated private List tools; @@ -125,6 +128,12 @@ public final class CompleteRequest implements JsonSerializable @Generated private String model; + /* + * Additional properties + */ + @Generated + private Map additionalProperties; + /** * Creates an instance of CompleteRequest class. * @@ -375,8 +384,9 @@ public CompleteRequest setStop(List stop) { } /** - * Get the tools property: The available tool definitions that the chat completions request can use, including - * caller-defined functions. + * Get the tools property: A list of tools the model may request to call. Currently, only functions are supported as + * a tool. The model + * may response with a function call request and provide the input arguments in JSON format for that function. * * @return the tools value. */ @@ -386,8 +396,9 @@ public List getTools() { } /** - * Set the tools property: The available tool definitions that the chat completions request can use, including - * caller-defined functions. + * Set the tools property: A list of tools the model may request to call. Currently, only functions are supported as + * a tool. The model + * may response with a function call request and provide the input arguments in JSON format for that function. * * @param tools the tools value to set. * @return the CompleteRequest object itself. @@ -470,6 +481,28 @@ public CompleteRequest setModel(String model) { return this; } + /** + * Get the additionalProperties property: Additional properties. + * + * @return the additionalProperties value. + */ + @Generated + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Additional properties. + * + * @param additionalProperties the additionalProperties value to set. + * @return the CompleteRequest object itself. + */ + @Generated + public CompleteRequest setAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + /** * {@inheritDoc} */ @@ -492,6 +525,11 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } jsonWriter.writeNumberField("seed", this.seed); jsonWriter.writeStringField("model", this.model); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } return jsonWriter.writeEndObject(); } @@ -520,6 +558,7 @@ public static CompleteRequest fromJson(JsonReader jsonReader) throws IOException BinaryData toolChoice = null; Long seed = null; String model = null; + Map additionalProperties = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -552,7 +591,11 @@ public static CompleteRequest fromJson(JsonReader jsonReader) throws IOException } else if ("model".equals(fieldName)) { model = reader.getString(); } else { - reader.skipChildren(); + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); } } CompleteRequest deserializedCompleteRequest = new CompleteRequest(messages); @@ -568,6 +611,7 @@ public static CompleteRequest fromJson(JsonReader jsonReader) throws IOException deserializedCompleteRequest.toolChoice = toolChoice; deserializedCompleteRequest.seed = seed; deserializedCompleteRequest.model = model; + deserializedCompleteRequest.additionalProperties = additionalProperties; return deserializedCompleteRequest; }); diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/EmbedRequest.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/EmbedRequest.java new file mode 100644 index 000000000000..e290a9c5f739 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/EmbedRequest.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.implementation.models; + +import com.azure.ai.inference.models.EmbeddingEncodingFormat; +import com.azure.ai.inference.models.EmbeddingInputType; +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * The EmbedRequest model. + */ +@Fluent +public final class EmbedRequest implements JsonSerializable { + /* + * Input text to embed, encoded as a string or array of tokens. + * To embed multiple inputs in a single request, pass an array + * of strings or array of token arrays. + */ + @Generated + private final List input; + + /* + * Optional. The number of dimensions the resulting output embeddings should have. + * Passing null causes the model to use its default value. + * Returns a 422 error if the model doesn't support the value or parameter. + */ + @Generated + private Integer dimensions; + + /* + * Optional. The desired format for the returned embeddings. + */ + @Generated + private EmbeddingEncodingFormat encodingFormat; + + /* + * Optional. The type of the input. + * Returns a 422 error if the model doesn't support the value or parameter. + */ + @Generated + private EmbeddingInputType inputType; + + /* + * ID of the specific AI model to use, if more than one model is available on the endpoint. + */ + @Generated + private String model; + + /* + * Additional properties + */ + @Generated + private Map additionalProperties; + + /** + * Creates an instance of EmbedRequest class. + * + * @param input the input value to set. + */ + @Generated + public EmbedRequest(List input) { + this.input = input; + } + + /** + * Get the input property: Input text to embed, encoded as a string or array of tokens. + * To embed multiple inputs in a single request, pass an array + * of strings or array of token arrays. + * + * @return the input value. + */ + @Generated + public List getInput() { + return this.input; + } + + /** + * Get the dimensions property: Optional. The number of dimensions the resulting output embeddings should have. + * Passing null causes the model to use its default value. + * Returns a 422 error if the model doesn't support the value or parameter. + * + * @return the dimensions value. + */ + @Generated + public Integer getDimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: Optional. The number of dimensions the resulting output embeddings should have. + * Passing null causes the model to use its default value. + * Returns a 422 error if the model doesn't support the value or parameter. + * + * @param dimensions the dimensions value to set. + * @return the EmbedRequest object itself. + */ + @Generated + public EmbedRequest setDimensions(Integer dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get the encodingFormat property: Optional. The desired format for the returned embeddings. + * + * @return the encodingFormat value. + */ + @Generated + public EmbeddingEncodingFormat getEncodingFormat() { + return this.encodingFormat; + } + + /** + * Set the encodingFormat property: Optional. The desired format for the returned embeddings. + * + * @param encodingFormat the encodingFormat value to set. + * @return the EmbedRequest object itself. + */ + @Generated + public EmbedRequest setEncodingFormat(EmbeddingEncodingFormat encodingFormat) { + this.encodingFormat = encodingFormat; + return this; + } + + /** + * Get the inputType property: Optional. The type of the input. + * Returns a 422 error if the model doesn't support the value or parameter. + * + * @return the inputType value. + */ + @Generated + public EmbeddingInputType getInputType() { + return this.inputType; + } + + /** + * Set the inputType property: Optional. The type of the input. + * Returns a 422 error if the model doesn't support the value or parameter. + * + * @param inputType the inputType value to set. + * @return the EmbedRequest object itself. + */ + @Generated + public EmbedRequest setInputType(EmbeddingInputType inputType) { + this.inputType = inputType; + return this; + } + + /** + * Get the model property: ID of the specific AI model to use, if more than one model is available on the endpoint. + * + * @return the model value. + */ + @Generated + public String getModel() { + return this.model; + } + + /** + * Set the model property: ID of the specific AI model to use, if more than one model is available on the endpoint. + * + * @param model the model value to set. + * @return the EmbedRequest object itself. + */ + @Generated + public EmbedRequest setModel(String model) { + this.model = model; + return this; + } + + /** + * Get the additionalProperties property: Additional properties. + * + * @return the additionalProperties value. + */ + @Generated + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Additional properties. + * + * @param additionalProperties the additionalProperties value to set. + * @return the EmbedRequest object itself. + */ + @Generated + public EmbedRequest setAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("input", this.input, (writer, element) -> writer.writeString(element)); + jsonWriter.writeNumberField("dimensions", this.dimensions); + jsonWriter.writeStringField("encoding_format", + this.encodingFormat == null ? null : this.encodingFormat.toString()); + jsonWriter.writeStringField("input_type", this.inputType == null ? null : this.inputType.toString()); + jsonWriter.writeStringField("model", this.model); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EmbedRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EmbedRequest if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EmbedRequest. + */ + @Generated + public static EmbedRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List input = null; + Integer dimensions = null; + EmbeddingEncodingFormat encodingFormat = null; + EmbeddingInputType inputType = null; + String model = null; + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("input".equals(fieldName)) { + input = reader.readArray(reader1 -> reader1.getString()); + } else if ("dimensions".equals(fieldName)) { + dimensions = reader.getNullable(JsonReader::getInt); + } else if ("encoding_format".equals(fieldName)) { + encodingFormat = EmbeddingEncodingFormat.fromString(reader.getString()); + } else if ("input_type".equals(fieldName)) { + inputType = EmbeddingInputType.fromString(reader.getString()); + } else if ("model".equals(fieldName)) { + model = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + EmbedRequest deserializedEmbedRequest = new EmbedRequest(input); + deserializedEmbedRequest.dimensions = dimensions; + deserializedEmbedRequest.encodingFormat = encodingFormat; + deserializedEmbedRequest.inputType = inputType; + deserializedEmbedRequest.model = model; + deserializedEmbedRequest.additionalProperties = additionalProperties; + + return deserializedEmbedRequest; + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/EmbedRequest1.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/EmbedRequest1.java new file mode 100644 index 000000000000..ce8c3cc46bb6 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/EmbedRequest1.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.implementation.models; + +import com.azure.ai.inference.models.EmbeddingEncodingFormat; +import com.azure.ai.inference.models.EmbeddingInput; +import com.azure.ai.inference.models.EmbeddingInputType; +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * The EmbedRequest1 model. + */ +@Fluent +public final class EmbedRequest1 implements JsonSerializable { + /* + * Input image to embed. To embed multiple inputs in a single request, pass an array. + * The input must not exceed the max input tokens for the model. + */ + @Generated + private final List input; + + /* + * Optional. The number of dimensions the resulting output embeddings should have. + * Passing null causes the model to use its default value. + * Returns a 422 error if the model doesn't support the value or parameter. + */ + @Generated + private Integer dimensions; + + /* + * Optional. The number of dimensions the resulting output embeddings should have. + * Passing null causes the model to use its default value. + * Returns a 422 error if the model doesn't support the value or parameter. + */ + @Generated + private EmbeddingEncodingFormat encodingFormat; + + /* + * Optional. The type of the input. + * Returns a 422 error if the model doesn't support the value or parameter. + */ + @Generated + private EmbeddingInputType inputType; + + /* + * ID of the specific AI model to use, if more than one model is available on the endpoint. + */ + @Generated + private String model; + + /* + * Additional properties + */ + @Generated + private Map additionalProperties; + + /** + * Creates an instance of EmbedRequest1 class. + * + * @param input the input value to set. + */ + @Generated + public EmbedRequest1(List input) { + this.input = input; + } + + /** + * Get the input property: Input image to embed. To embed multiple inputs in a single request, pass an array. + * The input must not exceed the max input tokens for the model. + * + * @return the input value. + */ + @Generated + public List getInput() { + return this.input; + } + + /** + * Get the dimensions property: Optional. The number of dimensions the resulting output embeddings should have. + * Passing null causes the model to use its default value. + * Returns a 422 error if the model doesn't support the value or parameter. + * + * @return the dimensions value. + */ + @Generated + public Integer getDimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: Optional. The number of dimensions the resulting output embeddings should have. + * Passing null causes the model to use its default value. + * Returns a 422 error if the model doesn't support the value or parameter. + * + * @param dimensions the dimensions value to set. + * @return the EmbedRequest1 object itself. + */ + @Generated + public EmbedRequest1 setDimensions(Integer dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get the encodingFormat property: Optional. The number of dimensions the resulting output embeddings should have. + * Passing null causes the model to use its default value. + * Returns a 422 error if the model doesn't support the value or parameter. + * + * @return the encodingFormat value. + */ + @Generated + public EmbeddingEncodingFormat getEncodingFormat() { + return this.encodingFormat; + } + + /** + * Set the encodingFormat property: Optional. The number of dimensions the resulting output embeddings should have. + * Passing null causes the model to use its default value. + * Returns a 422 error if the model doesn't support the value or parameter. + * + * @param encodingFormat the encodingFormat value to set. + * @return the EmbedRequest1 object itself. + */ + @Generated + public EmbedRequest1 setEncodingFormat(EmbeddingEncodingFormat encodingFormat) { + this.encodingFormat = encodingFormat; + return this; + } + + /** + * Get the inputType property: Optional. The type of the input. + * Returns a 422 error if the model doesn't support the value or parameter. + * + * @return the inputType value. + */ + @Generated + public EmbeddingInputType getInputType() { + return this.inputType; + } + + /** + * Set the inputType property: Optional. The type of the input. + * Returns a 422 error if the model doesn't support the value or parameter. + * + * @param inputType the inputType value to set. + * @return the EmbedRequest1 object itself. + */ + @Generated + public EmbedRequest1 setInputType(EmbeddingInputType inputType) { + this.inputType = inputType; + return this; + } + + /** + * Get the model property: ID of the specific AI model to use, if more than one model is available on the endpoint. + * + * @return the model value. + */ + @Generated + public String getModel() { + return this.model; + } + + /** + * Set the model property: ID of the specific AI model to use, if more than one model is available on the endpoint. + * + * @param model the model value to set. + * @return the EmbedRequest1 object itself. + */ + @Generated + public EmbedRequest1 setModel(String model) { + this.model = model; + return this; + } + + /** + * Get the additionalProperties property: Additional properties. + * + * @return the additionalProperties value. + */ + @Generated + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Additional properties. + * + * @param additionalProperties the additionalProperties value to set. + * @return the EmbedRequest1 object itself. + */ + @Generated + public EmbedRequest1 setAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("input", this.input, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("dimensions", this.dimensions); + jsonWriter.writeStringField("encoding_format", + this.encodingFormat == null ? null : this.encodingFormat.toString()); + jsonWriter.writeStringField("input_type", this.inputType == null ? null : this.inputType.toString()); + jsonWriter.writeStringField("model", this.model); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EmbedRequest1 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EmbedRequest1 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EmbedRequest1. + */ + @Generated + public static EmbedRequest1 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List input = null; + Integer dimensions = null; + EmbeddingEncodingFormat encodingFormat = null; + EmbeddingInputType inputType = null; + String model = null; + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("input".equals(fieldName)) { + input = reader.readArray(reader1 -> EmbeddingInput.fromJson(reader1)); + } else if ("dimensions".equals(fieldName)) { + dimensions = reader.getNullable(JsonReader::getInt); + } else if ("encoding_format".equals(fieldName)) { + encodingFormat = EmbeddingEncodingFormat.fromString(reader.getString()); + } else if ("input_type".equals(fieldName)) { + inputType = EmbeddingInputType.fromString(reader.getString()); + } else if ("model".equals(fieldName)) { + model = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + EmbedRequest1 deserializedEmbedRequest1 = new EmbedRequest1(input); + deserializedEmbedRequest1.dimensions = dimensions; + deserializedEmbedRequest1.encodingFormat = encodingFormat; + deserializedEmbedRequest1.inputType = inputType; + deserializedEmbedRequest1.model = model; + deserializedEmbedRequest1.additionalProperties = additionalProperties; + + return deserializedEmbedRequest1; + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolCall.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolCall.java index 4cdbfb0505df..6291596e47bf 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolCall.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolCall.java @@ -27,18 +27,10 @@ public final class ChatCompletionsFunctionToolCall extends ChatCompletionsToolCa * The details of the function invocation requested by the tool call. */ @Generated - private final FunctionCall function; + private FunctionCall function; - /** - * Creates an instance of ChatCompletionsFunctionToolCall class. - * - * @param id the id value to set. - * @param function the function value to set. - */ - @Generated public ChatCompletionsFunctionToolCall(String id, FunctionCall function) { - super(id); - this.function = function; + super(id, function); } /** diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolDefinition.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolDefinition.java index d0afd1795e82..8ec73693738d 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolDefinition.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolDefinition.java @@ -26,7 +26,7 @@ public final class ChatCompletionsFunctionToolDefinition extends ChatCompletions * The function definition details for the function tool. */ @Generated - private final FunctionDefinition function; + private FunctionDefinition function; /** * Creates an instance of ChatCompletionsFunctionToolDefinition class. @@ -35,7 +35,7 @@ public final class ChatCompletionsFunctionToolDefinition extends ChatCompletions */ @Generated public ChatCompletionsFunctionToolDefinition(FunctionDefinition function) { - this.function = function; + super(function); } /** diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsNamedFunctionToolSelection.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsNamedFunctionToolSelection.java index dae54fe7e768..8bd85b26b30c 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsNamedFunctionToolSelection.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsNamedFunctionToolSelection.java @@ -26,7 +26,7 @@ public final class ChatCompletionsNamedFunctionToolSelection extends ChatComplet * The function that should be called. */ @Generated - private final ChatCompletionsFunctionToolSelection function; + private ChatCompletionsFunctionToolSelection function; /** * Creates an instance of ChatCompletionsNamedFunctionToolSelection class. @@ -35,7 +35,7 @@ public final class ChatCompletionsNamedFunctionToolSelection extends ChatComplet */ @Generated public ChatCompletionsNamedFunctionToolSelection(ChatCompletionsFunctionToolSelection function) { - this.function = function; + super(function); } /** diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsNamedToolSelection.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsNamedToolSelection.java index b9bf1f0a9876..8370031a906e 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsNamedToolSelection.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsNamedToolSelection.java @@ -13,25 +13,34 @@ import java.io.IOException; /** - * An abstract representation of an explicit, named tool selection to use for a chat completions request. + * A tool selection of a specific, named function tool that will limit chat completions to using the named function. */ @Immutable public class ChatCompletionsNamedToolSelection implements JsonSerializable { /* - * The object type. + * The type of the tool. Currently, only `function` is supported. */ @Generated - private String type = "ChatCompletionsNamedToolSelection"; + private final String type = "function"; + + /* + * The function that should be called. + */ + @Generated + private final ChatCompletionsFunctionToolSelection function; /** * Creates an instance of ChatCompletionsNamedToolSelection class. + * + * @param function the function value to set. */ @Generated - public ChatCompletionsNamedToolSelection() { + public ChatCompletionsNamedToolSelection(ChatCompletionsFunctionToolSelection function) { + this.function = function; } /** - * Get the type property: The object type. + * Get the type property: The type of the tool. Currently, only `function` is supported. * * @return the type value. */ @@ -40,6 +49,16 @@ public String getType() { return this.type; } + /** + * Get the function property: The function that should be called. + * + * @return the function value. + */ + @Generated + public ChatCompletionsFunctionToolSelection getFunction() { + return this.function; + } + /** * {@inheritDoc} */ @@ -48,6 +67,7 @@ public String getType() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("type", this.type); + jsonWriter.writeJsonField("function", this.function); return jsonWriter.writeEndObject(); } @@ -57,51 +77,24 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ChatCompletionsNamedToolSelection if the JsonReader was pointing to an instance of it, or * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the ChatCompletionsNamedToolSelection. */ @Generated public static ChatCompletionsNamedToolSelection fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("type".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("function".equals(discriminatorValue)) { - return ChatCompletionsNamedFunctionToolSelection.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - @Generated - static ChatCompletionsNamedToolSelection fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ChatCompletionsNamedToolSelection deserializedChatCompletionsNamedToolSelection - = new ChatCompletionsNamedToolSelection(); + ChatCompletionsFunctionToolSelection function = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("type".equals(fieldName)) { - deserializedChatCompletionsNamedToolSelection.type = reader.getString(); + if ("function".equals(fieldName)) { + function = ChatCompletionsFunctionToolSelection.fromJson(reader); } else { reader.skipChildren(); } } - - return deserializedChatCompletionsNamedToolSelection; + return new ChatCompletionsNamedToolSelection(function); }); } } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsToolCall.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsToolCall.java index 43a1bbf306b9..b5a4e67e47e3 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsToolCall.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsToolCall.java @@ -13,35 +13,52 @@ import java.io.IOException; /** - * An abstract representation of a tool call that must be resolved in a subsequent request to perform the requested - * chat completion. + * A function tool call requested by the AI model. */ @Immutable public class ChatCompletionsToolCall implements JsonSerializable { /* - * The object type. + * The ID of the tool call. */ @Generated - private String type = "ChatCompletionsToolCall"; + private final String id; /* - * The ID of the tool call. + * The type of tool call. Currently, only `function` is supported. */ @Generated - private final String id; + private final String type = "function"; + + /* + * The details of the function call requested by the AI model. + */ + @Generated + private final FunctionCall function; /** * Creates an instance of ChatCompletionsToolCall class. * * @param id the id value to set. + * @param function the function value to set. */ @Generated - public ChatCompletionsToolCall(String id) { + public ChatCompletionsToolCall(String id, FunctionCall function) { this.id = id; + this.function = function; + } + + /** + * Get the id property: The ID of the tool call. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; } /** - * Get the type property: The object type. + * Get the type property: The type of tool call. Currently, only `function` is supported. * * @return the type value. */ @@ -51,13 +68,13 @@ public String getType() { } /** - * Get the id property: The ID of the tool call. + * Get the function property: The details of the function call requested by the AI model. * - * @return the id value. + * @return the function value. */ @Generated - public String getId() { - return this.id; + public FunctionCall getFunction() { + return this.function; } /** @@ -69,6 +86,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("id", this.id); jsonWriter.writeStringField("type", this.type); + jsonWriter.writeJsonField("function", this.function); return jsonWriter.writeEndObject(); } @@ -83,51 +101,22 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { */ @Generated public static ChatCompletionsToolCall fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("type".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("function".equals(discriminatorValue)) { - return ChatCompletionsFunctionToolCall.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - @Generated - static ChatCompletionsToolCall fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String id = null; - String type = null; + FunctionCall function = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("id".equals(fieldName)) { id = reader.getString(); - } else if ("type".equals(fieldName)) { - type = reader.getString(); + } else if ("function".equals(fieldName)) { + function = FunctionCall.fromJson(reader); } else { reader.skipChildren(); } } - ChatCompletionsToolCall deserializedChatCompletionsToolCall = new ChatCompletionsToolCall(id); - deserializedChatCompletionsToolCall.type = type; - - return deserializedChatCompletionsToolCall; + return new ChatCompletionsToolCall(id, function); }); } } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsToolDefinition.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsToolDefinition.java index ffea2854bed6..f623ddec710c 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsToolDefinition.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsToolDefinition.java @@ -13,25 +13,34 @@ import java.io.IOException; /** - * An abstract representation of a tool that can be used by the model to improve a chat completions response. + * The definition of a chat completions tool that can call a function. */ @Immutable public class ChatCompletionsToolDefinition implements JsonSerializable { /* - * The object type. + * The type of the tool. Currently, only `function` is supported. */ @Generated - private String type = "ChatCompletionsToolDefinition"; + private final String type = "function"; + + /* + * The function definition details for the function tool. + */ + @Generated + private final FunctionDefinition function; /** * Creates an instance of ChatCompletionsToolDefinition class. + * + * @param function the function value to set. */ @Generated - public ChatCompletionsToolDefinition() { + public ChatCompletionsToolDefinition(FunctionDefinition function) { + this.function = function; } /** - * Get the type property: The object type. + * Get the type property: The type of the tool. Currently, only `function` is supported. * * @return the type value. */ @@ -40,6 +49,16 @@ public String getType() { return this.type; } + /** + * Get the function property: The function definition details for the function tool. + * + * @return the function value. + */ + @Generated + public FunctionDefinition getFunction() { + return this.function; + } + /** * {@inheritDoc} */ @@ -48,6 +67,7 @@ public String getType() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("type", this.type); + jsonWriter.writeJsonField("function", this.function); return jsonWriter.writeEndObject(); } @@ -57,51 +77,24 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ChatCompletionsToolDefinition if the JsonReader was pointing to an instance of it, or null * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the ChatCompletionsToolDefinition. */ @Generated public static ChatCompletionsToolDefinition fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("type".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("function".equals(discriminatorValue)) { - return ChatCompletionsFunctionToolDefinition.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - @Generated - static ChatCompletionsToolDefinition fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ChatCompletionsToolDefinition deserializedChatCompletionsToolDefinition - = new ChatCompletionsToolDefinition(); + FunctionDefinition function = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("type".equals(fieldName)) { - deserializedChatCompletionsToolDefinition.type = reader.getString(); + if ("function".equals(fieldName)) { + function = FunctionDefinition.fromJson(reader); } else { reader.skipChildren(); } } - - return deserializedChatCompletionsToolDefinition; + return new ChatCompletionsToolDefinition(function); }); } } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingEncodingFormat.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingEncodingFormat.java new file mode 100644 index 000000000000..596a8e64ed54 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingEncodingFormat.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The format of the embeddings result. + * Returns a 422 error if the model doesn't support the value or parameter. + */ +public final class EmbeddingEncodingFormat extends ExpandableStringEnum { + /** + * Base64. + */ + @Generated + public static final EmbeddingEncodingFormat BASE64 = fromString("base64"); + + /** + * Binary. + */ + @Generated + public static final EmbeddingEncodingFormat BINARY = fromString("binary"); + + /** + * Floating point. + */ + @Generated + public static final EmbeddingEncodingFormat FLOAT = fromString("float"); + + /** + * Signed 8-bit integer. + */ + @Generated + public static final EmbeddingEncodingFormat INT8 = fromString("int8"); + + /** + * ubinary. + */ + @Generated + public static final EmbeddingEncodingFormat UBINARY = fromString("ubinary"); + + /** + * Unsigned 8-bit integer. + */ + @Generated + public static final EmbeddingEncodingFormat UINT8 = fromString("uint8"); + + /** + * Creates a new instance of EmbeddingEncodingFormat value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public EmbeddingEncodingFormat() { + } + + /** + * Creates or finds a EmbeddingEncodingFormat from its string representation. + * + * @param name a name to look for. + * @return the corresponding EmbeddingEncodingFormat. + */ + @Generated + public static EmbeddingEncodingFormat fromString(String name) { + return fromString(name, EmbeddingEncodingFormat.class); + } + + /** + * Gets known EmbeddingEncodingFormat values. + * + * @return known EmbeddingEncodingFormat values. + */ + @Generated + public static Collection values() { + return values(EmbeddingEncodingFormat.class); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingInput.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingInput.java new file mode 100644 index 000000000000..1a36fab999cc --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingInput.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents an image with optional text. + */ +@Fluent +public final class EmbeddingInput implements JsonSerializable { + /* + * The input image, in PNG format. + */ + @Generated + private final String image; + + /* + * Optional. The text input to feed into the model (like DINO, CLIP). + * Returns a 422 error if the model doesn't support the value or parameter. + */ + @Generated + private String text; + + /** + * Creates an instance of EmbeddingInput class. + * + * @param image the image value to set. + */ + @Generated + public EmbeddingInput(String image) { + this.image = image; + } + + /** + * Get the image property: The input image, in PNG format. + * + * @return the image value. + */ + @Generated + public String getImage() { + return this.image; + } + + /** + * Get the text property: Optional. The text input to feed into the model (like DINO, CLIP). + * Returns a 422 error if the model doesn't support the value or parameter. + * + * @return the text value. + */ + @Generated + public String getText() { + return this.text; + } + + /** + * Set the text property: Optional. The text input to feed into the model (like DINO, CLIP). + * Returns a 422 error if the model doesn't support the value or parameter. + * + * @param text the text value to set. + * @return the EmbeddingInput object itself. + */ + @Generated + public EmbeddingInput setText(String text) { + this.text = text; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("image", this.image); + jsonWriter.writeStringField("text", this.text); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EmbeddingInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EmbeddingInput if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EmbeddingInput. + */ + @Generated + public static EmbeddingInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String image = null; + String text = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("image".equals(fieldName)) { + image = reader.getString(); + } else if ("text".equals(fieldName)) { + text = reader.getString(); + } else { + reader.skipChildren(); + } + } + EmbeddingInput deserializedEmbeddingInput = new EmbeddingInput(image); + deserializedEmbeddingInput.text = text; + + return deserializedEmbeddingInput; + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingInputType.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingInputType.java new file mode 100644 index 000000000000..2e10403dcb6b --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingInputType.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Represents the input types used for embedding search. + */ +public final class EmbeddingInputType extends ExpandableStringEnum { + /** + * to do. + */ + @Generated + public static final EmbeddingInputType TEXT = fromString("text"); + + /** + * to do. + */ + @Generated + public static final EmbeddingInputType QUERY = fromString("query"); + + /** + * to do. + */ + @Generated + public static final EmbeddingInputType DOCUMENT = fromString("document"); + + /** + * Creates a new instance of EmbeddingInputType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public EmbeddingInputType() { + } + + /** + * Creates or finds a EmbeddingInputType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EmbeddingInputType. + */ + @Generated + public static EmbeddingInputType fromString(String name) { + return fromString(name, EmbeddingInputType.class); + } + + /** + * Gets known EmbeddingInputType values. + * + * @return known EmbeddingInputType values. + */ + @Generated + public static Collection values() { + return values(EmbeddingInputType.class); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingItem.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingItem.java new file mode 100644 index 000000000000..009085f90bc2 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingItem.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Representation of a single embeddings relatedness comparison. + */ +@Immutable +public final class EmbeddingItem implements JsonSerializable { + /* + * List of embedding values for the input prompt. These represent a measurement of the + * vector-based relatedness of the provided input. Or a base64 encoded string of the embedding vector. + */ + @Generated + private final BinaryData embedding; + + /* + * Index of the prompt to which the EmbeddingItem corresponds. + */ + @Generated + private final int index; + + /** + * Creates an instance of EmbeddingItem class. + * + * @param embedding the embedding value to set. + * @param index the index value to set. + */ + @Generated + private EmbeddingItem(BinaryData embedding, int index) { + this.embedding = embedding; + this.index = index; + } + + /** + * Get the embedding property: List of embedding values for the input prompt. These represent a measurement of the + * vector-based relatedness of the provided input. Or a base64 encoded string of the embedding vector. + * + * @return the embedding value. + */ + @Generated + public BinaryData getEmbedding() { + return this.embedding; + } + + /** + * Get the index property: Index of the prompt to which the EmbeddingItem corresponds. + * + * @return the index value. + */ + @Generated + public int getIndex() { + return this.index; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeUntypedField("embedding", this.embedding.toObject(Object.class)); + jsonWriter.writeIntField("index", this.index); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EmbeddingItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EmbeddingItem if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EmbeddingItem. + */ + @Generated + public static EmbeddingItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BinaryData embedding = null; + int index = 0; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("embedding".equals(fieldName)) { + embedding = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); + } else if ("index".equals(fieldName)) { + index = reader.getInt(); + } else { + reader.skipChildren(); + } + } + return new EmbeddingItem(embedding, index); + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingsResult.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingsResult.java new file mode 100644 index 000000000000..bbc38e5592e6 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingsResult.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Representation of the response data from an embeddings request. + * Embeddings measure the relatedness of text strings and are commonly used for search, clustering, + * recommendations, and other similar scenarios. + */ +@Immutable +public final class EmbeddingsResult implements JsonSerializable { + /* + * Embedding values for the prompts submitted in the request. + */ + @Generated + private final List data; + + /* + * Usage counts for tokens input using the embeddings API. + */ + @Generated + private final EmbeddingsUsage usage; + + /* + * The model ID used to generate this result. + */ + @Generated + private final String model; + + /** + * Creates an instance of EmbeddingsResult class. + * + * @param data the data value to set. + * @param usage the usage value to set. + * @param model the model value to set. + */ + @Generated + private EmbeddingsResult(List data, EmbeddingsUsage usage, String model) { + this.data = data; + this.usage = usage; + this.model = model; + } + + /** + * Get the data property: Embedding values for the prompts submitted in the request. + * + * @return the data value. + */ + @Generated + public List getData() { + return this.data; + } + + /** + * Get the usage property: Usage counts for tokens input using the embeddings API. + * + * @return the usage value. + */ + @Generated + public EmbeddingsUsage getUsage() { + return this.usage; + } + + /** + * Get the model property: The model ID used to generate this result. + * + * @return the model value. + */ + @Generated + public String getModel() { + return this.model; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("data", this.data, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("usage", this.usage); + jsonWriter.writeStringField("model", this.model); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EmbeddingsResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EmbeddingsResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EmbeddingsResult. + */ + @Generated + public static EmbeddingsResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List data = null; + EmbeddingsUsage usage = null; + String model = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("data".equals(fieldName)) { + data = reader.readArray(reader1 -> EmbeddingItem.fromJson(reader1)); + } else if ("usage".equals(fieldName)) { + usage = EmbeddingsUsage.fromJson(reader); + } else if ("model".equals(fieldName)) { + model = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new EmbeddingsResult(data, usage, model); + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingsUsage.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingsUsage.java new file mode 100644 index 000000000000..185910e2f94f --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingsUsage.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Measurement of the amount of tokens used in this request and response. + */ +@Immutable +public final class EmbeddingsUsage implements JsonSerializable { + /* + * Number of tokens in the request. + */ + @Generated + private final int promptTokens; + + /* + * Total number of tokens transacted in this request/response. Should equal the + * number of tokens in the request. + */ + @Generated + private final int totalTokens; + + /** + * Creates an instance of EmbeddingsUsage class. + * + * @param promptTokens the promptTokens value to set. + * @param totalTokens the totalTokens value to set. + */ + @Generated + private EmbeddingsUsage(int promptTokens, int totalTokens) { + this.promptTokens = promptTokens; + this.totalTokens = totalTokens; + } + + /** + * Get the promptTokens property: Number of tokens in the request. + * + * @return the promptTokens value. + */ + @Generated + public int getPromptTokens() { + return this.promptTokens; + } + + /** + * Get the totalTokens property: Total number of tokens transacted in this request/response. Should equal the + * number of tokens in the request. + * + * @return the totalTokens value. + */ + @Generated + public int getTotalTokens() { + return this.totalTokens; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("prompt_tokens", this.promptTokens); + jsonWriter.writeIntField("total_tokens", this.totalTokens); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EmbeddingsUsage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EmbeddingsUsage if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EmbeddingsUsage. + */ + @Generated + public static EmbeddingsUsage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int promptTokens = 0; + int totalTokens = 0; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("prompt_tokens".equals(fieldName)) { + promptTokens = reader.getInt(); + } else if ("total_tokens".equals(fieldName)) { + totalTokens = reader.getInt(); + } else { + reader.skipChildren(); + } + } + return new EmbeddingsUsage(promptTokens, totalTokens); + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java index 0184ee4fdb19..626e585109a7 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java @@ -11,6 +11,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.Map; /** * The definition of a caller-specified function that chat completions may invoke in response to matching user input. @@ -34,7 +35,7 @@ public final class FunctionDefinition implements JsonSerializable parameters; /** * Creates an instance of FunctionDefinition class. @@ -88,7 +89,7 @@ public FunctionDefinition setDescription(String description) { * @return the parameters value. */ @Generated - public Object getParameters() { + public Map getParameters() { return this.parameters; } @@ -99,7 +100,7 @@ public Object getParameters() { * @return the FunctionDefinition object itself. */ @Generated - public FunctionDefinition setParameters(Object parameters) { + public FunctionDefinition setParameters(Map parameters) { this.parameters = parameters; return this; } @@ -113,7 +114,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("name", this.name); jsonWriter.writeStringField("description", this.description); - jsonWriter.writeUntypedField("parameters", this.parameters); + jsonWriter.writeMapField("parameters", this.parameters, (writer, element) -> writer.writeUntyped(element)); return jsonWriter.writeEndObject(); } @@ -131,7 +132,7 @@ public static FunctionDefinition fromJson(JsonReader jsonReader) throws IOExcept return jsonReader.readObject(reader -> { String name = null; String description = null; - Object parameters = null; + Map parameters = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -141,7 +142,7 @@ public static FunctionDefinition fromJson(JsonReader jsonReader) throws IOExcept } else if ("description".equals(fieldName)) { description = reader.getString(); } else if ("parameters".equals(fieldName)) { - parameters = reader.readUntyped(); + parameters = reader.readMap(reader1 -> reader1.readUntyped()); } else { reader.skipChildren(); } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/StreamingChatChoiceUpdate.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/StreamingChatChoiceUpdate.java new file mode 100644 index 000000000000..e44b8a50a578 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/StreamingChatChoiceUpdate.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents an update to a single prompt completion when the service is streaming updates + * using Server Sent Events (SSE). + * Generally, `n` choices are generated per provided prompt with a default value of 1. + * Token limits and other settings may limit the number of choices generated. + */ +@Immutable +public final class StreamingChatChoiceUpdate implements JsonSerializable { + /* + * The ordered index associated with this chat completions choice. + */ + @Generated + private final int index; + + /* + * The reason that this chat completions choice completed its generated. + */ + @Generated + private final CompletionsFinishReason finishReason; + + /* + * An update to the chat message for a given chat completions prompt. + */ + @Generated + private final StreamingChatResponseMessageUpdate delta; + + /** + * Creates an instance of StreamingChatChoiceUpdate class. + * + * @param index the index value to set. + * @param finishReason the finishReason value to set. + * @param delta the delta value to set. + */ + @Generated + private StreamingChatChoiceUpdate(int index, CompletionsFinishReason finishReason, + StreamingChatResponseMessageUpdate delta) { + this.index = index; + this.finishReason = finishReason; + this.delta = delta; + } + + /** + * Get the index property: The ordered index associated with this chat completions choice. + * + * @return the index value. + */ + @Generated + public int getIndex() { + return this.index; + } + + /** + * Get the finishReason property: The reason that this chat completions choice completed its generated. + * + * @return the finishReason value. + */ + @Generated + public CompletionsFinishReason getFinishReason() { + return this.finishReason; + } + + /** + * Get the delta property: An update to the chat message for a given chat completions prompt. + * + * @return the delta value. + */ + @Generated + public StreamingChatResponseMessageUpdate getDelta() { + return this.delta; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("index", this.index); + jsonWriter.writeStringField("finish_reason", this.finishReason == null ? null : this.finishReason.toString()); + jsonWriter.writeJsonField("delta", this.delta); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StreamingChatChoiceUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StreamingChatChoiceUpdate if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the StreamingChatChoiceUpdate. + */ + @Generated + public static StreamingChatChoiceUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int index = 0; + CompletionsFinishReason finishReason = null; + StreamingChatResponseMessageUpdate delta = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("index".equals(fieldName)) { + index = reader.getInt(); + } else if ("finish_reason".equals(fieldName)) { + finishReason = CompletionsFinishReason.fromString(reader.getString()); + } else if ("delta".equals(fieldName)) { + delta = StreamingChatResponseMessageUpdate.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return new StreamingChatChoiceUpdate(index, finishReason, delta); + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/StreamingChatCompletionsUpdate.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/StreamingChatCompletionsUpdate.java new file mode 100644 index 000000000000..b75f804825b6 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/StreamingChatCompletionsUpdate.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; +import java.util.List; + +/** + * Represents a response update to a chat completions request, when the service is streaming updates + * using Server Sent Events (SSE). + * Completions support a wide variety of tasks and generate text that continues from or "completes" + * provided prompt data. + */ +@Immutable +public final class StreamingChatCompletionsUpdate implements JsonSerializable { + /* + * A unique identifier associated with this chat completions response. + */ + @Generated + private final String id; + + /* + * The first timestamp associated with generation activity for this completions response, + * represented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970. + */ + @Generated + private final long created; + + /* + * The model used for the chat completion. + */ + @Generated + private final String model; + + /* + * Usage information for tokens processed and generated as part of this completions operation. + */ + @Generated + private final CompletionsUsage usage; + + /* + * An update to the collection of completion choices associated with this completions response. + * Generally, `n` choices are generated per provided prompt with a default value of 1. + * Token limits and other settings may limit the number of choices generated. + */ + @Generated + private final List choices; + + /** + * Creates an instance of StreamingChatCompletionsUpdate class. + * + * @param id the id value to set. + * @param created the created value to set. + * @param model the model value to set. + * @param usage the usage value to set. + * @param choices the choices value to set. + */ + @Generated + private StreamingChatCompletionsUpdate(String id, OffsetDateTime created, String model, CompletionsUsage usage, + List choices) { + this.id = id; + if (created == null) { + this.created = 0L; + } else { + this.created = created.toEpochSecond(); + } + this.model = model; + this.usage = usage; + this.choices = choices; + } + + /** + * Get the id property: A unique identifier associated with this chat completions response. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the created property: The first timestamp associated with generation activity for this completions response, + * represented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970. + * + * @return the created value. + */ + @Generated + public OffsetDateTime getCreated() { + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.created), ZoneOffset.UTC); + } + + /** + * Get the model property: The model used for the chat completion. + * + * @return the model value. + */ + @Generated + public String getModel() { + return this.model; + } + + /** + * Get the usage property: Usage information for tokens processed and generated as part of this completions + * operation. + * + * @return the usage value. + */ + @Generated + public CompletionsUsage getUsage() { + return this.usage; + } + + /** + * Get the choices property: An update to the collection of completion choices associated with this completions + * response. + * Generally, `n` choices are generated per provided prompt with a default value of 1. + * Token limits and other settings may limit the number of choices generated. + * + * @return the choices value. + */ + @Generated + public List getChoices() { + return this.choices; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeLongField("created", this.created); + jsonWriter.writeStringField("model", this.model); + jsonWriter.writeJsonField("usage", this.usage); + jsonWriter.writeArrayField("choices", this.choices, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StreamingChatCompletionsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StreamingChatCompletionsUpdate if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the StreamingChatCompletionsUpdate. + */ + @Generated + public static StreamingChatCompletionsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + OffsetDateTime created = null; + String model = null; + CompletionsUsage usage = null; + List choices = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("created".equals(fieldName)) { + created = OffsetDateTime.ofInstant(Instant.ofEpochSecond(reader.getLong()), ZoneOffset.UTC); + } else if ("model".equals(fieldName)) { + model = reader.getString(); + } else if ("usage".equals(fieldName)) { + usage = CompletionsUsage.fromJson(reader); + } else if ("choices".equals(fieldName)) { + choices = reader.readArray(reader1 -> StreamingChatChoiceUpdate.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + return new StreamingChatCompletionsUpdate(id, created, model, usage, choices); + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/StreamingChatResponseMessageUpdate.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/StreamingChatResponseMessageUpdate.java new file mode 100644 index 000000000000..26a2604c0d63 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/StreamingChatResponseMessageUpdate.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A representation of a chat message update as received in a streaming response. + */ +@Immutable +public final class StreamingChatResponseMessageUpdate implements JsonSerializable { + /* + * The chat role associated with the message. If present, should always be 'assistant' + */ + @Generated + private ChatRole role; + + /* + * The content of the message. + */ + @Generated + private String content; + + /* + * The tool calls that must be resolved and have their outputs appended to subsequent input messages for the chat + * completions request to resolve as configured. + */ + @Generated + private List toolCalls; + + /** + * Creates an instance of StreamingChatResponseMessageUpdate class. + */ + @Generated + private StreamingChatResponseMessageUpdate() { + } + + /** + * Get the role property: The chat role associated with the message. If present, should always be 'assistant'. + * + * @return the role value. + */ + @Generated + public ChatRole getRole() { + return this.role; + } + + /** + * Get the content property: The content of the message. + * + * @return the content value. + */ + @Generated + public String getContent() { + return this.content; + } + + /** + * Get the toolCalls property: The tool calls that must be resolved and have their outputs appended to subsequent + * input messages for the chat + * completions request to resolve as configured. + * + * @return the toolCalls value. + */ + @Generated + public List getToolCalls() { + return this.toolCalls; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("role", this.role == null ? null : this.role.toString()); + jsonWriter.writeStringField("content", this.content); + jsonWriter.writeArrayField("tool_calls", this.toolCalls, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StreamingChatResponseMessageUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StreamingChatResponseMessageUpdate if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the StreamingChatResponseMessageUpdate. + */ + @Generated + public static StreamingChatResponseMessageUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StreamingChatResponseMessageUpdate deserializedStreamingChatResponseMessageUpdate + = new StreamingChatResponseMessageUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("role".equals(fieldName)) { + deserializedStreamingChatResponseMessageUpdate.role = ChatRole.fromString(reader.getString()); + } else if ("content".equals(fieldName)) { + deserializedStreamingChatResponseMessageUpdate.content = reader.getString(); + } else if ("tool_calls".equals(fieldName)) { + List toolCalls + = reader.readArray(reader1 -> StreamingChatResponseToolCallUpdate.fromJson(reader1)); + deserializedStreamingChatResponseMessageUpdate.toolCalls = toolCalls; + } else { + reader.skipChildren(); + } + } + + return deserializedStreamingChatResponseMessageUpdate; + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/StreamingChatResponseToolCallUpdate.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/StreamingChatResponseToolCallUpdate.java new file mode 100644 index 000000000000..41495891b99e --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/StreamingChatResponseToolCallUpdate.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An update to the function tool call information requested by the AI model. + */ +@Immutable +public final class StreamingChatResponseToolCallUpdate + implements JsonSerializable { + /* + * The ID of the tool call. + */ + @Generated + private final String id; + + /* + * Updates to the function call requested by the AI model. + */ + @Generated + private final FunctionCall function; + + /** + * Creates an instance of StreamingChatResponseToolCallUpdate class. + * + * @param id the id value to set. + * @param function the function value to set. + */ + @Generated + private StreamingChatResponseToolCallUpdate(String id, FunctionCall function) { + this.id = id; + this.function = function; + } + + /** + * Get the id property: The ID of the tool call. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the function property: Updates to the function call requested by the AI model. + * + * @return the function value. + */ + @Generated + public FunctionCall getFunction() { + return this.function; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("function", this.function); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StreamingChatResponseToolCallUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StreamingChatResponseToolCallUpdate if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the StreamingChatResponseToolCallUpdate. + */ + @Generated + public static StreamingChatResponseToolCallUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + FunctionCall function = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("function".equals(fieldName)) { + function = FunctionCall.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return new StreamingChatResponseToolCallUpdate(id, function); + }); + } +} diff --git a/sdk/ai/azure-ai-inference/src/main/java/module-info.java b/sdk/ai/azure-ai-inference/src/main/java/module-info.java index 49816749e27a..20f5ec8d9d92 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/module-info.java +++ b/sdk/ai/azure-ai-inference/src/main/java/module-info.java @@ -8,4 +8,4 @@ exports com.azure.ai.inference.models; opens com.azure.ai.inference.models to com.azure.core; opens com.azure.ai.inference.implementation.models to com.azure.core; -} +} \ No newline at end of file diff --git a/sdk/ai/azure-ai-inference/src/main/resources/META-INF/azure-ai-inference_apiview_properties.json b/sdk/ai/azure-ai-inference/src/main/resources/META-INF/azure-ai-inference_apiview_properties.json index b0893af5a456..9c4af625bb9d 100644 --- a/sdk/ai/azure-ai-inference/src/main/resources/META-INF/azure-ai-inference_apiview_properties.json +++ b/sdk/ai/azure-ai-inference/src/main/resources/META-INF/azure-ai-inference_apiview_properties.json @@ -12,18 +12,39 @@ "com.azure.ai.inference.ChatCompletionsClient.getModelInfo": "Customizations.Client1.getModelInfo", "com.azure.ai.inference.ChatCompletionsClient.getModelInfoWithResponse": "Customizations.Client1.getModelInfo", "com.azure.ai.inference.ChatCompletionsClientBuilder": "AI.Model.ChatCompletionsClient", + "com.azure.ai.inference.EmbeddingsAsyncClient": "AI.Model.EmbeddingsClient", + "com.azure.ai.inference.EmbeddingsAsyncClient.embed": "Customizations.Client2.embed", + "com.azure.ai.inference.EmbeddingsAsyncClient.embedWithResponse": "Customizations.Client2.embed", + "com.azure.ai.inference.EmbeddingsAsyncClient.getModelInfo": "Customizations.Client2.getModelInfo", + "com.azure.ai.inference.EmbeddingsAsyncClient.getModelInfoWithResponse": "Customizations.Client2.getModelInfo", + "com.azure.ai.inference.EmbeddingsClient": "AI.Model.EmbeddingsClient", + "com.azure.ai.inference.EmbeddingsClient.embed": "Customizations.Client2.embed", + "com.azure.ai.inference.EmbeddingsClient.embedWithResponse": "Customizations.Client2.embed", + "com.azure.ai.inference.EmbeddingsClient.getModelInfo": "Customizations.Client2.getModelInfo", + "com.azure.ai.inference.EmbeddingsClient.getModelInfoWithResponse": "Customizations.Client2.getModelInfo", + "com.azure.ai.inference.EmbeddingsClientBuilder": "AI.Model.EmbeddingsClient", + "com.azure.ai.inference.ImageEmbeddingsAsyncClient": "AI.Model.ImageEmbeddingsClient", + "com.azure.ai.inference.ImageEmbeddingsAsyncClient.embed": "Customizations.Client3.embed", + "com.azure.ai.inference.ImageEmbeddingsAsyncClient.embedWithResponse": "Customizations.Client3.embed", + "com.azure.ai.inference.ImageEmbeddingsAsyncClient.getModelInfo": "Customizations.Client3.getModelInfo", + "com.azure.ai.inference.ImageEmbeddingsAsyncClient.getModelInfoWithResponse": "Customizations.Client3.getModelInfo", + "com.azure.ai.inference.ImageEmbeddingsClient": "AI.Model.ImageEmbeddingsClient", + "com.azure.ai.inference.ImageEmbeddingsClient.embed": "Customizations.Client3.embed", + "com.azure.ai.inference.ImageEmbeddingsClient.embedWithResponse": "Customizations.Client3.embed", + "com.azure.ai.inference.ImageEmbeddingsClient.getModelInfo": "Customizations.Client3.getModelInfo", + "com.azure.ai.inference.ImageEmbeddingsClient.getModelInfoWithResponse": "Customizations.Client3.getModelInfo", + "com.azure.ai.inference.ImageEmbeddingsClientBuilder": "AI.Model.ImageEmbeddingsClient", "com.azure.ai.inference.implementation.models.CompleteOptions": "null", - "com.azure.ai.inference.implementation.models.CompleteRequest": "complete.Request.anonymous", + "com.azure.ai.inference.implementation.models.CompleteRequest": "Customizations.complete.Request.anonymous", + "com.azure.ai.inference.implementation.models.EmbedRequest": "Customizations.embed.Request.anonymous", + "com.azure.ai.inference.implementation.models.EmbedRequest1": "Customizations.embed.Request.anonymous", "com.azure.ai.inference.implementation.models.ExtraParameters": "AI.Model.ExtraParameters", "com.azure.ai.inference.models.ChatChoice": "AI.Model.ChatChoice", "com.azure.ai.inference.models.ChatCompletions": "AI.Model.ChatCompletions", - "com.azure.ai.inference.models.ChatCompletionsFunctionToolCall": "AI.Model.ChatCompletionsFunctionToolCall", - "com.azure.ai.inference.models.ChatCompletionsFunctionToolDefinition": "AI.Model.ChatCompletionsFunctionToolDefinition", "com.azure.ai.inference.models.ChatCompletionsFunctionToolSelection": "AI.Model.ChatCompletionsFunctionToolSelection", - "com.azure.ai.inference.models.ChatCompletionsNamedFunctionToolSelection": "AI.Model.ChatCompletionsNamedFunctionToolSelection", "com.azure.ai.inference.models.ChatCompletionsNamedToolSelection": "AI.Model.ChatCompletionsNamedToolSelection", "com.azure.ai.inference.models.ChatCompletionsResponseFormat": "AI.Model.ChatCompletionsResponseFormat", - "com.azure.ai.inference.models.ChatCompletionsResponseFormatJson": "AI.Model.ChatCompletionsResponseFormatJson", + "com.azure.ai.inference.models.ChatCompletionsResponseFormatJSON": "AI.Model.ChatCompletionsResponseFormatJSON", "com.azure.ai.inference.models.ChatCompletionsResponseFormatText": "AI.Model.ChatCompletionsResponseFormatText", "com.azure.ai.inference.models.ChatCompletionsToolCall": "AI.Model.ChatCompletionsToolCall", "com.azure.ai.inference.models.ChatCompletionsToolDefinition": "AI.Model.ChatCompletionsToolDefinition", @@ -42,9 +63,19 @@ "com.azure.ai.inference.models.ChatRole": "AI.Model.ChatRole", "com.azure.ai.inference.models.CompletionsFinishReason": "AI.Model.CompletionsFinishReason", "com.azure.ai.inference.models.CompletionsUsage": "AI.Model.CompletionsUsage", + "com.azure.ai.inference.models.EmbeddingEncodingFormat": "AI.Model.EmbeddingEncodingFormat", + "com.azure.ai.inference.models.EmbeddingInput": "AI.Model.EmbeddingInput", + "com.azure.ai.inference.models.EmbeddingInputType": "AI.Model.EmbeddingInputType", + "com.azure.ai.inference.models.EmbeddingItem": "AI.Model.EmbeddingItem", + "com.azure.ai.inference.models.EmbeddingsResult": "AI.Model.EmbeddingsResult", + "com.azure.ai.inference.models.EmbeddingsUsage": "AI.Model.EmbeddingsUsage", "com.azure.ai.inference.models.FunctionCall": "AI.Model.FunctionCall", "com.azure.ai.inference.models.FunctionDefinition": "AI.Model.FunctionDefinition", "com.azure.ai.inference.models.ModelInfo": "AI.Model.ModelInfo", - "com.azure.ai.inference.models.ModelType": "AI.Model.ModelType" + "com.azure.ai.inference.models.ModelType": "AI.Model.ModelType", + "com.azure.ai.inference.models.StreamingChatChoiceUpdate": "AI.Model.StreamingChatChoiceUpdate", + "com.azure.ai.inference.models.StreamingChatCompletionsUpdate": "AI.Model.StreamingChatCompletionsUpdate", + "com.azure.ai.inference.models.StreamingChatResponseMessageUpdate": "AI.Model.StreamingChatResponseMessageUpdate", + "com.azure.ai.inference.models.StreamingChatResponseToolCallUpdate": "AI.Model.StreamingChatResponseToolCallUpdate" } } diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java index 1328c2fbc2ae..5b94e8dc39ef 100644 --- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java +++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java @@ -37,6 +37,8 @@ public abstract class ChatCompletionsClientTestBase extends TestProxyTestBase { protected ChatCompletionsClient chatCompletionsClient; + protected EmbeddingsClient embeddingsClient; + protected ImageEmbeddingsClient imageEmbeddingsClient; private boolean sanitizersRemoved = false; ChatCompletionsClientBuilder getChatCompletionsClientBuilder(HttpClient httpClient) { @@ -70,6 +72,68 @@ ChatCompletionsClientBuilder getChatCompletionsClientBuilder(HttpClient httpClie return builder; } + EmbeddingsClientBuilder getEmbeddingsClientBuilder(HttpClient httpClient) { + EmbeddingsClientBuilder builder = new EmbeddingsClientBuilder() + .httpClient(httpClient); + TestMode testMode = getTestMode(); + if (testMode != TestMode.LIVE) { + addTestRecordCustomSanitizers(); + addCustomMatchers(); + // Disable "$..id"=AZSDK3430, "Set-Cookie"=AZSDK2015 for both azure and non-azure clients from the list of common sanitizers. + if (!sanitizersRemoved) { + interceptorManager.removeSanitizers("AZSDK3430", "AZSDK3493"); + sanitizersRemoved = true; + } + } + + if (testMode == TestMode.PLAYBACK) { + builder + .endpoint("https://localhost:8080") + .credential(new AzureKeyCredential(FAKE_API_KEY)); + } else if (testMode == TestMode.RECORD) { + builder + .addPolicy(interceptorManager.getRecordPolicy()) + .endpoint(Configuration.getGlobalConfiguration().get("MODEL_ENDPOINT")) + .credential(new AzureKeyCredential(Configuration.getGlobalConfiguration().get("AZURE_API_KEY"))); + } else { + builder + .endpoint(Configuration.getGlobalConfiguration().get("MODEL_ENDPOINT")) + .credential(new AzureKeyCredential(Configuration.getGlobalConfiguration().get("AZURE_API_KEY"))); + } + return builder; + } + + ImageEmbeddingsClientBuilder getImageEmbeddingsClientBuilder(HttpClient httpClient) { + ImageEmbeddingsClientBuilder builder = new ImageEmbeddingsClientBuilder() + .httpClient(httpClient); + TestMode testMode = getTestMode(); + if (testMode != TestMode.LIVE) { + addTestRecordCustomSanitizers(); + addCustomMatchers(); + // Disable "$..id"=AZSDK3430, "Set-Cookie"=AZSDK2015 for both azure and non-azure clients from the list of common sanitizers. + if (!sanitizersRemoved) { + interceptorManager.removeSanitizers("AZSDK3430", "AZSDK3493"); + sanitizersRemoved = true; + } + } + + if (testMode == TestMode.PLAYBACK) { + builder + .endpoint("https://localhost:8080") + .credential(new AzureKeyCredential(FAKE_API_KEY)); + } else if (testMode == TestMode.RECORD) { + builder + .addPolicy(interceptorManager.getRecordPolicy()) + .endpoint(Configuration.getGlobalConfiguration().get("MODEL_ENDPOINT")) + .credential(new AzureKeyCredential(Configuration.getGlobalConfiguration().get("AZURE_API_KEY"))); + } else { + builder + .endpoint(Configuration.getGlobalConfiguration().get("MODEL_ENDPOINT")) + .credential(new AzureKeyCredential(Configuration.getGlobalConfiguration().get("AZURE_API_KEY"))); + } + return builder; + } + private void addTestRecordCustomSanitizers() { interceptorManager.addSanitizers(Arrays.asList( new TestProxySanitizer("$..key", null, "REDACTED", TestProxySanitizerType.BODY_KEY), diff --git a/sdk/ai/azure-ai-inference/tsp-location.yaml b/sdk/ai/azure-ai-inference/tsp-location.yaml index ada3b01632dc..3c18180587a8 100644 --- a/sdk/ai/azure-ai-inference/tsp-location.yaml +++ b/sdk/ai/azure-ai-inference/tsp-location.yaml @@ -1,4 +1,4 @@ -commit: 6449340e804611b97c3e1a77cf2a74a9716a3d3d +commit: 4bc47ae220d30299af3c56a062e917ea6a6db2ac additionalDirectories: [] repo: Azure/azure-rest-api-specs directory: specification/ai/ModelClient From 2c591f7f362cc394198640734a45e1ff9e9fc066 Mon Sep 17 00:00:00 2001 From: glenn Date: Mon, 19 Aug 2024 16:23:04 -0400 Subject: [PATCH 023/128] revert parameters to Object type --- .../inference/models/FunctionDefinition.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java index 626e585109a7..8d4606e02082 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java @@ -35,11 +35,11 @@ public final class FunctionDefinition implements JsonSerializable parameters; + private Object parameters; /** * Creates an instance of FunctionDefinition class. - * + * * @param name the name value to set. */ @Generated @@ -49,7 +49,7 @@ public FunctionDefinition(String name) { /** * Get the name property: The name of the function to be called. - * + * * @return the name value. */ @Generated @@ -61,7 +61,7 @@ public String getName() { * Get the description property: A description of what the function does. The model will use this description when * selecting the function and * interpreting its parameters. - * + * * @return the description value. */ @Generated @@ -73,7 +73,7 @@ public String getDescription() { * Set the description property: A description of what the function does. The model will use this description when * selecting the function and * interpreting its parameters. - * + * * @param description the description value to set. * @return the FunctionDefinition object itself. */ @@ -85,17 +85,17 @@ public FunctionDefinition setDescription(String description) { /** * Get the parameters property: The parameters the function accepts, described as a JSON Schema object. - * + * * @return the parameters value. */ @Generated - public Map getParameters() { + public Object getParameters() { return this.parameters; } /** * Set the parameters property: The parameters the function accepts, described as a JSON Schema object. - * + * * @param parameters the parameters value to set. * @return the FunctionDefinition object itself. */ @@ -114,13 +114,13 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("name", this.name); jsonWriter.writeStringField("description", this.description); - jsonWriter.writeMapField("parameters", this.parameters, (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeUntypedField("parameters", this.parameters); return jsonWriter.writeEndObject(); } /** * Reads an instance of FunctionDefinition from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of FunctionDefinition if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. @@ -132,7 +132,7 @@ public static FunctionDefinition fromJson(JsonReader jsonReader) throws IOExcept return jsonReader.readObject(reader -> { String name = null; String description = null; - Map parameters = null; + Object parameters = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -142,7 +142,7 @@ public static FunctionDefinition fromJson(JsonReader jsonReader) throws IOExcept } else if ("description".equals(fieldName)) { description = reader.getString(); } else if ("parameters".equals(fieldName)) { - parameters = reader.readMap(reader1 -> reader1.readUntyped()); + parameters = reader.readUntyped(); } else { reader.skipChildren(); } From 8d57e386896279437806f80270b462156631677c Mon Sep 17 00:00:00 2001 From: glenn Date: Mon, 19 Aug 2024 18:26:54 -0400 Subject: [PATCH 024/128] add embedding sample --- .../azure/ai/inference/EmbeddingsClient.java | 22 +++++----- .../ai/inference/models/EmbeddingItem.java | 16 +++---- .../inference/usage/TextEmbeddingsSample.java | 42 +++++++++++++++++++ 3 files changed, 62 insertions(+), 18 deletions(-) create mode 100644 sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TextEmbeddingsSample.java diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java index cea9d176cfc8..97051a72bf82 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java @@ -35,7 +35,7 @@ public final class EmbeddingsClient { /** * Initializes an instance of EmbeddingsClient class. - * + * * @param serviceClient the service client implementation. */ @Generated @@ -57,7 +57,7 @@ public final class EmbeddingsClient { * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

- * + * *
{@code
      * {
      *     input (Required): [
@@ -72,9 +72,9 @@ public final class EmbeddingsClient {
      *     }
      * }
      * }
- * + * *

Response Body Schema

- * + * *
{@code
      * {
      *     data (Required): [
@@ -90,7 +90,7 @@ public final class EmbeddingsClient {
      *     model: String (Required)
      * }
      * }
- * + * * @param embedRequest The embedRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -111,7 +111,7 @@ Response embedWithResponse(BinaryData embedRequest, RequestOptions r * Returns information about the AI model. * The method makes a REST API call to the `/info` route on the given endpoint. *

Response Body Schema

- * + * *
{@code
      * {
      *     model_name: String (Required)
@@ -119,7 +119,7 @@ Response embedWithResponse(BinaryData embedRequest, RequestOptions r
      *     model_provider_name: String (Required)
      * }
      * }
- * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -136,7 +136,7 @@ Response getModelInfoWithResponse(RequestOptions requestOptions) { /** * Return the embedding vectors for given text prompts. * The method makes a REST API call to the `/embeddings` route on the given endpoint. - * + * * @param input Input text to embed, encoded as a string or array of tokens. * To embed multiple inputs in a single request, pass an array * of strings or array of token arrays. @@ -180,7 +180,7 @@ EmbeddingsResult embed(List input, Integer dimensions, EmbeddingEncoding /** * Return the embedding vectors for given text prompts. * The method makes a REST API call to the `/embeddings` route on the given endpoint. - * + * * @param input Input text to embed, encoded as a string or array of tokens. * To embed multiple inputs in a single request, pass an array * of strings or array of token arrays. @@ -196,7 +196,7 @@ EmbeddingsResult embed(List input, Integer dimensions, EmbeddingEncoding */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - EmbeddingsResult embed(List input) { + public EmbeddingsResult embed(List input) { // Generated convenience method for embedWithResponse RequestOptions requestOptions = new RequestOptions(); EmbedRequest embedRequestObj = new EmbedRequest(input); @@ -207,7 +207,7 @@ EmbeddingsResult embed(List input) { /** * Returns information about the AI model. * The method makes a REST API call to the `/info` route on the given endpoint. - * + * * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingItem.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingItem.java index 009085f90bc2..ece4584289df 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingItem.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingItem.java @@ -7,11 +7,14 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.TypeReference; 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.Base64; +import java.util.List; /** * Representation of a single embeddings relatedness comparison. @@ -33,7 +36,7 @@ public final class EmbeddingItem implements JsonSerializable { /** * Creates an instance of EmbeddingItem class. - * + * * @param embedding the embedding value to set. * @param index the index value to set. */ @@ -46,17 +49,16 @@ private EmbeddingItem(BinaryData embedding, int index) { /** * Get the embedding property: List of embedding values for the input prompt. These represent a measurement of the * vector-based relatedness of the provided input. Or a base64 encoded string of the embedding vector. - * + * * @return the embedding value. */ - @Generated - public BinaryData getEmbedding() { - return this.embedding; + public List getEmbedding() { + return this.embedding.toObject(new TypeReference<>() { }); } /** * Get the index property: Index of the prompt to which the EmbeddingItem corresponds. - * + * * @return the index value. */ @Generated @@ -78,7 +80,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of EmbeddingItem from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of EmbeddingItem if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TextEmbeddingsSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TextEmbeddingsSample.java new file mode 100644 index 000000000000..25afc1dafeb1 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TextEmbeddingsSample.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.usage; + +import com.azure.ai.inference.EmbeddingsClient; +import com.azure.ai.inference.EmbeddingsClientBuilder; +import com.azure.ai.inference.models.EmbeddingsResult; +import com.azure.ai.inference.models.EmbeddingItem; +import com.azure.core.credential.AzureKeyCredential; +import com.azure.core.util.Configuration; + +import java.util.ArrayList; +import java.util.List; + +public final class TextEmbeddingsSample { + /** + * @param args Unused. Arguments to the program. + */ + public static void main(String[] args) { + String key = Configuration.getGlobalConfiguration().get("AZURE_EMBEDDINGS_KEY"); + String endpoint = Configuration.getGlobalConfiguration().get("EMBEDDINGS_MODEL_ENDPOINT"); + EmbeddingsClient client = new EmbeddingsClientBuilder() + .credential(new AzureKeyCredential(key)) + .endpoint(endpoint) + .buildClient(); + + List promptList = new ArrayList<>(); + String prompt = "Tell me 3 jokes about trains"; + promptList.add(prompt); + + EmbeddingsResult embeddings = client.embed(promptList); + + for (EmbeddingItem item : embeddings.getData()) { + System.out.printf("Index: %d.%n", item.getIndex()); + for (Float embedding : item.getEmbedding()) { + System.out.printf("%f;", embedding); + } + } + } +} From 92c7940205f6c428f7966740590fe94e78dd7d46 Mon Sep 17 00:00:00 2001 From: glenn Date: Tue, 20 Aug 2024 10:44:04 -0400 Subject: [PATCH 025/128] add Embeddings test classes --- .../ChatCompletionsClientTestBase.java | 62 -------- .../inference/EmbeddingsClientTestBase.java | 145 ++++++++++++++++++ .../inference/EmbeddingsSyncClientTest.java | 36 +++++ 3 files changed, 181 insertions(+), 62 deletions(-) create mode 100644 sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsClientTestBase.java create mode 100644 sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsSyncClientTest.java diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java index 5b94e8dc39ef..fac65d099db1 100644 --- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java +++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java @@ -72,68 +72,6 @@ ChatCompletionsClientBuilder getChatCompletionsClientBuilder(HttpClient httpClie return builder; } - EmbeddingsClientBuilder getEmbeddingsClientBuilder(HttpClient httpClient) { - EmbeddingsClientBuilder builder = new EmbeddingsClientBuilder() - .httpClient(httpClient); - TestMode testMode = getTestMode(); - if (testMode != TestMode.LIVE) { - addTestRecordCustomSanitizers(); - addCustomMatchers(); - // Disable "$..id"=AZSDK3430, "Set-Cookie"=AZSDK2015 for both azure and non-azure clients from the list of common sanitizers. - if (!sanitizersRemoved) { - interceptorManager.removeSanitizers("AZSDK3430", "AZSDK3493"); - sanitizersRemoved = true; - } - } - - if (testMode == TestMode.PLAYBACK) { - builder - .endpoint("https://localhost:8080") - .credential(new AzureKeyCredential(FAKE_API_KEY)); - } else if (testMode == TestMode.RECORD) { - builder - .addPolicy(interceptorManager.getRecordPolicy()) - .endpoint(Configuration.getGlobalConfiguration().get("MODEL_ENDPOINT")) - .credential(new AzureKeyCredential(Configuration.getGlobalConfiguration().get("AZURE_API_KEY"))); - } else { - builder - .endpoint(Configuration.getGlobalConfiguration().get("MODEL_ENDPOINT")) - .credential(new AzureKeyCredential(Configuration.getGlobalConfiguration().get("AZURE_API_KEY"))); - } - return builder; - } - - ImageEmbeddingsClientBuilder getImageEmbeddingsClientBuilder(HttpClient httpClient) { - ImageEmbeddingsClientBuilder builder = new ImageEmbeddingsClientBuilder() - .httpClient(httpClient); - TestMode testMode = getTestMode(); - if (testMode != TestMode.LIVE) { - addTestRecordCustomSanitizers(); - addCustomMatchers(); - // Disable "$..id"=AZSDK3430, "Set-Cookie"=AZSDK2015 for both azure and non-azure clients from the list of common sanitizers. - if (!sanitizersRemoved) { - interceptorManager.removeSanitizers("AZSDK3430", "AZSDK3493"); - sanitizersRemoved = true; - } - } - - if (testMode == TestMode.PLAYBACK) { - builder - .endpoint("https://localhost:8080") - .credential(new AzureKeyCredential(FAKE_API_KEY)); - } else if (testMode == TestMode.RECORD) { - builder - .addPolicy(interceptorManager.getRecordPolicy()) - .endpoint(Configuration.getGlobalConfiguration().get("MODEL_ENDPOINT")) - .credential(new AzureKeyCredential(Configuration.getGlobalConfiguration().get("AZURE_API_KEY"))); - } else { - builder - .endpoint(Configuration.getGlobalConfiguration().get("MODEL_ENDPOINT")) - .credential(new AzureKeyCredential(Configuration.getGlobalConfiguration().get("AZURE_API_KEY"))); - } - return builder; - } - private void addTestRecordCustomSanitizers() { interceptorManager.addSanitizers(Arrays.asList( new TestProxySanitizer("$..key", null, "REDACTED", TestProxySanitizerType.BODY_KEY), diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsClientTestBase.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsClientTestBase.java new file mode 100644 index 000000000000..029971b80216 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsClientTestBase.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference; + +// The Java test files under 'generated' package are generated for your reference. +// If you wish to modify these files, please copy them out of the 'generated' package, and modify there. +// See https://aka.ms/azsdk/dpg/java/tests for guide on adding a test. + +import com.azure.ai.inference.models.*; +import com.azure.core.credential.AzureKeyCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.test.TestMode; +import com.azure.core.test.TestProxyTestBase; +import com.azure.core.test.models.CustomMatcher; +import com.azure.core.test.models.TestProxySanitizer; +import com.azure.core.test.models.TestProxySanitizerType; +import com.azure.core.util.Configuration; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.function.Consumer; + +import static com.azure.ai.inference.TestUtils.FAKE_API_KEY; +import static org.junit.jupiter.api.Assertions.*; + +public abstract class EmbeddingsClientTestBase extends TestProxyTestBase { + protected EmbeddingsClient embeddingsClient; + protected ImageEmbeddingsClient imageEmbeddingsClient; + private boolean sanitizersRemoved = false; + + EmbeddingsClientBuilder getEmbeddingsClientBuilder(HttpClient httpClient) { + EmbeddingsClientBuilder builder = new EmbeddingsClientBuilder() + .httpClient(httpClient); + TestMode testMode = getTestMode(); + if (testMode != TestMode.LIVE) { + addTestRecordCustomSanitizers(); + addCustomMatchers(); + // Disable "$..id"=AZSDK3430, "Set-Cookie"=AZSDK2015 for both azure and non-azure clients from the list of common sanitizers. + if (!sanitizersRemoved) { + interceptorManager.removeSanitizers("AZSDK3430", "AZSDK3493"); + sanitizersRemoved = true; + } + } + + if (testMode == TestMode.PLAYBACK) { + builder + .endpoint("https://localhost:8080") + .credential(new AzureKeyCredential(FAKE_API_KEY)); + } else if (testMode == TestMode.RECORD) { + builder + .addPolicy(interceptorManager.getRecordPolicy()) + .endpoint(Configuration.getGlobalConfiguration().get("EMBEDDINGS_MODEL_ENDPOINT")) + .credential(new AzureKeyCredential(Configuration.getGlobalConfiguration().get("AZURE_EMBEDDINGS_KEY"))); + } else { + builder + .endpoint(Configuration.getGlobalConfiguration().get("EMBEDDINGS_MODEL_ENDPOINT")) + .credential(new AzureKeyCredential(Configuration.getGlobalConfiguration().get("AZURE_EMBEDDINGS_KEY"))); + } + return builder; + } + + ImageEmbeddingsClientBuilder getImageEmbeddingsClientBuilder(HttpClient httpClient) { + ImageEmbeddingsClientBuilder builder = new ImageEmbeddingsClientBuilder() + .httpClient(httpClient); + TestMode testMode = getTestMode(); + if (testMode != TestMode.LIVE) { + addTestRecordCustomSanitizers(); + addCustomMatchers(); + // Disable "$..id"=AZSDK3430, "Set-Cookie"=AZSDK2015 for both azure and non-azure clients from the list of common sanitizers. + if (!sanitizersRemoved) { + interceptorManager.removeSanitizers("AZSDK3430", "AZSDK3493"); + sanitizersRemoved = true; + } + } + + if (testMode == TestMode.PLAYBACK) { + builder + .endpoint("https://localhost:8080") + .credential(new AzureKeyCredential(FAKE_API_KEY)); + } else if (testMode == TestMode.RECORD) { + builder + .addPolicy(interceptorManager.getRecordPolicy()) + .endpoint(Configuration.getGlobalConfiguration().get("EMBEDDINGS_MODEL_ENDPOINT")) + .credential(new AzureKeyCredential(Configuration.getGlobalConfiguration().get("AZURE_EMBEDDINGS_KEY"))); + } else { + builder + .endpoint(Configuration.getGlobalConfiguration().get("EMBEDDINGS_MODEL_ENDPOINT")) + .credential(new AzureKeyCredential(Configuration.getGlobalConfiguration().get("AZURE_EMBEDDINGS_KEY"))); + } + return builder; + } + + private void addTestRecordCustomSanitizers() { + interceptorManager.addSanitizers(Arrays.asList( + new TestProxySanitizer("$..key", null, "REDACTED", TestProxySanitizerType.BODY_KEY), + new TestProxySanitizer("$..endpoint", null, "https://REDACTED", TestProxySanitizerType.BODY_KEY), + new TestProxySanitizer("Content-Type", "(^multipart\\/form-data; boundary=[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{2})", + "multipart\\/form-data; boundary=BOUNDARY", TestProxySanitizerType.HEADER) + )); + } + + private void addCustomMatchers() { + interceptorManager.addMatchers(new CustomMatcher().setExcludedHeaders(Arrays.asList("Cookie", "Set-Cookie"))); + } + + @Test + public abstract void testGetEmbeddings(HttpClient httpClient); + + void getEmbeddingsRunner(Consumer> testRunner) { + testRunner.accept(getPrompts()); + } + + static void assertCompletionsStream(ChatCompletions chatCompletions) { + if (chatCompletions.getId() != null && !chatCompletions.getId().isEmpty()) { + assertNotNull(chatCompletions.getId()); + assertNotNull(chatCompletions.getChoices()); + assertFalse(chatCompletions.getChoices().isEmpty()); + assertNotNull(chatCompletions.getChoices().get(0).getDelta()); + } + } + + static void assertEmbeddings(EmbeddingsResult actual) { + List data = actual.getData(); + assertNotNull(data); + assertFalse(data.isEmpty()); + + for (EmbeddingItem item : data) { + List embedding = item.getEmbedding(); + assertNotNull(embedding); + assertFalse(embedding.isEmpty()); + } + assertNotNull(actual.getUsage()); + } + + private List getPrompts() { + List prompts = new ArrayList<>(); + prompts.add("Can you help me?"); + prompts.add("What's the best way to train a parrot?"); + return prompts; + } +} diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsSyncClientTest.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsSyncClientTest.java new file mode 100644 index 000000000000..0adee5408b10 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsSyncClientTest.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.ai.inference; + +import com.azure.ai.inference.models.*; +import com.azure.core.http.HttpClient; +import com.azure.core.util.IterableStream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +import java.util.ArrayList; +import java.util.List; + +import static com.azure.ai.inference.TestUtils.DISPLAY_NAME_WITH_ARGUMENTS; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class EmbeddingsSyncClientTest extends EmbeddingsClientTestBase { + private EmbeddingsClient client; + + private EmbeddingsClient getEmbeddingsClient(HttpClient httpClient) { + return getEmbeddingsClientBuilder( + interceptorManager.isPlaybackMode() ? interceptorManager.getPlaybackClient() : httpClient) + .buildClient(); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.inference.TestUtils#getTestParameters") + public void testGetEmbeddings(HttpClient httpClient) { + client = getEmbeddingsClient(httpClient); + getEmbeddingsRunner((promptList) -> { + EmbeddingsResult result = client.embed(promptList); + assertEmbeddings(result); + }); + } + +} From 41ac88cb0823c778eee435ed4f763902ce91dbb7 Mon Sep 17 00:00:00 2001 From: glenn Date: Wed, 21 Aug 2024 11:09:45 -0400 Subject: [PATCH 026/128] add async embeddings test --- .../inference/EmbeddingsAsyncClientTest.java | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsAsyncClientTest.java diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsAsyncClientTest.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsAsyncClientTest.java new file mode 100644 index 000000000000..840630e62845 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsAsyncClientTest.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.ai.inference; + +import com.azure.ai.inference.models.ChatCompletionsOptions; +import com.azure.core.http.HttpClient; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; +import reactor.test.StepVerifier; + +import java.util.ArrayList; + +import static com.azure.ai.inference.TestUtils.DISPLAY_NAME_WITH_ARGUMENTS; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class EmbeddingsAsyncClientTest extends EmbeddingsClientTestBase { + private EmbeddingsAsyncClient client; + + private EmbeddingsAsyncClient getEmbeddingsAsyncClient (HttpClient httpClient) { + return getEmbeddingsClientBuilder( + interceptorManager.isPlaybackMode() ? interceptorManager.getPlaybackClient() : httpClient) + .buildAsyncClient(); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.inference.TestUtils#getTestParameters") + public void testGetEmbeddings(HttpClient httpClient) { + client = getEmbeddingsAsyncClient(httpClient); + getEmbeddingsRunner((promptList) -> { + StepVerifier.create(client.embed(promptList)) + .assertNext(result -> { + assertNotNull(result.getUsage()); + assertEmbeddings(result); + }) + .verifyComplete(); + }); + } +} From bcd81e7283ea04464f4e83c07a4d05b1368691a4 Mon Sep 17 00:00:00 2001 From: glenn Date: Wed, 21 Aug 2024 15:55:32 -0400 Subject: [PATCH 027/128] add text embeddings async sample --- .../usage/TextEmbeddingsAsyncSample.java | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TextEmbeddingsAsyncSample.java diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TextEmbeddingsAsyncSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TextEmbeddingsAsyncSample.java new file mode 100644 index 000000000000..09fbaa568f59 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TextEmbeddingsAsyncSample.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.usage; + +import com.azure.ai.inference.EmbeddingsAsyncClient; +import com.azure.ai.inference.EmbeddingsClient; +import com.azure.ai.inference.EmbeddingsClientBuilder; +import com.azure.ai.inference.models.*; +import com.azure.core.credential.AzureKeyCredential; +import com.azure.core.util.Configuration; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; + +public final class TextEmbeddingsAsyncSample { + /** + * @param args Unused. Arguments to the program. + */ + public static void main(String[] args) throws InterruptedException { + String key = Configuration.getGlobalConfiguration().get("AZURE_EMBEDDINGS_KEY"); + String endpoint = Configuration.getGlobalConfiguration().get("EMBEDDINGS_MODEL_ENDPOINT"); + EmbeddingsAsyncClient client = new EmbeddingsClientBuilder() + .credential(new AzureKeyCredential(key)) + .endpoint(endpoint) + .buildAsyncClient(); + + List promptList = new ArrayList<>(); + String prompt = "Tell me 3 jokes about trains"; + promptList.add(prompt); + + client.embed(promptList).subscribe( + embeddings -> { + for (EmbeddingItem item : embeddings.getData()) { + System.out.printf("Index: %d.%n", item.getIndex()); + System.out.println("Embedding as list of floats: "); + for (Float embedding : item.getEmbedding()) { + System.out.printf("%f;", embedding); + } + } + EmbeddingsUsage usage = embeddings.getUsage(); + System.out.printf( + "Usage: number of prompt token is %d and number of total tokens in request and response is %d.%n", + usage.getPromptTokens(), usage.getTotalTokens()); + }, + error -> System.err.println("There was an error getting embeddings." + error), + () -> System.out.println("Completed called getEmbeddings.")); + + // The .subscribe() creation and assignment is not a blocking call. For the purpose of this example, we sleep + // the thread so the program does not end before the send operation is complete. Using .block() instead of + // .subscribe() will turn this into a synchronous call. + TimeUnit.SECONDS.sleep(10); + + } +} From 75cbd93e5f507dc932fdb66d57cd4b0e0226d123 Mon Sep 17 00:00:00 2001 From: glenn Date: Wed, 21 Aug 2024 16:03:54 -0400 Subject: [PATCH 028/128] make embed method public --- .../ai/inference/EmbeddingsAsyncClient.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java index 9b0ba5b4fbd6..16eb85c72ae9 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java @@ -37,7 +37,7 @@ public final class EmbeddingsAsyncClient { /** * Initializes an instance of EmbeddingsAsyncClient class. - * + * * @param serviceClient the service client implementation. */ @Generated @@ -59,7 +59,7 @@ public final class EmbeddingsAsyncClient { * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

- * + * *
{@code
      * {
      *     input (Required): [
@@ -74,9 +74,9 @@ public final class EmbeddingsAsyncClient {
      *     }
      * }
      * }
- * + * *

Response Body Schema

- * + * *
{@code
      * {
      *     data (Required): [
@@ -92,7 +92,7 @@ public final class EmbeddingsAsyncClient {
      *     model: String (Required)
      * }
      * }
- * + * * @param embedRequest The embedRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -114,7 +114,7 @@ Mono> embedWithResponse(BinaryData embedRequest, RequestOpt * Returns information about the AI model. * The method makes a REST API call to the `/info` route on the given endpoint. *

Response Body Schema

- * + * *
{@code
      * {
      *     model_name: String (Required)
@@ -122,7 +122,7 @@ Mono> embedWithResponse(BinaryData embedRequest, RequestOpt
      *     model_provider_name: String (Required)
      * }
      * }
- * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -140,7 +140,7 @@ Mono> getModelInfoWithResponse(RequestOptions requestOption /** * Return the embedding vectors for given text prompts. * The method makes a REST API call to the `/embeddings` route on the given endpoint. - * + * * @param input Input text to embed, encoded as a string or array of tokens. * To embed multiple inputs in a single request, pass an array * of strings or array of token arrays. @@ -185,7 +185,7 @@ Mono embed(List input, Integer dimensions, EmbeddingEn /** * Return the embedding vectors for given text prompts. * The method makes a REST API call to the `/embeddings` route on the given endpoint. - * + * * @param input Input text to embed, encoded as a string or array of tokens. * To embed multiple inputs in a single request, pass an array * of strings or array of token arrays. @@ -201,7 +201,7 @@ Mono embed(List input, Integer dimensions, EmbeddingEn */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Mono embed(List input) { + public Mono embed(List input) { // Generated convenience method for embedWithResponse RequestOptions requestOptions = new RequestOptions(); EmbedRequest embedRequestObj = new EmbedRequest(input); @@ -213,7 +213,7 @@ Mono embed(List input) { /** * Returns information about the AI model. * The method makes a REST API call to the `/info` route on the given endpoint. - * + * * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. From 0edc3dca3eaba59420c6a770015e08649da54bc1 Mon Sep 17 00:00:00 2001 From: glenn Date: Wed, 21 Aug 2024 23:24:39 -0400 Subject: [PATCH 029/128] cleaner embeddings sample output --- .../com/azure/ai/inference/usage/TextEmbeddingsAsyncSample.java | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TextEmbeddingsAsyncSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TextEmbeddingsAsyncSample.java index 09fbaa568f59..c3d6c9be1a0a 100644 --- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TextEmbeddingsAsyncSample.java +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TextEmbeddingsAsyncSample.java @@ -41,6 +41,7 @@ public static void main(String[] args) throws InterruptedException { } } EmbeddingsUsage usage = embeddings.getUsage(); + System.out.println(""); System.out.printf( "Usage: number of prompt token is %d and number of total tokens in request and response is %d.%n", usage.getPromptTokens(), usage.getTotalTokens()); From 5ec93fecbd413320bad76db8f8381cfe403b0b83 Mon Sep 17 00:00:00 2001 From: glenn Date: Wed, 21 Aug 2024 23:38:02 -0400 Subject: [PATCH 030/128] fix javadoc gen --- .../models/ChatCompletionsFunctionToolCall.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolCall.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolCall.java index 6291596e47bf..81136c842b7b 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolCall.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolCall.java @@ -29,13 +29,20 @@ public final class ChatCompletionsFunctionToolCall extends ChatCompletionsToolCa @Generated private FunctionCall function; + + /** + * Creates an instance of ChatCompletionsFunctionToolCall class. + * + * @param id the id value to set. + * @param function the function value to set. + */ public ChatCompletionsFunctionToolCall(String id, FunctionCall function) { super(id, function); } /** * Get the type property: The object type. - * + * * @return the type value. */ @Generated @@ -46,7 +53,7 @@ public String getType() { /** * Get the function property: The details of the function invocation requested by the tool call. - * + * * @return the function value. */ @Generated @@ -69,7 +76,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of ChatCompletionsFunctionToolCall from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of ChatCompletionsFunctionToolCall if the JsonReader was pointing to an instance of it, or * null if it was pointing to JSON null. From 56877a62dcadb2c60aea1b5e31b0283ebd623a79 Mon Sep 17 00:00:00 2001 From: glenn Date: Thu, 22 Aug 2024 09:30:43 -0400 Subject: [PATCH 031/128] fix dep versions --- sdk/ai/azure-ai-inference/pom.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk/ai/azure-ai-inference/pom.xml b/sdk/ai/azure-ai-inference/pom.xml index 7cfb18f01d4a..999f03324541 100644 --- a/sdk/ai/azure-ai-inference/pom.xml +++ b/sdk/ai/azure-ai-inference/pom.xml @@ -70,12 +70,12 @@ com.azure azure-core-test - 1.26.1 + 1.26.2 com.azure azure-identity - 1.13.1 + 1.13.2 test @@ -87,13 +87,13 @@ com.azure azure-core-http-okhttp - 1.12.1 + 1.12.2 test com.azure azure-core-http-vertx - 1.0.0-beta.19 + 1.0.0-beta.20 test @@ -133,7 +133,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.14 + 1.0.0-beta.15 test From 28ed275630553bc6fb045a1e02c5d8c1bd1d04cc Mon Sep 17 00:00:00 2001 From: glenn Date: Fri, 23 Aug 2024 12:30:59 -0400 Subject: [PATCH 032/128] phrasing --- sdk/ai/azure-ai-inference/TROUBLESHOOTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/ai/azure-ai-inference/TROUBLESHOOTING.md b/sdk/ai/azure-ai-inference/TROUBLESHOOTING.md index 4c34e5c038f1..7cdd4555a68c 100644 --- a/sdk/ai/azure-ai-inference/TROUBLESHOOTING.md +++ b/sdk/ai/azure-ai-inference/TROUBLESHOOTING.md @@ -107,7 +107,7 @@ asyncClient.complete(new ChatCompletionsOptions(chatMessages)) ### Authentication errors Azure Inference supports Azure Active Directory authentication. [ChatCompletionsClientBuilder][chat_completions_client_builder] -has method to set the `credential`. To provide a valid credential, you can use `azure-identity` dependency. For more +offers an API to set the `credential`. To provide a valid credential, you can use `azure-identity` dependency. For more details on getting started, refer to the [README][how_to_create_chat_completions_client] of Azure Inference library. You can also refer to the [Azure Identity documentation][identity_doc] for more details on the various types of credential supported in `azure-identity`. From c28cb8810523380861f33de724d266c8cd01cede Mon Sep 17 00:00:00 2001 From: glenn Date: Fri, 23 Aug 2024 17:05:19 -0400 Subject: [PATCH 033/128] add AAD sample with scope --- .../ChatCompletionsClientBuilder.java | 26 ++++++++++--- ...=> ChatCompletionsResponseFormatJson.java} | 0 .../inference/usage/BasicChatAADSample.java | 39 +++++++++++++++++++ 3 files changed, 59 insertions(+), 6 deletions(-) rename sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/{ChatCompletionsResponseFormatJSON.java => ChatCompletionsResponseFormatJson.java} (100%) create mode 100644 sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatAADSample.java diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClientBuilder.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClientBuilder.java index 760ad8e0ea27..1b75bd6be63d 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClientBuilder.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClientBuilder.java @@ -65,6 +65,8 @@ public final class ChatCompletionsClientBuilder implements HttpTrait pipelinePolicies; + private String[] scopes = DEFAULT_SCOPES; + /** * Create an instance of the ChatCompletionsClientBuilder. */ @@ -195,7 +197,19 @@ public ChatCompletionsClientBuilder configuration(Configuration configuration) { @Generated @Override public ChatCompletionsClientBuilder credential(TokenCredential tokenCredential) { + return this.credential(tokenCredential, DEFAULT_SCOPES); + } + + /** + * Sets credential for client authentication. + * + * @param tokenCredential credential to authenticate with. + * @param scopes scope to authenticate against. + * @return the ChatCompletionsClientBuilder. + */ + public ChatCompletionsClientBuilder credential(TokenCredential tokenCredential, String[] scopes) { this.tokenCredential = tokenCredential; + this.scopes = scopes; return this; } @@ -239,7 +253,7 @@ public ChatCompletionsClientBuilder endpoint(String endpoint) { /** * Sets Service version. - * + * * @param serviceVersion the serviceVersion value. * @return the ChatCompletionsClientBuilder. */ @@ -257,7 +271,7 @@ public ChatCompletionsClientBuilder serviceVersion(ModelServiceVersion serviceVe /** * Sets The retry policy that will attempt to retry failed requests, if applicable. - * + * * @param retryPolicy the retryPolicy value. * @return the ChatCompletionsClientBuilder. */ @@ -269,7 +283,7 @@ public ChatCompletionsClientBuilder retryPolicy(RetryPolicy retryPolicy) { /** * Builds an instance of ChatCompletionsClientImpl with the provided parameters. - * + * * @return an instance of ChatCompletionsClientImpl. */ @Generated @@ -317,7 +331,7 @@ private HttpPipeline createHttpPipeline() { policies.add(new KeyCredentialPolicy("api-key", keyCredential)); } if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); + policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, scopes)); } this.pipelinePolicies.stream() .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) @@ -333,7 +347,7 @@ private HttpPipeline createHttpPipeline() { /** * Builds an instance of ChatCompletionsAsyncClient class. - * + * * @return an instance of ChatCompletionsAsyncClient. */ @Generated @@ -343,7 +357,7 @@ public ChatCompletionsAsyncClient buildAsyncClient() { /** * Builds an instance of ChatCompletionsClient class. - * + * * @return an instance of ChatCompletionsClient. */ @Generated diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatJSON.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatJson.java similarity index 100% rename from sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatJSON.java rename to sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatJson.java diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatAADSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatAADSample.java new file mode 100644 index 000000000000..170b80e3dbab --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatAADSample.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.usage; + +import com.azure.ai.inference.ChatCompletionsClient; +import com.azure.ai.inference.ChatCompletionsClientBuilder; +import com.azure.ai.inference.models.ChatChoice; +import com.azure.ai.inference.models.ChatCompletions; +import com.azure.core.credential.AccessToken; +import com.azure.core.credential.AzureKeyCredential; +import com.azure.core.credential.TokenCredential; +import com.azure.core.credential.TokenRequestContext; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public final class BasicChatAADSample { + /** + * @param args Unused. Arguments to the program. + */ + public static void main(String[] args) { + TokenCredential defaultCredential = new DefaultAzureCredentialBuilder().build(); + String[] scopes = new String[] { "https://cognitiveservices.azure.com/.default" }; + String endpoint = Configuration.getGlobalConfiguration().get("MODEL_ENDPOINT"); + ChatCompletionsClient client = new ChatCompletionsClientBuilder() + .credential(defaultCredential, scopes) + .endpoint(endpoint) + .buildClient(); + + String prompt = "Tell me 3 jokes about trains"; + + ChatCompletions completions = client.complete(prompt); + + for (ChatChoice choice : completions.getChoices()) { + System.out.printf("%s.%n", choice.getMessage().getContent()); + } + } +} From 569a7bace65b33488ca4ed80525635836a04c358 Mon Sep 17 00:00:00 2001 From: glenn Date: Mon, 26 Aug 2024 16:08:13 -0400 Subject: [PATCH 034/128] better explanation of auth scope setting in sample --- .../java/com/azure/ai/inference/usage/BasicChatAADSample.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatAADSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatAADSample.java index 170b80e3dbab..6309995bdf79 100644 --- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatAADSample.java +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatAADSample.java @@ -21,10 +21,13 @@ public final class BasicChatAADSample { */ public static void main(String[] args) { TokenCredential defaultCredential = new DefaultAzureCredentialBuilder().build(); + // Currently the auth scope needs to be set as below for Azure OpenAI resources using EntraID. + // For non-Azure OpenAI models (such as Cohere, Mistral, Llama, or Phi), comment out the line below. String[] scopes = new String[] { "https://cognitiveservices.azure.com/.default" }; String endpoint = Configuration.getGlobalConfiguration().get("MODEL_ENDPOINT"); ChatCompletionsClient client = new ChatCompletionsClientBuilder() .credential(defaultCredential, scopes) + //.credential(defaultCredential) // For non-Azure OpenAI models (such as Cohere, Mistral, Llama, or Phi) .endpoint(endpoint) .buildClient(); From 0159de4fa0fff86feee660bf389e4c14063f1590 Mon Sep 17 00:00:00 2001 From: glenn Date: Tue, 27 Aug 2024 09:33:55 -0400 Subject: [PATCH 035/128] allow mvn compile --- .../main/java/com/azure/ai/inference/models/EmbeddingItem.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingItem.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingItem.java index ece4584289df..89f34c3087df 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingItem.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingItem.java @@ -53,7 +53,7 @@ private EmbeddingItem(BinaryData embedding, int index) { * @return the embedding value. */ public List getEmbedding() { - return this.embedding.toObject(new TypeReference<>() { }); + return this.embedding.toObject(new TypeReference>() { }); } /** From 5f7e9e4a527991be15f0a6fbd6e60cc218159f54 Mon Sep 17 00:00:00 2001 From: glenn Date: Tue, 27 Aug 2024 10:56:24 -0400 Subject: [PATCH 036/128] create and allow playback for test recordings --- sdk/ai/azure-ai-inference/assets.json | 2 +- .../com/azure/ai/inference/ChatCompletionsClientTestBase.java | 4 +++- .../java/com/azure/ai/inference/EmbeddingsClientTestBase.java | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/sdk/ai/azure-ai-inference/assets.json b/sdk/ai/azure-ai-inference/assets.json index 6dbf72e5cd89..17d0d146c96c 100644 --- a/sdk/ai/azure-ai-inference/assets.json +++ b/sdk/ai/azure-ai-inference/assets.json @@ -2,5 +2,5 @@ "AssetsRepo" : "Azure/azure-sdk-assets", "AssetsRepoPrefixPath" : "java", "TagPrefix" : "java/ai/azure-ai-inference", - "Tag" : "" + "Tag" : "java/ai/azure-ai-inference_865a982f7d" } \ No newline at end of file diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java index fac65d099db1..5c639a20a9b6 100644 --- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java +++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java @@ -73,9 +73,11 @@ ChatCompletionsClientBuilder getChatCompletionsClientBuilder(HttpClient httpClie } private void addTestRecordCustomSanitizers() { + String sanitizedRequestUri = "https://REDACTED/"; + String requestUriRegex = "https://.*/openai/deployments/.*?/"; interceptorManager.addSanitizers(Arrays.asList( new TestProxySanitizer("$..key", null, "REDACTED", TestProxySanitizerType.BODY_KEY), - new TestProxySanitizer("$..endpoint", null, "https://REDACTED", TestProxySanitizerType.BODY_KEY), + new TestProxySanitizer("$..endpoint", requestUriRegex, sanitizedRequestUri, TestProxySanitizerType.URL), new TestProxySanitizer("Content-Type", "(^multipart\\/form-data; boundary=[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{2})", "multipart\\/form-data; boundary=BOUNDARY", TestProxySanitizerType.HEADER) )); diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsClientTestBase.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsClientTestBase.java index 029971b80216..312ecb596c9e 100644 --- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsClientTestBase.java +++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsClientTestBase.java @@ -95,9 +95,11 @@ ImageEmbeddingsClientBuilder getImageEmbeddingsClientBuilder(HttpClient httpClie } private void addTestRecordCustomSanitizers() { + String sanitizedRequestUri = "https://REDACTED/"; + String requestUriRegex = "https://.*/openai/deployments/.*?/"; interceptorManager.addSanitizers(Arrays.asList( new TestProxySanitizer("$..key", null, "REDACTED", TestProxySanitizerType.BODY_KEY), - new TestProxySanitizer("$..endpoint", null, "https://REDACTED", TestProxySanitizerType.BODY_KEY), + new TestProxySanitizer("$..endpoint", requestUriRegex, sanitizedRequestUri, TestProxySanitizerType.URL), new TestProxySanitizer("Content-Type", "(^multipart\\/form-data; boundary=[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{2})", "multipart\\/form-data; boundary=BOUNDARY", TestProxySanitizerType.HEADER) )); From 724c6cd075bac5044210b94b1d9d2e00b7392c9a Mon Sep 17 00:00:00 2001 From: glenn Date: Tue, 27 Aug 2024 12:22:24 -0400 Subject: [PATCH 037/128] change display name in ci.yml --- sdk/ai/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/ai/ci.yml b/sdk/ai/ci.yml index cd2382d15f1b..1e214c50d245 100644 --- a/sdk/ai/ci.yml +++ b/sdk/ai/ci.yml @@ -31,7 +31,7 @@ pr: parameters: - name: release_azureaiinference - displayName: azure-ai-inference + displayName: 'azure-ai-inference' type: boolean default: true From 7b5fd75eb9d588b9f8ee9e689ad2e3c993304c49 Mon Sep 17 00:00:00 2001 From: glenn Date: Tue, 27 Aug 2024 12:53:46 -0400 Subject: [PATCH 038/128] add codeowners --- .github/CODEOWNERS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index c2e735dca1a4..3e406a3eced1 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -64,6 +64,9 @@ # ServiceLabel: %Advisor # ServiceOwners: @mojayara @Prasanna-Padmanabhan +# PRLabel: %AI +/sdk/ai/azure-ai-inference/ @dargilco @jhakulin @glharper + # ServiceLabel: %AKS # ServiceOwners: @Azure/aks-pm From 0addf5c29e013a2fdb90817baf644f6aa4bb4862 Mon Sep 17 00:00:00 2001 From: glenn Date: Tue, 27 Aug 2024 13:09:36 -0400 Subject: [PATCH 039/128] kick off new build --- sdk/ai/azure-ai-inference/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/ai/azure-ai-inference/CHANGELOG.md b/sdk/ai/azure-ai-inference/CHANGELOG.md index 56fe2aa6db74..822b80162399 100644 --- a/sdk/ai/azure-ai-inference/CHANGELOG.md +++ b/sdk/ai/azure-ai-inference/CHANGELOG.md @@ -2,7 +2,7 @@ ## 1.0.0-beta.1 (Unreleased) -- Azure AI Inference client library for Java. This package contains Microsoft Azure AI Inference client library. +- Azure AI Inference client library for Java. This package contains Microsoft Azure AI Inference client library. ### Features Added From 2014db0a16c83fe44fbda8fb08dba6c63e274197 Mon Sep 17 00:00:00 2001 From: glenn Date: Tue, 27 Aug 2024 13:16:44 -0400 Subject: [PATCH 040/128] add tests.yml --- sdk/ai/tests.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 sdk/ai/tests.yml diff --git a/sdk/ai/tests.yml b/sdk/ai/tests.yml new file mode 100644 index 000000000000..e69de29bb2d1 From aa0b20b0a3055c22a8c7313b274457190bb01f0f Mon Sep 17 00:00:00 2001 From: glenn Date: Tue, 27 Aug 2024 13:20:48 -0400 Subject: [PATCH 041/128] remove EnableBatchRelease field --- sdk/ai/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sdk/ai/ci.yml b/sdk/ai/ci.yml index 1e214c50d245..c52361cf6f1b 100644 --- a/sdk/ai/ci.yml +++ b/sdk/ai/ci.yml @@ -39,9 +39,8 @@ extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: ServiceDirectory: ai - EnableBatchRelease: true Artifacts: - name: azure-ai-inference groupId: com.azure safeName: azureaiinference - releaseInBatch: ${{ parameters.release_azureaiinference }} \ No newline at end of file + releaseInBatch: ${{ parameters.release_azureaiinference }} From 169ef29db00e13068b2e93f296a6db8829439f06 Mon Sep 17 00:00:00 2001 From: glenn Date: Tue, 27 Aug 2024 13:49:04 -0400 Subject: [PATCH 042/128] update to pass codegen test --- .../azure/ai/inference/models/ChatRequestAssistantMessage.java | 3 +-- sdk/ai/azure-ai-inference/tsp-location.yaml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestAssistantMessage.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestAssistantMessage.java index 558db3eb368b..526e1d8b7da8 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestAssistantMessage.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestAssistantMessage.java @@ -40,12 +40,11 @@ public final class ChatRequestAssistantMessage extends ChatRequestMessage { /** * Creates an instance of ChatRequestAssistantMessage class. */ - @Generated public ChatRequestAssistantMessage() { } /** - * Creates an instance of ChatRequestUserMessage class. + * Creates an instance of ChatRequestAssistantMessage class. * * @param content the content value to set. */ diff --git a/sdk/ai/azure-ai-inference/tsp-location.yaml b/sdk/ai/azure-ai-inference/tsp-location.yaml index 3c18180587a8..8ad7e8b1ab33 100644 --- a/sdk/ai/azure-ai-inference/tsp-location.yaml +++ b/sdk/ai/azure-ai-inference/tsp-location.yaml @@ -1,4 +1,4 @@ -commit: 4bc47ae220d30299af3c56a062e917ea6a6db2ac +commit: 0491ed5c44ecde29ff289cf961daaa46a964eb77 additionalDirectories: [] repo: Azure/azure-rest-api-specs directory: specification/ai/ModelClient From 0b94392736f7e41cc9667569fcefa4b3fcf435cb Mon Sep 17 00:00:00 2001 From: glenn Date: Tue, 27 Aug 2024 13:58:34 -0400 Subject: [PATCH 043/128] use existing label --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 3e406a3eced1..e749f952f0dc 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -64,7 +64,7 @@ # ServiceLabel: %Advisor # ServiceOwners: @mojayara @Prasanna-Padmanabhan -# PRLabel: %AI +# PRLabel: %AI Model Inference /sdk/ai/azure-ai-inference/ @dargilco @jhakulin @glharper # ServiceLabel: %AKS From 4d36050b39d7039b95285b7f50dbc36d5577870f Mon Sep 17 00:00:00 2001 From: glenn Date: Tue, 27 Aug 2024 14:16:47 -0400 Subject: [PATCH 044/128] add ubinary to ignored words --- .vscode/cspell.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 61ca10fe854e..58ebfa37fb7e 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -836,6 +836,13 @@ "NDVI" ] }, + { + "filename": "/sdk/ai/**", + "words": [ + "ubinary", + "UBINARY" + ] + }, { "filename": "/sdk/datalakeanalytics/**", "words": [ From af336a38123335acbdd8cafa99e3d7b9df6aa903 Mon Sep 17 00:00:00 2001 From: glenn Date: Tue, 27 Aug 2024 14:57:05 -0400 Subject: [PATCH 045/128] use proper streaming types, remove delta from ChatChoice --- sdk/ai/azure-ai-inference/README.md | 2 +- .../inference/ChatCompletionsAsyncClient.java | 25 ++++++++++--------- .../ai/inference/ChatCompletionsClient.java | 25 ++++++++++--------- .../azure/ai/inference/models/ChatChoice.java | 23 +---------------- .../com/azure/ai/inference/ReadmeSamples.java | 2 +- .../inference/usage/StreamingChatSample.java | 4 +-- .../usage/StreamingChatSampleAsync.java | 2 +- .../ChatCompletionsClientTestBase.java | 9 ++----- .../ChatCompletionsSyncClientTest.java | 7 ++---- .../inference/EmbeddingsClientTestBase.java | 9 ------- 10 files changed, 36 insertions(+), 72 deletions(-) diff --git a/sdk/ai/azure-ai-inference/README.md b/sdk/ai/azure-ai-inference/README.md index b4d63f765cd0..a6c6e2458bb4 100644 --- a/sdk/ai/azure-ai-inference/README.md +++ b/sdk/ai/azure-ai-inference/README.md @@ -139,7 +139,7 @@ client.completeStreaming(new ChatCompletionsOptions(chatMessages)) if (CoreUtils.isNullOrEmpty(chatCompletions.getChoices())) { return; } - ChatResponseMessage delta = chatCompletions.getChoices().get(0).getDelta(); + StreamingChatResponseMessageUpdate delta = chatCompletions.getChoices().get(0).getDelta(); if (delta.getRole() != null) { System.out.println("Role = " + delta.getRole()); } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java index d5ce3e289cca..f7bfb60da69a 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java @@ -12,6 +12,7 @@ import com.azure.ai.inference.implementation.models.ExtraParameters; import com.azure.ai.inference.models.ChatCompletions; import com.azure.ai.inference.models.ModelInfo; +import com.azure.ai.inference.models.StreamingChatCompletionsUpdate; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; @@ -40,7 +41,7 @@ public final class ChatCompletionsAsyncClient { /** * Initializes an instance of ChatCompletionsAsyncClient class. - * + * * @param serviceClient the service client implementation. */ @Generated @@ -64,7 +65,7 @@ public final class ChatCompletionsAsyncClient { * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

- * + * *
{@code
      * {
      *     messages (Required): [
@@ -104,9 +105,9 @@ public final class ChatCompletionsAsyncClient {
      *     }
      * }
      * }
- * + * *

Response Body Schema

- * + * *
{@code
      * {
      *     id: String (Required)
@@ -139,7 +140,7 @@ public final class ChatCompletionsAsyncClient {
      *     ]
      * }
      * }
- * + * * @param completeRequest The completeRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -160,7 +161,7 @@ Mono> completeWithResponse(BinaryData completeRequest, Requ * Returns information about the AI model. * The method makes a REST API call to the `/info` route on the given endpoint. *

Response Body Schema

- * + * *
{@code
      * {
      *     model_name: String (Required)
@@ -168,7 +169,7 @@ Mono> completeWithResponse(BinaryData completeRequest, Requ
      *     model_provider_name: String (Required)
      * }
      * }
- * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -199,14 +200,14 @@ public Mono> getModelInfoWithResponse(RequestOptions reques * generate text that continues from or "completes" provided prompt data. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public Flux completeStreaming(ChatCompletionsOptions options) { + public Flux completeStreaming(ChatCompletionsOptions options) { options.setStream(true); RequestOptions requestOptions = new RequestOptions(); Flux responseStream = completeWithResponse(BinaryData.fromObject(options), requestOptions).flatMapMany(response -> response.getValue().toFluxByteBuffer()); - InferenceServerSentEvents chatCompletionsStream - = new InferenceServerSentEvents<>(responseStream, ChatCompletions.class); + InferenceServerSentEvents chatCompletionsStream + = new InferenceServerSentEvents<>(responseStream, StreamingChatCompletionsUpdate.class); return chatCompletionsStream.getEvents(); } @@ -234,7 +235,7 @@ public Mono complete(String prompt) { * Completions support a wide variety of tasks and generate text that continues from or "completes" * provided prompt data. The method makes a REST API call to the `/chat/completions` route * on the given endpoint. - * + * * @param options Options for complete API. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -276,7 +277,7 @@ public Mono complete(ChatCompletionsOptions options) { /** * Returns information about the AI model. * The method makes a REST API call to the `/info` route on the given endpoint. - * + * * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java index b9b5df151f54..23a7430c8376 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java @@ -12,6 +12,7 @@ import com.azure.ai.inference.implementation.ChatCompletionsUtils; import com.azure.ai.inference.models.ChatCompletions; import com.azure.ai.inference.models.ModelInfo; +import com.azure.ai.inference.models.StreamingChatCompletionsUpdate; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; @@ -39,7 +40,7 @@ public final class ChatCompletionsClient { /** * Initializes an instance of ChatCompletionsClient class. - * + * * @param serviceClient the service client implementation. */ @Generated @@ -63,7 +64,7 @@ public final class ChatCompletionsClient { * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

- * + * *
{@code
      * {
      *     messages (Required): [
@@ -103,9 +104,9 @@ public final class ChatCompletionsClient {
      *     }
      * }
      * }
- * + * *

Response Body Schema

- * + * *
{@code
      * {
      *     id: String (Required)
@@ -138,7 +139,7 @@ public final class ChatCompletionsClient {
      *     ]
      * }
      * }
- * + * * @param completeRequest The completeRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -159,7 +160,7 @@ Response completeWithResponse(BinaryData completeRequest, RequestOpt * Returns information about the AI model. * The method makes a REST API call to the `/info` route on the given endpoint. *

Response Body Schema

- * + * *
{@code
      * {
      *     model_name: String (Required)
@@ -167,7 +168,7 @@ Response completeWithResponse(BinaryData completeRequest, RequestOpt
      *     model_provider_name: String (Required)
      * }
      * }
- * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -186,7 +187,7 @@ public Response getModelInfoWithResponse(RequestOptions requestOptio * Completions support a wide variety of tasks and generate text that continues from or "completes" * provided prompt data. The method makes a REST API call to the `/chat/completions` route * on the given endpoint. - * + * * @param options Options for complete API. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -259,7 +260,7 @@ public ChatCompletions complete(String prompt) { * generate text that continues from or "completes" provided prompt data. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public IterableStream completeStreaming(ChatCompletionsOptions options) { + public IterableStream completeStreaming(ChatCompletionsOptions options) { options.setStream(true); RequestOptions requestOptions = new RequestOptions(); CompleteRequest completeRequestObj @@ -282,8 +283,8 @@ public IterableStream completeStreaming(ChatCompletionsOptions } Flux responseStream = completeStreamingWithResponse( completeRequest, requestOptions).getValue().toFluxByteBuffer(); - InferenceServerSentEvents chatCompletionsStream - = new InferenceServerSentEvents<>(responseStream, ChatCompletions.class); + InferenceServerSentEvents chatCompletionsStream + = new InferenceServerSentEvents<>(responseStream, StreamingChatCompletionsUpdate.class); return new IterableStream<>(chatCompletionsStream.getEvents()); } @@ -368,7 +369,7 @@ public Response completeStreamingWithResponse(BinaryData chatComplet /** * Returns information about the AI model. * The method makes a REST API call to the `/info` route on the given endpoint. - * + * * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatChoice.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatChoice.java index bee8fb31b29b..5662fec338f5 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatChoice.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatChoice.java @@ -37,12 +37,6 @@ public final class ChatChoice implements JsonSerializable { @Generated private final ChatResponseMessage message; - /* - * The delta message content for a streaming response. - */ - @Generated - private ChatResponseMessage delta; - /** * Creates an instance of ChatChoice class. * @@ -67,15 +61,6 @@ public int getIndex() { return this.index; } - /** - * Get the delta property: The delta message content for a streaming response. - * - * @return the delta value. - */ - public ChatResponseMessage getDelta() { - return this.delta; - } - /** * Get the finishReason property: The reason that this chat completions choice completed its generated. * @@ -105,7 +90,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeIntField("index", this.index); jsonWriter.writeStringField("finish_reason", this.finishReason == null ? null : this.finishReason.toString()); jsonWriter.writeJsonField("message", this.message); - jsonWriter.writeJsonField("delta", this.delta); return jsonWriter.writeEndObject(); } @@ -123,7 +107,6 @@ public static ChatChoice fromJson(JsonReader jsonReader) throws IOException { int index = 0; CompletionsFinishReason finishReason = null; ChatResponseMessage message = null; - ChatResponseMessage delta = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -132,8 +115,6 @@ public static ChatChoice fromJson(JsonReader jsonReader) throws IOException { index = reader.getInt(); } else if ("finish_reason".equals(fieldName)) { finishReason = CompletionsFinishReason.fromString(reader.getString()); - } else if ("delta".equals(fieldName)) { - delta = ChatResponseMessage.fromJson(reader); } else if ("message".equals(fieldName)) { message = ChatResponseMessage.fromJson(reader); } else { @@ -141,9 +122,7 @@ public static ChatChoice fromJson(JsonReader jsonReader) throws IOException { } } - ChatChoice deserializedChatChoice = new ChatChoice(index, finishReason, message); - deserializedChatChoice.delta = delta; - return deserializedChatChoice; + return new ChatChoice(index, finishReason, message); }); } } diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/ReadmeSamples.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/ReadmeSamples.java index 82079c7302b6..a04c12476732 100644 --- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/ReadmeSamples.java +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/ReadmeSamples.java @@ -88,7 +88,7 @@ public void getChatCompletionsStream() { if (CoreUtils.isNullOrEmpty(chatCompletions.getChoices())) { return; } - ChatResponseMessage delta = chatCompletions.getChoices().get(0).getDelta(); + StreamingChatResponseMessageUpdate delta = chatCompletions.getChoices().get(0).getDelta(); if (delta.getRole() != null) { System.out.println("Role = " + delta.getRole()); } diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java index 093b626d389b..b77f87331c33 100644 --- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java @@ -34,7 +34,7 @@ public static void main(String[] args) { chatMessages.add(new ChatRequestAssistantMessage("Of course, me hearty! What can I do for ye?")); chatMessages.add(ChatRequestUserMessage.fromString("What's the best way to train a parrot?")); - IterableStream chatCompletionsStream = client.completeStreaming( + IterableStream chatCompletionsStream = client.completeStreaming( new ChatCompletionsOptions(chatMessages)); // The delta is the message content for a streaming response. @@ -58,7 +58,7 @@ public static void main(String[] args) { return; } - ChatResponseMessage delta = chatCompletions.getChoices().get(0).getDelta(); + StreamingChatResponseMessageUpdate delta = chatCompletions.getChoices().get(0).getDelta(); if (delta.getRole() != null) { System.out.println("Role = " + delta.getRole()); diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSampleAsync.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSampleAsync.java index 0063e67b566b..5927cd945472 100644 --- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSampleAsync.java +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSampleAsync.java @@ -56,7 +56,7 @@ public static void main(String[] args) throws InterruptedException { return ""; } - ChatResponseMessage delta = chatCompletions.getChoices().get(0).getDelta(); + StreamingChatResponseMessageUpdate delta = chatCompletions.getChoices().get(0).getDelta(); if (delta.getRole() != null) { System.out.println("Role = " + delta.getRole()); diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java index 5c639a20a9b6..b00610f4e6fc 100644 --- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java +++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java @@ -8,12 +8,7 @@ // If you wish to modify these files, please copy them out of the 'generated' package, and modify there. // See https://aka.ms/azsdk/dpg/java/tests for guide on adding a test. -import com.azure.ai.inference.models.ChatChoice; -import com.azure.ai.inference.models.ChatCompletions; -import com.azure.ai.inference.models.ChatRequestMessage; -import com.azure.ai.inference.models.ChatRequestUserMessage; -import com.azure.ai.inference.models.ChatRequestSystemMessage; -import com.azure.ai.inference.models.ChatRequestAssistantMessage; +import com.azure.ai.inference.models.*; import com.azure.core.credential.AzureKeyCredential; import com.azure.core.http.HttpClient; import com.azure.core.test.TestMode; @@ -98,7 +93,7 @@ void getStreamingChatCompletionsRunner(Consumer> testRu testRunner.accept(getChatMessages()); } - static void assertCompletionsStream(ChatCompletions chatCompletions) { + static void assertCompletionsStream(StreamingChatCompletionsUpdate chatCompletions) { if (chatCompletions.getId() != null && !chatCompletions.getId().isEmpty()) { assertNotNull(chatCompletions.getId()); assertNotNull(chatCompletions.getChoices()); diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java index 023635822bf6..0851252756f0 100644 --- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java +++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java @@ -2,10 +2,7 @@ // Licensed under the MIT License. package com.azure.ai.inference; -import com.azure.ai.inference.models.ChatCompletionsOptions; -import com.azure.ai.inference.models.ChatCompletions; -import com.azure.ai.inference.models.ChatRequestMessage; -import com.azure.ai.inference.models.ChatRequestUserMessage; +import com.azure.ai.inference.models.*; import com.azure.core.http.HttpClient; import com.azure.core.util.IterableStream; @@ -44,7 +41,7 @@ public void testGetCompletionsStream(HttpClient httpClient) { getChatCompletionsRunner((prompt) -> { List chatMessages = new ArrayList<>(); chatMessages.add(ChatRequestUserMessage.fromString(prompt)); - IterableStream resultCompletions = client.completeStreaming(new ChatCompletionsOptions(chatMessages)); + IterableStream resultCompletions = client.completeStreaming(new ChatCompletionsOptions(chatMessages)); assertTrue(resultCompletions.stream().toArray().length > 1); resultCompletions.forEach(ChatCompletionsClientTestBase::assertCompletionsStream); }); diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsClientTestBase.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsClientTestBase.java index 312ecb596c9e..616abe5fadd0 100644 --- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsClientTestBase.java +++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsClientTestBase.java @@ -116,15 +116,6 @@ void getEmbeddingsRunner(Consumer> testRunner) { testRunner.accept(getPrompts()); } - static void assertCompletionsStream(ChatCompletions chatCompletions) { - if (chatCompletions.getId() != null && !chatCompletions.getId().isEmpty()) { - assertNotNull(chatCompletions.getId()); - assertNotNull(chatCompletions.getChoices()); - assertFalse(chatCompletions.getChoices().isEmpty()); - assertNotNull(chatCompletions.getChoices().get(0).getDelta()); - } - } - static void assertEmbeddings(EmbeddingsResult actual) { List data = actual.getData(); assertNotNull(data); From c7666940e7b893672f1a6c9c1b482977c86c6e78 Mon Sep 17 00:00:00 2001 From: Glenn Harper Date: Tue, 27 Aug 2024 12:37:42 -0700 Subject: [PATCH 046/128] rename getEmbedding to getEmbeddingList, add auto-genned method --- .../com/azure/ai/inference/models/EmbeddingItem.java | 12 ++++++++++-- .../ai/inference/models/FunctionDefinition.java | 3 +-- .../inference/usage/TextEmbeddingsAsyncSample.java | 3 +-- .../ai/inference/usage/TextEmbeddingsSample.java | 2 +- .../azure/ai/inference/EmbeddingsClientTestBase.java | 2 +- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingItem.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingItem.java index 89f34c3087df..61ff3763bba6 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingItem.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingItem.java @@ -13,7 +13,6 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; -import java.util.Base64; import java.util.List; /** @@ -52,7 +51,16 @@ private EmbeddingItem(BinaryData embedding, int index) { * * @return the embedding value. */ - public List getEmbedding() { + @Generated + public BinaryData getEmbedding() { return this.embedding; } + + /** + * Get the embedding property: List of embedding values for the input prompt. These represent a measurement of the + * vector-based relatedness of the provided input. Or a base64 encoded string of the embedding vector. + * + * @return the embeddings as a list of floats. + */ + public List getEmbeddingList() { return this.embedding.toObject(new TypeReference>() { }); } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java index 8d4606e02082..fd6835462efe 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java @@ -11,7 +11,6 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; -import java.util.Map; /** * The definition of a caller-specified function that chat completions may invoke in response to matching user input. @@ -100,7 +99,7 @@ public Object getParameters() { * @return the FunctionDefinition object itself. */ @Generated - public FunctionDefinition setParameters(Map parameters) { + public FunctionDefinition setParameters(Object parameters) { this.parameters = parameters; return this; } diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TextEmbeddingsAsyncSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TextEmbeddingsAsyncSample.java index c3d6c9be1a0a..7864dc6db701 100644 --- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TextEmbeddingsAsyncSample.java +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TextEmbeddingsAsyncSample.java @@ -5,7 +5,6 @@ package com.azure.ai.inference.usage; import com.azure.ai.inference.EmbeddingsAsyncClient; -import com.azure.ai.inference.EmbeddingsClient; import com.azure.ai.inference.EmbeddingsClientBuilder; import com.azure.ai.inference.models.*; import com.azure.core.credential.AzureKeyCredential; @@ -36,7 +35,7 @@ public static void main(String[] args) throws InterruptedException { for (EmbeddingItem item : embeddings.getData()) { System.out.printf("Index: %d.%n", item.getIndex()); System.out.println("Embedding as list of floats: "); - for (Float embedding : item.getEmbedding()) { + for (Float embedding : item.getEmbeddingList()) { System.out.printf("%f;", embedding); } } diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TextEmbeddingsSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TextEmbeddingsSample.java index 25afc1dafeb1..62a9341bf542 100644 --- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TextEmbeddingsSample.java +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TextEmbeddingsSample.java @@ -34,7 +34,7 @@ public static void main(String[] args) { for (EmbeddingItem item : embeddings.getData()) { System.out.printf("Index: %d.%n", item.getIndex()); - for (Float embedding : item.getEmbedding()) { + for (Float embedding : item.getEmbeddingList()) { System.out.printf("%f;", embedding); } } diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsClientTestBase.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsClientTestBase.java index 616abe5fadd0..23fc9c51d96a 100644 --- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsClientTestBase.java +++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsClientTestBase.java @@ -122,7 +122,7 @@ static void assertEmbeddings(EmbeddingsResult actual) { assertFalse(data.isEmpty()); for (EmbeddingItem item : data) { - List embedding = item.getEmbedding(); + List embedding = item.getEmbeddingList(); assertNotNull(embedding); assertFalse(embedding.isEmpty()); } From ba30dfe1f86791f0cb863f55532a2016674a3bce Mon Sep 17 00:00:00 2001 From: glenn Date: Tue, 27 Aug 2024 20:54:33 -0400 Subject: [PATCH 047/128] make getModelInfo public for java --- sdk/ai/azure-ai-inference/tsp-location.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/ai/azure-ai-inference/tsp-location.yaml b/sdk/ai/azure-ai-inference/tsp-location.yaml index 8ad7e8b1ab33..454ad94000ae 100644 --- a/sdk/ai/azure-ai-inference/tsp-location.yaml +++ b/sdk/ai/azure-ai-inference/tsp-location.yaml @@ -1,4 +1,4 @@ -commit: 0491ed5c44ecde29ff289cf961daaa46a964eb77 +commit: 5ef43a1baf96f201b1c1751ecbfb5f772404fe33 additionalDirectories: [] repo: Azure/azure-rest-api-specs directory: specification/ai/ModelClient From 3c80a48fd390032487a06c221a4d1ff5d048d0bf Mon Sep 17 00:00:00 2001 From: glenn Date: Tue, 27 Aug 2024 21:50:23 -0400 Subject: [PATCH 048/128] use Json instead of JSON in class/file name --- sdk/ai/azure-ai-inference/tsp-location.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/ai/azure-ai-inference/tsp-location.yaml b/sdk/ai/azure-ai-inference/tsp-location.yaml index 454ad94000ae..4d9819b9a129 100644 --- a/sdk/ai/azure-ai-inference/tsp-location.yaml +++ b/sdk/ai/azure-ai-inference/tsp-location.yaml @@ -1,4 +1,4 @@ -commit: 5ef43a1baf96f201b1c1751ecbfb5f772404fe33 +commit: 01059a3a0949c7be396636f36d0f2266910fa3eb additionalDirectories: [] repo: Azure/azure-rest-api-specs directory: specification/ai/ModelClient From 7d6787341077af124e2ad7e95f4dbd18da2fc2bf Mon Sep 17 00:00:00 2001 From: glenn Date: Tue, 27 Aug 2024 21:52:36 -0400 Subject: [PATCH 049/128] sync ChatChoice with TS output --- .../main/java/com/azure/ai/inference/models/ChatChoice.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatChoice.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatChoice.java index 5662fec338f5..1d062e7d2eb5 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatChoice.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatChoice.java @@ -84,6 +84,7 @@ public ChatResponseMessage getMessage() { /** * {@inheritDoc} */ + @Generated @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); @@ -102,6 +103,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the ChatChoice. */ + @Generated public static ChatChoice fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { int index = 0; @@ -121,7 +123,6 @@ public static ChatChoice fromJson(JsonReader jsonReader) throws IOException { reader.skipChildren(); } } - return new ChatChoice(index, finishReason, message); }); } From 00e5ff551698a2e3a290dfbca075b0350143bf93 Mon Sep 17 00:00:00 2001 From: glenn Date: Wed, 28 Aug 2024 08:30:30 -0400 Subject: [PATCH 050/128] set partial-update to true --- sdk/ai/azure-ai-inference/tsp-location.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/ai/azure-ai-inference/tsp-location.yaml b/sdk/ai/azure-ai-inference/tsp-location.yaml index 4d9819b9a129..63a526da6360 100644 --- a/sdk/ai/azure-ai-inference/tsp-location.yaml +++ b/sdk/ai/azure-ai-inference/tsp-location.yaml @@ -1,4 +1,4 @@ -commit: 01059a3a0949c7be396636f36d0f2266910fa3eb +commit: 14a23cfe23884571e6971feebfa56fb4f64dd4a7 additionalDirectories: [] repo: Azure/azure-rest-api-specs directory: specification/ai/ModelClient From c41b3763daa66d0a119662d45382b97ad0d3bcf0 Mon Sep 17 00:00:00 2001 From: glenn Date: Wed, 28 Aug 2024 09:40:16 -0400 Subject: [PATCH 051/128] codegen more closely synced --- .../inference/ChatCompletionsAsyncClient.java | 33 +++++----- .../ai/inference/ChatCompletionsClient.java | 61 +++++++++--------- .../ChatCompletionsClientBuilder.java | 7 ++- .../ai/inference/EmbeddingsAsyncClient.java | 11 ++-- .../azure/ai/inference/EmbeddingsClient.java | 11 ++-- .../ai/inference/EmbeddingsClientBuilder.java | 12 ++-- .../inference/ImageEmbeddingsAsyncClient.java | 14 ++--- .../ai/inference/ImageEmbeddingsClient.java | 14 ++--- .../ImageEmbeddingsClientBuilder.java | 12 ++-- .../ChatCompletionsClientImpl.java | 8 +-- .../models/CompleteRequest.java | 63 +++++++++---------- .../implementation/models/EmbedRequest.java | 31 +++++---- .../implementation/models/EmbedRequest1.java | 31 +++++---- .../models/ExtraParameters.java | 8 +-- .../implementation/models/package-info.java | 1 - .../implementation/package-info.java | 1 - .../azure/ai/inference/models/ChatChoice.java | 3 +- .../ai/inference/models/ChatCompletions.java | 17 +++-- .../ChatCompletionsFunctionToolSelection.java | 9 ++- .../ChatCompletionsNamedToolSelection.java | 11 ++-- .../models/ChatCompletionsResponseFormat.java | 11 ++-- .../ChatCompletionsResponseFormatJson.java | 8 +-- .../ChatCompletionsResponseFormatText.java | 8 +-- .../models/ChatCompletionsToolCall.java | 13 ++-- .../models/ChatCompletionsToolDefinition.java | 11 ++-- .../ChatCompletionsToolSelectionPreset.java | 8 +-- .../models/ChatMessageContentItem.java | 11 ++-- .../models/ChatMessageImageContentItem.java | 12 ++-- .../models/ChatMessageImageDetailLevel.java | 8 +-- .../inference/models/ChatMessageImageUrl.java | 14 ++--- .../models/ChatMessageTextContentItem.java | 12 ++-- .../models/ChatRequestAssistantMessage.java | 5 +- .../inference/models/ChatRequestMessage.java | 11 ++-- .../models/ChatRequestSystemMessage.java | 12 ++-- .../models/ChatRequestToolMessage.java | 14 ++--- .../models/ChatRequestUserMessage.java | 15 ++--- .../inference/models/ChatResponseMessage.java | 14 ++--- .../azure/ai/inference/models/ChatRole.java | 8 +-- .../models/CompletionsFinishReason.java | 8 +-- .../ai/inference/models/CompletionsUsage.java | 13 ++-- .../models/EmbeddingEncodingFormat.java | 8 +-- .../ai/inference/models/EmbeddingInput.java | 14 ++--- .../inference/models/EmbeddingInputType.java | 8 +-- .../ai/inference/models/EmbeddingItem.java | 12 ++-- .../ai/inference/models/EmbeddingsResult.java | 13 ++-- .../ai/inference/models/EmbeddingsUsage.java | 11 ++-- .../ai/inference/models/FunctionCall.java | 11 ++-- .../inference/models/FunctionDefinition.java | 4 +- .../azure/ai/inference/models/ModelInfo.java | 13 ++-- .../azure/ai/inference/models/ModelType.java | 8 +-- .../models/StreamingChatChoiceUpdate.java | 13 ++-- .../StreamingChatCompletionsUpdate.java | 17 +++-- .../StreamingChatResponseMessageUpdate.java | 12 ++-- .../StreamingChatResponseToolCallUpdate.java | 11 ++-- .../ai/inference/models/package-info.java | 1 - .../com/azure/ai/inference/package-info.java | 1 - .../src/main/java/module-info.java | 2 +- ...azure-ai-inference_apiview_properties.json | 2 +- 58 files changed, 332 insertions(+), 403 deletions(-) diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java index f7bfb60da69a..5effaabf2b3b 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java @@ -1,18 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference; import com.azure.ai.inference.implementation.ChatCompletionsClientImpl; -import com.azure.ai.inference.implementation.InferenceServerSentEvents; -import com.azure.ai.inference.implementation.ChatCompletionsUtils; -import com.azure.ai.inference.models.ChatCompletionsOptions; import com.azure.ai.inference.implementation.models.CompleteRequest; import com.azure.ai.inference.implementation.models.ExtraParameters; import com.azure.ai.inference.models.ChatCompletions; import com.azure.ai.inference.models.ModelInfo; -import com.azure.ai.inference.models.StreamingChatCompletionsUpdate; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; @@ -28,7 +23,10 @@ import com.azure.core.util.FluxUtil; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; - +import com.azure.ai.inference.implementation.InferenceServerSentEvents; +import com.azure.ai.inference.implementation.ChatCompletionsUtils; +import com.azure.ai.inference.models.ChatCompletionsOptions; +import com.azure.ai.inference.models.StreamingChatCompletionsUpdate; import java.nio.ByteBuffer; /** @@ -36,6 +34,7 @@ */ @ServiceClient(builder = ChatCompletionsClientBuilder.class, isAsync = true) public final class ChatCompletionsAsyncClient { + @Generated private final ChatCompletionsClientImpl serviceClient; @@ -65,7 +64,7 @@ public final class ChatCompletionsAsyncClient { * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

- * + * *
{@code
      * {
      *     messages (Required): [
@@ -91,9 +90,7 @@ public final class ChatCompletionsAsyncClient {
      *             function (Required): {
      *                 name: String (Required)
      *                 description: String (Optional)
-     *                 parameters (Optional): {
-     *                     String: Object (Required)
-     *                 }
+     *                 parameters: Object (Optional)
      *             }
      *         }
      *     ]
@@ -105,9 +102,9 @@ public final class ChatCompletionsAsyncClient {
      *     }
      * }
      * }
- * + * *

Response Body Schema

- * + * *
{@code
      * {
      *     id: String (Required)
@@ -161,7 +158,7 @@ Mono> completeWithResponse(BinaryData completeRequest, Requ
      * Returns information about the AI model.
      * The method makes a REST API call to the `/info` route on the given endpoint.
      * 

Response Body Schema

- * + * *
{@code
      * {
      *     model_name: String (Required)
@@ -180,7 +177,7 @@ Mono> completeWithResponse(BinaryData completeRequest, Requ
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
-    public Mono> getModelInfoWithResponse(RequestOptions requestOptions) {
+    Mono> getModelInfoWithResponse(RequestOptions requestOptions) {
         return this.serviceClient.getModelInfoWithResponseAsync(requestOptions);
     }
 
@@ -203,9 +200,8 @@ public Mono> getModelInfoWithResponse(RequestOptions reques
     public Flux completeStreaming(ChatCompletionsOptions options) {
         options.setStream(true);
         RequestOptions requestOptions = new RequestOptions();
-        Flux responseStream
-            = completeWithResponse(BinaryData.fromObject(options),
-            requestOptions).flatMapMany(response -> response.getValue().toFluxByteBuffer());
+        Flux responseStream = completeWithResponse(BinaryData.fromObject(options), requestOptions)
+            .flatMapMany(response -> response.getValue().toFluxByteBuffer());
         InferenceServerSentEvents chatCompletionsStream
             = new InferenceServerSentEvents<>(responseStream, StreamingChatCompletionsUpdate.class);
         return chatCompletionsStream.getEvents();
@@ -247,7 +243,6 @@ public Mono complete(String prompt) {
      * Completions support a wide variety of tasks and generate text that continues from or "completes"
      * provided prompt data on successful completion of {@link Mono}.
      */
-    @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono complete(ChatCompletionsOptions options) {
         // Generated convenience method for completeWithResponse
@@ -287,7 +282,7 @@ public Mono complete(ChatCompletionsOptions options) {
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
-    public Mono getModelInfo() {
+    Mono getModelInfo() {
         // Generated convenience method for getModelInfoWithResponse
         RequestOptions requestOptions = new RequestOptions();
         return getModelInfoWithResponse(requestOptions).flatMap(FluxUtil::toMono)
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java
index 23a7430c8376..fd9a5a0904ec 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java
@@ -1,18 +1,13 @@
 // Copyright (c) Microsoft Corporation. All rights reserved.
 // Licensed under the MIT License.
 // Code generated by Microsoft (R) TypeSpec Code Generator.
-
 package com.azure.ai.inference;
 
 import com.azure.ai.inference.implementation.ChatCompletionsClientImpl;
-import com.azure.ai.inference.implementation.InferenceServerSentEvents;
-import com.azure.ai.inference.models.ChatCompletionsOptions;
 import com.azure.ai.inference.implementation.models.CompleteRequest;
 import com.azure.ai.inference.implementation.models.ExtraParameters;
-import com.azure.ai.inference.implementation.ChatCompletionsUtils;
 import com.azure.ai.inference.models.ChatCompletions;
 import com.azure.ai.inference.models.ModelInfo;
-import com.azure.ai.inference.models.StreamingChatCompletionsUpdate;
 import com.azure.core.annotation.Generated;
 import com.azure.core.annotation.ReturnType;
 import com.azure.core.annotation.ServiceClient;
@@ -25,9 +20,12 @@
 import com.azure.core.http.rest.RequestOptions;
 import com.azure.core.http.rest.Response;
 import com.azure.core.util.BinaryData;
+import com.azure.ai.inference.implementation.InferenceServerSentEvents;
+import com.azure.ai.inference.models.ChatCompletionsOptions;
+import com.azure.ai.inference.implementation.ChatCompletionsUtils;
+import com.azure.ai.inference.models.StreamingChatCompletionsUpdate;
 import com.azure.core.util.IterableStream;
 import reactor.core.publisher.Flux;
-
 import java.nio.ByteBuffer;
 
 /**
@@ -35,6 +33,7 @@
  */
 @ServiceClient(builder = ChatCompletionsClientBuilder.class)
 public final class ChatCompletionsClient {
+
     @Generated
     private final ChatCompletionsClientImpl serviceClient;
 
@@ -64,7 +63,7 @@ public final class ChatCompletionsClient {
      * 
      * You can add these to a request with {@link RequestOptions#addHeader}
      * 

Request Body Schema

- * + * *
{@code
      * {
      *     messages (Required): [
@@ -90,9 +89,7 @@ public final class ChatCompletionsClient {
      *             function (Required): {
      *                 name: String (Required)
      *                 description: String (Optional)
-     *                 parameters (Optional): {
-     *                     String: Object (Required)
-     *                 }
+     *                 parameters: Object (Optional)
      *             }
      *         }
      *     ]
@@ -104,9 +101,9 @@ public final class ChatCompletionsClient {
      *     }
      * }
      * }
- * + * *

Response Body Schema

- * + * *
{@code
      * {
      *     id: String (Required)
@@ -160,7 +157,7 @@ Response completeWithResponse(BinaryData completeRequest, RequestOpt
      * Returns information about the AI model.
      * The method makes a REST API call to the `/info` route on the given endpoint.
      * 

Response Body Schema

- * + * *
{@code
      * {
      *     model_name: String (Required)
@@ -178,7 +175,7 @@ Response completeWithResponse(BinaryData completeRequest, RequestOpt
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
-    public Response getModelInfoWithResponse(RequestOptions requestOptions) {
+    Response getModelInfoWithResponse(RequestOptions requestOptions) {
         return this.serviceClient.getModelInfoWithResponse(requestOptions);
     }
 
@@ -199,7 +196,6 @@ public Response getModelInfoWithResponse(RequestOptions requestOptio
      * Completions support a wide variety of tasks and generate text that continues from or "completes"
      * provided prompt data.
      */
-    @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
     ChatCompletions complete(ChatCompletionsOptions options) {
         // Generated convenience method for completeWithResponse
@@ -236,7 +232,8 @@ ChatCompletions complete(ChatCompletionsOptions options) {
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
      * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
-     * @return chat completions for the provided input prompts. Chat completions support a wide variety of tasks and generate text
+     * @return chat completions for the provided input prompts. Chat completions support a wide variety of tasks and
+     * generate text
      * that continues from or "completes" provided prompt data.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
@@ -265,24 +262,24 @@ public IterableStream completeStreaming(ChatComp
         RequestOptions requestOptions = new RequestOptions();
         CompleteRequest completeRequestObj
             = new CompleteRequest(options.getMessages()).setFrequencyPenalty(options.getFrequencyPenalty())
-            .setStream(options.isStream())
-            .setPresencePenalty(options.getPresencePenalty())
-            .setTemperature(options.getTemperature())
-            .setTopP(options.getTopP())
-            .setMaxTokens(options.getMaxTokens())
-            .setResponseFormat(options.getResponseFormat())
-            .setStop(options.getStop())
-            .setTools(options.getTools())
-            .setToolChoice(options.getToolChoice())
-            .setSeed(options.getSeed())
-            .setModel(options.getModel());
+                .setStream(options.isStream())
+                .setPresencePenalty(options.getPresencePenalty())
+                .setTemperature(options.getTemperature())
+                .setTopP(options.getTopP())
+                .setMaxTokens(options.getMaxTokens())
+                .setResponseFormat(options.getResponseFormat())
+                .setStop(options.getStop())
+                .setTools(options.getTools())
+                .setToolChoice(options.getToolChoice())
+                .setSeed(options.getSeed())
+                .setModel(options.getModel());
         BinaryData completeRequest = BinaryData.fromObject(completeRequestObj);
         ExtraParameters extraParams = options.getExtraParams();
         if (extraParams != null) {
             requestOptions.setHeader(HttpHeaderName.fromString("extra-parameters"), extraParams.toString());
         }
-        Flux responseStream = completeStreamingWithResponse(
-            completeRequest, requestOptions).getValue().toFluxByteBuffer();
+        Flux responseStream
+            = completeStreamingWithResponse(completeRequest, requestOptions).getValue().toFluxByteBuffer();
         InferenceServerSentEvents chatCompletionsStream
             = new InferenceServerSentEvents<>(responseStream, StreamingChatCompletionsUpdate.class);
         return new IterableStream<>(chatCompletionsStream.getEvents());
@@ -351,6 +348,7 @@ public IterableStream completeStreaming(ChatComp
      * }
* * (when using non-Azure OpenAI) to use for this request. + * * @param chatCompletionsOptions The configuration information for a chat completions request. Completions support a * wide variety of tasks and generate text that continues from or "completes" provided prompt data. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -362,7 +360,8 @@ public IterableStream completeStreaming(ChatComp * text that continues from or "completes" provided prompt data along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response completeStreamingWithResponse(BinaryData chatCompletionsOptions, RequestOptions requestOptions) { + public Response completeStreamingWithResponse(BinaryData chatCompletionsOptions, + RequestOptions requestOptions) { return serviceClient.completeWithResponse(chatCompletionsOptions, requestOptions); } @@ -379,7 +378,7 @@ public Response completeStreamingWithResponse(BinaryData chatComplet */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public ModelInfo getModelInfo() { + ModelInfo getModelInfo() { // Generated convenience method for getModelInfoWithResponse RequestOptions requestOptions = new RequestOptions(); return getModelInfoWithResponse(requestOptions).getValue().toObject(ModelInfo.class); diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClientBuilder.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClientBuilder.java index 1b75bd6be63d..af937872ca02 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClientBuilder.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClientBuilder.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference; import com.azure.ai.inference.implementation.ChatCompletionsClientImpl; @@ -50,6 +49,7 @@ public final class ChatCompletionsClientBuilder implements HttpTrait, ConfigurationTrait, TokenCredentialTrait, KeyCredentialTrait, EndpointTrait { + @Generated private static final String SDK_NAME = "name"; @@ -197,7 +197,8 @@ public ChatCompletionsClientBuilder configuration(Configuration configuration) { @Generated @Override public ChatCompletionsClientBuilder credential(TokenCredential tokenCredential) { - return this.credential(tokenCredential, DEFAULT_SCOPES); + this.tokenCredential = tokenCredential; + return this; } /** @@ -331,7 +332,7 @@ private HttpPipeline createHttpPipeline() { policies.add(new KeyCredentialPolicy("api-key", keyCredential)); } if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, scopes)); + policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); } this.pipelinePolicies.stream() .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java index 16eb85c72ae9..bf320aa92d77 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference; import com.azure.ai.inference.implementation.EmbeddingsClientImpl; @@ -32,6 +31,7 @@ */ @ServiceClient(builder = EmbeddingsClientBuilder.class, isAsync = true) public final class EmbeddingsAsyncClient { + @Generated private final EmbeddingsClientImpl serviceClient; @@ -59,7 +59,7 @@ public final class EmbeddingsAsyncClient { * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

- * + * *
{@code
      * {
      *     input (Required): [
@@ -74,9 +74,9 @@ public final class EmbeddingsAsyncClient {
      *     }
      * }
      * }
- * + * *

Response Body Schema

- * + * *
{@code
      * {
      *     data (Required): [
@@ -114,7 +114,7 @@ Mono> embedWithResponse(BinaryData embedRequest, RequestOpt
      * Returns information about the AI model.
      * The method makes a REST API call to the `/info` route on the given endpoint.
      * 

Response Body Schema

- * + * *
{@code
      * {
      *     model_name: String (Required)
@@ -199,7 +199,6 @@ Mono embed(List input, Integer dimensions, EmbeddingEn
      * Embeddings measure the relatedness of text strings and are commonly used for search, clustering,
      * recommendations, and other similar scenarios on successful completion of {@link Mono}.
      */
-    @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono embed(List input) {
         // Generated convenience method for embedWithResponse
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java
index 97051a72bf82..a25da0d7ae57 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java
@@ -1,7 +1,6 @@
 // Copyright (c) Microsoft Corporation. All rights reserved.
 // Licensed under the MIT License.
 // Code generated by Microsoft (R) TypeSpec Code Generator.
-
 package com.azure.ai.inference;
 
 import com.azure.ai.inference.implementation.EmbeddingsClientImpl;
@@ -30,6 +29,7 @@
  */
 @ServiceClient(builder = EmbeddingsClientBuilder.class)
 public final class EmbeddingsClient {
+
     @Generated
     private final EmbeddingsClientImpl serviceClient;
 
@@ -57,7 +57,7 @@ public final class EmbeddingsClient {
      * 
      * You can add these to a request with {@link RequestOptions#addHeader}
      * 

Request Body Schema

- * + * *
{@code
      * {
      *     input (Required): [
@@ -72,9 +72,9 @@ public final class EmbeddingsClient {
      *     }
      * }
      * }
- * + * *

Response Body Schema

- * + * *
{@code
      * {
      *     data (Required): [
@@ -111,7 +111,7 @@ Response embedWithResponse(BinaryData embedRequest, RequestOptions r
      * Returns information about the AI model.
      * The method makes a REST API call to the `/info` route on the given endpoint.
      * 

Response Body Schema

- * + * *
{@code
      * {
      *     model_name: String (Required)
@@ -194,7 +194,6 @@ EmbeddingsResult embed(List input, Integer dimensions, EmbeddingEncoding
      * Embeddings measure the relatedness of text strings and are commonly used for search, clustering,
      * recommendations, and other similar scenarios.
      */
-    @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
     public EmbeddingsResult embed(List input) {
         // Generated convenience method for embedWithResponse
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClientBuilder.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClientBuilder.java
index 4afc1480d68f..cd001d53dd23 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClientBuilder.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClientBuilder.java
@@ -1,7 +1,6 @@
 // Copyright (c) Microsoft Corporation. All rights reserved.
 // Licensed under the MIT License.
 // Code generated by Microsoft (R) TypeSpec Code Generator.
-
 package com.azure.ai.inference;
 
 import com.azure.ai.inference.implementation.EmbeddingsClientImpl;
@@ -50,6 +49,7 @@
 public final class EmbeddingsClientBuilder implements HttpTrait,
     ConfigurationTrait, TokenCredentialTrait,
     KeyCredentialTrait, EndpointTrait {
+
     @Generated
     private static final String SDK_NAME = "name";
 
@@ -239,7 +239,7 @@ public EmbeddingsClientBuilder endpoint(String endpoint) {
 
     /**
      * Sets Service version.
-     * 
+     *
      * @param serviceVersion the serviceVersion value.
      * @return the EmbeddingsClientBuilder.
      */
@@ -257,7 +257,7 @@ public EmbeddingsClientBuilder serviceVersion(ModelServiceVersion serviceVersion
 
     /**
      * Sets The retry policy that will attempt to retry failed requests, if applicable.
-     * 
+     *
      * @param retryPolicy the retryPolicy value.
      * @return the EmbeddingsClientBuilder.
      */
@@ -269,7 +269,7 @@ public EmbeddingsClientBuilder retryPolicy(RetryPolicy retryPolicy) {
 
     /**
      * Builds an instance of EmbeddingsClientImpl with the provided parameters.
-     * 
+     *
      * @return an instance of EmbeddingsClientImpl.
      */
     @Generated
@@ -333,7 +333,7 @@ private HttpPipeline createHttpPipeline() {
 
     /**
      * Builds an instance of EmbeddingsAsyncClient class.
-     * 
+     *
      * @return an instance of EmbeddingsAsyncClient.
      */
     @Generated
@@ -343,7 +343,7 @@ public EmbeddingsAsyncClient buildAsyncClient() {
 
     /**
      * Builds an instance of EmbeddingsClient class.
-     * 
+     *
      * @return an instance of EmbeddingsClient.
      */
     @Generated
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java
index 9b90ef7ac8c6..61f78fbc2e23 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java
@@ -1,7 +1,6 @@
 // Copyright (c) Microsoft Corporation. All rights reserved.
 // Licensed under the MIT License.
 // Code generated by Microsoft (R) TypeSpec Code Generator.
-
 package com.azure.ai.inference;
 
 import com.azure.ai.inference.implementation.ImageEmbeddingsClientImpl;
@@ -33,12 +32,13 @@
  */
 @ServiceClient(builder = ImageEmbeddingsClientBuilder.class, isAsync = true)
 public final class ImageEmbeddingsAsyncClient {
+
     @Generated
     private final ImageEmbeddingsClientImpl serviceClient;
 
     /**
      * Initializes an instance of ImageEmbeddingsAsyncClient class.
-     * 
+     *
      * @param serviceClient the service client implementation.
      */
     @Generated
@@ -96,7 +96,7 @@ public final class ImageEmbeddingsAsyncClient {
      *     model: String (Required)
      * }
      * }
- * + * * @param embedRequest1 The embedRequest1 parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -126,7 +126,7 @@ Mono> embedWithResponse(BinaryData embedRequest1, RequestOp * model_provider_name: String (Required) * } * }
- * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -144,7 +144,7 @@ Mono> getModelInfoWithResponse(RequestOptions requestOption /** * Return the embedding vectors for given images. * The method makes a REST API call to the `/images/embeddings` route on the given endpoint. - * + * * @param input Input image to embed. To embed multiple inputs in a single request, pass an array. * The input must not exceed the max input tokens for the model. * @param dimensions Optional. The number of dimensions the resulting output embeddings should have. @@ -190,7 +190,7 @@ Mono embed(List input, Integer dimensions, Emb /** * Return the embedding vectors for given images. * The method makes a REST API call to the `/images/embeddings` route on the given endpoint. - * + * * @param input Input image to embed. To embed multiple inputs in a single request, pass an array. * The input must not exceed the max input tokens for the model. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -217,7 +217,7 @@ Mono embed(List input) { /** * Returns information about the AI model. * The method makes a REST API call to the `/info` route on the given endpoint. - * + * * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClient.java index e90344df9bab..4cc4e8d5700f 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClient.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference; import com.azure.ai.inference.implementation.ImageEmbeddingsClientImpl; @@ -31,12 +30,13 @@ */ @ServiceClient(builder = ImageEmbeddingsClientBuilder.class) public final class ImageEmbeddingsClient { + @Generated private final ImageEmbeddingsClientImpl serviceClient; /** * Initializes an instance of ImageEmbeddingsClient class. - * + * * @param serviceClient the service client implementation. */ @Generated @@ -94,7 +94,7 @@ public final class ImageEmbeddingsClient { * model: String (Required) * } * }
- * + * * @param embedRequest1 The embedRequest1 parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -123,7 +123,7 @@ Response embedWithResponse(BinaryData embedRequest1, RequestOptions * model_provider_name: String (Required) * } * }
- * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -140,7 +140,7 @@ Response getModelInfoWithResponse(RequestOptions requestOptions) { /** * Return the embedding vectors for given images. * The method makes a REST API call to the `/images/embeddings` route on the given endpoint. - * + * * @param input Input image to embed. To embed multiple inputs in a single request, pass an array. * The input must not exceed the max input tokens for the model. * @param dimensions Optional. The number of dimensions the resulting output embeddings should have. @@ -185,7 +185,7 @@ EmbeddingsResult embed(List input, Integer dimensions, Embedding /** * Return the embedding vectors for given images. * The method makes a REST API call to the `/images/embeddings` route on the given endpoint. - * + * * @param input Input image to embed. To embed multiple inputs in a single request, pass an array. * The input must not exceed the max input tokens for the model. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -211,7 +211,7 @@ EmbeddingsResult embed(List input) { /** * Returns information about the AI model. * The method makes a REST API call to the `/info` route on the given endpoint. - * + * * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClientBuilder.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClientBuilder.java index 231d2c1b0acc..c32b35aed339 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClientBuilder.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClientBuilder.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference; import com.azure.ai.inference.implementation.ImageEmbeddingsClientImpl; @@ -50,6 +49,7 @@ public final class ImageEmbeddingsClientBuilder implements HttpTrait, ConfigurationTrait, TokenCredentialTrait, KeyCredentialTrait, EndpointTrait { + @Generated private static final String SDK_NAME = "name"; @@ -239,7 +239,7 @@ public ImageEmbeddingsClientBuilder endpoint(String endpoint) { /** * Sets Service version. - * + * * @param serviceVersion the serviceVersion value. * @return the ImageEmbeddingsClientBuilder. */ @@ -257,7 +257,7 @@ public ImageEmbeddingsClientBuilder serviceVersion(ModelServiceVersion serviceVe /** * Sets The retry policy that will attempt to retry failed requests, if applicable. - * + * * @param retryPolicy the retryPolicy value. * @return the ImageEmbeddingsClientBuilder. */ @@ -269,7 +269,7 @@ public ImageEmbeddingsClientBuilder retryPolicy(RetryPolicy retryPolicy) { /** * Builds an instance of ImageEmbeddingsClientImpl with the provided parameters. - * + * * @return an instance of ImageEmbeddingsClientImpl. */ @Generated @@ -333,7 +333,7 @@ private HttpPipeline createHttpPipeline() { /** * Builds an instance of ImageEmbeddingsAsyncClient class. - * + * * @return an instance of ImageEmbeddingsAsyncClient. */ @Generated @@ -343,7 +343,7 @@ public ImageEmbeddingsAsyncClient buildAsyncClient() { /** * Builds an instance of ImageEmbeddingsClient class. - * + * * @return an instance of ImageEmbeddingsClient. */ @Generated diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsClientImpl.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsClientImpl.java index 6d867fce9584..9654615ddb2d 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsClientImpl.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsClientImpl.java @@ -230,9 +230,7 @@ Response getModelInfoSync(@HostParam("endpoint") String endpoint, * function (Required): { * name: String (Required) * description: String (Optional) - * parameters (Optional): { - * String: Object (Required) - * } + * parameters: Object (Optional) * } * } * ] @@ -340,9 +338,7 @@ public Mono> completeWithResponseAsync(BinaryData completeR * function (Required): { * name: String (Required) * description: String (Optional) - * parameters (Optional): { - * String: Object (Required) - * } + * parameters: Object (Optional) * } * } * ] diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/CompleteRequest.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/CompleteRequest.java index 3ff00d964d8f..cd99a7ab8b7a 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/CompleteRequest.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/CompleteRequest.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference.implementation.models; import com.azure.ai.inference.models.ChatCompletionsResponseFormat; @@ -24,6 +23,7 @@ */ @Fluent public final class CompleteRequest implements JsonSerializable { + /* * The collection of context messages associated with this chat completions request. * Typical usage begins with a chat message for the System role that provides instructions for @@ -136,7 +136,7 @@ public final class CompleteRequest implements JsonSerializable /** * Creates an instance of CompleteRequest class. - * + * * @param messages the messages value to set. */ @Generated @@ -149,7 +149,7 @@ public CompleteRequest(List messages) { * Typical usage begins with a chat message for the System role that provides instructions for * the behavior of the assistant, followed by alternating messages between the User and * Assistant roles. - * + * * @return the messages value. */ @Generated @@ -164,7 +164,7 @@ public List getMessages() { * Positive values will make tokens less likely to appear as their frequency increases and * decrease the likelihood of the model repeating the same statements verbatim. * Supported range is [-2, 2]. - * + * * @return the frequencyPenalty value. */ @Generated @@ -179,7 +179,7 @@ public Double getFrequencyPenalty() { * Positive values will make tokens less likely to appear as their frequency increases and * decrease the likelihood of the model repeating the same statements verbatim. * Supported range is [-2, 2]. - * + * * @param frequencyPenalty the frequencyPenalty value to set. * @return the CompleteRequest object itself. */ @@ -191,7 +191,7 @@ public CompleteRequest setFrequencyPenalty(Double frequencyPenalty) { /** * Get the stream property: A value indicating whether chat completions should be streamed for this request. - * + * * @return the stream value. */ @Generated @@ -201,7 +201,7 @@ public Boolean isStream() { /** * Set the stream property: A value indicating whether chat completions should be streamed for this request. - * + * * @param stream the stream value to set. * @return the CompleteRequest object itself. */ @@ -218,7 +218,7 @@ public CompleteRequest setStream(Boolean stream) { * Positive values will make tokens less likely to appear when they already exist and increase the * model's likelihood to output new topics. * Supported range is [-2, 2]. - * + * * @return the presencePenalty value. */ @Generated @@ -233,7 +233,7 @@ public Double getPresencePenalty() { * Positive values will make tokens less likely to appear when they already exist and increase the * model's likelihood to output new topics. * Supported range is [-2, 2]. - * + * * @param presencePenalty the presencePenalty value to set. * @return the CompleteRequest object itself. */ @@ -251,7 +251,7 @@ public CompleteRequest setPresencePenalty(Double presencePenalty) { * It is not recommended to modify temperature and top_p for the same completions request as the * interaction of these two settings is difficult to predict. * Supported range is [0, 1]. - * + * * @return the temperature value. */ @Generated @@ -267,7 +267,7 @@ public Double getTemperature() { * It is not recommended to modify temperature and top_p for the same completions request as the * interaction of these two settings is difficult to predict. * Supported range is [0, 1]. - * + * * @param temperature the temperature value to set. * @return the CompleteRequest object itself. */ @@ -285,7 +285,7 @@ public CompleteRequest setTemperature(Double temperature) { * It is not recommended to modify temperature and top_p for the same completions request as the * interaction of these two settings is difficult to predict. * Supported range is [0, 1]. - * + * * @return the topP value. */ @Generated @@ -301,7 +301,7 @@ public Double getTopP() { * It is not recommended to modify temperature and top_p for the same completions request as the * interaction of these two settings is difficult to predict. * Supported range is [0, 1]. - * + * * @param topP the topP value to set. * @return the CompleteRequest object itself. */ @@ -313,7 +313,7 @@ public CompleteRequest setTopP(Double topP) { /** * Get the maxTokens property: The maximum number of tokens to generate. - * + * * @return the maxTokens value. */ @Generated @@ -323,7 +323,7 @@ public Integer getMaxTokens() { /** * Set the maxTokens property: The maximum number of tokens to generate. - * + * * @param maxTokens the maxTokens value to set. * @return the CompleteRequest object itself. */ @@ -338,7 +338,7 @@ public CompleteRequest setMaxTokens(Integer maxTokens) { * the default text mode. * Note that to enable JSON mode, some AI models may also require you to instruct the model to produce JSON * via a system or user message. - * + * * @return the responseFormat value. */ @Generated @@ -351,7 +351,7 @@ public ChatCompletionsResponseFormat getResponseFormat() { * the default text mode. * Note that to enable JSON mode, some AI models may also require you to instruct the model to produce JSON * via a system or user message. - * + * * @param responseFormat the responseFormat value to set. * @return the CompleteRequest object itself. */ @@ -363,7 +363,7 @@ public CompleteRequest setResponseFormat(ChatCompletionsResponseFormat responseF /** * Get the stop property: A collection of textual sequences that will end completions generation. - * + * * @return the stop value. */ @Generated @@ -373,7 +373,7 @@ public List getStop() { /** * Set the stop property: A collection of textual sequences that will end completions generation. - * + * * @param stop the stop value to set. * @return the CompleteRequest object itself. */ @@ -387,7 +387,7 @@ public CompleteRequest setStop(List stop) { * Get the tools property: A list of tools the model may request to call. Currently, only functions are supported as * a tool. The model * may response with a function call request and provide the input arguments in JSON format for that function. - * + * * @return the tools value. */ @Generated @@ -399,7 +399,7 @@ public List getTools() { * Set the tools property: A list of tools the model may request to call. Currently, only functions are supported as * a tool. The model * may response with a function call request and provide the input arguments in JSON format for that function. - * + * * @param tools the tools value to set. * @return the CompleteRequest object itself. */ @@ -412,7 +412,7 @@ public CompleteRequest setTools(List tools) { /** * Get the toolChoice property: If specified, the model will configure which of the provided tools it can use for * the chat completions response. - * + * * @return the toolChoice value. */ @Generated @@ -423,7 +423,7 @@ public BinaryData getToolChoice() { /** * Set the toolChoice property: If specified, the model will configure which of the provided tools it can use for * the chat completions response. - * + * * @param toolChoice the toolChoice value to set. * @return the CompleteRequest object itself. */ @@ -437,7 +437,7 @@ public CompleteRequest setToolChoice(BinaryData toolChoice) { * Get the seed property: If specified, the system will make a best effort to sample deterministically such that * repeated requests with the * same seed and parameters should return the same result. Determinism is not guaranteed. - * + * * @return the seed value. */ @Generated @@ -449,7 +449,7 @@ public Long getSeed() { * Set the seed property: If specified, the system will make a best effort to sample deterministically such that * repeated requests with the * same seed and parameters should return the same result. Determinism is not guaranteed. - * + * * @param seed the seed value to set. * @return the CompleteRequest object itself. */ @@ -461,7 +461,7 @@ public CompleteRequest setSeed(Long seed) { /** * Get the model property: ID of the specific AI model to use, if more than one model is available on the endpoint. - * + * * @return the model value. */ @Generated @@ -471,7 +471,7 @@ public String getModel() { /** * Set the model property: ID of the specific AI model to use, if more than one model is available on the endpoint. - * + * * @param model the model value to set. * @return the CompleteRequest object itself. */ @@ -483,7 +483,7 @@ public CompleteRequest setModel(String model) { /** * Get the additionalProperties property: Additional properties. - * + * * @return the additionalProperties value. */ @Generated @@ -493,7 +493,7 @@ public Map getAdditionalProperties() { /** * Set the additionalProperties property: Additional properties. - * + * * @param additionalProperties the additionalProperties value to set. * @return the CompleteRequest object itself. */ @@ -535,7 +535,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of CompleteRequest from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of CompleteRequest if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. @@ -562,7 +562,6 @@ public static CompleteRequest fromJson(JsonReader jsonReader) throws IOException while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("messages".equals(fieldName)) { messages = reader.readArray(reader1 -> ChatRequestMessage.fromJson(reader1)); } else if ("frequency_penalty".equals(fieldName)) { @@ -594,7 +593,6 @@ public static CompleteRequest fromJson(JsonReader jsonReader) throws IOException if (additionalProperties == null) { additionalProperties = new LinkedHashMap<>(); } - additionalProperties.put(fieldName, reader.readUntyped()); } } @@ -612,7 +610,6 @@ public static CompleteRequest fromJson(JsonReader jsonReader) throws IOException deserializedCompleteRequest.seed = seed; deserializedCompleteRequest.model = model; deserializedCompleteRequest.additionalProperties = additionalProperties; - return deserializedCompleteRequest; }); } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/EmbedRequest.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/EmbedRequest.java index e290a9c5f739..2b47c538787a 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/EmbedRequest.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/EmbedRequest.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference.implementation.models; import com.azure.ai.inference.models.EmbeddingEncodingFormat; @@ -22,6 +21,7 @@ */ @Fluent public final class EmbedRequest implements JsonSerializable { + /* * Input text to embed, encoded as a string or array of tokens. * To embed multiple inputs in a single request, pass an array @@ -65,7 +65,7 @@ public final class EmbedRequest implements JsonSerializable { /** * Creates an instance of EmbedRequest class. - * + * * @param input the input value to set. */ @Generated @@ -77,7 +77,7 @@ public EmbedRequest(List input) { * Get the input property: Input text to embed, encoded as a string or array of tokens. * To embed multiple inputs in a single request, pass an array * of strings or array of token arrays. - * + * * @return the input value. */ @Generated @@ -89,7 +89,7 @@ public List getInput() { * Get the dimensions property: Optional. The number of dimensions the resulting output embeddings should have. * Passing null causes the model to use its default value. * Returns a 422 error if the model doesn't support the value or parameter. - * + * * @return the dimensions value. */ @Generated @@ -101,7 +101,7 @@ public Integer getDimensions() { * Set the dimensions property: Optional. The number of dimensions the resulting output embeddings should have. * Passing null causes the model to use its default value. * Returns a 422 error if the model doesn't support the value or parameter. - * + * * @param dimensions the dimensions value to set. * @return the EmbedRequest object itself. */ @@ -113,7 +113,7 @@ public EmbedRequest setDimensions(Integer dimensions) { /** * Get the encodingFormat property: Optional. The desired format for the returned embeddings. - * + * * @return the encodingFormat value. */ @Generated @@ -123,7 +123,7 @@ public EmbeddingEncodingFormat getEncodingFormat() { /** * Set the encodingFormat property: Optional. The desired format for the returned embeddings. - * + * * @param encodingFormat the encodingFormat value to set. * @return the EmbedRequest object itself. */ @@ -136,7 +136,7 @@ public EmbedRequest setEncodingFormat(EmbeddingEncodingFormat encodingFormat) { /** * Get the inputType property: Optional. The type of the input. * Returns a 422 error if the model doesn't support the value or parameter. - * + * * @return the inputType value. */ @Generated @@ -147,7 +147,7 @@ public EmbeddingInputType getInputType() { /** * Set the inputType property: Optional. The type of the input. * Returns a 422 error if the model doesn't support the value or parameter. - * + * * @param inputType the inputType value to set. * @return the EmbedRequest object itself. */ @@ -159,7 +159,7 @@ public EmbedRequest setInputType(EmbeddingInputType inputType) { /** * Get the model property: ID of the specific AI model to use, if more than one model is available on the endpoint. - * + * * @return the model value. */ @Generated @@ -169,7 +169,7 @@ public String getModel() { /** * Set the model property: ID of the specific AI model to use, if more than one model is available on the endpoint. - * + * * @param model the model value to set. * @return the EmbedRequest object itself. */ @@ -181,7 +181,7 @@ public EmbedRequest setModel(String model) { /** * Get the additionalProperties property: Additional properties. - * + * * @return the additionalProperties value. */ @Generated @@ -191,7 +191,7 @@ public Map getAdditionalProperties() { /** * Set the additionalProperties property: Additional properties. - * + * * @param additionalProperties the additionalProperties value to set. * @return the EmbedRequest object itself. */ @@ -224,7 +224,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of EmbedRequest from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of EmbedRequest if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. @@ -243,7 +243,6 @@ public static EmbedRequest fromJson(JsonReader jsonReader) throws IOException { while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("input".equals(fieldName)) { input = reader.readArray(reader1 -> reader1.getString()); } else if ("dimensions".equals(fieldName)) { @@ -258,7 +257,6 @@ public static EmbedRequest fromJson(JsonReader jsonReader) throws IOException { if (additionalProperties == null) { additionalProperties = new LinkedHashMap<>(); } - additionalProperties.put(fieldName, reader.readUntyped()); } } @@ -268,7 +266,6 @@ public static EmbedRequest fromJson(JsonReader jsonReader) throws IOException { deserializedEmbedRequest.inputType = inputType; deserializedEmbedRequest.model = model; deserializedEmbedRequest.additionalProperties = additionalProperties; - return deserializedEmbedRequest; }); } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/EmbedRequest1.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/EmbedRequest1.java index ce8c3cc46bb6..615c7018b9bf 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/EmbedRequest1.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/EmbedRequest1.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference.implementation.models; import com.azure.ai.inference.models.EmbeddingEncodingFormat; @@ -23,6 +22,7 @@ */ @Fluent public final class EmbedRequest1 implements JsonSerializable { + /* * Input image to embed. To embed multiple inputs in a single request, pass an array. * The input must not exceed the max input tokens for the model. @@ -67,7 +67,7 @@ public final class EmbedRequest1 implements JsonSerializable { /** * Creates an instance of EmbedRequest1 class. - * + * * @param input the input value to set. */ @Generated @@ -78,7 +78,7 @@ public EmbedRequest1(List input) { /** * Get the input property: Input image to embed. To embed multiple inputs in a single request, pass an array. * The input must not exceed the max input tokens for the model. - * + * * @return the input value. */ @Generated @@ -90,7 +90,7 @@ public List getInput() { * Get the dimensions property: Optional. The number of dimensions the resulting output embeddings should have. * Passing null causes the model to use its default value. * Returns a 422 error if the model doesn't support the value or parameter. - * + * * @return the dimensions value. */ @Generated @@ -102,7 +102,7 @@ public Integer getDimensions() { * Set the dimensions property: Optional. The number of dimensions the resulting output embeddings should have. * Passing null causes the model to use its default value. * Returns a 422 error if the model doesn't support the value or parameter. - * + * * @param dimensions the dimensions value to set. * @return the EmbedRequest1 object itself. */ @@ -116,7 +116,7 @@ public EmbedRequest1 setDimensions(Integer dimensions) { * Get the encodingFormat property: Optional. The number of dimensions the resulting output embeddings should have. * Passing null causes the model to use its default value. * Returns a 422 error if the model doesn't support the value or parameter. - * + * * @return the encodingFormat value. */ @Generated @@ -128,7 +128,7 @@ public EmbeddingEncodingFormat getEncodingFormat() { * Set the encodingFormat property: Optional. The number of dimensions the resulting output embeddings should have. * Passing null causes the model to use its default value. * Returns a 422 error if the model doesn't support the value or parameter. - * + * * @param encodingFormat the encodingFormat value to set. * @return the EmbedRequest1 object itself. */ @@ -141,7 +141,7 @@ public EmbedRequest1 setEncodingFormat(EmbeddingEncodingFormat encodingFormat) { /** * Get the inputType property: Optional. The type of the input. * Returns a 422 error if the model doesn't support the value or parameter. - * + * * @return the inputType value. */ @Generated @@ -152,7 +152,7 @@ public EmbeddingInputType getInputType() { /** * Set the inputType property: Optional. The type of the input. * Returns a 422 error if the model doesn't support the value or parameter. - * + * * @param inputType the inputType value to set. * @return the EmbedRequest1 object itself. */ @@ -164,7 +164,7 @@ public EmbedRequest1 setInputType(EmbeddingInputType inputType) { /** * Get the model property: ID of the specific AI model to use, if more than one model is available on the endpoint. - * + * * @return the model value. */ @Generated @@ -174,7 +174,7 @@ public String getModel() { /** * Set the model property: ID of the specific AI model to use, if more than one model is available on the endpoint. - * + * * @param model the model value to set. * @return the EmbedRequest1 object itself. */ @@ -186,7 +186,7 @@ public EmbedRequest1 setModel(String model) { /** * Get the additionalProperties property: Additional properties. - * + * * @return the additionalProperties value. */ @Generated @@ -196,7 +196,7 @@ public Map getAdditionalProperties() { /** * Set the additionalProperties property: Additional properties. - * + * * @param additionalProperties the additionalProperties value to set. * @return the EmbedRequest1 object itself. */ @@ -229,7 +229,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of EmbedRequest1 from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of EmbedRequest1 if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. @@ -248,7 +248,6 @@ public static EmbedRequest1 fromJson(JsonReader jsonReader) throws IOException { while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("input".equals(fieldName)) { input = reader.readArray(reader1 -> EmbeddingInput.fromJson(reader1)); } else if ("dimensions".equals(fieldName)) { @@ -263,7 +262,6 @@ public static EmbedRequest1 fromJson(JsonReader jsonReader) throws IOException { if (additionalProperties == null) { additionalProperties = new LinkedHashMap<>(); } - additionalProperties.put(fieldName, reader.readUntyped()); } } @@ -273,7 +271,6 @@ public static EmbedRequest1 fromJson(JsonReader jsonReader) throws IOException { deserializedEmbedRequest1.inputType = inputType; deserializedEmbedRequest1.model = model; deserializedEmbedRequest1.additionalProperties = additionalProperties; - return deserializedEmbedRequest1; }); } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/ExtraParameters.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/ExtraParameters.java index 53e3ff8fa2ed..c7d93eb32281 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/ExtraParameters.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/ExtraParameters.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference.implementation.models; import com.azure.core.annotation.Generated; @@ -12,6 +11,7 @@ * Controls what happens if extra parameters, undefined by the REST API, are passed in the JSON request payload. */ public final class ExtraParameters extends ExpandableStringEnum { + /** * The service will error if it detected extra parameters in the request payload. This is the service default. */ @@ -33,7 +33,7 @@ public final class ExtraParameters extends ExpandableStringEnum /** * Creates a new instance of ExtraParameters value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Generated @@ -43,7 +43,7 @@ public ExtraParameters() { /** * Creates or finds a ExtraParameters from its string representation. - * + * * @param name a name to look for. * @return the corresponding ExtraParameters. */ @@ -54,7 +54,7 @@ public static ExtraParameters fromString(String name) { /** * Gets known ExtraParameters values. - * + * * @return known ExtraParameters values. */ @Generated diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/package-info.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/package-info.java index 165b7203bc56..19b0b7fbff14 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/package-info.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/package-info.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - /** * Package containing the data models for Model. */ diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/package-info.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/package-info.java index 5acfabb9301b..bff731a5427e 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/package-info.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/package-info.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - /** * Package containing the implementations for Model. */ diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatChoice.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatChoice.java index 1d062e7d2eb5..64ced3188488 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatChoice.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatChoice.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference.models; import com.azure.core.annotation.Generated; @@ -19,6 +18,7 @@ */ @Immutable public final class ChatChoice implements JsonSerializable { + /* * The ordered index associated with this chat completions choice. */ @@ -112,7 +112,6 @@ public static ChatChoice fromJson(JsonReader jsonReader) throws IOException { while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("index".equals(fieldName)) { index = reader.getInt(); } else if ("finish_reason".equals(fieldName)) { diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletions.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletions.java index c959cb487d44..d63d1df281c6 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletions.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletions.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference.models; import com.azure.core.annotation.Generated; @@ -23,6 +22,7 @@ */ @Immutable public final class ChatCompletions implements JsonSerializable { + /* * A unique identifier associated with this chat completions response. */ @@ -58,7 +58,7 @@ public final class ChatCompletions implements JsonSerializable /** * Creates an instance of ChatCompletions class. - * + * * @param id the id value to set. * @param created the created value to set. * @param model the model value to set. @@ -81,7 +81,7 @@ private ChatCompletions(String id, OffsetDateTime created, String model, Complet /** * Get the id property: A unique identifier associated with this chat completions response. - * + * * @return the id value. */ @Generated @@ -92,7 +92,7 @@ public String getId() { /** * Get the created property: The first timestamp associated with generation activity for this completions response, * represented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970. - * + * * @return the created value. */ @Generated @@ -102,7 +102,7 @@ public OffsetDateTime getCreated() { /** * Get the model property: The model used for the chat completion. - * + * * @return the model value. */ @Generated @@ -113,7 +113,7 @@ public String getModel() { /** * Get the usage property: Usage information for tokens processed and generated as part of this completions * operation. - * + * * @return the usage value. */ @Generated @@ -125,7 +125,7 @@ public CompletionsUsage getUsage() { * Get the choices property: The collection of completions choices associated with this completions response. * Generally, `n` choices are generated per provided prompt with a default value of 1. * Token limits and other settings may limit the number of choices generated. - * + * * @return the choices value. */ @Generated @@ -150,7 +150,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of ChatCompletions from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of ChatCompletions if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. @@ -168,7 +168,6 @@ public static ChatCompletions fromJson(JsonReader jsonReader) throws IOException while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("id".equals(fieldName)) { id = reader.getString(); } else if ("created".equals(fieldName)) { diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolSelection.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolSelection.java index 4f51d507fcfe..9db5a33e0b92 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolSelection.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolSelection.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference.models; import com.azure.core.annotation.Generated; @@ -18,6 +17,7 @@ @Immutable public final class ChatCompletionsFunctionToolSelection implements JsonSerializable { + /* * The name of the function that should be called. */ @@ -26,7 +26,7 @@ public final class ChatCompletionsFunctionToolSelection /** * Creates an instance of ChatCompletionsFunctionToolSelection class. - * + * * @param name the name value to set. */ @Generated @@ -36,7 +36,7 @@ public ChatCompletionsFunctionToolSelection(String name) { /** * Get the name property: The name of the function that should be called. - * + * * @return the name value. */ @Generated @@ -57,7 +57,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of ChatCompletionsFunctionToolSelection from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of ChatCompletionsFunctionToolSelection if the JsonReader was pointing to an instance of it, * or null if it was pointing to JSON null. @@ -71,7 +71,6 @@ public static ChatCompletionsFunctionToolSelection fromJson(JsonReader jsonReade while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("name".equals(fieldName)) { name = reader.getString(); } else { diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsNamedToolSelection.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsNamedToolSelection.java index 8370031a906e..3eb8ccaf531a 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsNamedToolSelection.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsNamedToolSelection.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference.models; import com.azure.core.annotation.Generated; @@ -17,6 +16,7 @@ */ @Immutable public class ChatCompletionsNamedToolSelection implements JsonSerializable { + /* * The type of the tool. Currently, only `function` is supported. */ @@ -31,7 +31,7 @@ public class ChatCompletionsNamedToolSelection implements JsonSerializable { + /* * The response format type to use for chat completions. */ @@ -34,7 +34,7 @@ public ChatCompletionsResponseFormat() { /** * Get the type property: The response format type to use for chat completions. - * + * * @return the type value. */ @Generated @@ -55,7 +55,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of ChatCompletionsResponseFormat from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of ChatCompletionsResponseFormat if the JsonReader was pointing to an instance of it, or null * if it was pointing to JSON null. @@ -66,7 +66,8 @@ public static ChatCompletionsResponseFormat fromJson(JsonReader jsonReader) thro return jsonReader.readObject(reader -> { String discriminatorValue = null; try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading + // Prepare for reading + readerToUse.nextToken(); while (readerToUse.nextToken() != JsonToken.END_OBJECT) { String fieldName = readerToUse.getFieldName(); readerToUse.nextToken(); @@ -97,14 +98,12 @@ static ChatCompletionsResponseFormat fromJsonKnownDiscriminator(JsonReader jsonR while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("type".equals(fieldName)) { deserializedChatCompletionsResponseFormat.type = reader.getString(); } else { reader.skipChildren(); } } - return deserializedChatCompletionsResponseFormat; }); } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatJson.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatJson.java index ca1ef0a58f4b..86db6bdbea4f 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatJson.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatJson.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference.models; import com.azure.core.annotation.Generated; @@ -18,6 +17,7 @@ */ @Immutable public final class ChatCompletionsResponseFormatJson extends ChatCompletionsResponseFormat { + /* * The response format type to use for chat completions. */ @@ -33,7 +33,7 @@ public ChatCompletionsResponseFormatJson() { /** * Get the type property: The response format type to use for chat completions. - * + * * @return the type value. */ @Generated @@ -55,7 +55,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of ChatCompletionsResponseFormatJson from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of ChatCompletionsResponseFormatJson if the JsonReader was pointing to an instance of it, or * null if it was pointing to JSON null. @@ -69,14 +69,12 @@ public static ChatCompletionsResponseFormatJson fromJson(JsonReader jsonReader) while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("type".equals(fieldName)) { deserializedChatCompletionsResponseFormatJson.type = reader.getString(); } else { reader.skipChildren(); } } - return deserializedChatCompletionsResponseFormatJson; }); } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatText.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatText.java index d8177f2c3cc1..9c049b8e2aeb 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatText.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatText.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference.models; import com.azure.core.annotation.Generated; @@ -16,6 +15,7 @@ */ @Immutable public final class ChatCompletionsResponseFormatText extends ChatCompletionsResponseFormat { + /* * The response format type to use for chat completions. */ @@ -31,7 +31,7 @@ public ChatCompletionsResponseFormatText() { /** * Get the type property: The response format type to use for chat completions. - * + * * @return the type value. */ @Generated @@ -53,7 +53,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of ChatCompletionsResponseFormatText from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of ChatCompletionsResponseFormatText if the JsonReader was pointing to an instance of it, or * null if it was pointing to JSON null. @@ -67,14 +67,12 @@ public static ChatCompletionsResponseFormatText fromJson(JsonReader jsonReader) while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("type".equals(fieldName)) { deserializedChatCompletionsResponseFormatText.type = reader.getString(); } else { reader.skipChildren(); } } - return deserializedChatCompletionsResponseFormatText; }); } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsToolCall.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsToolCall.java index b5a4e67e47e3..a368a505fdff 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsToolCall.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsToolCall.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference.models; import com.azure.core.annotation.Generated; @@ -17,6 +16,7 @@ */ @Immutable public class ChatCompletionsToolCall implements JsonSerializable { + /* * The ID of the tool call. */ @@ -37,7 +37,7 @@ public class ChatCompletionsToolCall implements JsonSerializable { + /* * The type of the tool. Currently, only `function` is supported. */ @@ -31,7 +31,7 @@ public class ChatCompletionsToolDefinition implements JsonSerializable { + /** * Specifies that the model may either use any of the tools provided in this chat completions request or * instead return a standard chat completions response as if no tools were provided. @@ -34,7 +34,7 @@ public final class ChatCompletionsToolSelectionPreset extends ExpandableStringEn /** * Creates a new instance of ChatCompletionsToolSelectionPreset value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Generated @@ -44,7 +44,7 @@ public ChatCompletionsToolSelectionPreset() { /** * Creates or finds a ChatCompletionsToolSelectionPreset from its string representation. - * + * * @param name a name to look for. * @return the corresponding ChatCompletionsToolSelectionPreset. */ @@ -55,7 +55,7 @@ public static ChatCompletionsToolSelectionPreset fromString(String name) { /** * Gets known ChatCompletionsToolSelectionPreset values. - * + * * @return known ChatCompletionsToolSelectionPreset values. */ @Generated diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageContentItem.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageContentItem.java index 5e355d1364bd..0acb2a8bdd15 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageContentItem.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageContentItem.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference.models; import com.azure.core.annotation.Generated; @@ -17,6 +16,7 @@ */ @Immutable public class ChatMessageContentItem implements JsonSerializable { + /* * The discriminated object type. */ @@ -32,7 +32,7 @@ public ChatMessageContentItem() { /** * Get the type property: The discriminated object type. - * + * * @return the type value. */ @Generated @@ -53,7 +53,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of ChatMessageContentItem from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of ChatMessageContentItem if the JsonReader was pointing to an instance of it, or null if it * was pointing to JSON null. @@ -64,7 +64,8 @@ public static ChatMessageContentItem fromJson(JsonReader jsonReader) throws IOEx return jsonReader.readObject(reader -> { String discriminatorValue = null; try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading + // Prepare for reading + readerToUse.nextToken(); while (readerToUse.nextToken() != JsonToken.END_OBJECT) { String fieldName = readerToUse.getFieldName(); readerToUse.nextToken(); @@ -94,14 +95,12 @@ static ChatMessageContentItem fromJsonKnownDiscriminator(JsonReader jsonReader) while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("type".equals(fieldName)) { deserializedChatMessageContentItem.type = reader.getString(); } else { reader.skipChildren(); } } - return deserializedChatMessageContentItem; }); } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageContentItem.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageContentItem.java index 52822b48db66..526bba57bba3 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageContentItem.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageContentItem.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference.models; import com.azure.core.annotation.Generated; @@ -16,6 +15,7 @@ */ @Immutable public final class ChatMessageImageContentItem extends ChatMessageContentItem { + /* * The discriminated object type. */ @@ -30,7 +30,7 @@ public final class ChatMessageImageContentItem extends ChatMessageContentItem { /** * Creates an instance of ChatMessageImageContentItem class. - * + * * @param imageUrl the imageUrl value to set. */ @Generated @@ -40,7 +40,7 @@ public ChatMessageImageContentItem(ChatMessageImageUrl imageUrl) { /** * Get the type property: The discriminated object type. - * + * * @return the type value. */ @Generated @@ -52,7 +52,7 @@ public String getType() { /** * Get the imageUrl property: An internet location, which must be accessible to the model,from which the image may * be retrieved. - * + * * @return the imageUrl value. */ @Generated @@ -74,7 +74,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of ChatMessageImageContentItem from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of ChatMessageImageContentItem if the JsonReader was pointing to an instance of it, or null * if it was pointing to JSON null. @@ -89,7 +89,6 @@ public static ChatMessageImageContentItem fromJson(JsonReader jsonReader) throws while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("image_url".equals(fieldName)) { imageUrl = ChatMessageImageUrl.fromJson(reader); } else if ("type".equals(fieldName)) { @@ -101,7 +100,6 @@ public static ChatMessageImageContentItem fromJson(JsonReader jsonReader) throws ChatMessageImageContentItem deserializedChatMessageImageContentItem = new ChatMessageImageContentItem(imageUrl); deserializedChatMessageImageContentItem.type = type; - return deserializedChatMessageImageContentItem; }); } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageDetailLevel.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageDetailLevel.java index f056199e229f..f238f423bc65 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageDetailLevel.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageDetailLevel.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference.models; import com.azure.core.annotation.Generated; @@ -12,6 +11,7 @@ * A representation of the possible image detail levels for image-based chat completions message content. */ public final class ChatMessageImageDetailLevel extends ExpandableStringEnum { + /** * Specifies that the model should determine which detail level to apply using heuristics like image size. */ @@ -34,7 +34,7 @@ public final class ChatMessageImageDetailLevel extends ExpandableStringEnum { + /* * The URL of the image. */ @@ -32,7 +32,7 @@ public final class ChatMessageImageUrl implements JsonSerializable { + /* * The chat role associated with this message. */ @@ -32,7 +32,7 @@ public ChatRequestMessage() { /** * Get the role property: The chat role associated with this message. - * + * * @return the role value. */ @Generated @@ -53,7 +53,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of ChatRequestMessage from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of ChatRequestMessage if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. @@ -64,7 +64,8 @@ public static ChatRequestMessage fromJson(JsonReader jsonReader) throws IOExcept return jsonReader.readObject(reader -> { String discriminatorValue = null; try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading + // Prepare for reading + readerToUse.nextToken(); while (readerToUse.nextToken() != JsonToken.END_OBJECT) { String fieldName = readerToUse.getFieldName(); readerToUse.nextToken(); @@ -98,14 +99,12 @@ static ChatRequestMessage fromJsonKnownDiscriminator(JsonReader jsonReader) thro while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("role".equals(fieldName)) { deserializedChatRequestMessage.role = ChatRole.fromString(reader.getString()); } else { reader.skipChildren(); } } - return deserializedChatRequestMessage; }); } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestSystemMessage.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestSystemMessage.java index 75c915004e68..9f7c52ab5324 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestSystemMessage.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestSystemMessage.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference.models; import com.azure.core.annotation.Generated; @@ -17,6 +16,7 @@ */ @Immutable public final class ChatRequestSystemMessage extends ChatRequestMessage { + /* * The chat role associated with this message. */ @@ -31,7 +31,7 @@ public final class ChatRequestSystemMessage extends ChatRequestMessage { /** * Creates an instance of ChatRequestSystemMessage class. - * + * * @param content the content value to set. */ @Generated @@ -41,7 +41,7 @@ public ChatRequestSystemMessage(String content) { /** * Get the role property: The chat role associated with this message. - * + * * @return the role value. */ @Generated @@ -52,7 +52,7 @@ public ChatRole getRole() { /** * Get the content property: The contents of the system message. - * + * * @return the content value. */ @Generated @@ -74,7 +74,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of ChatRequestSystemMessage from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of ChatRequestSystemMessage if the JsonReader was pointing to an instance of it, or null if * it was pointing to JSON null. @@ -89,7 +89,6 @@ public static ChatRequestSystemMessage fromJson(JsonReader jsonReader) throws IO while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("content".equals(fieldName)) { content = reader.getString(); } else if ("role".equals(fieldName)) { @@ -100,7 +99,6 @@ public static ChatRequestSystemMessage fromJson(JsonReader jsonReader) throws IO } ChatRequestSystemMessage deserializedChatRequestSystemMessage = new ChatRequestSystemMessage(content); deserializedChatRequestSystemMessage.role = role; - return deserializedChatRequestSystemMessage; }); } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestToolMessage.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestToolMessage.java index db776da6f681..16dca9ee729d 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestToolMessage.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestToolMessage.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference.models; import com.azure.core.annotation.Generated; @@ -16,6 +15,7 @@ */ @Immutable public final class ChatRequestToolMessage extends ChatRequestMessage { + /* * The chat role associated with this message. */ @@ -36,7 +36,7 @@ public final class ChatRequestToolMessage extends ChatRequestMessage { /** * Creates an instance of ChatRequestToolMessage class. - * + * * @param content the content value to set. * @param toolCallId the toolCallId value to set. */ @@ -48,7 +48,7 @@ public ChatRequestToolMessage(String content, String toolCallId) { /** * Get the role property: The chat role associated with this message. - * + * * @return the role value. */ @Generated @@ -59,7 +59,7 @@ public ChatRole getRole() { /** * Get the content property: The content of the message. - * + * * @return the content value. */ @Generated @@ -69,7 +69,7 @@ public String getContent() { /** * Get the toolCallId property: The ID of the tool call resolved by the provided content. - * + * * @return the toolCallId value. */ @Generated @@ -92,7 +92,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of ChatRequestToolMessage from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of ChatRequestToolMessage if the JsonReader was pointing to an instance of it, or null if it * was pointing to JSON null. @@ -108,7 +108,6 @@ public static ChatRequestToolMessage fromJson(JsonReader jsonReader) throws IOEx while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("content".equals(fieldName)) { content = reader.getString(); } else if ("tool_call_id".equals(fieldName)) { @@ -121,7 +120,6 @@ public static ChatRequestToolMessage fromJson(JsonReader jsonReader) throws IOEx } ChatRequestToolMessage deserializedChatRequestToolMessage = new ChatRequestToolMessage(content, toolCallId); deserializedChatRequestToolMessage.role = role; - return deserializedChatRequestToolMessage; }); } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java index 5c9d461d790f..391c3e615a18 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java @@ -1,17 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference.models; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.azure.core.util.BinaryData; -import com.azure.json.JsonProviders; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import com.azure.json.JsonProviders; import java.io.StringReader; /** @@ -19,6 +18,7 @@ */ @Immutable public final class ChatRequestUserMessage extends ChatRequestMessage { + /* * The chat role associated with this message. */ @@ -91,7 +91,6 @@ public static ChatRequestUserMessage fromJson(JsonReader jsonReader) throws IOEx while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("content".equals(fieldName)) { content = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); } else if ("role".equals(fieldName)) { @@ -102,7 +101,6 @@ public static ChatRequestUserMessage fromJson(JsonReader jsonReader) throws IOEx } ChatRequestUserMessage deserializedChatRequestUserMessage = new ChatRequestUserMessage(content); deserializedChatRequestUserMessage.role = role; - return deserializedChatRequestUserMessage; }); } @@ -115,17 +113,12 @@ public static ChatRequestUserMessage fromJson(JsonReader jsonReader) throws IOEx * was pointing to JSON null. */ public static ChatRequestUserMessage fromString(String content) { - String jsonPrompt = "{" - + "\"content\":\"%s\"" - + "}"; + String jsonPrompt = "{" + "\"content\":\"%s\"" + "}"; String contentString = String.format(jsonPrompt, content); try { - return ChatRequestUserMessage.fromJson( - JsonProviders.createReader(new StringReader(contentString)) - ); + return ChatRequestUserMessage.fromJson(JsonProviders.createReader(new StringReader(contentString))); } catch (IOException e) { throw new RuntimeException(e); } } - } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatResponseMessage.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatResponseMessage.java index 12b800edb254..57cc94b718bb 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatResponseMessage.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatResponseMessage.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference.models; import com.azure.core.annotation.Generated; @@ -18,6 +17,7 @@ */ @Immutable public final class ChatResponseMessage implements JsonSerializable { + /* * The chat role associated with the message. */ @@ -39,7 +39,7 @@ public final class ChatResponseMessage implements JsonSerializable { + /** * The role that instructs or sets the behavior of the assistant. */ @@ -38,7 +38,7 @@ public final class ChatRole extends ExpandableStringEnum { /** * Creates a new instance of ChatRole value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Generated @@ -48,7 +48,7 @@ public ChatRole() { /** * Creates or finds a ChatRole from its string representation. - * + * * @param name a name to look for. * @return the corresponding ChatRole. */ @@ -59,7 +59,7 @@ public static ChatRole fromString(String name) { /** * Gets known ChatRole values. - * + * * @return known ChatRole values. */ @Generated diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/CompletionsFinishReason.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/CompletionsFinishReason.java index 24cbd157376e..f98d925da9a3 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/CompletionsFinishReason.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/CompletionsFinishReason.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference.models; import com.azure.core.annotation.Generated; @@ -12,6 +11,7 @@ * Representation of the manner in which a completions response concluded. */ public final class CompletionsFinishReason extends ExpandableStringEnum { + /** * Completions ended normally and reached its end of token generation. */ @@ -39,7 +39,7 @@ public final class CompletionsFinishReason extends ExpandableStringEnum { + /* * The number of tokens generated across all completions emissions. */ @@ -39,7 +39,7 @@ public final class CompletionsUsage implements JsonSerializable { + /** * Base64. */ @@ -51,7 +51,7 @@ public final class EmbeddingEncodingFormat extends ExpandableStringEnum { + /* * The input image, in PNG format. */ @@ -32,7 +32,7 @@ public final class EmbeddingInput implements JsonSerializable { /** * Creates an instance of EmbeddingInput class. - * + * * @param image the image value to set. */ @Generated @@ -42,7 +42,7 @@ public EmbeddingInput(String image) { /** * Get the image property: The input image, in PNG format. - * + * * @return the image value. */ @Generated @@ -53,7 +53,7 @@ public String getImage() { /** * Get the text property: Optional. The text input to feed into the model (like DINO, CLIP). * Returns a 422 error if the model doesn't support the value or parameter. - * + * * @return the text value. */ @Generated @@ -64,7 +64,7 @@ public String getText() { /** * Set the text property: Optional. The text input to feed into the model (like DINO, CLIP). * Returns a 422 error if the model doesn't support the value or parameter. - * + * * @param text the text value to set. * @return the EmbeddingInput object itself. */ @@ -88,7 +88,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of EmbeddingInput from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of EmbeddingInput if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. @@ -103,7 +103,6 @@ public static EmbeddingInput fromJson(JsonReader jsonReader) throws IOException while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("image".equals(fieldName)) { image = reader.getString(); } else if ("text".equals(fieldName)) { @@ -114,7 +113,6 @@ public static EmbeddingInput fromJson(JsonReader jsonReader) throws IOException } EmbeddingInput deserializedEmbeddingInput = new EmbeddingInput(image); deserializedEmbeddingInput.text = text; - return deserializedEmbeddingInput; }); } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingInputType.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingInputType.java index 2e10403dcb6b..2fbe119da216 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingInputType.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingInputType.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference.models; import com.azure.core.annotation.Generated; @@ -12,6 +11,7 @@ * Represents the input types used for embedding search. */ public final class EmbeddingInputType extends ExpandableStringEnum { + /** * to do. */ @@ -32,7 +32,7 @@ public final class EmbeddingInputType extends ExpandableStringEnum { + /* * List of embedding values for the input prompt. These represent a measurement of the * vector-based relatedness of the provided input. Or a base64 encoded string of the embedding vector. @@ -52,7 +52,9 @@ private EmbeddingItem(BinaryData embedding, int index) { * @return the embedding value. */ @Generated - public BinaryData getEmbedding() { return this.embedding; } + public BinaryData getEmbedding() { + return this.embedding; + } /** * Get the embedding property: List of embedding values for the input prompt. These represent a measurement of the @@ -61,7 +63,8 @@ private EmbeddingItem(BinaryData embedding, int index) { * @return the embeddings as a list of floats. */ public List getEmbeddingList() { - return this.embedding.toObject(new TypeReference>() { }); + return this.embedding.toObject(new TypeReference>() { + }); } /** @@ -103,7 +106,6 @@ public static EmbeddingItem fromJson(JsonReader jsonReader) throws IOException { while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("embedding".equals(fieldName)) { embedding = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); } else if ("index".equals(fieldName)) { diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingsResult.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingsResult.java index bbc38e5592e6..486fb8b128ab 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingsResult.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingsResult.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference.models; import com.azure.core.annotation.Generated; @@ -20,6 +19,7 @@ */ @Immutable public final class EmbeddingsResult implements JsonSerializable { + /* * Embedding values for the prompts submitted in the request. */ @@ -40,7 +40,7 @@ public final class EmbeddingsResult implements JsonSerializable data, EmbeddingsUsage usage, String /** * Get the data property: Embedding values for the prompts submitted in the request. - * + * * @return the data value. */ @Generated @@ -64,7 +64,7 @@ public List getData() { /** * Get the usage property: Usage counts for tokens input using the embeddings API. - * + * * @return the usage value. */ @Generated @@ -74,7 +74,7 @@ public EmbeddingsUsage getUsage() { /** * Get the model property: The model ID used to generate this result. - * + * * @return the model value. */ @Generated @@ -97,7 +97,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of EmbeddingsResult from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of EmbeddingsResult if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. @@ -113,7 +113,6 @@ public static EmbeddingsResult fromJson(JsonReader jsonReader) throws IOExceptio while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("data".equals(fieldName)) { data = reader.readArray(reader1 -> EmbeddingItem.fromJson(reader1)); } else if ("usage".equals(fieldName)) { diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingsUsage.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingsUsage.java index 185910e2f94f..fad43a5295e7 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingsUsage.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingsUsage.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference.models; import com.azure.core.annotation.Generated; @@ -17,6 +16,7 @@ */ @Immutable public final class EmbeddingsUsage implements JsonSerializable { + /* * Number of tokens in the request. */ @@ -32,7 +32,7 @@ public final class EmbeddingsUsage implements JsonSerializable /** * Creates an instance of EmbeddingsUsage class. - * + * * @param promptTokens the promptTokens value to set. * @param totalTokens the totalTokens value to set. */ @@ -44,7 +44,7 @@ private EmbeddingsUsage(int promptTokens, int totalTokens) { /** * Get the promptTokens property: Number of tokens in the request. - * + * * @return the promptTokens value. */ @Generated @@ -55,7 +55,7 @@ public int getPromptTokens() { /** * Get the totalTokens property: Total number of tokens transacted in this request/response. Should equal the * number of tokens in the request. - * + * * @return the totalTokens value. */ @Generated @@ -77,7 +77,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of EmbeddingsUsage from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of EmbeddingsUsage if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. @@ -92,7 +92,6 @@ public static EmbeddingsUsage fromJson(JsonReader jsonReader) throws IOException while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("prompt_tokens".equals(fieldName)) { promptTokens = reader.getInt(); } else if ("total_tokens".equals(fieldName)) { diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionCall.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionCall.java index 1b65e7209b13..34b65cc42fb1 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionCall.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionCall.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference.models; import com.azure.core.annotation.Generated; @@ -17,6 +16,7 @@ */ @Immutable public final class FunctionCall implements JsonSerializable { + /* * The name of the function to call. */ @@ -34,7 +34,7 @@ public final class FunctionCall implements JsonSerializable { /** * Creates an instance of FunctionCall class. - * + * * @param name the name value to set. * @param arguments the arguments value to set. */ @@ -46,7 +46,7 @@ public FunctionCall(String name, String arguments) { /** * Get the name property: The name of the function to call. - * + * * @return the name value. */ @Generated @@ -59,7 +59,7 @@ public String getName() { * Note that the model does not always generate valid JSON, and may hallucinate parameters * not defined by your function schema. Validate the arguments in your code before calling * your function. - * + * * @return the arguments value. */ @Generated @@ -81,7 +81,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of FunctionCall from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of FunctionCall if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. @@ -96,7 +96,6 @@ public static FunctionCall fromJson(JsonReader jsonReader) throws IOException { while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("name".equals(fieldName)) { name = reader.getString(); } else if ("arguments".equals(fieldName)) { diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java index fd6835462efe..b63fd4e910cc 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference.models; import com.azure.core.annotation.Fluent; @@ -17,6 +16,7 @@ */ @Fluent public final class FunctionDefinition implements JsonSerializable { + /* * The name of the function to be called. */ @@ -135,7 +135,6 @@ public static FunctionDefinition fromJson(JsonReader jsonReader) throws IOExcept while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("name".equals(fieldName)) { name = reader.getString(); } else if ("description".equals(fieldName)) { @@ -149,7 +148,6 @@ public static FunctionDefinition fromJson(JsonReader jsonReader) throws IOExcept FunctionDefinition deserializedFunctionDefinition = new FunctionDefinition(name); deserializedFunctionDefinition.description = description; deserializedFunctionDefinition.parameters = parameters; - return deserializedFunctionDefinition; }); } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ModelInfo.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ModelInfo.java index 653d90a0cfe6..235a2659960a 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ModelInfo.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ModelInfo.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference.models; import com.azure.core.annotation.Generated; @@ -17,6 +16,7 @@ */ @Immutable public final class ModelInfo implements JsonSerializable { + /* * The name of the AI model. For example: `Phi21` */ @@ -37,7 +37,7 @@ public final class ModelInfo implements JsonSerializable { /** * Creates an instance of ModelInfo class. - * + * * @param modelName the modelName value to set. * @param modelType the modelType value to set. * @param modelProviderName the modelProviderName value to set. @@ -51,7 +51,7 @@ private ModelInfo(String modelName, ModelType modelType, String modelProviderNam /** * Get the modelName property: The name of the AI model. For example: `Phi21`. - * + * * @return the modelName value. */ @Generated @@ -61,7 +61,7 @@ public String getModelName() { /** * Get the modelType property: The type of the AI model. A Unique identifier for the profile. - * + * * @return the modelType value. */ @Generated @@ -71,7 +71,7 @@ public ModelType getModelType() { /** * Get the modelProviderName property: The model provider name. For example: `Microsoft Research`. - * + * * @return the modelProviderName value. */ @Generated @@ -94,7 +94,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of ModelInfo from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of ModelInfo if the JsonReader was pointing to an instance of it, or null if it was pointing * to JSON null. @@ -110,7 +110,6 @@ public static ModelInfo fromJson(JsonReader jsonReader) throws IOException { while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("model_name".equals(fieldName)) { modelName = reader.getString(); } else if ("model_type".equals(fieldName)) { diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ModelType.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ModelType.java index 79c51729bb85..be9e52d19d3a 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ModelType.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ModelType.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference.models; import com.azure.core.annotation.Generated; @@ -12,6 +11,7 @@ * The type of AI model. */ public final class ModelType extends ExpandableStringEnum { + /** * Embeddings. */ @@ -50,7 +50,7 @@ public final class ModelType extends ExpandableStringEnum { /** * Creates a new instance of ModelType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Generated @@ -60,7 +60,7 @@ public ModelType() { /** * Creates or finds a ModelType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ModelType. */ @@ -71,7 +71,7 @@ public static ModelType fromString(String name) { /** * Gets known ModelType values. - * + * * @return known ModelType values. */ @Generated diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/StreamingChatChoiceUpdate.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/StreamingChatChoiceUpdate.java index e44b8a50a578..369541df75b6 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/StreamingChatChoiceUpdate.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/StreamingChatChoiceUpdate.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference.models; import com.azure.core.annotation.Generated; @@ -20,6 +19,7 @@ */ @Immutable public final class StreamingChatChoiceUpdate implements JsonSerializable { + /* * The ordered index associated with this chat completions choice. */ @@ -40,7 +40,7 @@ public final class StreamingChatChoiceUpdate implements JsonSerializable { + /* * A unique identifier associated with this chat completions response. */ @@ -59,7 +59,7 @@ public final class StreamingChatCompletionsUpdate implements JsonSerializable { + /* * The chat role associated with the message. If present, should always be 'assistant' */ @@ -46,7 +46,7 @@ private StreamingChatResponseMessageUpdate() { /** * Get the role property: The chat role associated with the message. If present, should always be 'assistant'. - * + * * @return the role value. */ @Generated @@ -56,7 +56,7 @@ public ChatRole getRole() { /** * Get the content property: The content of the message. - * + * * @return the content value. */ @Generated @@ -68,7 +68,7 @@ public String getContent() { * Get the toolCalls property: The tool calls that must be resolved and have their outputs appended to subsequent * input messages for the chat * completions request to resolve as configured. - * + * * @return the toolCalls value. */ @Generated @@ -91,7 +91,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of StreamingChatResponseMessageUpdate from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of StreamingChatResponseMessageUpdate if the JsonReader was pointing to an instance of it, or * null if it was pointing to JSON null. @@ -105,7 +105,6 @@ public static StreamingChatResponseMessageUpdate fromJson(JsonReader jsonReader) while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("role".equals(fieldName)) { deserializedStreamingChatResponseMessageUpdate.role = ChatRole.fromString(reader.getString()); } else if ("content".equals(fieldName)) { @@ -118,7 +117,6 @@ public static StreamingChatResponseMessageUpdate fromJson(JsonReader jsonReader) reader.skipChildren(); } } - return deserializedStreamingChatResponseMessageUpdate; }); } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/StreamingChatResponseToolCallUpdate.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/StreamingChatResponseToolCallUpdate.java index 41495891b99e..64b3dbfd4c3d 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/StreamingChatResponseToolCallUpdate.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/StreamingChatResponseToolCallUpdate.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.inference.models; import com.azure.core.annotation.Generated; @@ -18,6 +17,7 @@ @Immutable public final class StreamingChatResponseToolCallUpdate implements JsonSerializable { + /* * The ID of the tool call. */ @@ -32,7 +32,7 @@ public final class StreamingChatResponseToolCallUpdate /** * Creates an instance of StreamingChatResponseToolCallUpdate class. - * + * * @param id the id value to set. * @param function the function value to set. */ @@ -44,7 +44,7 @@ private StreamingChatResponseToolCallUpdate(String id, FunctionCall function) { /** * Get the id property: The ID of the tool call. - * + * * @return the id value. */ @Generated @@ -54,7 +54,7 @@ public String getId() { /** * Get the function property: Updates to the function call requested by the AI model. - * + * * @return the function value. */ @Generated @@ -76,7 +76,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of StreamingChatResponseToolCallUpdate from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of StreamingChatResponseToolCallUpdate if the JsonReader was pointing to an instance of it, * or null if it was pointing to JSON null. @@ -91,7 +91,6 @@ public static StreamingChatResponseToolCallUpdate fromJson(JsonReader jsonReader while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("id".equals(fieldName)) { id = reader.getString(); } else if ("function".equals(fieldName)) { diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/package-info.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/package-info.java index 59ce7efa59bf..ae296ef0748c 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/package-info.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/package-info.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - /** * Package containing the data models for Model. */ diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/package-info.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/package-info.java index 7e46067adf99..06b95a667d3e 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/package-info.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/package-info.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - /** * Package containing the classes for Model. */ diff --git a/sdk/ai/azure-ai-inference/src/main/java/module-info.java b/sdk/ai/azure-ai-inference/src/main/java/module-info.java index 20f5ec8d9d92..49816749e27a 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/module-info.java +++ b/sdk/ai/azure-ai-inference/src/main/java/module-info.java @@ -8,4 +8,4 @@ exports com.azure.ai.inference.models; opens com.azure.ai.inference.models to com.azure.core; opens com.azure.ai.inference.implementation.models to com.azure.core; -} \ No newline at end of file +} diff --git a/sdk/ai/azure-ai-inference/src/main/resources/META-INF/azure-ai-inference_apiview_properties.json b/sdk/ai/azure-ai-inference/src/main/resources/META-INF/azure-ai-inference_apiview_properties.json index 9c4af625bb9d..b88e7d1bfc3d 100644 --- a/sdk/ai/azure-ai-inference/src/main/resources/META-INF/azure-ai-inference_apiview_properties.json +++ b/sdk/ai/azure-ai-inference/src/main/resources/META-INF/azure-ai-inference_apiview_properties.json @@ -44,7 +44,7 @@ "com.azure.ai.inference.models.ChatCompletionsFunctionToolSelection": "AI.Model.ChatCompletionsFunctionToolSelection", "com.azure.ai.inference.models.ChatCompletionsNamedToolSelection": "AI.Model.ChatCompletionsNamedToolSelection", "com.azure.ai.inference.models.ChatCompletionsResponseFormat": "AI.Model.ChatCompletionsResponseFormat", - "com.azure.ai.inference.models.ChatCompletionsResponseFormatJSON": "AI.Model.ChatCompletionsResponseFormatJSON", + "com.azure.ai.inference.models.ChatCompletionsResponseFormatJson": "AI.Model.ChatCompletionsResponseFormatJSON", "com.azure.ai.inference.models.ChatCompletionsResponseFormatText": "AI.Model.ChatCompletionsResponseFormatText", "com.azure.ai.inference.models.ChatCompletionsToolCall": "AI.Model.ChatCompletionsToolCall", "com.azure.ai.inference.models.ChatCompletionsToolDefinition": "AI.Model.ChatCompletionsToolDefinition", From f282c7f115813827949c0bb00ecc98879c263674 Mon Sep 17 00:00:00 2001 From: glenn Date: Wed, 28 Aug 2024 09:41:24 -0400 Subject: [PATCH 052/128] use latest typespec --- sdk/ai/azure-ai-inference/tsp-location.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/ai/azure-ai-inference/tsp-location.yaml b/sdk/ai/azure-ai-inference/tsp-location.yaml index 63a526da6360..ed684490bade 100644 --- a/sdk/ai/azure-ai-inference/tsp-location.yaml +++ b/sdk/ai/azure-ai-inference/tsp-location.yaml @@ -1,4 +1,4 @@ -commit: 14a23cfe23884571e6971feebfa56fb4f64dd4a7 +commit: 7d64c392924c28cd125576903cc5121a1f444dcc additionalDirectories: [] repo: Azure/azure-rest-api-specs directory: specification/ai/ModelClient From 92079076f0510b2e9637167438be775c53354277 Mon Sep 17 00:00:00 2001 From: glenn Date: Wed, 28 Aug 2024 11:00:44 -0400 Subject: [PATCH 053/128] add customization code --- .../azure-ai-inference/customization/pom.xml | 21 ++++++++++ .../main/java/InferenceCustomizations.java | 41 +++++++++++++++++++ sdk/ai/azure-ai-inference/tsp-location.yaml | 2 +- 3 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 sdk/ai/azure-ai-inference/customization/pom.xml create mode 100644 sdk/ai/azure-ai-inference/customization/src/main/java/InferenceCustomizations.java diff --git a/sdk/ai/azure-ai-inference/customization/pom.xml b/sdk/ai/azure-ai-inference/customization/pom.xml new file mode 100644 index 000000000000..86a2d9fb1767 --- /dev/null +++ b/sdk/ai/azure-ai-inference/customization/pom.xml @@ -0,0 +1,21 @@ + + + 4.0.0 + + + com.azure + azure-code-customization-parent + 1.0.0-beta.1 + ../../../parents/azure-code-customization-parent + + + Azure AI Inference client for Java + This package contains client customization for Azure AI Inference + + com.azure.tools + azure-ai-inference-customization + 1.0.0-beta.1 + jar + diff --git a/sdk/ai/azure-ai-inference/customization/src/main/java/InferenceCustomizations.java b/sdk/ai/azure-ai-inference/customization/src/main/java/InferenceCustomizations.java new file mode 100644 index 000000000000..80a2c5f377ba --- /dev/null +++ b/sdk/ai/azure-ai-inference/customization/src/main/java/InferenceCustomizations.java @@ -0,0 +1,41 @@ +import com.azure.autorest.customization.ClassCustomization; +import com.azure.autorest.customization.Customization; +import com.azure.autorest.customization.LibraryCustomization; +import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; +import com.github.javaparser.ast.body.FieldDeclaration; +import org.slf4j.Logger; + +/** + * This class contains the customization code to customize the AutoRest generated code for OpenAI. + */ +public class InferenceCustomizations extends Customization { + + @Override + public void customize(LibraryCustomization customization, Logger logger) { + // remove unused class (no reference to them, after partial-update) + customization.getRawEditor().removeFile("src/main/java/com/azure/ai/inference/implementation/models/CompleteOptions.java"); + //customizeEmbeddingEncodingFormatClass(customization, logger); + //customizeEmbeddingsOptions(customization, logger); + } + + /* + private void customizeEmbeddingEncodingFormatClass(LibraryCustomization customization, Logger logger) { + logger.info("Customizing the EmbeddingEncodingFormat class"); + ClassCustomization embeddingEncodingFormatClass = customization.getPackage("com.azure.ai.openai.models").getClass("EmbeddingEncodingFormat"); + embeddingEncodingFormatClass.getConstructor("EmbeddingEncodingFormat").setModifier(0); + embeddingEncodingFormatClass.setModifier(0); + } + + private void customizeEmbeddingsOptions(LibraryCustomization customization, Logger logger) { + logger.info("Customizing the EmbeddingsOptions class"); + ClassCustomization embeddingsOptionsClass = customization.getPackage("com.azure.ai.openai.models").getClass("EmbeddingsOptions"); + embeddingsOptionsClass.getMethod("getEncodingFormat").setModifier(0); + embeddingsOptionsClass.getMethod("setEncodingFormat").setModifier(0); + } + + private static String joinWithNewline(String... lines) { + return String.join("\n", lines); + } + + */ +} diff --git a/sdk/ai/azure-ai-inference/tsp-location.yaml b/sdk/ai/azure-ai-inference/tsp-location.yaml index ed684490bade..180a14f0911d 100644 --- a/sdk/ai/azure-ai-inference/tsp-location.yaml +++ b/sdk/ai/azure-ai-inference/tsp-location.yaml @@ -1,4 +1,4 @@ -commit: 7d64c392924c28cd125576903cc5121a1f444dcc +commit: 4dc99b86409163e24341215f4bbb6418c51ac186 additionalDirectories: [] repo: Azure/azure-rest-api-specs directory: specification/ai/ModelClient From 91315db21951ed8d31e61a0e5d3d119f957796d0 Mon Sep 17 00:00:00 2001 From: glenn Date: Wed, 28 Aug 2024 11:13:17 -0400 Subject: [PATCH 054/128] updated typespec --- .../customization/src/main/java/InferenceCustomizations.java | 4 ++-- sdk/ai/azure-ai-inference/tsp-location.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/ai/azure-ai-inference/customization/src/main/java/InferenceCustomizations.java b/sdk/ai/azure-ai-inference/customization/src/main/java/InferenceCustomizations.java index 80a2c5f377ba..422bb9a0e8a3 100644 --- a/sdk/ai/azure-ai-inference/customization/src/main/java/InferenceCustomizations.java +++ b/sdk/ai/azure-ai-inference/customization/src/main/java/InferenceCustomizations.java @@ -6,7 +6,7 @@ import org.slf4j.Logger; /** - * This class contains the customization code to customize the AutoRest generated code for OpenAI. + * This class contains the customization code to customize the AutoRest generated code for Azure AI Inference. */ public class InferenceCustomizations extends Customization { @@ -32,10 +32,10 @@ private void customizeEmbeddingsOptions(LibraryCustomization customization, Logg embeddingsOptionsClass.getMethod("getEncodingFormat").setModifier(0); embeddingsOptionsClass.getMethod("setEncodingFormat").setModifier(0); } + */ private static String joinWithNewline(String... lines) { return String.join("\n", lines); } - */ } diff --git a/sdk/ai/azure-ai-inference/tsp-location.yaml b/sdk/ai/azure-ai-inference/tsp-location.yaml index 180a14f0911d..1c5d9634acb0 100644 --- a/sdk/ai/azure-ai-inference/tsp-location.yaml +++ b/sdk/ai/azure-ai-inference/tsp-location.yaml @@ -1,4 +1,4 @@ -commit: 4dc99b86409163e24341215f4bbb6418c51ac186 +commit: 69098f115bd7d8b0a27bc7f57b2fca2906982ae1 additionalDirectories: [] repo: Azure/azure-rest-api-specs directory: specification/ai/ModelClient From 31c668bbca9b4339bbe5c98d4b43b8294f811c25 Mon Sep 17 00:00:00 2001 From: Matthew Metcalf Date: Tue, 27 Aug 2024 09:58:08 -0700 Subject: [PATCH 055/128] App Config Correlation Context update + yaml hint fix (#41607) * Updating correlation context to use pipeline context * Fixing yaml hints * Updating property docs from yaml * removing unused imports --- .../pom.xml | 6 ++ ...ationApplicationSettingPropertySource.java | 4 +- .../AppConfigurationPropertySource.java | 2 +- ...AppConfigurationPropertySourceLocator.java | 6 +- .../AppConfigurationPullRefresh.java | 2 - .../AppConfigurationRefreshUtil.java | 8 +- .../AppConfigurationReplicaClient.java | 23 +++-- .../implementation/FeatureFlagClient.java | 4 +- .../config/implementation/HostType.java | 7 +- .../RequestTracingConstants.java | 5 + .../policy/BaseAppConfigurationPolicy.java | 25 ++--- .../http/policy/TracingInfo.java | 20 +++- .../AppConfigurationKeyValueSelector.java | 25 ++++- .../AppConfigurationProperties.java | 7 +- .../AppConfigurationStoreMonitoring.java | 28 ++++++ .../AppConfigurationStoreTrigger.java | 7 ++ .../properties/ConfigStore.java | 54 ++++++++++- .../FeatureFlagKeyValueSelector.java | 11 +++ ...nApplicationSettingPropertySourceTest.java | 19 ++-- ...nfigurationPropertySourceKeyVaultTest.java | 19 ++-- ...onfigurationPropertySourceLocatorTest.java | 28 +++--- .../AppConfigurationRefreshUtilTest.java | 48 ++++++---- .../AppConfigurationReplicaClientTest.java | 92 +++++++++++-------- .../implementation/FeatureFlagClientTest.java | 24 +++-- .../BaseAppConfigurationPolicyTest.java | 4 +- 25 files changed, 332 insertions(+), 146 deletions(-) diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/pom.xml b/sdk/spring/spring-cloud-azure-appconfiguration-config/pom.xml index 8ca857c5b49f..b68abc0933e3 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/pom.xml +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/pom.xml @@ -23,6 +23,12 @@ spring-boot-autoconfigure 3.3.3 + + org.springframework.boot + spring-boot-configuration-processor + 3.3.2 + true + org.springframework.cloud spring-cloud-starter-bootstrap diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationApplicationSettingPropertySource.java b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationApplicationSettingPropertySource.java index c6fbf1b5e18b..5d410ab33151 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationApplicationSettingPropertySource.java +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationApplicationSettingPropertySource.java @@ -60,7 +60,7 @@ class AppConfigurationApplicationSettingPropertySource extends AppConfigurationP * @param keyPrefixTrimValues prefixs to trim from key values * @throws InvalidConfigurationPropertyValueException thrown if fails to parse Json content type */ - public void initProperties(List keyPrefixTrimValues) throws InvalidConfigurationPropertyValueException { + public void initProperties(List keyPrefixTrimValues, boolean isRefresh) throws InvalidConfigurationPropertyValueException { List labels = Arrays.asList(labelFilters); // Reverse labels so they have the right priority order. @@ -70,7 +70,7 @@ public void initProperties(List keyPrefixTrimValues) throws InvalidConfi SettingSelector settingSelector = new SettingSelector().setKeyFilter(keyFilter + "*").setLabelFilter(label); // * for wildcard match - processConfigurationSettings(replicaClient.listSettings(settingSelector), settingSelector.getKeyFilter(), + processConfigurationSettings(replicaClient.listSettings(settingSelector, isRefresh), settingSelector.getKeyFilter(), keyPrefixTrimValues); } } diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationPropertySource.java b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationPropertySource.java index 6877a09a014b..c31069689625 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationPropertySource.java +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationPropertySource.java @@ -55,5 +55,5 @@ protected static String getLabelName(String[] labelFilters) { return String.join(",", labelFilters); } - protected abstract void initProperties(List trim) throws InvalidConfigurationPropertyValueException; + protected abstract void initProperties(List trim, boolean isRefresh) throws InvalidConfigurationPropertyValueException; } diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationPropertySourceLocator.java b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationPropertySourceLocator.java index 824d3017cfa6..04de646b0631 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationPropertySourceLocator.java +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationPropertySourceLocator.java @@ -200,7 +200,7 @@ private void setupMonitoring(ConfigStore configStore, AppConfigurationReplicaCli if (monitoring.isEnabled()) { // Setting new ETag values for Watch List watchKeysSettings = monitoring.getTriggers().stream() - .map(trigger -> client.getWatchKey(trigger.getKey(), trigger.getLabel())).toList(); + .map(trigger -> client.getWatchKey(trigger.getKey(), trigger.getLabel(), !STARTUP.get())).toList(); newState.setState(configStore.getEndpoint(), watchKeysSettings, monitoring.getRefreshInterval()); } @@ -258,7 +258,7 @@ private List createSettings(AppConfigurationRepl selectedKeys.getKeyFilter() + store.getEndpoint() + "/", client, keyVaultClientFactory, selectedKeys.getKeyFilter(), selectedKeys.getLabelFilter(profiles)); } - propertySource.initProperties(store.getTrimKeyPrefix()); + propertySource.initProperties(store.getTrimKeyPrefix(), !STARTUP.get()); sourceList.add(propertySource); } @@ -281,7 +281,7 @@ private List createFeatureFlags(AppConfigurationReplicaClient clie if (store.getFeatureFlags().getEnabled()) { for (FeatureFlagKeyValueSelector selectedKeys : store.getFeatureFlags().getSelects()) { List storesFeatureFlags = featureFlagClient.loadFeatureFlags(client, - selectedKeys.getKeyFilter(), selectedKeys.getLabelFilter(profiles)); + selectedKeys.getKeyFilter(), selectedKeys.getLabelFilter(profiles), !STARTUP.get()); storesFeatureFlags.forEach(featureFlags -> featureFlags.setConfigStore(store)); featureFlagWatchKeys.addAll(storesFeatureFlags); } diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationPullRefresh.java b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationPullRefresh.java index e346eaf1e633..ac8965d6e901 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationPullRefresh.java +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationPullRefresh.java @@ -16,7 +16,6 @@ import com.azure.spring.cloud.appconfiguration.config.AppConfigurationStoreHealth; import com.azure.spring.cloud.appconfiguration.config.implementation.AppConfigurationRefreshUtil.RefreshEventData; import com.azure.spring.cloud.appconfiguration.config.implementation.autofailover.ReplicaLookUp; -import com.azure.spring.cloud.appconfiguration.config.implementation.http.policy.BaseAppConfigurationPolicy; import reactor.core.publisher.Mono; @@ -110,7 +109,6 @@ public void expireRefreshInterval(String endpoint, String syncToken) { */ private boolean refreshStores() { if (running.compareAndSet(false, true)) { - BaseAppConfigurationPolicy.setWatchRequests(true); try { RefreshEventData eventData = refreshUtils.refreshStoresCheck(clientFactory, refreshInterval, defaultMinBackoff, replicaLookUp); diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationRefreshUtil.java b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationRefreshUtil.java index 61e6b2eddc58..ca1cc33c3905 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationRefreshUtil.java +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationRefreshUtil.java @@ -15,7 +15,6 @@ import com.azure.spring.cloud.appconfiguration.config.implementation.autofailover.ReplicaLookUp; import com.azure.spring.cloud.appconfiguration.config.implementation.feature.FeatureFlagState; import com.azure.spring.cloud.appconfiguration.config.implementation.feature.FeatureFlags; -import com.azure.spring.cloud.appconfiguration.config.implementation.http.policy.BaseAppConfigurationPolicy; import com.azure.spring.cloud.appconfiguration.config.implementation.properties.AppConfigurationStoreMonitoring; import com.azure.spring.cloud.appconfiguration.config.implementation.properties.FeatureFlagStore; @@ -32,7 +31,6 @@ public class AppConfigurationRefreshUtil { RefreshEventData refreshStoresCheck(AppConfigurationReplicaClientFactory clientFactory, Duration refreshInterval, Long defaultMinBackoff, ReplicaLookUp replicaLookUp) { RefreshEventData eventData = new RefreshEventData(); - BaseAppConfigurationPolicy.setWatchRequests(true); try { if (refreshInterval != null && StateHolder.getNextForcedRefresh() != null @@ -178,7 +176,7 @@ private static void refreshWithTime(AppConfigurationReplicaClient client, State private static void refreshWithoutTime(AppConfigurationReplicaClient client, List watchKeys, RefreshEventData eventData) throws AppConfigurationStatusException { for (ConfigurationSetting watchKey : watchKeys) { - ConfigurationSetting watchedKey = client.getWatchKey(watchKey.getKey(), watchKey.getLabel()); + ConfigurationSetting watchedKey = client.getWatchKey(watchKey.getKey(), watchKey.getLabel(), true); // If there is no result, etag will be considered empty. // A refresh will trigger once the selector returns a value. @@ -200,7 +198,7 @@ private static void refreshWithTimeFeatureFlags(AppConfigurationReplicaClient cl for (FeatureFlags featureFlags : state.getWatchKeys()) { - if (client.checkWatchKeys(featureFlags.getSettingSelector())) { + if (client.checkWatchKeys(featureFlags.getSettingSelector(), true)) { String eventDataInfo = ".appconfig.featureflag/*"; // Only one refresh Event needs to be call to update all of the @@ -222,7 +220,7 @@ private static void refreshWithoutTimeFeatureFlags(AppConfigurationReplicaClient for (FeatureFlags featureFlags : watchKeys.getWatchKeys()) { - if (client.checkWatchKeys(featureFlags.getSettingSelector())) { + if (client.checkWatchKeys(featureFlags.getSettingSelector(), true)) { String eventDataInfo = ".appconfig.featureflag/*"; // Only one refresh Event needs to be call to update all of the diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationReplicaClient.java b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationReplicaClient.java index 7e55d4b6622c..9c43522cafcb 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationReplicaClient.java +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationReplicaClient.java @@ -14,6 +14,7 @@ import com.azure.core.http.MatchConditions; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.PagedResponse; +import com.azure.core.util.Context; import com.azure.data.appconfiguration.ConfigurationClient; import com.azure.data.appconfiguration.models.ConfigurationSetting; import com.azure.data.appconfiguration.models.ConfigurationSnapshot; @@ -91,11 +92,14 @@ String getEndpoint() { * @param label String value of the watch key, use \0 for null. * @return The first returned configuration. */ - ConfigurationSetting getWatchKey(String key, String label) + ConfigurationSetting getWatchKey(String key, String label, Boolean isRefresh) throws HttpResponseException { try { + Context context = new Context("refresh", isRefresh); + ConfigurationSetting selector = new ConfigurationSetting().setKey(key).setLabel(label); ConfigurationSetting watchKey = NormalizeNull - .normalizeNullLabel(client.getConfigurationSetting(key, label)); + .normalizeNullLabel( + client.getConfigurationSettingWithResponse(selector, null, false, context).getValue()); this.failedAttempts = 0; return watchKey; } catch (HttpResponseException e) { @@ -111,11 +115,12 @@ ConfigurationSetting getWatchKey(String key, String label) * @param settingSelector Information on which setting to pull. i.e. number of results, key value... * @return List of Configuration Settings. */ - List listSettings(SettingSelector settingSelector) + List listSettings(SettingSelector settingSelector, Boolean isRefresh) throws HttpResponseException { List configurationSettings = new ArrayList<>(); try { - PagedIterable settings = client.listConfigurationSettings(settingSelector); + Context context = new Context("refresh", isRefresh); + PagedIterable settings = client.listConfigurationSettings(settingSelector, context); settings.forEach(setting -> { configurationSettings.add(NormalizeNull.normalizeNullLabel(setting)); }); @@ -129,11 +134,12 @@ List listSettings(SettingSelector settingSelector) } } - FeatureFlags listFeatureFlags(SettingSelector settingSelector) throws HttpResponseException { + FeatureFlags listFeatureFlags(SettingSelector settingSelector, Boolean isRefresh) throws HttpResponseException { List configurationSettings = new ArrayList<>(); List checks = new ArrayList<>(); try { - client.listConfigurationSettings(settingSelector).streamByPage().forEach(pagedResponse -> { + Context context = new Context("refresh", isRefresh); + client.listConfigurationSettings(settingSelector, context).streamByPage().forEach(pagedResponse -> { checks.add( new MatchConditions().setIfNoneMatch(pagedResponse.getHeaders().getValue(HttpHeaderName.ETAG))); for (ConfigurationSetting featureFlag : pagedResponse.getValue()) { @@ -172,8 +178,9 @@ List listSettingSnapshot(String snapshotName) { } } - Boolean checkWatchKeys(SettingSelector settingSelector) { - List> results = client.listConfigurationSettings(settingSelector) + Boolean checkWatchKeys(SettingSelector settingSelector, Boolean isRefresh) { + Context context = new Context("refresh", isRefresh); + List> results = client.listConfigurationSettings(settingSelector, context) .streamByPage().filter(pagedResponse -> pagedResponse.getStatusCode() != 304).toList(); return results.size() > 0; } diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/FeatureFlagClient.java b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/FeatureFlagClient.java index 4a4fb7ee4219..956454d616ca 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/FeatureFlagClient.java +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/FeatureFlagClient.java @@ -63,7 +63,7 @@ public class FeatureFlagClient { * */ public List loadFeatureFlags(AppConfigurationReplicaClient replicaClient, String customKeyFilter, - String[] labelFilter) { + String[] labelFilter, boolean isRefresh) { List loadedFeatureFlags = new ArrayList<>(); String keyFilter = SELECT_ALL_FEATURE_FLAGS; @@ -78,7 +78,7 @@ public List loadFeatureFlags(AppConfigurationReplicaClient replica for (String label : labels) { SettingSelector settingSelector = new SettingSelector().setKeyFilter(keyFilter).setLabelFilter(label); - FeatureFlags features = replicaClient.listFeatureFlags(settingSelector); + FeatureFlags features = replicaClient.listFeatureFlags(settingSelector, isRefresh); loadedFeatureFlags.addAll(proccessFeatureFlags(features, keyFilter)); } return loadedFeatureFlags; diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/HostType.java b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/HostType.java index 6465186dbecc..e438a3c2fc15 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/HostType.java +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/HostType.java @@ -30,7 +30,12 @@ public enum HostType { /** * Host is Container App */ - CONTAINER_APP("ContainerApp"); + CONTAINER_APP("ContainerApp"), + + /** + * Host is Service Fabric + */ + SERVICE_FABRIC("ServiceFabric"); private final String text; diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/RequestTracingConstants.java b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/RequestTracingConstants.java index bd0cbff3aa08..e5884a0f4753 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/RequestTracingConstants.java +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/RequestTracingConstants.java @@ -32,6 +32,11 @@ public enum RequestTracingConstants { */ CONTAINER_APP_ENVIRONMENT_VARIABLE("CONTAINER_APP_NAME"), + /** + * Constant for checking Service Fabric + */ + SERVICE_FABRIC_ENVIRONMENT_VARIABLE("Fabric_NodeName"), + /** * Constant for tracing the type of request */ diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/http/policy/BaseAppConfigurationPolicy.java b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/http/policy/BaseAppConfigurationPolicy.java index 49c72ba082fd..0f5db1c2ee38 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/http/policy/BaseAppConfigurationPolicy.java +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/http/policy/BaseAppConfigurationPolicy.java @@ -2,17 +2,18 @@ // Licensed under the MIT License. package com.azure.spring.cloud.appconfiguration.config.implementation.http.policy; -import static com.azure.spring.cloud.appconfiguration.config.implementation.AppConfigurationConstants.USER_AGENT_TYPE; - import org.springframework.util.StringUtils; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpPipelineCallContext; import com.azure.core.http.HttpPipelineNextPolicy; import com.azure.core.http.HttpResponse; import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.spring.cloud.appconfiguration.config.implementation.RequestTracingConstants; +import com.azure.spring.cloud.appconfiguration.config.implementation.AppConfigurationConstants; import reactor.core.publisher.Mono; + /** * HttpPipelinePolicy for connecting to Azure App Configuration. */ @@ -29,8 +30,6 @@ public final class BaseAppConfigurationPolicy implements HttpPipelinePolicy { public static final String USER_AGENT = String.format("%s/%s", StringUtils.replace(PACKAGE_NAME, " ", ""), BaseAppConfigurationPolicy.class.getPackage().getImplementationVersion()); - static Boolean watchRequests = false; - final TracingInfo tracingInfo; /** @@ -41,22 +40,16 @@ public BaseAppConfigurationPolicy(TracingInfo tracingInfo) { this.tracingInfo = tracingInfo; } - @SuppressWarnings("deprecation") @Override public Mono process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { - String sdkUserAgent = context.getHttpRequest().getHeaders().get(USER_AGENT_TYPE).getValue(); - context.getHttpRequest().getHeaders().set(USER_AGENT_TYPE, USER_AGENT + " " + sdkUserAgent); - context.getHttpRequest().getHeaders().set(RequestTracingConstants.CORRELATION_CONTEXT_HEADER.toString(), + Boolean watchRequests = (Boolean) context.getData("refresh").orElse(false); + HttpHeaders headers = context.getHttpRequest().getHeaders(); + String sdkUserAgent = headers.get(HttpHeaderName.USER_AGENT).getValue(); + headers.set(HttpHeaderName.USER_AGENT, USER_AGENT + " " + sdkUserAgent); + headers.set(HttpHeaderName.fromString(AppConfigurationConstants.CORRELATION_CONTEXT), tracingInfo.getValue(watchRequests)); return next.process(); } - /** - * @param watchRequests the watchRequests to set - */ - public static void setWatchRequests(Boolean watchRequests) { - BaseAppConfigurationPolicy.watchRequests = watchRequests; - } - } diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/http/policy/TracingInfo.java b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/http/policy/TracingInfo.java index 3299dbd5ab14..e9608eb72db2 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/http/policy/TracingInfo.java +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/http/policy/TracingInfo.java @@ -5,6 +5,8 @@ import static com.azure.spring.cloud.appconfiguration.config.implementation.AppConfigurationConstants.DEV_ENV_TRACING; import static com.azure.spring.cloud.appconfiguration.config.implementation.AppConfigurationConstants.KEY_VAULT_CONFIGURED_TRACING; +import org.springframework.util.StringUtils; + import com.azure.core.util.Configuration; import com.azure.spring.cloud.appconfiguration.config.implementation.HostType; import com.azure.spring.cloud.appconfiguration.config.implementation.RequestTracingConstants; @@ -19,7 +21,7 @@ public class TracingInfo { private int replicaCount; private final FeatureFlagTracing featureFlagTracing; - + private final Configuration configuration; public TracingInfo(boolean isDev, boolean isKeyVaultConfigured, int replicaCount, Configuration configuration) { @@ -31,7 +33,8 @@ public TracingInfo(boolean isDev, boolean isKeyVaultConfigured, int replicaCount } public String getValue(boolean watchRequests) { - String track = configuration.get(RequestTracingConstants.REQUEST_TRACING_DISABLED_ENVIRONMENT_VARIABLE.toString()); + String track = configuration + .get(RequestTracingConstants.REQUEST_TRACING_DISABLED_ENVIRONMENT_VARIABLE.toString()); if (track != null && Boolean.valueOf(track)) { return ""; } @@ -60,6 +63,8 @@ public String getValue(boolean watchRequests) { if (replicaCount > 0) { sb.append(",").append(RequestTracingConstants.REPLICA_COUNT).append("=").append(replicaCount); } + + sb = getFeatureManagementUsage(sb); return sb.toString(); } @@ -80,10 +85,21 @@ private static String getHostType() { hostType = HostType.KUBERNETES; } else if (System.getenv(RequestTracingConstants.CONTAINER_APP_ENVIRONMENT_VARIABLE.toString()) != null) { hostType = HostType.CONTAINER_APP; + } else if (System.getenv(RequestTracingConstants.SERVICE_FABRIC_ENVIRONMENT_VARIABLE.toString()) != null) { + hostType = HostType.SERVICE_FABRIC; } return hostType.toString(); } + + private static StringBuilder getFeatureManagementUsage(StringBuilder sb) { + ClassLoader loader = ClassLoader.getSystemClassLoader(); + Package ff = loader.getDefinedPackage("com.azure.spring.cloud.feature.management.models"); + if (ff != null && StringUtils.hasText(ff.getImplementationVersion())) { + sb.append(",FMSpVer=").append(ff.getImplementationVersion()); + } + return sb; + } /** * @return the featureFlagTracing diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/properties/AppConfigurationKeyValueSelector.java b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/properties/AppConfigurationKeyValueSelector.java index b8b9f1ad8684..d6d4baed1efd 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/properties/AppConfigurationKeyValueSelector.java +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/properties/AppConfigurationKeyValueSelector.java @@ -33,11 +33,30 @@ public final class AppConfigurationKeyValueSelector { public static final String LABEL_SEPARATOR = ","; @NotNull + /** + * Key filter to use when loading configurations. The default value is + * "/application/". The key filter is used to filter configurations by key. + * The key filter must be a non-null string that does not contain an asterisk. + */ private String keyFilter = ""; + /** + * Label filter to use when loading configurations. The label filter is used to + * filter configurations by label. If the label filter is not set, the default + * value is the current active Spring profiles. If no active profiles are set, + * then all configurations with no label are loaded. The label filter must be a + * non-null string that does not contain an asterisk. + */ private String labelFilter; + /** + * Snapshot name to use when loading configurations. The snapshot name is used + * to load configurations from a snapshot. If the snapshot name is set, the key + * and label filters must not be set. The snapshot name must be a non-null + * string that does not contain an asterisk. + */ private String snapshotName = ""; + /** * @return the keyFilter */ @@ -55,8 +74,10 @@ public AppConfigurationKeyValueSelector setKeyFilter(String keyFilter) { } /** - * @param profiles List of current Spring profiles to default to using is null label is set. - * @return List of reversed label values, which are split by the separator, the latter label has higher priority + * @param profiles List of current Spring profiles to default to using is null + * label is set. + * @return List of reversed label values, which are split by the separator, the + * latter label has higher priority */ public String[] getLabelFilter(List profiles) { if (labelFilter == null && profiles.size() > 0) { diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/properties/AppConfigurationProperties.java b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/properties/AppConfigurationProperties.java index 981f487518cc..8518170fc57c 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/properties/AppConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/properties/AppConfigurationProperties.java @@ -9,6 +9,7 @@ import java.util.Map; import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; import org.springframework.util.Assert; import org.springframework.util.StringUtils; @@ -17,8 +18,9 @@ /** * Properties for all Azure App Configuration stores that are loaded. */ +@Configuration @ConfigurationProperties(prefix = AppConfigurationProperties.CONFIG_PREFIX) -public final class AppConfigurationProperties { +public class AppConfigurationProperties { /** * Prefix for client configurations for connecting to configuration stores. @@ -27,6 +29,9 @@ public final class AppConfigurationProperties { private boolean enabled = true; + /** + * List of Azure App Configuration stores to connect to. + */ private List stores = new ArrayList<>(); private Duration refreshInterval; diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/properties/AppConfigurationStoreMonitoring.java b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/properties/AppConfigurationStoreMonitoring.java index cfc724d7c126..22db1862d354 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/properties/AppConfigurationStoreMonitoring.java +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/properties/AppConfigurationStoreMonitoring.java @@ -15,14 +15,30 @@ */ public final class AppConfigurationStoreMonitoring { + /** + * If true, the application will check for updates to the configuration store. + * When set to true at least one trigger must be set. + */ private boolean enabled = false; + /** + * The minimum time between checks. The minimum valid time is 1s. The default refresh interval is 30s. + */ private Duration refreshInterval = Duration.ofSeconds(30); + /** + * The minimum time between checks of feature flags. The minimum valid time is 1s. The default refresh interval is 30s. + */ private Duration featureFlagRefreshInterval = Duration.ofSeconds(30); + /** + * List of triggers that will cause a refresh of the configuration store. + */ private List triggers = new ArrayList<>(); + /** + * Validation tokens for push notificaiton requests. + */ private PushNotification pushNotification = new PushNotification(); /** @@ -118,8 +134,14 @@ public void validateAndInit() { */ public static class PushNotification { + /** + * Validation token for push notification requests. + */ private AccessToken primaryToken = new AccessToken(); + /** + * Secondary validation token for push notification requests. + */ private AccessToken secondaryToken = new AccessToken(); /** @@ -156,8 +178,14 @@ public void setSecondaryToken(AccessToken secondaryToken) { */ public static class AccessToken { + /** + * Name of the token. + */ private String name; + /** + * Secret for the token. + */ private String secret; /** diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/properties/AppConfigurationStoreTrigger.java b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/properties/AppConfigurationStoreTrigger.java index e57a6d984d69..ec69376e1bd7 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/properties/AppConfigurationStoreTrigger.java +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/properties/AppConfigurationStoreTrigger.java @@ -14,9 +14,16 @@ */ public final class AppConfigurationStoreTrigger { + /** + * Key value of the configuration setting checked when looking for changes. + */ @NotNull private String key; + /** + * Label value of the configuration setting checked when looking for changes. + * If the label is not set, the default value is no label. + */ private String label; /** diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/properties/ConfigStore.java b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/properties/ConfigStore.java index 878db9e464c8..7444d739770f 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/properties/ConfigStore.java +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/properties/ConfigStore.java @@ -21,27 +21,73 @@ public final class ConfigStore { private static final String DEFAULT_KEYS = "/application/"; + /** + * Endpoint for the Azure Config Service. + */ private String endpoint = ""; // Config store endpoint + /** + * List of endpoints for geo-replicated config store instances. When connecting + * to Azure App Configuration, the endpoints will failover to the next endpoint + * in the list if the current endpoint is unreachable. + */ private List endpoints = new ArrayList<>(); + /** + * Connection String for the Azure Config Service. + */ private String connectionString; + /** + * List of connection strings for geo-replicated config store instances. When + * connecting to Azure App Configuration, the connection strings will failover + * to the next connection string in the list if the current connection string is + * unreachable. + */ private List connectionStrings = new ArrayList<>(); - // Label values separated by comma in the Azure Config Service, can be empty + /** + * List of key selectors to filter the keys to be retrieved from the Azure + * Config Service. If no selectors are provided, the default selector will + * retrieve all keys with the prefix "/application/" and no label. + */ private List selects = new ArrayList<>(); + /** + * If true, the application will fail to start if the Config Store cannot be + * reached. If false, the application will start without the Config Store. + */ private boolean failFast = true; + /** + * Options for retrieving Feature Flags from the Azure Config Service. + */ private FeatureFlagStore featureFlags = new FeatureFlagStore(); + /** + * If true, the Config Store will be enabled. If false, the Config Store will be + * disabled and no keys will be retrieved from the Config Store. + */ private boolean enabled = true; + /** + * Options for monitoring the Config Store. + */ private AppConfigurationStoreMonitoring monitoring = new AppConfigurationStoreMonitoring(); + /** + * List of values to be trimmed from key names before being set to + * `@ConfigurationProperties`. By default the prefix "/application/" is trimmed + * from key names. If any trimKeyPrefix values are provided, the default prefix + * will not be trimmed. + */ private List trimKeyPrefix; + /** + * If true, the Config Store will attempt to discover the replica endpoints for + * the Config Store. If false, the Config Store will not attempt to discover the + * replica endpoints for the Config Store. + */ private boolean replicaDiscoveryEnabled = true; /** @@ -66,7 +112,8 @@ public List getEndpoints() { } /** - * @param endpoints list of endpoints to connect to geo-replicated config store instances. + * @param endpoints list of endpoints to connect to geo-replicated config store + * instances. */ public void setEndpoints(List endpoints) { this.endpoints = endpoints; @@ -185,7 +232,8 @@ public List getTrimKeyPrefix() { } /** - * @param trimKeyPrefix the values to be trimmed from key names before being set to `@ConfigurationProperties` + * @param trimKeyPrefix the values to be trimmed from key names before being set + * to `@ConfigurationProperties` */ public void setTrimKeyPrefix(List trimKeyPrefix) { this.trimKeyPrefix = trimKeyPrefix; diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/properties/FeatureFlagKeyValueSelector.java b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/properties/FeatureFlagKeyValueSelector.java index 358464a6802b..b3280178e200 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/properties/FeatureFlagKeyValueSelector.java +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/properties/FeatureFlagKeyValueSelector.java @@ -25,8 +25,18 @@ public final class FeatureFlagKeyValueSelector { */ private static final String[] EMPTY_LABEL_ARRAY = { EMPTY_LABEL }; + /** + * Key filter to use when loading feature flags. The provided key filter is + * appended after the feature flag prefix, ".appconfig.featureflag/". By + * default, all feature flags are loaded. + */ private String keyFilter = ""; + /** + * Label filter to use when loading feature flags. By default, all feature flags + * with no label are loaded. The label filter must be a non-null string that + * does not contain an asterisk. + */ private String labelFilter; /** @@ -74,6 +84,7 @@ public String[] getLabelFilter(List profiles) { /** * Get all labels as a single String + * * @param profiles current user profiles * @return comma separated list of labels */ diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationApplicationSettingPropertySourceTest.java b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationApplicationSettingPropertySourceTest.java index 9836dbed373d..1f7fe5ce9760 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationApplicationSettingPropertySourceTest.java +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationApplicationSettingPropertySourceTest.java @@ -63,7 +63,8 @@ public class AppConfigurationApplicationSettingPropertySourceTest { private static final ConfigurationSetting ITEM_NULL = createItem(KEY_FILTER, TEST_KEY_3, TEST_VALUE_3, TEST_LABEL_3, null); - private static final ConfigurationSetting ITEM_INVALID_JSON = createItem(KEY_FILTER, TEST_KEY_3, TEST_VALUE_3, TEST_LABEL_3, + private static final ConfigurationSetting ITEM_INVALID_JSON = createItem(KEY_FILTER, TEST_KEY_3, TEST_VALUE_3, + TEST_LABEL_3, JSON_CONTENT_TYPE); private static final ObjectMapper MAPPER = new ObjectMapper(); @@ -115,10 +116,10 @@ public void cleanup() throws Exception { @Test public void testPropCanBeInitAndQueried() throws IOException { when(configurationListMock.iterator()).thenReturn(testItems.iterator()); - when(clientMock.listSettings(Mockito.any())).thenReturn(configurationListMock) + when(clientMock.listSettings(Mockito.any(), Mockito.anyBoolean())).thenReturn(configurationListMock) .thenReturn(configurationListMock); - propertySource.initProperties(null); + propertySource.initProperties(null, false); String[] keyNames = propertySource.getPropertyNames(); String[] expectedKeyNames = testItems.stream() @@ -139,10 +140,10 @@ public void testPropertyNameSlashConvertedToDots() throws IOException { settings.add(slashedProp); when(configurationListMock.iterator()).thenReturn(settings.iterator()) .thenReturn(Collections.emptyIterator()); - when(clientMock.listSettings(Mockito.any())).thenReturn(configurationListMock) + when(clientMock.listSettings(Mockito.any(), Mockito.anyBoolean())).thenReturn(configurationListMock) .thenReturn(configurationListMock); - propertySource.initProperties(null); + propertySource.initProperties(null, false); String expectedKeyName = TEST_SLASH_KEY.replace('/', '.'); String[] actualKeyNames = propertySource.getPropertyNames(); @@ -159,9 +160,9 @@ public void initNullValidContentTypeTest() throws IOException { items.add(ITEM_NULL); when(configurationListMock.iterator()).thenReturn(items.iterator()) .thenReturn(Collections.emptyIterator()); - when(clientMock.listSettings(Mockito.any())).thenReturn(configurationListMock); + when(clientMock.listSettings(Mockito.any(), Mockito.anyBoolean())).thenReturn(configurationListMock); - propertySource.initProperties(null); + propertySource.initProperties(null, false); String[] keyNames = propertySource.getPropertyNames(); String[] expectedKeyNames = items.stream() @@ -176,9 +177,9 @@ public void jsonContentTypeWithInvalidJsonValueTest() { items.add(ITEM_INVALID_JSON); when(configurationListMock.iterator()).thenReturn(items.iterator()) .thenReturn(Collections.emptyIterator()); - when(clientMock.listSettings(Mockito.any())).thenReturn(configurationListMock); + when(clientMock.listSettings(Mockito.any(), Mockito.anyBoolean())).thenReturn(configurationListMock); - assertThatThrownBy(() -> propertySource.initProperties(null)) + assertThatThrownBy(() -> propertySource.initProperties(null, false)) .isInstanceOf(InvalidConfigurationPropertyValueException.class) .hasMessageNotContaining(ITEM_INVALID_JSON.getValue()); } diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationPropertySourceKeyVaultTest.java b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationPropertySourceKeyVaultTest.java index 8ed112b31f8e..2833cc92970c 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationPropertySourceKeyVaultTest.java +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationPropertySourceKeyVaultTest.java @@ -98,15 +98,16 @@ public void testKeyVaultTest() { List settings = List.of(KEY_VAULT_ITEM); when(keyVaultSecretListMock.iterator()).thenReturn(settings.iterator()) .thenReturn(Collections.emptyIterator()); - when(replicaClientMock.listSettings(Mockito.any())).thenReturn(keyVaultSecretListMock) + when(replicaClientMock.listSettings(Mockito.any(), Mockito.anyBoolean())).thenReturn(keyVaultSecretListMock) .thenReturn(keyVaultSecretListMock); KeyVaultSecret secret = new KeyVaultSecret("mySecret", "mySecretValue"); - when(keyVaultClientFactoryMock.getClient(Mockito.eq("https://test.key.vault.com"))).thenReturn(clientManagerMock); + when(keyVaultClientFactoryMock.getClient(Mockito.eq("https://test.key.vault.com"))) + .thenReturn(clientManagerMock); when(clientManagerMock.getSecret(Mockito.any(URI.class))).thenReturn(secret); try { - propertySource.initProperties(null); + propertySource.initProperties(null, false); } catch (InvalidConfigurationPropertyValueException e) { fail("Failed Reading in Feature Flags"); } @@ -124,11 +125,11 @@ public void invalidKeyVaultReferenceInvalidURITest() { List settings = List.of(KEY_VAULT_ITEM_INVALID_URI); when(keyVaultSecretListMock.iterator()).thenReturn(settings.iterator()) .thenReturn(Collections.emptyIterator()); - when(replicaClientMock.listSettings(Mockito.any())).thenReturn(keyVaultSecretListMock) + when(replicaClientMock.listSettings(Mockito.any(), Mockito.anyBoolean())).thenReturn(keyVaultSecretListMock) .thenReturn(keyVaultSecretListMock); InvalidConfigurationPropertyValueException exception = assertThrows( - InvalidConfigurationPropertyValueException.class, () -> propertySource.initProperties(null)); + InvalidConfigurationPropertyValueException.class, () -> propertySource.initProperties(null, false)); assertEquals("test_key_vault_1", exception.getName()); assertEquals("", exception.getValue()); assertEquals("Invalid URI found in JSON property field 'uri' unable to parse.", exception.getReason()); @@ -139,12 +140,14 @@ public void invalidKeyVaultReferenceParseErrorTest() { List settings = List.of(KEY_VAULT_ITEM); when(keyVaultSecretListMock.iterator()).thenReturn(settings.iterator()) .thenReturn(Collections.emptyIterator()); - when(replicaClientMock.listSettings(Mockito.any())).thenReturn(keyVaultSecretListMock) + when(replicaClientMock.listSettings(Mockito.any(), Mockito.anyBoolean())).thenReturn(keyVaultSecretListMock) .thenReturn(keyVaultSecretListMock); - when(keyVaultClientFactoryMock.getClient(Mockito.eq("https://test.key.vault.com"))).thenReturn(clientManagerMock); + when(keyVaultClientFactoryMock.getClient(Mockito.eq("https://test.key.vault.com"))) + .thenReturn(clientManagerMock); when(clientManagerMock.getSecret(Mockito.any())).thenThrow(new RuntimeException("Parse Failed")); - RuntimeException exception = assertThrows(RuntimeException.class, () -> propertySource.initProperties(null)); + RuntimeException exception = assertThrows(RuntimeException.class, + () -> propertySource.initProperties(null, false)); assertEquals("Parse Failed", exception.getMessage()); } } diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationPropertySourceLocatorTest.java b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationPropertySourceLocatorTest.java index 09b9c7b36caf..a68ac60e28e6 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationPropertySourceLocatorTest.java +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationPropertySourceLocatorTest.java @@ -194,7 +194,7 @@ public void compositeSourceIsCreatedWithMonitoring() { properties.getStores().get(0).setMonitoring(monitoring); - when(replicaClientMock.getWatchKey(Mockito.eq(watchKey), Mockito.anyString())) + when(replicaClientMock.getWatchKey(Mockito.eq(watchKey), Mockito.anyString(), Mockito.anyBoolean())) .thenReturn(TestUtils.createItem("", watchKey, "0", EMPTY_LABEL, "")); locator = new AppConfigurationPropertySourceLocator(appProperties, clientFactoryMock, keyVaultClientFactory, @@ -213,7 +213,8 @@ public void compositeSourceIsCreatedWithMonitoring() { }; assertEquals(expectedSourceNames.length, sources.size()); assertArrayEquals((Object[]) expectedSourceNames, sources.stream().map(PropertySource::getName).toArray()); - verify(replicaClientMock, times(1)).getWatchKey(Mockito.eq(watchKey), Mockito.anyString()); + verify(replicaClientMock, times(1)).getWatchKey(Mockito.eq(watchKey), Mockito.anyString(), + Mockito.anyBoolean()); } } @@ -234,7 +235,7 @@ public void compositeSourceIsCreatedWithMonitoringWatchKeyDoesNotExist() { properties.getStores().get(0).setMonitoring(monitoring); - when(replicaClientMock.getWatchKey(Mockito.eq(watchKey), Mockito.anyString())) + when(replicaClientMock.getWatchKey(Mockito.eq(watchKey), Mockito.anyString(), Mockito.anyBoolean())) .thenReturn(null); locator = new AppConfigurationPropertySourceLocator(appProperties, clientFactoryMock, keyVaultClientFactory, @@ -253,7 +254,8 @@ public void compositeSourceIsCreatedWithMonitoringWatchKeyDoesNotExist() { }; assertEquals(expectedSourceNames.length, sources.size()); assertArrayEquals((Object[]) expectedSourceNames, sources.stream().map(PropertySource::getName).toArray()); - verify(replicaClientMock, times(1)).getWatchKey(Mockito.eq(watchKey), Mockito.anyString()); + verify(replicaClientMock, times(1)).getWatchKey(Mockito.eq(watchKey), Mockito.anyString(), + Mockito.anyBoolean()); } } @@ -262,7 +264,7 @@ public void devSourceIsCreated() { when(devEnvironment.getActiveProfiles()).thenReturn(new String[] { PROFILE_NAME_1 }); when(devEnvironment.getPropertySources()).thenReturn(sources); when(clientFactoryMock.getAvailableClients(Mockito.anyString(), Mockito.eq(true))).thenReturn(Arrays.asList(replicaClientMock)); - when(replicaClientMock.listSettings(Mockito.any())).thenReturn(List.of()); + when(replicaClientMock.listSettings(Mockito.any(), Mockito.anyBoolean())).thenReturn(List.of()); when(featureFlagClientMock.getProperties()).thenReturn(Map.of()); locator = new AppConfigurationPropertySourceLocator(appProperties, clientFactoryMock, keyVaultClientFactory, @@ -288,7 +290,7 @@ public void multiSourceIsCreated() { when(multiEnvironment.getActiveProfiles()).thenReturn(new String[] { PROFILE_NAME_1, PROFILE_NAME_2 }); when(multiEnvironment.getPropertySources()).thenReturn(sources); when(clientFactoryMock.getAvailableClients(Mockito.anyString(), Mockito.eq(true))).thenReturn(Arrays.asList(replicaClientMock)); - when(replicaClientMock.listSettings(Mockito.any())).thenReturn(List.of()); + when(replicaClientMock.listSettings(Mockito.any(), Mockito.anyBoolean())).thenReturn(List.of()); when(featureFlagClientMock.getProperties()).thenReturn(Map.of()); locator = new AppConfigurationPropertySourceLocator(appProperties, clientFactoryMock, keyVaultClientFactory, @@ -323,7 +325,7 @@ public void storeCreatedWithFeatureFlags() { properties.getStores().get(0).setFeatureFlags(featureFlagStore); - when(replicaClientMock.listSettings(Mockito.any())).thenReturn(List.of(featureFlag)); + when(replicaClientMock.listSettings(Mockito.any(), Mockito.anyBoolean())).thenReturn(List.of(featureFlag)); locator = new AppConfigurationPropertySourceLocator(appProperties, clientFactoryMock, keyVaultClientFactory, null, stores, replicaLookUpMock, featureFlagClientMock); @@ -360,7 +362,7 @@ public void storeCreatedWithFeatureFlagsWithMonitoring() { properties.getStores().get(0).setFeatureFlags(featureFlagStore); properties.getStores().get(0).setMonitoring(monitoring); - when(replicaClientMock.listSettings(Mockito.any())).thenReturn(List.of(featureFlag)); + when(replicaClientMock.listSettings(Mockito.any(), Mockito.anyBoolean())).thenReturn(List.of(featureFlag)); locator = new AppConfigurationPropertySourceLocator(appProperties, clientFactoryMock, keyVaultClientFactory, null, stores, replicaLookUpMock, featureFlagClientMock); @@ -423,7 +425,7 @@ public void defaultFailFastThrowException() { locator = new AppConfigurationPropertySourceLocator(appProperties, clientFactoryMock, keyVaultClientFactory, null, List.of(configStoreMock), replicaLookUpMock, featureFlagClientMock); - when(replicaClientMock.getWatchKey(Mockito.any(), Mockito.anyString())).thenThrow(new RuntimeException()); + when(replicaClientMock.getWatchKey(Mockito.any(), Mockito.anyString(), Mockito.anyBoolean())).thenThrow(new RuntimeException()); RuntimeException e = assertThrows(RuntimeException.class, () -> locator.locate(emptyEnvironment)); assertEquals("Failed to generate property sources for " + TEST_STORE_NAME, e.getMessage()); verify(configStoreMock, times(1)).isFailFast(); @@ -432,7 +434,7 @@ public void defaultFailFastThrowException() { @Test public void refreshThrowException() throws IllegalArgumentException { setupEmptyEnvironment(); - when(replicaClientMock.listSettings(any())).thenThrow(new RuntimeException()); + when(replicaClientMock.listSettings(any(), Mockito.anyBoolean())).thenThrow(new RuntimeException()); AppConfigurationPropertySourceLocator.STARTUP.set(false); @@ -499,7 +501,7 @@ public void multiplePropertySourcesExistForMultiStores() { @Test public void awaitOnError() { when(clientFactoryMock.getAvailableClients(Mockito.anyString(), Mockito.eq(true))).thenReturn(Arrays.asList(replicaClientMock)); - when(replicaClientMock.listSettings(Mockito.any())).thenReturn(List.of()); + when(replicaClientMock.listSettings(Mockito.any(), Mockito.anyBoolean())).thenReturn(List.of()); when(appPropertiesMock.getPrekillTime()).thenReturn(5); ConfigurableEnvironment env = Mockito.mock(ConfigurableEnvironment.class); @@ -526,7 +528,7 @@ public Object getProperty(String name) { when(configStoreMockError.isFailFast()).thenReturn(true); when(configStoreMockError.getEndpoint()).thenReturn(""); - when(replicaClientMock.listSettings(Mockito.any())).thenThrow(new NullPointerException("")); + when(replicaClientMock.listSettings(Mockito.any(), Mockito.anyBoolean())).thenThrow(new NullPointerException("")); when(appPropertiesMock.getPrekillTime()).thenReturn(-60); when(appPropertiesMock.getStartDate()).thenReturn(Instant.now()); @@ -561,6 +563,6 @@ private void setupEmptyEnvironment() { when(emptyEnvironment.getActiveProfiles()).thenReturn(new String[] {}); when(emptyEnvironment.getPropertySources()).thenReturn(sources); when(clientFactoryMock.getAvailableClients(Mockito.anyString(), Mockito.eq(true))).thenReturn(Arrays.asList(replicaClientMock)); - when(replicaClientMock.listSettings(Mockito.any())).thenReturn(List.of()); + when(replicaClientMock.listSettings(Mockito.any(), Mockito.anyBoolean())).thenReturn(List.of()); } } diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationRefreshUtilTest.java b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationRefreshUtilTest.java index 30104ca62524..ba6b62292b8c 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationRefreshUtilTest.java +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationRefreshUtilTest.java @@ -121,7 +121,8 @@ public void refreshWithoutTimeWatchKeyConfigStoreWatchKeyNotReturned(TestInfo te State newState = new State(watchKeys, Math.toIntExact(Duration.ofMinutes(10).getSeconds()), endpoint); // Config Store doesn't return a watch key change. - when(clientMock.getWatchKey(Mockito.eq(KEY_FILTER), Mockito.eq(EMPTY_LABEL))).thenReturn(watchKeys.get(0)); + when(clientMock.getWatchKey(Mockito.eq(KEY_FILTER), Mockito.eq(EMPTY_LABEL), Mockito.anyBoolean())) + .thenReturn(watchKeys.get(0)); try (MockedStatic stateHolderMock = Mockito.mockStatic(StateHolder.class)) { stateHolderMock.when(() -> StateHolder.getLoadState(endpoint)).thenReturn(true); stateHolderMock.when(() -> StateHolder.getState(endpoint)).thenReturn(newState); @@ -142,7 +143,7 @@ public void refreshWithoutTimeWatchKeyConfigStoreWatchKeyNoChange(TestInfo testI Math.toIntExact(Duration.ofMinutes(10).getSeconds()), endpoint); // Config Store does return a watch key change. - when(clientMock.checkWatchKeys(Mockito.any(SettingSelector.class))).thenReturn(false); + when(clientMock.checkWatchKeys(Mockito.any(SettingSelector.class), Mockito.anyBoolean())).thenReturn(false); try (MockedStatic stateHolderMock = Mockito.mockStatic(StateHolder.class)) { stateHolderMock.when(() -> StateHolder.getStateFeatureFlag(endpoint)).thenReturn(newState); @@ -192,7 +193,7 @@ public void refreshWithoutTimeFeatureFlagNoChange(TestInfo testInfo) { Math.toIntExact(Duration.ofMinutes(10).getSeconds()), endpoint); // Config Store doesn't return a watch key change. - when(clientMock.checkWatchKeys(Mockito.any(SettingSelector.class))).thenReturn(false); + when(clientMock.checkWatchKeys(Mockito.any(SettingSelector.class), Mockito.anyBoolean())).thenReturn(false); try (MockedStatic stateHolderMock = Mockito.mockStatic(StateHolder.class)) { stateHolderMock.when(() -> StateHolder.getStateFeatureFlag(endpoint)).thenReturn(newState); @@ -213,7 +214,7 @@ public void refreshWithoutTimeFeatureFlagEtagChanged(TestInfo testInfo) { Math.toIntExact(Duration.ofMinutes(10).getSeconds()), endpoint); // Config Store does return a watch key change. - when(clientMock.checkWatchKeys(Mockito.any(SettingSelector.class))).thenReturn(true); + when(clientMock.checkWatchKeys(Mockito.any(SettingSelector.class), Mockito.anyBoolean())).thenReturn(true); try (MockedStatic stateHolderMock = Mockito.mockStatic(StateHolder.class)) { stateHolderMock.when(() -> StateHolder.getStateFeatureFlag(endpoint)).thenReturn(newState); @@ -240,7 +241,8 @@ public void refreshStoresCheckSettingsTestNotEnabled(TestInfo testInfo) { (long) 60, replicaLookUpMock); assertFalse(eventData.getDoRefresh()); verify(clientFactoryMock, times(1)).setCurrentConfigStoreClient(Mockito.eq(endpoint), Mockito.eq(endpoint)); - verify(clientOriginMock, times(0)).getWatchKey(Mockito.anyString(), Mockito.anyString()); + verify(clientOriginMock, times(0)).getWatchKey(Mockito.anyString(), Mockito.anyString(), + Mockito.anyBoolean()); } } @@ -259,7 +261,8 @@ public void refreshStoresCheckSettingsTestNotLoaded(TestInfo testInfo) { Duration.ofMinutes(10), (long) 60, replicaLookUpMock); assertFalse(eventData.getDoRefresh()); verify(clientFactoryMock, times(1)).setCurrentConfigStoreClient(Mockito.eq(endpoint), Mockito.eq(endpoint)); - verify(clientOriginMock, times(0)).getWatchKey(Mockito.anyString(), Mockito.anyString()); + verify(clientOriginMock, times(0)).getWatchKey(Mockito.anyString(), Mockito.anyString(), + Mockito.anyBoolean()); } } @@ -279,7 +282,8 @@ public void refreshStoresCheckSettingsTestNotRefreshTime(TestInfo testInfo) { (long) 60, replicaLookUpMock); assertFalse(eventData.getDoRefresh()); verify(clientFactoryMock, times(1)).setCurrentConfigStoreClient(Mockito.eq(endpoint), Mockito.eq(endpoint)); - verify(clientOriginMock, times(0)).getWatchKey(Mockito.anyString(), Mockito.anyString()); + verify(clientOriginMock, times(0)).getWatchKey(Mockito.anyString(), Mockito.anyString(), + Mockito.anyBoolean()); } } @@ -301,7 +305,8 @@ public void refreshStoresCheckSettingsTestFailedRequest(TestInfo testInfo) { (long) 60, replicaLookUpMock); assertFalse(eventData.getDoRefresh()); verify(clientFactoryMock, times(1)).setCurrentConfigStoreClient(Mockito.eq(endpoint), Mockito.eq(endpoint)); - verify(clientOriginMock, times(1)).getWatchKey(Mockito.anyString(), Mockito.anyString()); + verify(clientOriginMock, times(1)).getWatchKey(Mockito.anyString(), Mockito.anyString(), + Mockito.anyBoolean()); assertEquals(newState, StateHolder.getState(endpoint)); } } @@ -311,7 +316,7 @@ public void refreshStoresCheckSettingsTestRefreshTimeNoChange(TestInfo testInfo) endpoint = testInfo.getDisplayName() + ".azconfig.io"; setupFeatureFlagLoad(); - when(clientOriginMock.getWatchKey(Mockito.anyString(), Mockito.anyString())) + when(clientOriginMock.getWatchKey(Mockito.anyString(), Mockito.anyString(), Mockito.anyBoolean())) .thenReturn(generateWatchKeys().get(0)); State newState = new State(generateWatchKeys(), Math.toIntExact(Duration.ofMinutes(-1).getSeconds()), endpoint); @@ -327,7 +332,8 @@ public void refreshStoresCheckSettingsTestRefreshTimeNoChange(TestInfo testInfo) assertEquals(newState, StateHolder.getState(endpoint)); assertFalse(eventData.getDoRefresh()); verify(clientFactoryMock, times(1)).setCurrentConfigStoreClient(Mockito.eq(endpoint), Mockito.eq(endpoint)); - verify(clientOriginMock, times(1)).getWatchKey(Mockito.anyString(), Mockito.anyString()); + verify(clientOriginMock, times(1)).getWatchKey(Mockito.anyString(), Mockito.anyString(), + Mockito.anyBoolean()); } } @@ -343,7 +349,8 @@ public void refreshStoresCheckSettingsTestTriggerRefresh(TestInfo testInfo) { ConfigurationSetting refreshKey = new ConfigurationSetting().setKey(KEY_FILTER).setLabel(EMPTY_LABEL) .setETag("new"); - when(clientOriginMock.getWatchKey(Mockito.anyString(), Mockito.anyString())).thenReturn(refreshKey); + when(clientOriginMock.getWatchKey(Mockito.anyString(), Mockito.anyString(), Mockito.anyBoolean())) + .thenReturn(refreshKey); State newState = new State(generateWatchKeys(), Math.toIntExact(Duration.ofMinutes(-1).getSeconds()), endpoint); @@ -357,7 +364,8 @@ public void refreshStoresCheckSettingsTestTriggerRefresh(TestInfo testInfo) { (long) 60, replicaLookUpMock); assertTrue(eventData.getDoRefresh()); verify(clientFactoryMock, times(1)).setCurrentConfigStoreClient(Mockito.eq(endpoint), Mockito.eq(endpoint)); - verify(clientOriginMock, times(1)).getWatchKey(Mockito.anyString(), Mockito.anyString()); + verify(clientOriginMock, times(1)).getWatchKey(Mockito.anyString(), Mockito.anyString(), + Mockito.anyBoolean()); verify(currentStateMock, times(1)).updateStateRefresh(Mockito.any(), Mockito.any()); } } @@ -380,7 +388,8 @@ public void refreshStoresCheckFeatureFlagTestNotLoaded(TestInfo testInfo) { (long) 60, replicaLookUpMock); assertFalse(eventData.getDoRefresh()); verify(clientFactoryMock, times(1)).setCurrentConfigStoreClient(Mockito.eq(endpoint), Mockito.eq(endpoint)); - verify(clientOriginMock, times(0)).getWatchKey(Mockito.anyString(), Mockito.anyString()); + verify(clientOriginMock, times(0)).getWatchKey(Mockito.anyString(), Mockito.anyString(), + Mockito.anyBoolean()); } } @@ -402,7 +411,8 @@ public void refreshStoresCheckFeatureFlagTestNotRefreshTime(TestInfo testInfo) { (long) 60, replicaLookUpMock); assertFalse(eventData.getDoRefresh()); verify(clientFactoryMock, times(1)).setCurrentConfigStoreClient(Mockito.eq(endpoint), Mockito.eq(endpoint)); - verify(clientOriginMock, times(0)).getWatchKey(Mockito.anyString(), Mockito.anyString()); + verify(clientOriginMock, times(0)).getWatchKey(Mockito.anyString(), Mockito.anyString(), + Mockito.anyBoolean()); } } @@ -414,7 +424,7 @@ public void refreshStoresCheckFeatureFlagTestNoChange(TestInfo testInfo) { configStore.setMonitoring(monitoring); setupFeatureFlagLoad(); - when(clientOriginMock.checkWatchKeys(Mockito.any())).thenReturn(false); + when(clientOriginMock.checkWatchKeys(Mockito.any(), Mockito.anyBoolean())).thenReturn(false); FeatureFlagState newState = new FeatureFlagState( List.of(new FeatureFlags(new SettingSelector().setKeyFilter(KEY_FILTER).setLabelFilter(EMPTY_LABEL), null)), @@ -430,7 +440,8 @@ public void refreshStoresCheckFeatureFlagTestNoChange(TestInfo testInfo) { Duration.ofMinutes(10), (long) 60, replicaLookUpMock); assertFalse(eventData.getDoRefresh()); verify(clientFactoryMock, times(1)).setCurrentConfigStoreClient(Mockito.eq(endpoint), Mockito.eq(endpoint)); - verify(clientOriginMock, times(0)).getWatchKey(Mockito.anyString(), Mockito.anyString()); + verify(clientOriginMock, times(0)).getWatchKey(Mockito.anyString(), Mockito.anyString(), + Mockito.anyBoolean()); verify(currentStateMock, times(1)).updateFeatureFlagStateRefresh(Mockito.any(), Mockito.any()); } @@ -440,7 +451,7 @@ public void refreshStoresCheckFeatureFlagTestNoChange(TestInfo testInfo) { public void refreshStoresCheckFeatureFlagTestTriggerRefresh(TestInfo testInfo) { endpoint = testInfo.getDisplayName() + ".azconfig.io"; setupFeatureFlagLoad(); - when(clientOriginMock.checkWatchKeys(Mockito.any())).thenReturn(true); + when(clientOriginMock.checkWatchKeys(Mockito.any(), Mockito.anyBoolean())).thenReturn(true); FeatureFlags featureFlags = new FeatureFlags(new SettingSelector(), watchKeysFeatureFlags); @@ -457,7 +468,8 @@ public void refreshStoresCheckFeatureFlagTestTriggerRefresh(TestInfo testInfo) { Duration.ofMinutes(10), (long) 60, replicaLookUpMock); assertTrue(eventData.getDoRefresh()); verify(clientFactoryMock, times(1)).setCurrentConfigStoreClient(Mockito.eq(endpoint), Mockito.eq(endpoint)); - verify(clientOriginMock, times(0)).getWatchKey(Mockito.anyString(), Mockito.anyString()); + verify(clientOriginMock, times(0)).getWatchKey(Mockito.anyString(), Mockito.anyString(), + Mockito.anyBoolean()); } } diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationReplicaClientTest.java b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationReplicaClientTest.java index 68d57642399e..99c71ea169a0 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationReplicaClientTest.java +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationReplicaClientTest.java @@ -36,6 +36,7 @@ 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.util.Configuration; import com.azure.data.appconfiguration.ConfigurationClient; import com.azure.data.appconfiguration.models.ConfigurationSetting; @@ -65,6 +66,9 @@ public class AppConfigurationReplicaClientTest { @Mock private Supplier>> supplierMock; + @Mock + private Response mockResponse; + private final String endpoint = "clientTest.azconfig.io"; private MockitoSession session; @@ -77,8 +81,8 @@ public void setup() { @AfterEach public void cleanup() throws Exception { - MockitoAnnotations.openMocks(this).close(); session.finishMocking(); + MockitoAnnotations.openMocks(this).close(); } @Test @@ -88,28 +92,31 @@ public void getWatchKeyTest() { ConfigurationSetting watchKey = new ConfigurationSetting().setKey("watch").setLabel("\0"); - when(clientMock.getConfigurationSetting(Mockito.anyString(), Mockito.anyString())).thenReturn(watchKey); + when(clientMock.getConfigurationSettingWithResponse(Mockito.any(), Mockito.isNull(), Mockito.anyBoolean(), + Mockito.any())).thenReturn(mockResponse); + when(mockResponse.getValue()).thenReturn(watchKey); - assertEquals(watchKey, client.getWatchKey("watch", "\0")); + //assertEquals(watchKey, client.getWatchKey("watch", "\0", false)); - when(clientMock.getConfigurationSetting(Mockito.anyString(), Mockito.anyString())) - .thenThrow(exceptionMock); + when(clientMock.getConfigurationSettingWithResponse(Mockito.any(), Mockito.isNull(), Mockito.anyBoolean(), + Mockito.any())).thenReturn(mockResponse); + when(mockResponse.getValue()).thenThrow(exceptionMock); when(exceptionMock.getResponse()).thenReturn(responseMock); when(responseMock.getStatusCode()).thenReturn(429); - assertThrows(AppConfigurationStatusException.class, () -> client.getWatchKey("watch", "\0")); + assertThrows(AppConfigurationStatusException.class, () -> client.getWatchKey("watch", "\0", false)); when(responseMock.getStatusCode()).thenReturn(408); - assertThrows(AppConfigurationStatusException.class, () -> client.getWatchKey("watch", "\0")); + assertThrows(AppConfigurationStatusException.class, () -> client.getWatchKey("watch", "\0", false)); when(responseMock.getStatusCode()).thenReturn(500); - assertThrows(AppConfigurationStatusException.class, () -> client.getWatchKey("watch", "\0")); + assertThrows(AppConfigurationStatusException.class, () -> client.getWatchKey("watch", "\0", false)); when(responseMock.getStatusCode()).thenReturn(499); - assertThrows(HttpResponseException.class, () -> client.getWatchKey("watch", "\0")); + assertThrows(HttpResponseException.class, () -> client.getWatchKey("watch", "\0", false)); - when(clientMock.getConfigurationSetting(Mockito.any(), Mockito.any())) - .thenThrow(new UncheckedIOException(new UnknownHostException())); - assertThrows(AppConfigurationStatusException.class, () -> client.getWatchKey("watch", "\0")); + when(clientMock.getConfigurationSettingWithResponse(Mockito.any(), Mockito.isNull(), Mockito.anyBoolean(), + Mockito.any())).thenThrow(new UncheckedIOException(new UnknownHostException())); + assertThrows(AppConfigurationStatusException.class, () -> client.getWatchKey("watch", "\0", false)); } @Test @@ -125,23 +132,24 @@ public void listSettingsTest() { 200, null, configurations, null, null); when(supplierMock.get()).thenReturn(Mono.just(pagedResponse)); - when(clientMock.listConfigurationSettings(Mockito.any())).thenReturn(new PagedIterable<>(pagedFlux)); + when(clientMock.listConfigurationSettings(Mockito.any(), Mockito.any())) + .thenReturn(new PagedIterable<>(pagedFlux)); - assertEquals(configurations, client.listSettings(new SettingSelector())); + assertEquals(configurations, client.listSettings(new SettingSelector(), false)); - when(clientMock.listConfigurationSettings(Mockito.any())).thenThrow(exceptionMock); + when(clientMock.listConfigurationSettings(Mockito.any(), Mockito.any())).thenThrow(exceptionMock); when(exceptionMock.getResponse()).thenReturn(responseMock); when(responseMock.getStatusCode()).thenReturn(429); - assertThrows(AppConfigurationStatusException.class, () -> client.listSettings(new SettingSelector())); + assertThrows(AppConfigurationStatusException.class, () -> client.listSettings(new SettingSelector(), false)); when(responseMock.getStatusCode()).thenReturn(408); - assertThrows(AppConfigurationStatusException.class, () -> client.listSettings(new SettingSelector())); + assertThrows(AppConfigurationStatusException.class, () -> client.listSettings(new SettingSelector(), false)); when(responseMock.getStatusCode()).thenReturn(500); - assertThrows(AppConfigurationStatusException.class, () -> client.listSettings(new SettingSelector())); + assertThrows(AppConfigurationStatusException.class, () -> client.listSettings(new SettingSelector(), false)); when(responseMock.getStatusCode()).thenReturn(499); - assertThrows(HttpResponseException.class, () -> client.listSettings(new SettingSelector())); + assertThrows(HttpResponseException.class, () -> client.listSettings(new SettingSelector(), false)); } @Test @@ -159,23 +167,27 @@ public void listFeatureFlagsTest() { when(supplierMock.get()).thenReturn(Mono.just(pagedResponse)); - when(clientMock.listConfigurationSettings(Mockito.any())).thenReturn(new PagedIterable<>(pagedFlux)); + when(clientMock.listConfigurationSettings(Mockito.any(), Mockito.any())) + .thenReturn(new PagedIterable<>(pagedFlux)); - assertEquals(configurations, client.listFeatureFlags(new SettingSelector()).getFeatureFlags()); + assertEquals(configurations, client.listFeatureFlags(new SettingSelector(), false).getFeatureFlags()); - when(clientMock.listConfigurationSettings(Mockito.any())).thenThrow(exceptionMock); + when(clientMock.listConfigurationSettings(Mockito.any(), Mockito.any())).thenThrow(exceptionMock); when(exceptionMock.getResponse()).thenReturn(responseMock); when(responseMock.getStatusCode()).thenReturn(429); - assertThrows(AppConfigurationStatusException.class, () -> client.listFeatureFlags(new SettingSelector())); + assertThrows(AppConfigurationStatusException.class, + () -> client.listFeatureFlags(new SettingSelector(), false)); when(responseMock.getStatusCode()).thenReturn(408); - assertThrows(AppConfigurationStatusException.class, () -> client.listFeatureFlags(new SettingSelector())); + assertThrows(AppConfigurationStatusException.class, + () -> client.listFeatureFlags(new SettingSelector(), false)); when(responseMock.getStatusCode()).thenReturn(500); - assertThrows(AppConfigurationStatusException.class, () -> client.listFeatureFlags(new SettingSelector())); + assertThrows(AppConfigurationStatusException.class, + () -> client.listFeatureFlags(new SettingSelector(), false)); when(responseMock.getStatusCode()).thenReturn(499); - assertThrows(HttpResponseException.class, () -> client.listFeatureFlags(new SettingSelector())); + assertThrows(HttpResponseException.class, () -> client.listFeatureFlags(new SettingSelector(), false)); } @Test @@ -183,9 +195,9 @@ public void listSettingsUnknownHostTest() { AppConfigurationReplicaClient client = new AppConfigurationReplicaClient(endpoint, clientMock, new TracingInfo(false, false, 0, Configuration.getGlobalConfiguration())); - when(clientMock.listConfigurationSettings(Mockito.any())) + when(clientMock.listConfigurationSettings(Mockito.any(), Mockito.any())) .thenThrow(new UncheckedIOException(new UnknownHostException())); - assertThrows(AppConfigurationStatusException.class, () -> client.listSettings(new SettingSelector())); + assertThrows(AppConfigurationStatusException.class, () -> client.listSettings(new SettingSelector(), false)); } @Test @@ -193,10 +205,10 @@ public void listSettingsNoCredentialTest() { AppConfigurationReplicaClient client = new AppConfigurationReplicaClient(endpoint, clientMock, new TracingInfo(false, false, 0, Configuration.getGlobalConfiguration())); - when(clientMock.listConfigurationSettings(Mockito.any())) + when(clientMock.listConfigurationSettings(Mockito.any(), Mockito.any())) .thenThrow(new CredentialUnavailableException("No Credential")); - assertThrows(CredentialUnavailableException.class, () -> client.listSettings(new SettingSelector())); + assertThrows(CredentialUnavailableException.class, () -> client.listSettings(new SettingSelector(), false)); } @Test @@ -204,10 +216,12 @@ public void getWatchNoCredentialTest() { AppConfigurationReplicaClient client = new AppConfigurationReplicaClient(endpoint, clientMock, new TracingInfo(false, false, 0, Configuration.getGlobalConfiguration())); - when(clientMock.getConfigurationSetting(Mockito.anyString(), Mockito.anyString())) + when(clientMock.getConfigurationSettingWithResponse(Mockito.any(), Mockito.isNull(), Mockito.anyBoolean(), + Mockito.any())).thenReturn(mockResponse); + when(mockResponse.getValue()) .thenThrow(new CredentialUnavailableException("No Credential")); - assertThrows(CredentialUnavailableException.class, () -> client.getWatchKey("key", "label")); + assertThrows(CredentialUnavailableException.class, () -> client.getWatchKey("key", "label", false)); } @Test @@ -231,9 +245,10 @@ public void backoffTest() { assertEquals(2, client.getFailedAttempts()); // Success in a list request results in a reset of failed attemtps - when(clientMock.listConfigurationSettings(Mockito.any(SettingSelector.class))).thenReturn(settingsMock); + when(clientMock.listConfigurationSettings(Mockito.any(SettingSelector.class), Mockito.any())) + .thenReturn(settingsMock); - client.listSettings(new SettingSelector()); + client.listSettings(new SettingSelector(), false); assertTrue(client.getBackoffEndTime().isBefore(Instant.now())); assertEquals(0, client.getFailedAttempts()); } @@ -315,9 +330,10 @@ public void checkWatchKeysTest() { when(supplierMock.get()).thenReturn(Mono.just(pagedResponse)); - when(clientMock.listConfigurationSettings(Mockito.any())).thenReturn(new PagedIterable<>(pagedFlux)); + when(clientMock.listConfigurationSettings(Mockito.any(), Mockito.any())) + .thenReturn(new PagedIterable<>(pagedFlux)); - assertTrue(client.checkWatchKeys(new SettingSelector())); + assertTrue(client.checkWatchKeys(new SettingSelector(), false)); pagedResponse.close(); } catch (IOException e) { e.printStackTrace(); @@ -329,9 +345,9 @@ public void checkWatchKeysTest() { when(supplierMock.get()).thenReturn(Mono.just(pagedResponse)); - when(clientMock.listConfigurationSettings(Mockito.any())).thenReturn(new PagedIterable<>(pagedFlux)); + when(clientMock.listConfigurationSettings(Mockito.any(), Mockito.any())).thenReturn(new PagedIterable<>(pagedFlux)); - assertFalse(client.checkWatchKeys(new SettingSelector())); + assertFalse(client.checkWatchKeys(new SettingSelector(), false)); pagedResponse.close(); } catch (IOException e) { e.printStackTrace(); diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/FeatureFlagClientTest.java b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/FeatureFlagClientTest.java index 6f5bcf70e29c..f473388bd8c3 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/FeatureFlagClientTest.java +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/FeatureFlagClientTest.java @@ -76,9 +76,10 @@ public void cleanup() throws Exception { public void loadFeatureFlagsTestNoFeatureFlags() { List settings = List.of(new ConfigurationSetting().setKey("FakeKey")); FeatureFlags featureFlags = new FeatureFlags(null, settings); - when(clientMock.listFeatureFlags(Mockito.any())).thenReturn(featureFlags); + when(clientMock.listFeatureFlags(Mockito.any(), Mockito.anyBoolean())).thenReturn(featureFlags); - List featureFlagsList = featureFlagClient.loadFeatureFlags(clientMock, null, emptyLabelList); + List featureFlagsList = featureFlagClient.loadFeatureFlags(clientMock, null, emptyLabelList, + false); assertEquals(1, featureFlagsList.size()); assertEquals(featureFlags, featureFlagsList.get(0)); assertEquals("FakeKey", featureFlagsList.get(0).getFeatureFlags().get(0).getKey()); @@ -90,9 +91,10 @@ public void loadFeatureFlagsTestFeatureFlags() { List settings = List.of(new FeatureFlagConfigurationSetting("Alpha", false), new FeatureFlagConfigurationSetting("Beta", true)); FeatureFlags featureFlags = new FeatureFlags(null, settings); - when(clientMock.listFeatureFlags(Mockito.any())).thenReturn(featureFlags); + when(clientMock.listFeatureFlags(Mockito.any(), Mockito.anyBoolean())).thenReturn(featureFlags); - List featureFlagsList = featureFlagClient.loadFeatureFlags(clientMock, null, emptyLabelList); + List featureFlagsList = featureFlagClient.loadFeatureFlags(clientMock, null, emptyLabelList, + false); assertEquals(1, featureFlagsList.size()); assertEquals(featureFlags, featureFlagsList.get(0)); assertEquals(".appconfig.featureflag/Alpha", featureFlagsList.get(0).getFeatureFlags().get(0).getKey()); @@ -105,9 +107,10 @@ public void loadFeatureFlagsTestMultipleLoads() { List settings = List.of(new FeatureFlagConfigurationSetting("Alpha", false), new FeatureFlagConfigurationSetting("Beta", true)); FeatureFlags featureFlags = new FeatureFlags(null, settings); - when(clientMock.listFeatureFlags(Mockito.any())).thenReturn(featureFlags); + when(clientMock.listFeatureFlags(Mockito.any(), Mockito.anyBoolean())).thenReturn(featureFlags); - List featureFlagsList = featureFlagClient.loadFeatureFlags(clientMock, null, emptyLabelList); + List featureFlagsList = featureFlagClient.loadFeatureFlags(clientMock, null, emptyLabelList, + false); assertEquals(1, featureFlagsList.size()); assertEquals(featureFlags, featureFlagsList.get(0)); assertEquals(".appconfig.featureflag/Alpha", featureFlagsList.get(0).getFeatureFlags().get(0).getKey()); @@ -117,9 +120,9 @@ public void loadFeatureFlagsTestMultipleLoads() { List settings2 = List.of(new FeatureFlagConfigurationSetting("Alpha", true), new FeatureFlagConfigurationSetting("Gamma", false)); featureFlags = new FeatureFlags(null, settings2); - when(clientMock.listFeatureFlags(Mockito.any())).thenReturn(featureFlags); + when(clientMock.listFeatureFlags(Mockito.any(), Mockito.anyBoolean())).thenReturn(featureFlags); - featureFlagsList = featureFlagClient.loadFeatureFlags(clientMock, null, emptyLabelList); + featureFlagsList = featureFlagClient.loadFeatureFlags(clientMock, null, emptyLabelList, false); assertEquals(1, featureFlagsList.size()); assertEquals(featureFlags, featureFlagsList.get(0)); assertEquals(".appconfig.featureflag/Alpha", featureFlagsList.get(0).getFeatureFlags().get(0).getKey()); @@ -163,9 +166,10 @@ public void loadFeatureFlagsTestTargetingFilter() { targetingFlag.addClientFilter(targetingFilter); List settings = List.of(targetingFlag); FeatureFlags featureFlags = new FeatureFlags(null, settings); - when(clientMock.listFeatureFlags(Mockito.any())).thenReturn(featureFlags); + when(clientMock.listFeatureFlags(Mockito.any(), Mockito.anyBoolean())).thenReturn(featureFlags); - List featureFlagsList = featureFlagClient.loadFeatureFlags(clientMock, null, emptyLabelList); + List featureFlagsList = featureFlagClient.loadFeatureFlags(clientMock, null, emptyLabelList, + false); assertEquals(1, featureFlagsList.size()); assertEquals(featureFlags, featureFlagsList.get(0)); assertEquals(".appconfig.featureflag/TargetingTest", featureFlagsList.get(0).getFeatureFlags().get(0).getKey()); diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/http/policy/BaseAppConfigurationPolicyTest.java b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/http/policy/BaseAppConfigurationPolicyTest.java index 89e339f0b6cc..c08c29975ffa 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/http/policy/BaseAppConfigurationPolicyTest.java +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/http/policy/BaseAppConfigurationPolicyTest.java @@ -11,6 +11,7 @@ import java.net.MalformedURLException; import java.net.URL; +import java.util.Optional; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -47,7 +48,6 @@ public class BaseAppConfigurationPolicyTest { @BeforeEach public void setup() { MockitoAnnotations.openMocks(this); - BaseAppConfigurationPolicy.setWatchRequests(false); } @AfterEach @@ -78,7 +78,7 @@ public void startupThenWatchUpdateTest() throws MalformedURLException { request.setHeader(USER_AGENT_TYPE, "PreExistingUserAgent"); when(contextMock.getHttpRequest()).thenReturn(request); - BaseAppConfigurationPolicy.setWatchRequests(true); + when(contextMock.getData("refresh")).thenReturn(Optional.of(true)); policy.process(contextMock, nextMock); From f331c0678f5da7499b39e06af812c779b03832c2 Mon Sep 17 00:00:00 2001 From: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> Date: Tue, 27 Aug 2024 13:43:18 -0400 Subject: [PATCH 056/128] Use code customizations to map internal Storage error in generated code (#41624) Use code customizations to map internal Storage error in generated code --- .../checkstyle/checkstyle-suppressions.xml | 55 - .../resources/spotbugs/spotbugs-exclude.xml | 117 +- .../blob/BlobContainerAsyncClient.java | 22 +- .../storage/blob/BlobServiceAsyncClient.java | 12 +- .../blob/implementation/AppendBlobsImpl.java | 296 ++-- .../blob/implementation/BlobsImpl.java | 1184 ++++++++----- .../blob/implementation/BlockBlobsImpl.java | 550 +++--- .../blob/implementation/ContainersImpl.java | 822 +++++---- .../blob/implementation/PageBlobsImpl.java | 612 ++++--- .../blob/implementation/ServicesImpl.java | 359 ++-- .../models/BlobStorageError.java | 2 +- .../blob/implementation/util/ModelHelper.java | 10 +- .../specialized/AppendBlobAsyncClient.java | 10 +- .../blob/specialized/BlobAsyncClientBase.java | 39 +- .../specialized/BlobLeaseAsyncClient.java | 32 +- .../specialized/BlockBlobAsyncClient.java | 17 +- .../blob/specialized/PageBlobAsyncClient.java | 36 +- .../main/java/BlobStorageCustomization.java | 136 +- .../checkstyle-suppressions.xml | 8 + .../DataLakeDirectoryAsyncClient.java | 4 +- .../datalake/DataLakeDirectoryClient.java | 6 +- .../datalake/DataLakeFileAsyncClient.java | 7 +- .../file/datalake/DataLakeFileClient.java | 7 +- .../DataLakeFileSystemAsyncClient.java | 13 +- .../datalake/DataLakeFileSystemClient.java | 22 +- .../datalake/DataLakePathAsyncClient.java | 18 +- .../file/datalake/DataLakePathClient.java | 41 +- .../implementation/FileSystemsImpl.java | 537 +++--- .../datalake/implementation/PathsImpl.java | 1334 ++++++++------ .../datalake/implementation/ServicesImpl.java | 106 +- .../util/DataLakeImplUtils.java | 11 - .../implementation/util/ModelHelper.java | 10 +- .../java/DataLakeStorageCustomization.java | 119 ++ .../checkstyle-suppressions.xml | 10 + .../storage/file/share/ShareAsyncClient.java | 16 +- .../azure/storage/file/share/ShareClient.java | 76 +- .../file/share/ShareDirectoryAsyncClient.java | 14 +- .../file/share/ShareDirectoryClient.java | 69 +- .../file/share/ShareFileAsyncClient.java | 37 +- .../storage/file/share/ShareFileClient.java | 130 +- .../file/share/ShareServiceAsyncClient.java | 13 +- .../file/share/ShareServiceClient.java | 28 +- .../share/implementation/DirectoriesImpl.java | 735 +++++--- .../file/share/implementation/FilesImpl.java | 1539 ++++++++++------- .../share/implementation/ServicesImpl.java | 274 ++- .../file/share/implementation/SharesImpl.java | 1175 ++++++++----- .../implementation/util/ModelHelper.java | 30 +- .../specialized/ShareLeaseAsyncClient.java | 32 +- .../main/java/ShareStorageCustomization.java | 120 ++ .../checkstyle-suppressions.xml | 10 + .../azure/storage/queue/QueueAsyncClient.java | 24 +- .../com/azure/storage/queue/QueueClient.java | 63 +- .../queue/QueueServiceAsyncClient.java | 12 +- .../storage/queue/QueueServiceClient.java | 21 +- .../queue/implementation/MessageIdsImpl.java | 133 +- .../queue/implementation/MessagesImpl.java | 274 ++- .../queue/implementation/QueuesImpl.java | 389 +++-- .../queue/implementation/ServicesImpl.java | 340 ++-- .../implementation/util/ModelHelper.java | 21 +- .../azure-storage-queue/swagger/README.md | 1 + .../azure-storage-queue/swagger/pom.xml | 17 + .../main/java/QueueStorageCustomization.java | 136 ++ 62 files changed, 7435 insertions(+), 4858 deletions(-) create mode 100644 sdk/storage/azure-storage-queue/swagger/pom.xml create mode 100644 sdk/storage/azure-storage-queue/swagger/src/main/java/QueueStorageCustomization.java diff --git a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml index d7496c3ed2e9..6a907a19a665 100644 --- a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml +++ b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml @@ -34,9 +34,6 @@ - - - @@ -77,15 +74,6 @@ - - - - - - - - - @@ -146,29 +134,6 @@ the main ServiceBusClientBuilder. --> - - - - - - - - - - - - - - @@ -184,13 +149,6 @@ the main ServiceBusClientBuilder. --> - - - - - - - @@ -231,8 +189,6 @@ the main ServiceBusClientBuilder. --> - - @@ -246,9 +202,6 @@ the main ServiceBusClientBuilder. --> - - - - @@ -440,13 +392,6 @@ the main ServiceBusClientBuilder. --> - - - - - - 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 2b1257ba70c1..d7b34475724b 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 @@ -164,10 +164,7 @@ - - - - + @@ -411,19 +408,6 @@ - - - - - - - - - - - - - @@ -482,24 +466,6 @@ - - - - - - - - - - - - - - - - - - @@ -541,8 +507,6 @@ - - - - - - - - @@ -596,48 +554,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1891,37 +1807,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerAsyncClient.java index 1d53e8fe0e45..753176857abc 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerAsyncClient.java @@ -427,8 +427,7 @@ Mono> createWithResponse(Map metadata, PublicAcce Context context) { context = context == null ? Context.NONE : context; return this.azureBlobStorage.getContainers().createNoCustomHeadersWithResponseAsync(containerName, null, - metadata, accessType, null, blobContainerEncryptionScope, context) - .onErrorMap(ModelHelper::mapToBlobStorageException); + metadata, accessType, null, blobContainerEncryptionScope, context); } /** @@ -576,8 +575,7 @@ Mono> deleteWithResponse(BlobRequestConditions requestConditions, return this.azureBlobStorage.getContainers().deleteNoCustomHeadersWithResponseAsync(containerName, null, requestConditions.getLeaseId(), requestConditions.getIfModifiedSince(), - requestConditions.getIfUnmodifiedSince(), null, context) - .onErrorMap(ModelHelper::mapToBlobStorageException); + requestConditions.getIfUnmodifiedSince(), null, context); } /** @@ -718,7 +716,6 @@ Mono> getPropertiesWithResponse(String leaseId return this.azureBlobStorage.getContainers() .getPropertiesWithResponseAsync(containerName, null, leaseId, null, context) - .onErrorMap(ModelHelper::mapToBlobStorageException) .map(rb -> { ContainersGetPropertiesHeaders hd = rb.getDeserializedHeaders(); BlobContainerProperties properties = new BlobContainerProperties(hd.getXMsMeta(), hd.getETag(), @@ -802,8 +799,7 @@ Mono> setMetadataWithResponse(Map metadata, } return this.azureBlobStorage.getContainers().setMetadataNoCustomHeadersWithResponseAsync(containerName, null, - requestConditions.getLeaseId(), metadata, requestConditions.getIfModifiedSince(), null, context) - .onErrorMap(ModelHelper::mapToBlobStorageException); + requestConditions.getLeaseId(), metadata, requestConditions.getIfModifiedSince(), null, context); } /** @@ -871,7 +867,6 @@ Mono> getAccessPolicyWithResponse(String l context = context == null ? Context.NONE : context; return this.azureBlobStorage.getContainers().getAccessPolicyWithResponseAsync( containerName, null, leaseId, null, context) - .onErrorMap(ModelHelper::mapToBlobStorageException) .map(response -> new SimpleResponse<>(response, new BlobContainerAccessPolicies(response.getDeserializedHeaders().getXMsBlobPublicAccess(), response.getValue().items()))); @@ -995,8 +990,7 @@ OffsetDateTime.now will only give back milliseconds (more precise fields are zer return this.azureBlobStorage.getContainers().setAccessPolicyNoCustomHeadersWithResponseAsync(containerName, null, requestConditions.getLeaseId(), accessType, requestConditions.getIfModifiedSince(), - requestConditions.getIfUnmodifiedSince(), null, identifiers, context) - .onErrorMap(ModelHelper::mapToBlobStorageException); + requestConditions.getIfUnmodifiedSince(), null, identifiers, context); } /** @@ -1203,8 +1197,7 @@ PagedFlux listBlobsFlatWithOptionalTimeout(ListBlobsOptions options, S return StorageImplUtils.applyOptionalTimeout( this.azureBlobStorage.getContainers().listBlobFlatSegmentWithResponseAsync(containerName, options.getPrefix(), marker, options.getMaxResultsPerPage(), include, null, null, Context.NONE), - timeout) - .onErrorMap(ModelHelper::mapToBlobStorageException); + timeout); } /** @@ -1378,8 +1371,7 @@ PagedFlux listBlobsHierarchyWithOptionalTimeout(String delimiter, List this.azureBlobStorage.getContainers().listBlobHierarchySegmentWithResponseAsync(containerName, delimiter, options.getPrefix(), marker, options.getMaxResultsPerPage(), include, null, null, Context.NONE), - timeout) - .onErrorMap(ModelHelper::mapToBlobStorageException); + timeout); } /** @@ -1462,7 +1454,6 @@ private Mono> findBlobsByTags( return StorageImplUtils.applyOptionalTimeout( this.azureBlobStorage.getContainers().filterBlobsWithResponseAsync(containerName, null, null, options.getQuery(), marker, options.getMaxResultsPerPage(), null, context), timeout) - .onErrorMap(ModelHelper::mapToBlobStorageException) .map(response -> { List value = response.getValue().getBlobs().stream() .map(ModelHelper::populateTaggedBlobItem) @@ -1529,7 +1520,6 @@ public Mono> getAccountInfoWithResponse() { Mono> getAccountInfoWithResponse(Context context) { context = context == null ? Context.NONE : context; return this.azureBlobStorage.getContainers().getAccountInfoWithResponseAsync(containerName, context) - .onErrorMap(ModelHelper::mapToBlobStorageException) .map(rb -> { ContainersGetAccountInfoHeaders hd = rb.getDeserializedHeaders(); return new SimpleResponse<>(rb, new StorageAccountInfo(hd.getXMsSkuName(), hd.getXMsAccountKind())); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceAsyncClient.java index 729889954532..3842d2b3e621 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceAsyncClient.java @@ -539,8 +539,7 @@ private Mono> listBlobContainersSegment(String this.azureBlobStorage.getServices().listBlobContainersSegmentSinglePageAsync( options.getPrefix(), marker, options.getMaxResultsPerPage(), toIncludeTypes(options.getDetails()), - null, null, Context.NONE), timeout) - .onErrorMap(ModelHelper::mapToBlobStorageException); + null, null, Context.NONE), timeout); } /** @@ -614,7 +613,6 @@ private Mono> findBlobsByTags( return StorageImplUtils.applyOptionalTimeout( this.azureBlobStorage.getServices().filterBlobsWithResponseAsync(null, null, options.getQuery(), marker, options.getMaxResultsPerPage(), null, context), timeout) - .onErrorMap(ModelHelper::mapToBlobStorageException) .map(response -> { List value = response.getValue().getBlobs().stream() .map(ModelHelper::populateTaggedBlobItem) @@ -712,7 +710,6 @@ Mono> getPropertiesWithResponse(Context context) context = context == null ? Context.NONE : context; throwOnAnonymousAccess(); return this.azureBlobStorage.getServices().getPropertiesWithResponseAsync(null, null, context) - .onErrorMap(ModelHelper::mapToBlobStorageException) .map(rb -> new SimpleResponse<>(rb, rb.getValue())); } @@ -859,8 +856,7 @@ Mono> setPropertiesWithResponse(BlobServiceProperties properties, context = context == null ? Context.NONE : context; return this.azureBlobStorage.getServices() - .setPropertiesNoCustomHeadersWithResponseAsync(finalProperties, null, null, context) - .onErrorMap(ModelHelper::mapToBlobStorageException); + .setPropertiesNoCustomHeadersWithResponseAsync(finalProperties, null, null, context); } /** @@ -964,7 +960,6 @@ Mono> getUserDelegationKeyWithResponse(OffsetDateTim .setStart(start == null ? "" : Constants.ISO_8601_UTC_DATE_FORMATTER.format(start)) .setExpiry(Constants.ISO_8601_UTC_DATE_FORMATTER.format(expiry)), null, null, context) - .onErrorMap(ModelHelper::mapToBlobStorageException) .map(rb -> new SimpleResponse<>(rb, rb.getValue())); } @@ -1022,7 +1017,6 @@ Mono> getStatisticsWithResponse(Context context) context = context == null ? Context.NONE : context; return this.azureBlobStorage.getServices().getStatisticsWithResponseAsync(null, null, context) - .onErrorMap(ModelHelper::mapToBlobStorageException) .map(rb -> new SimpleResponse<>(rb, rb.getValue())); } @@ -1074,7 +1068,6 @@ public Mono> getAccountInfoWithResponse() { Mono> getAccountInfoWithResponse(Context context) { throwOnAnonymousAccess(); return this.azureBlobStorage.getServices().getAccountInfoWithResponseAsync(context) - .onErrorMap(ModelHelper::mapToBlobStorageException) .map(rb -> { ServicesGetAccountInfoHeaders hd = rb.getDeserializedHeaders(); return new SimpleResponse<>(rb, new StorageAccountInfo(hd.getXMsSkuName(), hd.getXMsAccountKind(), @@ -1276,7 +1269,6 @@ Mono> undeleteBlobContainerWithResponse( context = context == null ? Context.NONE : context; return this.azureBlobStorage.getContainers().restoreWithResponseAsync(finalDestinationContainerName, null, null, options.getDeletedContainerName(), options.getDeletedContainerVersion(), context) - .onErrorMap(ModelHelper::mapToBlobStorageException) .map(response -> new SimpleResponse<>(response, getBlobContainerAsyncClient(finalDestinationContainerName))); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AppendBlobsImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AppendBlobsImpl.java index 09a7e2b2d317..70bcd8fc25ce 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AppendBlobsImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AppendBlobsImpl.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.storage.blob.implementation; import com.azure.core.annotation.BodyParam; @@ -39,11 +38,13 @@ import java.util.Map; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import com.azure.storage.blob.implementation.util.ModelHelper; /** * An instance of this class provides access to all the operations defined in AppendBlobs. */ public final class AppendBlobsImpl { + /** * The proxy service used to perform REST calls. */ @@ -56,7 +57,7 @@ public final class AppendBlobsImpl { /** * Initializes an instance of AppendBlobsImpl. - * + * * @param client the instance of the service client containing this operation class. */ AppendBlobsImpl(AzureBlobStorageImpl client) { @@ -72,6 +73,7 @@ public final class AppendBlobsImpl { @Host("{url}") @ServiceInterface(name = "AzureBlobStorageAppe") public interface AppendBlobsService { + @Put("/{containerName}/{blob}") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -307,7 +309,7 @@ Mono> sealNoCustomHeaders(@HostParam("url") String url, /** * The Create Append Blob operation creates a new append blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -408,17 +410,19 @@ public Mono> createWithResponseAsyn = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return FluxUtil.withContext(context -> service.create(this.client.getUrl(), containerName, blob, blobType, - timeout, contentLength, contentType, contentEncoding, contentLanguage, contentMd5Converted, cacheControl, - metadata, leaseId, contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, - encryptionScope, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, blobTagsString, immutabilityPolicyExpiryConverted, - immutabilityPolicyMode, legalHold, accept, context)); + return FluxUtil + .withContext(context -> service.create(this.client.getUrl(), containerName, blob, blobType, timeout, + contentLength, contentType, contentEncoding, contentLanguage, contentMd5Converted, cacheControl, + metadata, leaseId, contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, + encryptionScope, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, blobTagsString, immutabilityPolicyExpiryConverted, + immutabilityPolicyMode, legalHold, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Create Append Blob operation creates a new append blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -524,12 +528,13 @@ public Mono> createWithResponseAsyn contentEncoding, contentLanguage, contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, - blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, accept, context); + blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Create Append Blob operation creates a new append blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -573,12 +578,13 @@ public Mono createAsync(String containerName, String blob, long contentLen return createWithResponseAsync(containerName, blob, contentLength, timeout, metadata, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, blobHttpHeaders, cpkInfo, encryptionScopeParam) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Create Append Blob operation creates a new append blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -623,12 +629,13 @@ public Mono createAsync(String containerName, String blob, long contentLen return createWithResponseAsync(containerName, blob, contentLength, timeout, metadata, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, blobHttpHeaders, cpkInfo, encryptionScopeParam, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Create Append Blob operation creates a new append blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -729,17 +736,19 @@ public Mono> createNoCustomHeadersWithResponseAsync(String contai = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return FluxUtil.withContext(context -> service.createNoCustomHeaders(this.client.getUrl(), containerName, blob, - blobType, timeout, contentLength, contentType, contentEncoding, contentLanguage, contentMd5Converted, - cacheControl, metadata, leaseId, contentDisposition, encryptionKey, encryptionKeySha256, - encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, ifTags, this.client.getVersion(), requestId, blobTagsString, immutabilityPolicyExpiryConverted, - immutabilityPolicyMode, legalHold, accept, context)); + return FluxUtil + .withContext(context -> service.createNoCustomHeaders(this.client.getUrl(), containerName, blob, blobType, + timeout, contentLength, contentType, contentEncoding, contentLanguage, contentMd5Converted, + cacheControl, metadata, leaseId, contentDisposition, encryptionKey, encryptionKeySha256, + encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, + ifNoneMatch, ifTags, this.client.getVersion(), requestId, blobTagsString, + immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Create Append Blob operation creates a new append blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -841,19 +850,21 @@ public Mono> createNoCustomHeadersWithResponseAsync(String contai = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return service.createNoCustomHeaders(this.client.getUrl(), containerName, blob, blobType, timeout, - contentLength, contentType, contentEncoding, contentLanguage, contentMd5Converted, cacheControl, metadata, - leaseId, contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, blobTagsString, immutabilityPolicyExpiryConverted, - immutabilityPolicyMode, legalHold, accept, context); + return service + .createNoCustomHeaders(this.client.getUrl(), containerName, blob, blobType, timeout, contentLength, + contentType, contentEncoding, contentLanguage, contentMd5Converted, cacheControl, metadata, leaseId, + contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, blobTagsString, immutabilityPolicyExpiryConverted, + immutabilityPolicyMode, legalHold, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Append Block operation commits a new block of data to the end of an existing append blob. The Append Block * operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is * supported only on version 2015-02-21 version or later. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -922,18 +933,20 @@ public Mono> appendBlockWithRe = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.appendBlock(this.client.getUrl(), containerName, blob, comp, - timeout, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, leaseId, - maxSize, appendPosition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, body, accept, context)); + return FluxUtil + .withContext(context -> service.appendBlock(this.client.getUrl(), containerName, blob, comp, timeout, + contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, leaseId, maxSize, + appendPosition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, body, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Append Block operation commits a new block of data to the end of an existing append blob. The Append Block * operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is * supported only on version 2015-02-21 version or later. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1003,18 +1016,20 @@ public Mono> appendBlockWithRe = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.appendBlock(this.client.getUrl(), containerName, blob, comp, timeout, contentLength, - transactionalContentMD5Converted, transactionalContentCrc64Converted, leaseId, maxSize, appendPosition, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, body, accept, - context); + return service + .appendBlock(this.client.getUrl(), containerName, blob, comp, timeout, contentLength, + transactionalContentMD5Converted, transactionalContentCrc64Converted, leaseId, maxSize, appendPosition, + encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, body, + accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Append Block operation commits a new block of data to the end of an existing append blob. The Append Block * operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is * supported only on version 2015-02-21 version or later. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1056,14 +1071,16 @@ public Mono appendBlockAsync(String containerName, String blob, long conte String ifNoneMatch, String ifTags, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { return appendBlockWithResponseAsync(containerName, blob, contentLength, body, timeout, transactionalContentMD5, transactionalContentCrc64, leaseId, maxSize, appendPosition, ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch, ifTags, requestId, cpkInfo, encryptionScopeParam).flatMap(ignored -> Mono.empty()); + ifNoneMatch, ifTags, requestId, cpkInfo, encryptionScopeParam) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * The Append Block operation commits a new block of data to the end of an existing append blob. The Append Block * operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is * supported only on version 2015-02-21 version or later. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1107,14 +1124,16 @@ public Mono appendBlockAsync(String containerName, String blob, long conte Context context) { return appendBlockWithResponseAsync(containerName, blob, contentLength, body, timeout, transactionalContentMD5, transactionalContentCrc64, leaseId, maxSize, appendPosition, ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch, ifTags, requestId, cpkInfo, encryptionScopeParam, context).flatMap(ignored -> Mono.empty()); + ifNoneMatch, ifTags, requestId, cpkInfo, encryptionScopeParam, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * The Append Block operation commits a new block of data to the end of an existing append blob. The Append Block * operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is * supported only on version 2015-02-21 version or later. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1183,18 +1202,20 @@ public Mono> appendBlockNoCustomHeadersWithResponseAsync(String c = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.appendBlockNoCustomHeaders(this.client.getUrl(), containerName, - blob, comp, timeout, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, - leaseId, maxSize, appendPosition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, body, accept, context)); + return FluxUtil + .withContext(context -> service.appendBlockNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, + timeout, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, leaseId, + maxSize, appendPosition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, body, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Append Block operation commits a new block of data to the end of an existing append blob. The Append Block * operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is * supported only on version 2015-02-21 version or later. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1264,18 +1285,20 @@ public Mono> appendBlockNoCustomHeadersWithResponseAsync(String c = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.appendBlockNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, - contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, leaseId, maxSize, - appendPosition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, body, accept, context); + return service + .appendBlockNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, contentLength, + transactionalContentMD5Converted, transactionalContentCrc64Converted, leaseId, maxSize, appendPosition, + encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, body, + accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Append Block operation commits a new block of data to the end of an existing append blob. The Append Block * operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is * supported only on version 2015-02-21 version or later. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1344,18 +1367,20 @@ public Mono> appendBlockWithRe = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.appendBlock(this.client.getUrl(), containerName, blob, comp, - timeout, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, leaseId, - maxSize, appendPosition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, body, accept, context)); + return FluxUtil + .withContext(context -> service.appendBlock(this.client.getUrl(), containerName, blob, comp, timeout, + contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, leaseId, maxSize, + appendPosition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, body, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Append Block operation commits a new block of data to the end of an existing append blob. The Append Block * operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is * supported only on version 2015-02-21 version or later. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1425,18 +1450,20 @@ public Mono> appendBlockWithRe = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.appendBlock(this.client.getUrl(), containerName, blob, comp, timeout, contentLength, - transactionalContentMD5Converted, transactionalContentCrc64Converted, leaseId, maxSize, appendPosition, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, body, accept, - context); + return service + .appendBlock(this.client.getUrl(), containerName, blob, comp, timeout, contentLength, + transactionalContentMD5Converted, transactionalContentCrc64Converted, leaseId, maxSize, appendPosition, + encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, body, + accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Append Block operation commits a new block of data to the end of an existing append blob. The Append Block * operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is * supported only on version 2015-02-21 version or later. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1478,14 +1505,16 @@ public Mono appendBlockAsync(String containerName, String blob, long conte String ifNoneMatch, String ifTags, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { return appendBlockWithResponseAsync(containerName, blob, contentLength, body, timeout, transactionalContentMD5, transactionalContentCrc64, leaseId, maxSize, appendPosition, ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch, ifTags, requestId, cpkInfo, encryptionScopeParam).flatMap(ignored -> Mono.empty()); + ifNoneMatch, ifTags, requestId, cpkInfo, encryptionScopeParam) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * The Append Block operation commits a new block of data to the end of an existing append blob. The Append Block * operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is * supported only on version 2015-02-21 version or later. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1529,14 +1558,16 @@ public Mono appendBlockAsync(String containerName, String blob, long conte Context context) { return appendBlockWithResponseAsync(containerName, blob, contentLength, body, timeout, transactionalContentMD5, transactionalContentCrc64, leaseId, maxSize, appendPosition, ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch, ifTags, requestId, cpkInfo, encryptionScopeParam, context).flatMap(ignored -> Mono.empty()); + ifNoneMatch, ifTags, requestId, cpkInfo, encryptionScopeParam, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * The Append Block operation commits a new block of data to the end of an existing append blob. The Append Block * operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is * supported only on version 2015-02-21 version or later. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1605,18 +1636,20 @@ public Mono> appendBlockNoCustomHeadersWithResponseAsync(String c = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.appendBlockNoCustomHeaders(this.client.getUrl(), containerName, - blob, comp, timeout, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, - leaseId, maxSize, appendPosition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, body, accept, context)); + return FluxUtil + .withContext(context -> service.appendBlockNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, + timeout, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, leaseId, + maxSize, appendPosition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, body, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Append Block operation commits a new block of data to the end of an existing append blob. The Append Block * operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is * supported only on version 2015-02-21 version or later. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1686,18 +1719,20 @@ public Mono> appendBlockNoCustomHeadersWithResponseAsync(String c = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.appendBlockNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, - contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, leaseId, maxSize, - appendPosition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, body, accept, context); + return service + .appendBlockNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, contentLength, + transactionalContentMD5Converted, transactionalContentCrc64Converted, leaseId, maxSize, appendPosition, + encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, body, + accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Append Block operation commits a new block of data to the end of an existing append blob where the contents * are read from a source url. The Append Block operation is permitted only if the blob was created with * x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later. - * + * * @param containerName The container name. * @param blob The blob name. * @param sourceUrl Specify a URL to the copy source. @@ -1791,14 +1826,14 @@ public Mono> appendBloc encryptionScope, leaseId, maxSize, appendPosition, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, this.client.getVersion(), requestId, copySourceAuthorization, accept, - context)); + context)).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Append Block operation commits a new block of data to the end of an existing append blob where the contents * are read from a source url. The Append Block operation is permitted only if the blob was created with * x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later. - * + * * @param containerName The container name. * @param blob The blob name. * @param sourceUrl Specify a URL to the copy source. @@ -1892,14 +1927,15 @@ public Mono> appendBloc transactionalContentMD5Converted, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, leaseId, maxSize, appendPosition, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, - sourceIfNoneMatch, this.client.getVersion(), requestId, copySourceAuthorization, accept, context); + sourceIfNoneMatch, this.client.getVersion(), requestId, copySourceAuthorization, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Append Block operation commits a new block of data to the end of an existing append blob where the contents * are read from a source url. The Append Block operation is permitted only if the blob was created with * x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later. - * + * * @param containerName The container name. * @param blob The blob name. * @param sourceUrl Specify a URL to the copy source. @@ -1957,14 +1993,15 @@ public Mono appendBlockFromUrlAsync(String containerName, String blob, Str sourceContentMD5, sourceContentcrc64, timeout, transactionalContentMD5, leaseId, maxSize, appendPosition, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, requestId, copySourceAuthorization, cpkInfo, - encryptionScopeParam).flatMap(ignored -> Mono.empty()); + encryptionScopeParam).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * The Append Block operation commits a new block of data to the end of an existing append blob where the contents * are read from a source url. The Append Block operation is permitted only if the blob was created with * x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later. - * + * * @param containerName The container name. * @param blob The blob name. * @param sourceUrl Specify a URL to the copy source. @@ -2023,14 +2060,16 @@ public Mono appendBlockFromUrlAsync(String containerName, String blob, Str sourceContentMD5, sourceContentcrc64, timeout, transactionalContentMD5, leaseId, maxSize, appendPosition, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, requestId, copySourceAuthorization, cpkInfo, - encryptionScopeParam, context).flatMap(ignored -> Mono.empty()); + encryptionScopeParam, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * The Append Block operation commits a new block of data to the end of an existing append blob where the contents * are read from a source url. The Append Block operation is permitted only if the blob was created with * x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later. - * + * * @param containerName The container name. * @param blob The blob name. * @param sourceUrl Specify a URL to the copy source. @@ -2117,20 +2156,22 @@ public Mono> appendBlockFromUrlNoCustomHeadersWithResponseAsync(S = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - return FluxUtil.withContext(context -> service.appendBlockFromUrlNoCustomHeaders(this.client.getUrl(), - containerName, blob, comp, sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, - timeout, contentLength, transactionalContentMD5Converted, encryptionKey, encryptionKeySha256, - encryptionAlgorithm, encryptionScope, leaseId, maxSize, appendPosition, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSinceConverted, - sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, this.client.getVersion(), requestId, - copySourceAuthorization, accept, context)); + return FluxUtil + .withContext(context -> service.appendBlockFromUrlNoCustomHeaders(this.client.getUrl(), containerName, blob, + comp, sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, timeout, + contentLength, transactionalContentMD5Converted, encryptionKey, encryptionKeySha256, + encryptionAlgorithm, encryptionScope, leaseId, maxSize, appendPosition, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSinceConverted, + sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, this.client.getVersion(), requestId, + copySourceAuthorization, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Append Block operation commits a new block of data to the end of an existing append blob where the contents * are read from a source url. The Append Block operation is permitted only if the blob was created with * x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later. - * + * * @param containerName The container name. * @param blob The blob name. * @param sourceUrl Specify a URL to the copy source. @@ -2223,13 +2264,14 @@ public Mono> appendBlockFromUrlNoCustomHeadersWithResponseAsync(S transactionalContentMD5Converted, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, leaseId, maxSize, appendPosition, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, - sourceIfNoneMatch, this.client.getVersion(), requestId, copySourceAuthorization, accept, context); + sourceIfNoneMatch, this.client.getVersion(), requestId, copySourceAuthorization, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version 2019-12-12 * version or later. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2263,15 +2305,17 @@ public Mono> sealWithResponseAsync(St = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.seal(this.client.getUrl(), containerName, blob, comp, timeout, - this.client.getVersion(), requestId, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, appendPosition, accept, context)); + return FluxUtil + .withContext(context -> service.seal(this.client.getUrl(), containerName, blob, comp, timeout, + this.client.getVersion(), requestId, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, + ifMatch, ifNoneMatch, appendPosition, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version 2019-12-12 * version or later. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2306,15 +2350,17 @@ public Mono> sealWithResponseAsync(St = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.seal(this.client.getUrl(), containerName, blob, comp, timeout, this.client.getVersion(), - requestId, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, - appendPosition, accept, context); + return service + .seal(this.client.getUrl(), containerName, blob, comp, timeout, this.client.getVersion(), requestId, + leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, appendPosition, + accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version 2019-12-12 * version or later. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2343,13 +2389,15 @@ public Mono sealAsync(String containerName, String blob, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, Long appendPosition) { return sealWithResponseAsync(containerName, blob, timeout, requestId, leaseId, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, appendPosition).flatMap(ignored -> Mono.empty()); + ifUnmodifiedSince, ifMatch, ifNoneMatch, appendPosition) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version 2019-12-12 * version or later. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2379,13 +2427,15 @@ public Mono sealAsync(String containerName, String blob, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, Long appendPosition, Context context) { return sealWithResponseAsync(containerName, blob, timeout, requestId, leaseId, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, appendPosition, context).flatMap(ignored -> Mono.empty()); + ifUnmodifiedSince, ifMatch, ifNoneMatch, appendPosition, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version 2019-12-12 * version or later. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2419,15 +2469,17 @@ public Mono> sealNoCustomHeadersWithResponseAsync(String containe = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.sealNoCustomHeaders(this.client.getUrl(), containerName, blob, - comp, timeout, this.client.getVersion(), requestId, leaseId, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, appendPosition, accept, context)); + return FluxUtil + .withContext(context -> service.sealNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, + timeout, this.client.getVersion(), requestId, leaseId, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, appendPosition, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version 2019-12-12 * version or later. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2462,8 +2514,10 @@ public Mono> sealNoCustomHeadersWithResponseAsync(String containe = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.sealNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, - this.client.getVersion(), requestId, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, appendPosition, accept, context); + return service + .sealNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, this.client.getVersion(), + requestId, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, + appendPosition, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlobsImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlobsImpl.java index a486f7542d11..c5770824b839 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlobsImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlobsImpl.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.storage.blob.implementation; import com.azure.core.annotation.BodyParam; @@ -71,11 +70,13 @@ import java.util.Map; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import com.azure.storage.blob.implementation.util.ModelHelper; /** * An instance of this class provides access to all the operations defined in Blobs. */ public final class BlobsImpl { + /** * The proxy service used to perform REST calls. */ @@ -88,7 +89,7 @@ public final class BlobsImpl { /** * Initializes an instance of BlobsImpl. - * + * * @param client the instance of the service client containing this operation class. */ BlobsImpl(AzureBlobStorageImpl client) { @@ -103,6 +104,7 @@ public final class BlobsImpl { @Host("{url}") @ServiceInterface(name = "AzureBlobStorageBlob") public interface BlobsService { + @Get("/{containerName}/{blob}") @ExpectedResponses({ 200, 206 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -817,7 +819,7 @@ Mono> setTagsNoCustomHeaders(@HostParam("url") String url, /** * The Download operation reads or downloads a blob from the system, including its metadata and properties. You can * also call Download to read a snapshot or version. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -876,16 +878,18 @@ public Mono>> downloadWithRe = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.download(this.client.getUrl(), containerName, blob, snapshot, - versionId, timeout, range, leaseId, rangeGetContentMD5, rangeGetContentCRC64, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.download(this.client.getUrl(), containerName, blob, snapshot, versionId, + timeout, range, leaseId, rangeGetContentMD5, rangeGetContentCRC64, encryptionKey, encryptionKeySha256, + encryptionAlgorithm, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Download operation reads or downloads a blob from the system, including its metadata and properties. You can * also call Download to read a snapshot or version. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -945,16 +949,18 @@ public Mono>> downloadWithRe = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.download(this.client.getUrl(), containerName, blob, snapshot, versionId, timeout, range, leaseId, - rangeGetContentMD5, rangeGetContentCRC64, encryptionKey, encryptionKeySha256, encryptionAlgorithm, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context); + return service + .download(this.client.getUrl(), containerName, blob, snapshot, versionId, timeout, range, leaseId, + rangeGetContentMD5, rangeGetContentCRC64, encryptionKey, encryptionKeySha256, encryptionAlgorithm, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Download operation reads or downloads a blob from the system, including its metadata and properties. You can * also call Download to read a snapshot or version. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -994,13 +1000,14 @@ public Flux downloadAsync(String containerName, String blob, String String ifTags, String requestId, CpkInfo cpkInfo) { return downloadWithResponseAsync(containerName, blob, snapshot, versionId, timeout, range, leaseId, rangeGetContentMD5, rangeGetContentCRC64, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, - requestId, cpkInfo).flatMapMany(fluxByteBufferResponse -> fluxByteBufferResponse.getValue()); + requestId, cpkInfo).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMapMany(fluxByteBufferResponse -> fluxByteBufferResponse.getValue()); } /** * The Download operation reads or downloads a blob from the system, including its metadata and properties. You can * also call Download to read a snapshot or version. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -1041,13 +1048,15 @@ public Flux downloadAsync(String containerName, String blob, String String ifTags, String requestId, CpkInfo cpkInfo, Context context) { return downloadWithResponseAsync(containerName, blob, snapshot, versionId, timeout, range, leaseId, rangeGetContentMD5, rangeGetContentCRC64, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, - requestId, cpkInfo, context).flatMapMany(fluxByteBufferResponse -> fluxByteBufferResponse.getValue()); + requestId, cpkInfo, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMapMany(fluxByteBufferResponse -> fluxByteBufferResponse.getValue()); } /** * The Download operation reads or downloads a blob from the system, including its metadata and properties. You can * also call Download to read a snapshot or version. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -1105,16 +1114,18 @@ public Mono downloadNoCustomHeadersWithResponseAsync(String cont = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.downloadNoCustomHeaders(this.client.getUrl(), containerName, - blob, snapshot, versionId, timeout, range, leaseId, rangeGetContentMD5, rangeGetContentCRC64, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.downloadNoCustomHeaders(this.client.getUrl(), containerName, blob, snapshot, + versionId, timeout, range, leaseId, rangeGetContentMD5, rangeGetContentCRC64, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, + ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Download operation reads or downloads a blob from the system, including its metadata and properties. You can * also call Download to read a snapshot or version. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -1173,16 +1184,18 @@ public Mono downloadNoCustomHeadersWithResponseAsync(String cont = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.downloadNoCustomHeaders(this.client.getUrl(), containerName, blob, snapshot, versionId, timeout, - range, leaseId, rangeGetContentMD5, rangeGetContentCRC64, encryptionKey, encryptionKeySha256, - encryptionAlgorithm, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context); + return service + .downloadNoCustomHeaders(this.client.getUrl(), containerName, blob, snapshot, versionId, timeout, range, + leaseId, rangeGetContentMD5, rangeGetContentCRC64, encryptionKey, encryptionKeySha256, + encryptionAlgorithm, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system properties * for the blob. It does not return the content of the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -1235,16 +1248,18 @@ public Mono> getPropertiesWithResp = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.getProperties(this.client.getUrl(), containerName, blob, - snapshot, versionId, timeout, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.getProperties(this.client.getUrl(), containerName, blob, snapshot, + versionId, timeout, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system properties * for the blob. It does not return the content of the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -1298,16 +1313,18 @@ public Mono> getPropertiesWithResp = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.getProperties(this.client.getUrl(), containerName, blob, snapshot, versionId, timeout, leaseId, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, - context); + return service + .getProperties(this.client.getUrl(), containerName, blob, snapshot, versionId, timeout, leaseId, + encryptionKey, encryptionKeySha256, encryptionAlgorithm, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, + context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system properties * for the blob. It does not return the content of the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -1341,13 +1358,14 @@ public Mono getPropertiesAsync(String containerName, String blob, String s String ifMatch, String ifNoneMatch, String ifTags, String requestId, CpkInfo cpkInfo) { return getPropertiesWithResponseAsync(containerName, blob, snapshot, versionId, timeout, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, cpkInfo) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system properties * for the blob. It does not return the content of the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -1382,13 +1400,14 @@ public Mono getPropertiesAsync(String containerName, String blob, String s String ifMatch, String ifNoneMatch, String ifTags, String requestId, CpkInfo cpkInfo, Context context) { return getPropertiesWithResponseAsync(containerName, blob, snapshot, versionId, timeout, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, cpkInfo, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system properties * for the blob. It does not return the content of the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -1441,16 +1460,18 @@ public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.getPropertiesNoCustomHeaders(this.client.getUrl(), containerName, - blob, snapshot, versionId, timeout, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.getPropertiesNoCustomHeaders(this.client.getUrl(), containerName, blob, + snapshot, versionId, timeout, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system properties * for the blob. It does not return the content of the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -1504,10 +1525,12 @@ public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.getPropertiesNoCustomHeaders(this.client.getUrl(), containerName, blob, snapshot, versionId, - timeout, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, - context); + return service + .getPropertiesNoCustomHeaders(this.client.getUrl(), containerName, blob, snapshot, versionId, timeout, + leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, + context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -1526,7 +1549,7 @@ public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String * automatic snapshot using snapshot timestamp or version id. You can restore the blob by calling Put or Copy Blob * API with automatic snapshot as source. Deleting automatic snapshot requires shared key or special SAS/RBAC * permissions. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -1568,9 +1591,11 @@ public Mono> deleteWithResponseAsync(Stri = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.delete(this.client.getUrl(), containerName, blob, snapshot, - versionId, timeout, leaseId, deleteSnapshots, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, ifTags, this.client.getVersion(), requestId, blobDeleteType, accept, context)); + return FluxUtil + .withContext(context -> service.delete(this.client.getUrl(), containerName, blob, snapshot, versionId, + timeout, leaseId, deleteSnapshots, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, + ifNoneMatch, ifTags, this.client.getVersion(), requestId, blobDeleteType, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -1589,7 +1614,7 @@ public Mono> deleteWithResponseAsync(Stri * automatic snapshot using snapshot timestamp or version id. You can restore the blob by calling Put or Copy Blob * API with automatic snapshot as source. Deleting automatic snapshot requires shared key or special SAS/RBAC * permissions. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -1632,9 +1657,11 @@ public Mono> deleteWithResponseAsync(Stri = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.delete(this.client.getUrl(), containerName, blob, snapshot, versionId, timeout, leaseId, - deleteSnapshots, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, blobDeleteType, accept, context); + return service + .delete(this.client.getUrl(), containerName, blob, snapshot, versionId, timeout, leaseId, deleteSnapshots, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, blobDeleteType, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -1653,7 +1680,7 @@ public Mono> deleteWithResponseAsync(Stri * automatic snapshot using snapshot timestamp or version id. You can restore the blob by calling Put or Copy Blob * API with automatic snapshot as source. Deleting automatic snapshot requires shared key or special SAS/RBAC * permissions. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -1692,6 +1719,7 @@ public Mono deleteAsync(String containerName, String blob, String snapshot BlobDeleteType blobDeleteType) { return deleteWithResponseAsync(containerName, blob, snapshot, versionId, timeout, leaseId, deleteSnapshots, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, blobDeleteType) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } @@ -1711,7 +1739,7 @@ public Mono deleteAsync(String containerName, String blob, String snapshot * automatic snapshot using snapshot timestamp or version id. You can restore the blob by calling Put or Copy Blob * API with automatic snapshot as source. Deleting automatic snapshot requires shared key or special SAS/RBAC * permissions. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -1751,6 +1779,7 @@ public Mono deleteAsync(String containerName, String blob, String snapshot BlobDeleteType blobDeleteType, Context context) { return deleteWithResponseAsync(containerName, blob, snapshot, versionId, timeout, leaseId, deleteSnapshots, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, blobDeleteType, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } @@ -1770,7 +1799,7 @@ public Mono deleteAsync(String containerName, String blob, String snapshot * automatic snapshot using snapshot timestamp or version id. You can restore the blob by calling Put or Copy Blob * API with automatic snapshot as source. Deleting automatic snapshot requires shared key or special SAS/RBAC * permissions. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -1815,7 +1844,8 @@ public Mono> deleteNoCustomHeadersWithResponseAsync(String contai return FluxUtil .withContext(context -> service.deleteNoCustomHeaders(this.client.getUrl(), containerName, blob, snapshot, versionId, timeout, leaseId, deleteSnapshots, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, blobDeleteType, accept, context)); + ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, blobDeleteType, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -1834,7 +1864,7 @@ public Mono> deleteNoCustomHeadersWithResponseAsync(String contai * automatic snapshot using snapshot timestamp or version id. You can restore the blob by calling Put or Copy Blob * API with automatic snapshot as source. Deleting automatic snapshot requires shared key or special SAS/RBAC * permissions. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -1877,14 +1907,16 @@ public Mono> deleteNoCustomHeadersWithResponseAsync(String contai = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.deleteNoCustomHeaders(this.client.getUrl(), containerName, blob, snapshot, versionId, timeout, - leaseId, deleteSnapshots, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, - ifTags, this.client.getVersion(), requestId, blobDeleteType, accept, context); + return service + .deleteNoCustomHeaders(this.client.getUrl(), containerName, blob, snapshot, versionId, timeout, leaseId, + deleteSnapshots, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, blobDeleteType, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Undelete a blob that was previously soft deleted. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1902,13 +1934,15 @@ public Mono> undeleteWithResponseAsync( Integer timeout, String requestId) { final String comp = "undelete"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.undelete(this.client.getUrl(), containerName, blob, comp, - timeout, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.undelete(this.client.getUrl(), containerName, blob, comp, timeout, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Undelete a blob that was previously soft deleted. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1927,13 +1961,15 @@ public Mono> undeleteWithResponseAsync( Integer timeout, String requestId, Context context) { final String comp = "undelete"; final String accept = "application/xml"; - return service.undelete(this.client.getUrl(), containerName, blob, comp, timeout, this.client.getVersion(), - requestId, accept, context); + return service + .undelete(this.client.getUrl(), containerName, blob, comp, timeout, this.client.getVersion(), requestId, + accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Undelete a blob that was previously soft deleted. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1948,12 +1984,14 @@ public Mono> undeleteWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono undeleteAsync(String containerName, String blob, Integer timeout, String requestId) { - return undeleteWithResponseAsync(containerName, blob, timeout, requestId).flatMap(ignored -> Mono.empty()); + return undeleteWithResponseAsync(containerName, blob, timeout, requestId) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Undelete a blob that was previously soft deleted. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1971,12 +2009,13 @@ public Mono undeleteAsync(String containerName, String blob, Integer timeo public Mono undeleteAsync(String containerName, String blob, Integer timeout, String requestId, Context context) { return undeleteWithResponseAsync(containerName, blob, timeout, requestId, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * Undelete a blob that was previously soft deleted. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1994,13 +2033,15 @@ public Mono> undeleteNoCustomHeadersWithResponseAsync(String cont Integer timeout, String requestId) { final String comp = "undelete"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.undeleteNoCustomHeaders(this.client.getUrl(), containerName, - blob, comp, timeout, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.undeleteNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, + timeout, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Undelete a blob that was previously soft deleted. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2019,13 +2060,15 @@ public Mono> undeleteNoCustomHeadersWithResponseAsync(String cont Integer timeout, String requestId, Context context) { final String comp = "undelete"; final String accept = "application/xml"; - return service.undeleteNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, - this.client.getVersion(), requestId, accept, context); + return service + .undeleteNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, this.client.getVersion(), + requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Sets the time a blob will expire and be deleted. - * + * * @param containerName The container name. * @param blob The blob name. * @param expiryOptions Required. Indicates mode of the expiry time. @@ -2045,13 +2088,15 @@ public Mono> setExpiryWithResponseAsyn BlobExpiryOptions expiryOptions, Integer timeout, String requestId, String expiresOn) { final String comp = "expiry"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.setExpiry(this.client.getUrl(), containerName, blob, comp, - timeout, this.client.getVersion(), requestId, expiryOptions, expiresOn, accept, context)); + return FluxUtil + .withContext(context -> service.setExpiry(this.client.getUrl(), containerName, blob, comp, timeout, + this.client.getVersion(), requestId, expiryOptions, expiresOn, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Sets the time a blob will expire and be deleted. - * + * * @param containerName The container name. * @param blob The blob name. * @param expiryOptions Required. Indicates mode of the expiry time. @@ -2072,13 +2117,15 @@ public Mono> setExpiryWithResponseAsyn BlobExpiryOptions expiryOptions, Integer timeout, String requestId, String expiresOn, Context context) { final String comp = "expiry"; final String accept = "application/xml"; - return service.setExpiry(this.client.getUrl(), containerName, blob, comp, timeout, this.client.getVersion(), - requestId, expiryOptions, expiresOn, accept, context); + return service + .setExpiry(this.client.getUrl(), containerName, blob, comp, timeout, this.client.getVersion(), requestId, + expiryOptions, expiresOn, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Sets the time a blob will expire and be deleted. - * + * * @param containerName The container name. * @param blob The blob name. * @param expiryOptions Required. Indicates mode of the expiry time. @@ -2097,12 +2144,13 @@ public Mono> setExpiryWithResponseAsyn public Mono setExpiryAsync(String containerName, String blob, BlobExpiryOptions expiryOptions, Integer timeout, String requestId, String expiresOn) { return setExpiryWithResponseAsync(containerName, blob, expiryOptions, timeout, requestId, expiresOn) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * Sets the time a blob will expire and be deleted. - * + * * @param containerName The container name. * @param blob The blob name. * @param expiryOptions Required. Indicates mode of the expiry time. @@ -2122,12 +2170,13 @@ public Mono setExpiryAsync(String containerName, String blob, BlobExpiryOp public Mono setExpiryAsync(String containerName, String blob, BlobExpiryOptions expiryOptions, Integer timeout, String requestId, String expiresOn, Context context) { return setExpiryWithResponseAsync(containerName, blob, expiryOptions, timeout, requestId, expiresOn, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * Sets the time a blob will expire and be deleted. - * + * * @param containerName The container name. * @param blob The blob name. * @param expiryOptions Required. Indicates mode of the expiry time. @@ -2147,13 +2196,15 @@ public Mono> setExpiryNoCustomHeadersWithResponseAsync(String con BlobExpiryOptions expiryOptions, Integer timeout, String requestId, String expiresOn) { final String comp = "expiry"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.setExpiryNoCustomHeaders(this.client.getUrl(), containerName, - blob, comp, timeout, this.client.getVersion(), requestId, expiryOptions, expiresOn, accept, context)); + return FluxUtil + .withContext(context -> service.setExpiryNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, + timeout, this.client.getVersion(), requestId, expiryOptions, expiresOn, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Sets the time a blob will expire and be deleted. - * + * * @param containerName The container name. * @param blob The blob name. * @param expiryOptions Required. Indicates mode of the expiry time. @@ -2174,13 +2225,15 @@ public Mono> setExpiryNoCustomHeadersWithResponseAsync(String con BlobExpiryOptions expiryOptions, Integer timeout, String requestId, String expiresOn, Context context) { final String comp = "expiry"; final String accept = "application/xml"; - return service.setExpiryNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, - this.client.getVersion(), requestId, expiryOptions, expiresOn, accept, context); + return service + .setExpiryNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, + this.client.getVersion(), requestId, expiryOptions, expiresOn, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Set HTTP Headers operation sets system properties on the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2243,15 +2296,17 @@ public Mono> setHttpHeadersWithRe = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.setHttpHeaders(this.client.getUrl(), containerName, blob, comp, - timeout, cacheControl, contentType, contentMd5Converted, contentEncoding, contentLanguage, leaseId, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, contentDisposition, - this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.setHttpHeaders(this.client.getUrl(), containerName, blob, comp, timeout, + cacheControl, contentType, contentMd5Converted, contentEncoding, contentLanguage, leaseId, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, contentDisposition, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Set HTTP Headers operation sets system properties on the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2316,15 +2371,17 @@ public Mono> setHttpHeadersWithRe = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.setHttpHeaders(this.client.getUrl(), containerName, blob, comp, timeout, cacheControl, - contentType, contentMd5Converted, contentEncoding, contentLanguage, leaseId, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, contentDisposition, this.client.getVersion(), - requestId, accept, context); + return service + .setHttpHeaders(this.client.getUrl(), containerName, blob, comp, timeout, cacheControl, contentType, + contentMd5Converted, contentEncoding, contentLanguage, leaseId, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, contentDisposition, this.client.getVersion(), + requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Set HTTP Headers operation sets system properties on the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2352,12 +2409,13 @@ public Mono setHttpHeadersAsync(String containerName, String blob, Integer String ifTags, String requestId, BlobHttpHeaders blobHttpHeaders) { return setHttpHeadersWithResponseAsync(containerName, blob, timeout, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, blobHttpHeaders) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Set HTTP Headers operation sets system properties on the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2386,12 +2444,13 @@ public Mono setHttpHeadersAsync(String containerName, String blob, Integer String ifTags, String requestId, BlobHttpHeaders blobHttpHeaders, Context context) { return setHttpHeadersWithResponseAsync(containerName, blob, timeout, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, blobHttpHeaders, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Set HTTP Headers operation sets system properties on the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2454,15 +2513,17 @@ public Mono> setHttpHeadersNoCustomHeadersWithResponseAsync(Strin = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.setHttpHeadersNoCustomHeaders(this.client.getUrl(), - containerName, blob, comp, timeout, cacheControl, contentType, contentMd5Converted, contentEncoding, - contentLanguage, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, - ifTags, contentDisposition, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.setHttpHeadersNoCustomHeaders(this.client.getUrl(), containerName, blob, + comp, timeout, cacheControl, contentType, contentMd5Converted, contentEncoding, contentLanguage, + leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + contentDisposition, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Set HTTP Headers operation sets system properties on the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2527,15 +2588,17 @@ public Mono> setHttpHeadersNoCustomHeadersWithResponseAsync(Strin = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.setHttpHeadersNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, - cacheControl, contentType, contentMd5Converted, contentEncoding, contentLanguage, leaseId, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, contentDisposition, - this.client.getVersion(), requestId, accept, context); + return service + .setHttpHeadersNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, cacheControl, + contentType, contentMd5Converted, contentEncoding, contentLanguage, leaseId, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, contentDisposition, this.client.getVersion(), + requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Set Immutability Policy operation sets the immutability policy on the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2562,14 +2625,16 @@ public Mono> setImmutabili = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return FluxUtil.withContext(context -> service.setImmutabilityPolicy(this.client.getUrl(), containerName, blob, - comp, timeout, this.client.getVersion(), requestId, ifUnmodifiedSinceConverted, - immutabilityPolicyExpiryConverted, immutabilityPolicyMode, accept, context)); + return FluxUtil + .withContext(context -> service.setImmutabilityPolicy(this.client.getUrl(), containerName, blob, comp, + timeout, this.client.getVersion(), requestId, ifUnmodifiedSinceConverted, + immutabilityPolicyExpiryConverted, immutabilityPolicyMode, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Set Immutability Policy operation sets the immutability policy on the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2597,14 +2662,16 @@ public Mono> setImmutabili = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return service.setImmutabilityPolicy(this.client.getUrl(), containerName, blob, comp, timeout, - this.client.getVersion(), requestId, ifUnmodifiedSinceConverted, immutabilityPolicyExpiryConverted, - immutabilityPolicyMode, accept, context); + return service + .setImmutabilityPolicy(this.client.getUrl(), containerName, blob, comp, timeout, this.client.getVersion(), + requestId, ifUnmodifiedSinceConverted, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, + accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Set Immutability Policy operation sets the immutability policy on the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2626,12 +2693,14 @@ public Mono setImmutabilityPolicyAsync(String containerName, String blob, OffsetDateTime ifUnmodifiedSince, OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode) { return setImmutabilityPolicyWithResponseAsync(containerName, blob, timeout, requestId, ifUnmodifiedSince, - immutabilityPolicyExpiry, immutabilityPolicyMode).flatMap(ignored -> Mono.empty()); + immutabilityPolicyExpiry, immutabilityPolicyMode) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * The Set Immutability Policy operation sets the immutability policy on the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2654,12 +2723,14 @@ public Mono setImmutabilityPolicyAsync(String containerName, String blob, OffsetDateTime ifUnmodifiedSince, OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, Context context) { return setImmutabilityPolicyWithResponseAsync(containerName, blob, timeout, requestId, ifUnmodifiedSince, - immutabilityPolicyExpiry, immutabilityPolicyMode, context).flatMap(ignored -> Mono.empty()); + immutabilityPolicyExpiry, immutabilityPolicyMode, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * The Set Immutability Policy operation sets the immutability policy on the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2686,14 +2757,16 @@ public Mono> setImmutabilityPolicyNoCustomHeadersWithResponseAsyn = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return FluxUtil.withContext(context -> service.setImmutabilityPolicyNoCustomHeaders(this.client.getUrl(), - containerName, blob, comp, timeout, this.client.getVersion(), requestId, ifUnmodifiedSinceConverted, - immutabilityPolicyExpiryConverted, immutabilityPolicyMode, accept, context)); + return FluxUtil + .withContext(context -> service.setImmutabilityPolicyNoCustomHeaders(this.client.getUrl(), containerName, + blob, comp, timeout, this.client.getVersion(), requestId, ifUnmodifiedSinceConverted, + immutabilityPolicyExpiryConverted, immutabilityPolicyMode, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Set Immutability Policy operation sets the immutability policy on the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2721,14 +2794,16 @@ public Mono> setImmutabilityPolicyNoCustomHeadersWithResponseAsyn = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return service.setImmutabilityPolicyNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, - this.client.getVersion(), requestId, ifUnmodifiedSinceConverted, immutabilityPolicyExpiryConverted, - immutabilityPolicyMode, accept, context); + return service + .setImmutabilityPolicyNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, + this.client.getVersion(), requestId, ifUnmodifiedSinceConverted, immutabilityPolicyExpiryConverted, + immutabilityPolicyMode, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Delete Immutability Policy operation deletes the immutability policy on the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2746,13 +2821,15 @@ public Mono> deleteImmu String containerName, String blob, Integer timeout, String requestId) { final String comp = "immutabilityPolicies"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.deleteImmutabilityPolicy(this.client.getUrl(), containerName, - blob, comp, timeout, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.deleteImmutabilityPolicy(this.client.getUrl(), containerName, blob, comp, + timeout, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Delete Immutability Policy operation deletes the immutability policy on the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2771,13 +2848,15 @@ public Mono> deleteImmu String containerName, String blob, Integer timeout, String requestId, Context context) { final String comp = "immutabilityPolicies"; final String accept = "application/xml"; - return service.deleteImmutabilityPolicy(this.client.getUrl(), containerName, blob, comp, timeout, - this.client.getVersion(), requestId, accept, context); + return service + .deleteImmutabilityPolicy(this.client.getUrl(), containerName, blob, comp, timeout, + this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Delete Immutability Policy operation deletes the immutability policy on the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2794,12 +2873,13 @@ public Mono> deleteImmu public Mono deleteImmutabilityPolicyAsync(String containerName, String blob, Integer timeout, String requestId) { return deleteImmutabilityPolicyWithResponseAsync(containerName, blob, timeout, requestId) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Delete Immutability Policy operation deletes the immutability policy on the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2817,12 +2897,13 @@ public Mono deleteImmutabilityPolicyAsync(String containerName, String blo public Mono deleteImmutabilityPolicyAsync(String containerName, String blob, Integer timeout, String requestId, Context context) { return deleteImmutabilityPolicyWithResponseAsync(containerName, blob, timeout, requestId, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Delete Immutability Policy operation deletes the immutability policy on the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2840,13 +2921,15 @@ public Mono> deleteImmutabilityPolicyNoCustomHeadersWithResponseA String blob, Integer timeout, String requestId) { final String comp = "immutabilityPolicies"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.deleteImmutabilityPolicyNoCustomHeaders(this.client.getUrl(), - containerName, blob, comp, timeout, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.deleteImmutabilityPolicyNoCustomHeaders(this.client.getUrl(), containerName, + blob, comp, timeout, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Delete Immutability Policy operation deletes the immutability policy on the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2865,13 +2948,15 @@ public Mono> deleteImmutabilityPolicyNoCustomHeadersWithResponseA String blob, Integer timeout, String requestId, Context context) { final String comp = "immutabilityPolicies"; final String accept = "application/xml"; - return service.deleteImmutabilityPolicyNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, - this.client.getVersion(), requestId, accept, context); + return service + .deleteImmutabilityPolicyNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, + this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Set Legal Hold operation sets a legal hold on the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param legalHold Specified if a legal hold should be set on the blob. @@ -2890,13 +2975,15 @@ public Mono> setLegalHoldWithRespon String blob, boolean legalHold, Integer timeout, String requestId) { final String comp = "legalhold"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.setLegalHold(this.client.getUrl(), containerName, blob, comp, - timeout, this.client.getVersion(), requestId, legalHold, accept, context)); + return FluxUtil + .withContext(context -> service.setLegalHold(this.client.getUrl(), containerName, blob, comp, timeout, + this.client.getVersion(), requestId, legalHold, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Set Legal Hold operation sets a legal hold on the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param legalHold Specified if a legal hold should be set on the blob. @@ -2916,13 +3003,15 @@ public Mono> setLegalHoldWithRespon String blob, boolean legalHold, Integer timeout, String requestId, Context context) { final String comp = "legalhold"; final String accept = "application/xml"; - return service.setLegalHold(this.client.getUrl(), containerName, blob, comp, timeout, this.client.getVersion(), - requestId, legalHold, accept, context); + return service + .setLegalHold(this.client.getUrl(), containerName, blob, comp, timeout, this.client.getVersion(), requestId, + legalHold, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Set Legal Hold operation sets a legal hold on the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param legalHold Specified if a legal hold should be set on the blob. @@ -2940,12 +3029,13 @@ public Mono> setLegalHoldWithRespon public Mono setLegalHoldAsync(String containerName, String blob, boolean legalHold, Integer timeout, String requestId) { return setLegalHoldWithResponseAsync(containerName, blob, legalHold, timeout, requestId) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Set Legal Hold operation sets a legal hold on the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param legalHold Specified if a legal hold should be set on the blob. @@ -2964,12 +3054,13 @@ public Mono setLegalHoldAsync(String containerName, String blob, boolean l public Mono setLegalHoldAsync(String containerName, String blob, boolean legalHold, Integer timeout, String requestId, Context context) { return setLegalHoldWithResponseAsync(containerName, blob, legalHold, timeout, requestId, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Set Legal Hold operation sets a legal hold on the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param legalHold Specified if a legal hold should be set on the blob. @@ -2988,13 +3079,15 @@ public Mono> setLegalHoldNoCustomHeadersWithResponseAsync(String boolean legalHold, Integer timeout, String requestId) { final String comp = "legalhold"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.setLegalHoldNoCustomHeaders(this.client.getUrl(), containerName, - blob, comp, timeout, this.client.getVersion(), requestId, legalHold, accept, context)); + return FluxUtil + .withContext(context -> service.setLegalHoldNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, + timeout, this.client.getVersion(), requestId, legalHold, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Set Legal Hold operation sets a legal hold on the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param legalHold Specified if a legal hold should be set on the blob. @@ -3014,14 +3107,16 @@ public Mono> setLegalHoldNoCustomHeadersWithResponseAsync(String boolean legalHold, Integer timeout, String requestId, Context context) { final String comp = "legalhold"; final String accept = "application/xml"; - return service.setLegalHoldNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, - this.client.getVersion(), requestId, legalHold, accept, context); + return service + .setLegalHoldNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, + this.client.getVersion(), requestId, legalHold, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Set Blob Metadata operation sets user-defined metadata for the specified blob as one or more name-value * pairs. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3081,16 +3176,18 @@ public Mono> setMetadataWithResponse = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.setMetadata(this.client.getUrl(), containerName, blob, comp, - timeout, metadata, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.setMetadata(this.client.getUrl(), containerName, blob, comp, timeout, + metadata, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Set Blob Metadata operation sets user-defined metadata for the specified blob as one or more name-value * pairs. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3151,16 +3248,18 @@ public Mono> setMetadataWithResponse = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.setMetadata(this.client.getUrl(), containerName, blob, comp, timeout, metadata, leaseId, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, - context); + return service + .setMetadata(this.client.getUrl(), containerName, blob, comp, timeout, metadata, leaseId, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, + context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Set Blob Metadata operation sets user-defined metadata for the specified blob as one or more name-value * pairs. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3195,13 +3294,14 @@ public Mono setMetadataAsync(String containerName, String blob, Integer ti String ifNoneMatch, String ifTags, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { return setMetadataWithResponseAsync(containerName, blob, timeout, metadata, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, cpkInfo, encryptionScopeParam) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Set Blob Metadata operation sets user-defined metadata for the specified blob as one or more name-value * pairs. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3238,13 +3338,14 @@ public Mono setMetadataAsync(String containerName, String blob, Integer ti Context context) { return setMetadataWithResponseAsync(containerName, blob, timeout, metadata, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, cpkInfo, encryptionScopeParam, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Set Blob Metadata operation sets user-defined metadata for the specified blob as one or more name-value * pairs. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3304,16 +3405,18 @@ public Mono> setMetadataNoCustomHeadersWithResponseAsync(String c = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.setMetadataNoCustomHeaders(this.client.getUrl(), containerName, - blob, comp, timeout, metadata, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, - encryptionScope, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.setMetadataNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, + timeout, metadata, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Set Blob Metadata operation sets user-defined metadata for the specified blob as one or more name-value * pairs. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3374,15 +3477,17 @@ public Mono> setMetadataNoCustomHeadersWithResponseAsync(String c = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.setMetadataNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, metadata, - leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, - context); + return service + .setMetadataNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, metadata, leaseId, + encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, + context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3419,14 +3524,16 @@ public Mono> acquireLeaseWithRespon = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.acquireLease(this.client.getUrl(), containerName, blob, comp, - action, timeout, duration, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.acquireLease(this.client.getUrl(), containerName, blob, comp, action, + timeout, duration, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, + ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3465,14 +3572,16 @@ public Mono> acquireLeaseWithRespon = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.acquireLease(this.client.getUrl(), containerName, blob, comp, action, timeout, duration, - proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context); + return service + .acquireLease(this.client.getUrl(), containerName, blob, comp, action, timeout, duration, proposedLeaseId, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3503,12 +3612,14 @@ public Mono acquireLeaseAsync(String containerName, String blob, Integer t String proposedLeaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId) { return acquireLeaseWithResponseAsync(containerName, blob, timeout, duration, proposedLeaseId, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId).flatMap(ignored -> Mono.empty()); + ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3540,12 +3651,14 @@ public Mono acquireLeaseAsync(String containerName, String blob, Integer t String proposedLeaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, Context context) { return acquireLeaseWithResponseAsync(containerName, blob, timeout, duration, proposedLeaseId, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, context).flatMap(ignored -> Mono.empty()); + ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3585,12 +3698,13 @@ public Mono> acquireLeaseNoCustomHeadersWithResponseAsync(String return FluxUtil .withContext(context -> service.acquireLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, action, timeout, duration, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context)); + ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3629,14 +3743,16 @@ public Mono> acquireLeaseNoCustomHeadersWithResponseAsync(String = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.acquireLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, action, timeout, - duration, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, - ifTags, this.client.getVersion(), requestId, accept, context); + return service + .acquireLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, action, timeout, duration, + proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * + * * @param containerName The container name. * @param blob The blob name. * @param leaseId Specifies the current lease ID on the resource. @@ -3668,14 +3784,16 @@ public Mono> releaseLeaseWithRespon = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.releaseLease(this.client.getUrl(), containerName, blob, comp, - action, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, - ifTags, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.releaseLease(this.client.getUrl(), containerName, blob, comp, action, + timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * + * * @param containerName The container name. * @param blob The blob name. * @param leaseId Specifies the current lease ID on the resource. @@ -3708,14 +3826,16 @@ public Mono> releaseLeaseWithRespon = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.releaseLease(this.client.getUrl(), containerName, blob, comp, action, timeout, leaseId, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context); + return service + .releaseLease(this.client.getUrl(), containerName, blob, comp, action, timeout, leaseId, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * + * * @param containerName The container name. * @param blob The blob name. * @param leaseId Specifies the current lease ID on the resource. @@ -3741,12 +3861,14 @@ public Mono releaseLeaseAsync(String containerName, String blob, String le OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId) { return releaseLeaseWithResponseAsync(containerName, blob, leaseId, timeout, ifModifiedSince, ifUnmodifiedSince, - ifMatch, ifNoneMatch, ifTags, requestId).flatMap(ignored -> Mono.empty()); + ifMatch, ifNoneMatch, ifTags, requestId) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * + * * @param containerName The container name. * @param blob The blob name. * @param leaseId Specifies the current lease ID on the resource. @@ -3773,12 +3895,14 @@ public Mono releaseLeaseAsync(String containerName, String blob, String le OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, Context context) { return releaseLeaseWithResponseAsync(containerName, blob, leaseId, timeout, ifModifiedSince, ifUnmodifiedSince, - ifMatch, ifNoneMatch, ifTags, requestId, context).flatMap(ignored -> Mono.empty()); + ifMatch, ifNoneMatch, ifTags, requestId, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * + * * @param containerName The container name. * @param blob The blob name. * @param leaseId Specifies the current lease ID on the resource. @@ -3810,14 +3934,16 @@ public Mono> releaseLeaseNoCustomHeadersWithResponseAsync(String = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.releaseLeaseNoCustomHeaders(this.client.getUrl(), containerName, - blob, comp, action, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.releaseLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, + action, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, + ifTags, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * + * * @param containerName The container name. * @param blob The blob name. * @param leaseId Specifies the current lease ID on the resource. @@ -3850,14 +3976,16 @@ public Mono> releaseLeaseNoCustomHeadersWithResponseAsync(String = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.releaseLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, action, timeout, - leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context); + return service + .releaseLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, action, timeout, leaseId, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * + * * @param containerName The container name. * @param blob The blob name. * @param leaseId Specifies the current lease ID on the resource. @@ -3889,14 +4017,16 @@ public Mono> renewLeaseWithResponseAs = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.renewLease(this.client.getUrl(), containerName, blob, comp, - action, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, - ifTags, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.renewLease(this.client.getUrl(), containerName, blob, comp, action, timeout, + leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * + * * @param containerName The container name. * @param blob The blob name. * @param leaseId Specifies the current lease ID on the resource. @@ -3929,14 +4059,16 @@ public Mono> renewLeaseWithResponseAs = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.renewLease(this.client.getUrl(), containerName, blob, comp, action, timeout, leaseId, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context); + return service + .renewLease(this.client.getUrl(), containerName, blob, comp, action, timeout, leaseId, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * + * * @param containerName The container name. * @param blob The blob name. * @param leaseId Specifies the current lease ID on the resource. @@ -3962,12 +4094,14 @@ public Mono renewLeaseAsync(String containerName, String blob, String leas OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId) { return renewLeaseWithResponseAsync(containerName, blob, leaseId, timeout, ifModifiedSince, ifUnmodifiedSince, - ifMatch, ifNoneMatch, ifTags, requestId).flatMap(ignored -> Mono.empty()); + ifMatch, ifNoneMatch, ifTags, requestId) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * + * * @param containerName The container name. * @param blob The blob name. * @param leaseId Specifies the current lease ID on the resource. @@ -3994,12 +4128,14 @@ public Mono renewLeaseAsync(String containerName, String blob, String leas OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, Context context) { return renewLeaseWithResponseAsync(containerName, blob, leaseId, timeout, ifModifiedSince, ifUnmodifiedSince, - ifMatch, ifNoneMatch, ifTags, requestId, context).flatMap(ignored -> Mono.empty()); + ifMatch, ifNoneMatch, ifTags, requestId, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * + * * @param containerName The container name. * @param blob The blob name. * @param leaseId Specifies the current lease ID on the resource. @@ -4031,14 +4167,16 @@ public Mono> renewLeaseNoCustomHeadersWithResponseAsync(String co = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.renewLeaseNoCustomHeaders(this.client.getUrl(), containerName, - blob, comp, action, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.renewLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, + action, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, + ifTags, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * + * * @param containerName The container name. * @param blob The blob name. * @param leaseId Specifies the current lease ID on the resource. @@ -4071,14 +4209,16 @@ public Mono> renewLeaseNoCustomHeadersWithResponseAsync(String co = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.renewLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, action, timeout, - leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context); + return service + .renewLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, action, timeout, leaseId, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * + * * @param containerName The container name. * @param blob The blob name. * @param leaseId Specifies the current lease ID on the resource. @@ -4113,14 +4253,16 @@ public Mono> changeLeaseWithResponse = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.changeLease(this.client.getUrl(), containerName, blob, comp, - action, timeout, leaseId, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.changeLease(this.client.getUrl(), containerName, blob, comp, action, + timeout, leaseId, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, + ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * + * * @param containerName The container name. * @param blob The blob name. * @param leaseId Specifies the current lease ID on the resource. @@ -4157,14 +4299,16 @@ public Mono> changeLeaseWithResponse = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.changeLease(this.client.getUrl(), containerName, blob, comp, action, timeout, leaseId, - proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context); + return service + .changeLease(this.client.getUrl(), containerName, blob, comp, action, timeout, leaseId, proposedLeaseId, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * + * * @param containerName The container name. * @param blob The blob name. * @param leaseId Specifies the current lease ID on the resource. @@ -4193,12 +4337,14 @@ public Mono changeLeaseAsync(String containerName, String blob, String lea Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId) { return changeLeaseWithResponseAsync(containerName, blob, leaseId, proposedLeaseId, timeout, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId).flatMap(ignored -> Mono.empty()); + ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * + * * @param containerName The container name. * @param blob The blob name. * @param leaseId Specifies the current lease ID on the resource. @@ -4228,12 +4374,14 @@ public Mono changeLeaseAsync(String containerName, String blob, String lea Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, Context context) { return changeLeaseWithResponseAsync(containerName, blob, leaseId, proposedLeaseId, timeout, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, context).flatMap(ignored -> Mono.empty()); + ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * + * * @param containerName The container name. * @param blob The blob name. * @param leaseId Specifies the current lease ID on the resource. @@ -4268,14 +4416,16 @@ public Mono> changeLeaseNoCustomHeadersWithResponseAsync(String c = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.changeLeaseNoCustomHeaders(this.client.getUrl(), containerName, - blob, comp, action, timeout, leaseId, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.changeLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, + action, timeout, leaseId, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, + ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * + * * @param containerName The container name. * @param blob The blob name. * @param leaseId Specifies the current lease ID on the resource. @@ -4312,14 +4462,16 @@ public Mono> changeLeaseNoCustomHeadersWithResponseAsync(String c = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.changeLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, action, timeout, - leaseId, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, - ifTags, this.client.getVersion(), requestId, accept, context); + return service + .changeLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, action, timeout, leaseId, + proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -4356,14 +4508,16 @@ public Mono> breakLeaseWithResponseAs = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.breakLease(this.client.getUrl(), containerName, blob, comp, - action, timeout, breakPeriod, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, - ifTags, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.breakLease(this.client.getUrl(), containerName, blob, comp, action, timeout, + breakPeriod, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -4402,14 +4556,16 @@ public Mono> breakLeaseWithResponseAs = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.breakLease(this.client.getUrl(), containerName, blob, comp, action, timeout, breakPeriod, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context); + return service + .breakLease(this.client.getUrl(), containerName, blob, comp, action, timeout, breakPeriod, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -4440,12 +4596,14 @@ public Mono breakLeaseAsync(String containerName, String blob, Integer tim OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId) { return breakLeaseWithResponseAsync(containerName, blob, timeout, breakPeriod, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId).flatMap(ignored -> Mono.empty()); + ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -4477,12 +4635,14 @@ public Mono breakLeaseAsync(String containerName, String blob, Integer tim OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, Context context) { return breakLeaseWithResponseAsync(containerName, blob, timeout, breakPeriod, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, context).flatMap(ignored -> Mono.empty()); + ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -4519,14 +4679,16 @@ public Mono> breakLeaseNoCustomHeadersWithResponseAsync(String co = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.breakLeaseNoCustomHeaders(this.client.getUrl(), containerName, - blob, comp, action, timeout, breakPeriod, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.breakLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, + action, timeout, breakPeriod, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, + ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -4564,14 +4726,16 @@ public Mono> breakLeaseNoCustomHeadersWithResponseAsync(String co = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.breakLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, action, timeout, - breakPeriod, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context); + return service + .breakLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, action, timeout, breakPeriod, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Create Snapshot operation creates a read-only snapshot of a blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -4631,15 +4795,17 @@ public Mono> createSnapshotWithRe = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.createSnapshot(this.client.getUrl(), containerName, blob, comp, - timeout, metadata, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, leaseId, - this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.createSnapshot(this.client.getUrl(), containerName, blob, comp, timeout, + metadata, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, leaseId, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Create Snapshot operation creates a read-only snapshot of a blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -4700,15 +4866,17 @@ public Mono> createSnapshotWithRe = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.createSnapshot(this.client.getUrl(), containerName, blob, comp, timeout, metadata, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, leaseId, this.client.getVersion(), requestId, - accept, context); + return service + .createSnapshot(this.client.getUrl(), containerName, blob, comp, timeout, metadata, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, leaseId, this.client.getVersion(), requestId, + accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Create Snapshot operation creates a read-only snapshot of a blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -4744,12 +4912,13 @@ public Mono createSnapshotAsync(String containerName, String blob, Integer EncryptionScope encryptionScopeParam) { return createSnapshotWithResponseAsync(containerName, blob, timeout, metadata, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, leaseId, requestId, cpkInfo, encryptionScopeParam) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Create Snapshot operation creates a read-only snapshot of a blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -4786,12 +4955,13 @@ public Mono createSnapshotAsync(String containerName, String blob, Integer EncryptionScope encryptionScopeParam, Context context) { return createSnapshotWithResponseAsync(containerName, blob, timeout, metadata, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, leaseId, requestId, cpkInfo, encryptionScopeParam, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Create Snapshot operation creates a read-only snapshot of a blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -4851,15 +5021,17 @@ public Mono> createSnapshotNoCustomHeadersWithResponseAsync(Strin = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.createSnapshotNoCustomHeaders(this.client.getUrl(), - containerName, blob, comp, timeout, metadata, encryptionKey, encryptionKeySha256, encryptionAlgorithm, - encryptionScope, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - leaseId, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.createSnapshotNoCustomHeaders(this.client.getUrl(), containerName, blob, + comp, timeout, metadata, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, leaseId, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Create Snapshot operation creates a read-only snapshot of a blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -4920,15 +5092,17 @@ public Mono> createSnapshotNoCustomHeadersWithResponseAsync(Strin = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.createSnapshotNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, metadata, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, leaseId, this.client.getVersion(), requestId, - accept, context); + return service + .createSnapshotNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, metadata, + encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, leaseId, this.client.getVersion(), requestId, + accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Start Copy From URL operation copies a blob or an internet resource to a new blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in @@ -4996,12 +5170,13 @@ public Mono> startCopyFromURLWi metadata, tier, rehydratePriority, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, copySource, leaseId, this.client.getVersion(), requestId, blobTagsString, - sealBlob, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, accept, context)); + sealBlob, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Start Copy From URL operation copies a blob or an internet resource to a new blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in @@ -5066,16 +5241,18 @@ public Mono> startCopyFromURLWi = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return service.startCopyFromURL(this.client.getUrl(), containerName, blob, timeout, metadata, tier, - rehydratePriority, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, - sourceIfNoneMatch, sourceIfTags, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, - ifTags, copySource, leaseId, this.client.getVersion(), requestId, blobTagsString, sealBlob, - immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, accept, context); + return service + .startCopyFromURL(this.client.getUrl(), containerName, blob, timeout, metadata, tier, rehydratePriority, + sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, + sourceIfTags, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + copySource, leaseId, this.client.getVersion(), requestId, blobTagsString, sealBlob, + immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Start Copy From URL operation copies a blob or an internet resource to a new blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in @@ -5131,12 +5308,13 @@ public Mono startCopyFromURLAsync(String containerName, String blob, Strin rehydratePriority, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, leaseId, requestId, blobTagsString, sealBlob, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Start Copy From URL operation copies a blob or an internet resource to a new blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in @@ -5193,12 +5371,13 @@ public Mono startCopyFromURLAsync(String containerName, String blob, Strin rehydratePriority, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, leaseId, requestId, blobTagsString, sealBlob, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Start Copy From URL operation copies a blob or an internet resource to a new blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in @@ -5261,17 +5440,19 @@ public Mono> startCopyFromURLNoCustomHeadersWithResponseAsync(Str = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return FluxUtil.withContext( - context -> service.startCopyFromURLNoCustomHeaders(this.client.getUrl(), containerName, blob, timeout, - metadata, tier, rehydratePriority, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, - sourceIfMatch, sourceIfNoneMatch, sourceIfTags, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - ifMatch, ifNoneMatch, ifTags, copySource, leaseId, this.client.getVersion(), requestId, blobTagsString, - sealBlob, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, accept, context)); + return FluxUtil + .withContext(context -> service.startCopyFromURLNoCustomHeaders(this.client.getUrl(), containerName, blob, + timeout, metadata, tier, rehydratePriority, sourceIfModifiedSinceConverted, + sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, copySource, leaseId, + this.client.getVersion(), requestId, blobTagsString, sealBlob, immutabilityPolicyExpiryConverted, + immutabilityPolicyMode, legalHold, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Start Copy From URL operation copies a blob or an internet resource to a new blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in @@ -5336,17 +5517,19 @@ public Mono> startCopyFromURLNoCustomHeadersWithResponseAsync(Str = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return service.startCopyFromURLNoCustomHeaders(this.client.getUrl(), containerName, blob, timeout, metadata, - tier, rehydratePriority, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, - sourceIfNoneMatch, sourceIfTags, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, - ifTags, copySource, leaseId, this.client.getVersion(), requestId, blobTagsString, sealBlob, - immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, accept, context); + return service + .startCopyFromURLNoCustomHeaders(this.client.getUrl(), containerName, blob, timeout, metadata, tier, + rehydratePriority, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, + sourceIfNoneMatch, sourceIfTags, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, + ifNoneMatch, ifTags, copySource, leaseId, this.client.getVersion(), requestId, blobTagsString, sealBlob, + immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return a response * until the copy is complete. - * + * * @param containerName The container name. * @param blob The blob name. * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in @@ -5420,18 +5603,20 @@ public Mono> copyFromURLWithResponse String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return FluxUtil.withContext(context -> service.copyFromURL(this.client.getUrl(), containerName, blob, - xMsRequiresSync, timeout, metadata, tier, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, - sourceIfMatch, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, ifTags, copySource, leaseId, this.client.getVersion(), requestId, sourceContentMD5Converted, - blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, - copySourceAuthorization, encryptionScope, copySourceTags, accept, context)); + return FluxUtil + .withContext(context -> service.copyFromURL(this.client.getUrl(), containerName, blob, xMsRequiresSync, + timeout, metadata, tier, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, + sourceIfMatch, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, + ifNoneMatch, ifTags, copySource, leaseId, this.client.getVersion(), requestId, + sourceContentMD5Converted, blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, + legalHold, copySourceAuthorization, encryptionScope, copySourceTags, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return a response * until the copy is complete. - * + * * @param containerName The container name. * @param blob The blob name. * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in @@ -5506,18 +5691,20 @@ public Mono> copyFromURLWithResponse String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return service.copyFromURL(this.client.getUrl(), containerName, blob, xMsRequiresSync, timeout, metadata, tier, - sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, copySource, leaseId, - this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, - immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, copySourceAuthorization, - encryptionScope, copySourceTags, accept, context); + return service + .copyFromURL(this.client.getUrl(), containerName, blob, xMsRequiresSync, timeout, metadata, tier, + sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, copySource, leaseId, + this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, + immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, copySourceAuthorization, + encryptionScope, copySourceTags, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return a response * until the copy is complete. - * + * * @param containerName The container name. * @param blob The blob name. * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in @@ -5576,13 +5763,14 @@ public Mono copyFromURLAsync(String containerName, String blob, String cop sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, leaseId, requestId, sourceContentMD5, blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, copySourceAuthorization, copySourceTags, - encryptionScopeParam).flatMap(ignored -> Mono.empty()); + encryptionScopeParam).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return a response * until the copy is complete. - * + * * @param containerName The container name. * @param blob The blob name. * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in @@ -5643,13 +5831,15 @@ public Mono copyFromURLAsync(String containerName, String blob, String cop sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, leaseId, requestId, sourceContentMD5, blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, copySourceAuthorization, copySourceTags, - encryptionScopeParam, context).flatMap(ignored -> Mono.empty()); + encryptionScopeParam, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return a response * until the copy is complete. - * + * * @param containerName The container name. * @param blob The blob name. * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in @@ -5723,19 +5913,21 @@ public Mono> copyFromURLNoCustomHeadersWithResponseAsync(String c String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return FluxUtil.withContext( - context -> service.copyFromURLNoCustomHeaders(this.client.getUrl(), containerName, blob, xMsRequiresSync, - timeout, metadata, tier, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, - sourceIfMatch, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, ifTags, copySource, leaseId, this.client.getVersion(), requestId, - sourceContentMD5Converted, blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, - legalHold, copySourceAuthorization, encryptionScope, copySourceTags, accept, context)); + return FluxUtil + .withContext(context -> service.copyFromURLNoCustomHeaders(this.client.getUrl(), containerName, blob, + xMsRequiresSync, timeout, metadata, tier, sourceIfModifiedSinceConverted, + sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, copySource, leaseId, this.client.getVersion(), + requestId, sourceContentMD5Converted, blobTagsString, immutabilityPolicyExpiryConverted, + immutabilityPolicyMode, legalHold, copySourceAuthorization, encryptionScope, copySourceTags, accept, + context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return a response * until the copy is complete. - * + * * @param containerName The container name. * @param blob The blob name. * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in @@ -5810,18 +6002,20 @@ public Mono> copyFromURLNoCustomHeadersWithResponseAsync(String c String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return service.copyFromURLNoCustomHeaders(this.client.getUrl(), containerName, blob, xMsRequiresSync, timeout, - metadata, tier, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, - sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - copySource, leaseId, this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, - immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, copySourceAuthorization, - encryptionScope, copySourceTags, accept, context); + return service + .copyFromURLNoCustomHeaders(this.client.getUrl(), containerName, blob, xMsRequiresSync, timeout, metadata, + tier, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, + sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + copySource, leaseId, this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, + immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, copySourceAuthorization, + encryptionScope, copySourceTags, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Abort Copy From URL operation aborts a pending Copy From URL operation, and leaves a destination blob with * zero length and full metadata. - * + * * @param containerName The container name. * @param blob The blob name. * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy Blob operation. @@ -5843,13 +6037,14 @@ public Mono> abortCopyFromURLWi final String copyActionAbortConstant = "abort"; final String accept = "application/xml"; return FluxUtil.withContext(context -> service.abortCopyFromURL(this.client.getUrl(), containerName, blob, comp, - copyActionAbortConstant, copyId, timeout, leaseId, this.client.getVersion(), requestId, accept, context)); + copyActionAbortConstant, copyId, timeout, leaseId, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Abort Copy From URL operation aborts a pending Copy From URL operation, and leaves a destination blob with * zero length and full metadata. - * + * * @param containerName The container name. * @param blob The blob name. * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy Blob operation. @@ -5872,14 +6067,16 @@ public Mono> abortCopyFromURLWi final String comp = "copy"; final String copyActionAbortConstant = "abort"; final String accept = "application/xml"; - return service.abortCopyFromURL(this.client.getUrl(), containerName, blob, comp, copyActionAbortConstant, - copyId, timeout, leaseId, this.client.getVersion(), requestId, accept, context); + return service + .abortCopyFromURL(this.client.getUrl(), containerName, blob, comp, copyActionAbortConstant, copyId, timeout, + leaseId, this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Abort Copy From URL operation aborts a pending Copy From URL operation, and leaves a destination blob with * zero length and full metadata. - * + * * @param containerName The container name. * @param blob The blob name. * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy Blob operation. @@ -5898,13 +6095,14 @@ public Mono> abortCopyFromURLWi public Mono abortCopyFromURLAsync(String containerName, String blob, String copyId, Integer timeout, String leaseId, String requestId) { return abortCopyFromURLWithResponseAsync(containerName, blob, copyId, timeout, leaseId, requestId) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Abort Copy From URL operation aborts a pending Copy From URL operation, and leaves a destination blob with * zero length and full metadata. - * + * * @param containerName The container name. * @param blob The blob name. * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy Blob operation. @@ -5924,13 +6122,14 @@ public Mono abortCopyFromURLAsync(String containerName, String blob, Strin public Mono abortCopyFromURLAsync(String containerName, String blob, String copyId, Integer timeout, String leaseId, String requestId, Context context) { return abortCopyFromURLWithResponseAsync(containerName, blob, copyId, timeout, leaseId, requestId, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Abort Copy From URL operation aborts a pending Copy From URL operation, and leaves a destination blob with * zero length and full metadata. - * + * * @param containerName The container name. * @param blob The blob name. * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy Blob operation. @@ -5953,13 +6152,14 @@ public Mono> abortCopyFromURLNoCustomHeadersWithResponseAsync(Str final String accept = "application/xml"; return FluxUtil.withContext(context -> service.abortCopyFromURLNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, copyActionAbortConstant, copyId, timeout, leaseId, this.client.getVersion(), - requestId, accept, context)); + requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Abort Copy From URL operation aborts a pending Copy From URL operation, and leaves a destination blob with * zero length and full metadata. - * + * * @param containerName The container name. * @param blob The blob name. * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy Blob operation. @@ -5981,8 +6181,10 @@ public Mono> abortCopyFromURLNoCustomHeadersWithResponseAsync(Str final String comp = "copy"; final String copyActionAbortConstant = "abort"; final String accept = "application/xml"; - return service.abortCopyFromURLNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, - copyActionAbortConstant, copyId, timeout, leaseId, this.client.getVersion(), requestId, accept, context); + return service + .abortCopyFromURLNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, copyActionAbortConstant, + copyId, timeout, leaseId, this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -5990,7 +6192,7 @@ public Mono> abortCopyFromURLNoCustomHeadersWithResponseAsync(Str * account and on a block blob in a blob storage account (locally redundant storage only). A premium page blob's * tier determines the allowed size, IOPS, and bandwidth of the blob. A block blob's tier determines * Hot/Cool/Archive storage type. This operation does not update the blob's ETag. - * + * * @param containerName The container name. * @param blob The blob name. * @param tier Indicates the tier to be set on the blob. @@ -6019,9 +6221,11 @@ public Mono> setTierWithResponseAsync(St String requestId, String leaseId, String ifTags) { final String comp = "tier"; final String accept = "application/xml"; - return FluxUtil.withContext( - context -> service.setTier(this.client.getUrl(), containerName, blob, comp, snapshot, versionId, timeout, - tier, rehydratePriority, this.client.getVersion(), requestId, leaseId, ifTags, accept, context)); + return FluxUtil + .withContext(context -> service.setTier(this.client.getUrl(), containerName, blob, comp, snapshot, + versionId, timeout, tier, rehydratePriority, this.client.getVersion(), requestId, leaseId, ifTags, + accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -6029,7 +6233,7 @@ public Mono> setTierWithResponseAsync(St * account and on a block blob in a blob storage account (locally redundant storage only). A premium page blob's * tier determines the allowed size, IOPS, and bandwidth of the blob. A block blob's tier determines * Hot/Cool/Archive storage type. This operation does not update the blob's ETag. - * + * * @param containerName The container name. * @param blob The blob name. * @param tier Indicates the tier to be set on the blob. @@ -6059,8 +6263,10 @@ public Mono> setTierWithResponseAsync(St String requestId, String leaseId, String ifTags, Context context) { final String comp = "tier"; final String accept = "application/xml"; - return service.setTier(this.client.getUrl(), containerName, blob, comp, snapshot, versionId, timeout, tier, - rehydratePriority, this.client.getVersion(), requestId, leaseId, ifTags, accept, context); + return service + .setTier(this.client.getUrl(), containerName, blob, comp, snapshot, versionId, timeout, tier, + rehydratePriority, this.client.getVersion(), requestId, leaseId, ifTags, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -6068,7 +6274,7 @@ public Mono> setTierWithResponseAsync(St * account and on a block blob in a blob storage account (locally redundant storage only). A premium page blob's * tier determines the allowed size, IOPS, and bandwidth of the blob. A block blob's tier determines * Hot/Cool/Archive storage type. This operation does not update the blob's ETag. - * + * * @param containerName The container name. * @param blob The blob name. * @param tier Indicates the tier to be set on the blob. @@ -6096,7 +6302,9 @@ public Mono setTierAsync(String containerName, String blob, AccessTier tie String versionId, Integer timeout, RehydratePriority rehydratePriority, String requestId, String leaseId, String ifTags) { return setTierWithResponseAsync(containerName, blob, tier, snapshot, versionId, timeout, rehydratePriority, - requestId, leaseId, ifTags).flatMap(ignored -> Mono.empty()); + requestId, leaseId, ifTags) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** @@ -6104,7 +6312,7 @@ public Mono setTierAsync(String containerName, String blob, AccessTier tie * account and on a block blob in a blob storage account (locally redundant storage only). A premium page blob's * tier determines the allowed size, IOPS, and bandwidth of the blob. A block blob's tier determines * Hot/Cool/Archive storage type. This operation does not update the blob's ETag. - * + * * @param containerName The container name. * @param blob The blob name. * @param tier Indicates the tier to be set on the blob. @@ -6133,7 +6341,9 @@ public Mono setTierAsync(String containerName, String blob, AccessTier tie String versionId, Integer timeout, RehydratePriority rehydratePriority, String requestId, String leaseId, String ifTags, Context context) { return setTierWithResponseAsync(containerName, blob, tier, snapshot, versionId, timeout, rehydratePriority, - requestId, leaseId, ifTags, context).flatMap(ignored -> Mono.empty()); + requestId, leaseId, ifTags, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** @@ -6141,7 +6351,7 @@ public Mono setTierAsync(String containerName, String blob, AccessTier tie * account and on a block blob in a blob storage account (locally redundant storage only). A premium page blob's * tier determines the allowed size, IOPS, and bandwidth of the blob. A block blob's tier determines * Hot/Cool/Archive storage type. This operation does not update the blob's ETag. - * + * * @param containerName The container name. * @param blob The blob name. * @param tier Indicates the tier to be set on the blob. @@ -6170,9 +6380,11 @@ public Mono> setTierNoCustomHeadersWithResponseAsync(String conta String requestId, String leaseId, String ifTags) { final String comp = "tier"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.setTierNoCustomHeaders(this.client.getUrl(), containerName, blob, - comp, snapshot, versionId, timeout, tier, rehydratePriority, this.client.getVersion(), requestId, leaseId, - ifTags, accept, context)); + return FluxUtil + .withContext(context -> service.setTierNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, + snapshot, versionId, timeout, tier, rehydratePriority, this.client.getVersion(), requestId, leaseId, + ifTags, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -6180,7 +6392,7 @@ public Mono> setTierNoCustomHeadersWithResponseAsync(String conta * account and on a block blob in a blob storage account (locally redundant storage only). A premium page blob's * tier determines the allowed size, IOPS, and bandwidth of the blob. A block blob's tier determines * Hot/Cool/Archive storage type. This operation does not update the blob's ETag. - * + * * @param containerName The container name. * @param blob The blob name. * @param tier Indicates the tier to be set on the blob. @@ -6210,13 +6422,15 @@ public Mono> setTierNoCustomHeadersWithResponseAsync(String conta String requestId, String leaseId, String ifTags, Context context) { final String comp = "tier"; final String accept = "application/xml"; - return service.setTierNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, snapshot, versionId, - timeout, tier, rehydratePriority, this.client.getVersion(), requestId, leaseId, ifTags, accept, context); + return service + .setTierNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, snapshot, versionId, timeout, tier, + rehydratePriority, this.client.getVersion(), requestId, leaseId, ifTags, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Returns the sku name and account kind. - * + * * @param containerName The container name. * @param blob The blob name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -6230,13 +6444,15 @@ public Mono> getAccountInfoWithRe final String restype = "account"; final String comp = "properties"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getAccountInfo(this.client.getUrl(), containerName, blob, - restype, comp, this.client.getVersion(), accept, context)); + return FluxUtil + .withContext(context -> service.getAccountInfo(this.client.getUrl(), containerName, blob, restype, comp, + this.client.getVersion(), accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Returns the sku name and account kind. - * + * * @param containerName The container name. * @param blob The blob name. * @param context The context to associate with this operation. @@ -6251,13 +6467,15 @@ public Mono> getAccountInfoWithRe final String restype = "account"; final String comp = "properties"; final String accept = "application/xml"; - return service.getAccountInfo(this.client.getUrl(), containerName, blob, restype, comp, - this.client.getVersion(), accept, context); + return service + .getAccountInfo(this.client.getUrl(), containerName, blob, restype, comp, this.client.getVersion(), accept, + context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Returns the sku name and account kind. - * + * * @param containerName The container name. * @param blob The blob name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -6267,12 +6485,14 @@ public Mono> getAccountInfoWithRe */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getAccountInfoAsync(String containerName, String blob) { - return getAccountInfoWithResponseAsync(containerName, blob).flatMap(ignored -> Mono.empty()); + return getAccountInfoWithResponseAsync(containerName, blob) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Returns the sku name and account kind. - * + * * @param containerName The container name. * @param blob The blob name. * @param context The context to associate with this operation. @@ -6283,12 +6503,14 @@ public Mono getAccountInfoAsync(String containerName, String blob) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getAccountInfoAsync(String containerName, String blob, Context context) { - return getAccountInfoWithResponseAsync(containerName, blob, context).flatMap(ignored -> Mono.empty()); + return getAccountInfoWithResponseAsync(containerName, blob, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Returns the sku name and account kind. - * + * * @param containerName The container name. * @param blob The blob name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -6301,13 +6523,15 @@ public Mono> getAccountInfoNoCustomHeadersWithResponseAsync(Strin final String restype = "account"; final String comp = "properties"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getAccountInfoNoCustomHeaders(this.client.getUrl(), - containerName, blob, restype, comp, this.client.getVersion(), accept, context)); + return FluxUtil + .withContext(context -> service.getAccountInfoNoCustomHeaders(this.client.getUrl(), containerName, blob, + restype, comp, this.client.getVersion(), accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Returns the sku name and account kind. - * + * * @param containerName The container name. * @param blob The blob name. * @param context The context to associate with this operation. @@ -6322,13 +6546,15 @@ public Mono> getAccountInfoNoCustomHeadersWithResponseAsync(Strin final String restype = "account"; final String comp = "properties"; final String accept = "application/xml"; - return service.getAccountInfoNoCustomHeaders(this.client.getUrl(), containerName, blob, restype, comp, - this.client.getVersion(), accept, context); + return service + .getAccountInfoNoCustomHeaders(this.client.getUrl(), containerName, blob, restype, comp, + this.client.getVersion(), accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Query operation enables users to select/project on blob data by providing simple query expressions. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -6381,15 +6607,17 @@ public Mono>> queryWithResponse = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.query(this.client.getUrl(), containerName, blob, comp, snapshot, - timeout, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, queryRequest, - accept, context)); + return FluxUtil + .withContext(context -> service.query(this.client.getUrl(), containerName, blob, comp, snapshot, timeout, + leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, + queryRequest, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Query operation enables users to select/project on blob data by providing simple query expressions. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -6443,14 +6671,16 @@ public Mono>> queryWithResponse = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.query(this.client.getUrl(), containerName, blob, comp, snapshot, timeout, leaseId, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, ifTags, this.client.getVersion(), requestId, queryRequest, accept, context); + return service + .query(this.client.getUrl(), containerName, blob, comp, snapshot, timeout, leaseId, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, + ifNoneMatch, ifTags, this.client.getVersion(), requestId, queryRequest, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Query operation enables users to select/project on blob data by providing simple query expressions. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -6483,12 +6713,13 @@ public Flux queryAsync(String containerName, String blob, String sna String ifNoneMatch, String ifTags, String requestId, QueryRequest queryRequest, CpkInfo cpkInfo) { return queryWithResponseAsync(containerName, blob, snapshot, timeout, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, queryRequest, cpkInfo) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMapMany(fluxByteBufferResponse -> fluxByteBufferResponse.getValue()); } /** * The Query operation enables users to select/project on blob data by providing simple query expressions. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -6523,12 +6754,13 @@ public Flux queryAsync(String containerName, String blob, String sna Context context) { return queryWithResponseAsync(containerName, blob, snapshot, timeout, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, queryRequest, cpkInfo, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMapMany(fluxByteBufferResponse -> fluxByteBufferResponse.getValue()); } /** * The Query operation enables users to select/project on blob data by providing simple query expressions. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -6581,15 +6813,17 @@ public Mono queryNoCustomHeadersWithResponseAsync(String contain = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.queryNoCustomHeaders(this.client.getUrl(), containerName, blob, - comp, snapshot, timeout, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, queryRequest, accept, context)); + return FluxUtil + .withContext(context -> service.queryNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, + snapshot, timeout, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, queryRequest, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Query operation enables users to select/project on blob data by providing simple query expressions. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -6643,15 +6877,17 @@ public Mono queryNoCustomHeadersWithResponseAsync(String contain = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.queryNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, snapshot, timeout, leaseId, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, queryRequest, - accept, context); + return service + .queryNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, snapshot, timeout, leaseId, + encryptionKey, encryptionKeySha256, encryptionAlgorithm, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, + queryRequest, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Get Tags operation enables users to get the tags associated with a blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -6677,13 +6913,15 @@ public Mono> getTagsWithResponseAsyn Integer timeout, String requestId, String snapshot, String versionId, String ifTags, String leaseId) { final String comp = "tags"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getTags(this.client.getUrl(), containerName, blob, comp, timeout, - this.client.getVersion(), requestId, snapshot, versionId, ifTags, leaseId, accept, context)); + return FluxUtil + .withContext(context -> service.getTags(this.client.getUrl(), containerName, blob, comp, timeout, + this.client.getVersion(), requestId, snapshot, versionId, ifTags, leaseId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Get Tags operation enables users to get the tags associated with a blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -6711,13 +6949,15 @@ public Mono> getTagsWithResponseAsyn Context context) { final String comp = "tags"; final String accept = "application/xml"; - return service.getTags(this.client.getUrl(), containerName, blob, comp, timeout, this.client.getVersion(), - requestId, snapshot, versionId, ifTags, leaseId, accept, context); + return service + .getTags(this.client.getUrl(), containerName, blob, comp, timeout, this.client.getVersion(), requestId, + snapshot, versionId, ifTags, leaseId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Get Tags operation enables users to get the tags associated with a blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -6742,12 +6982,13 @@ public Mono> getTagsWithResponseAsyn public Mono getTagsAsync(String containerName, String blob, Integer timeout, String requestId, String snapshot, String versionId, String ifTags, String leaseId) { return getTagsWithResponseAsync(containerName, blob, timeout, requestId, snapshot, versionId, ifTags, leaseId) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * The Get Tags operation enables users to get the tags associated with a blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -6773,12 +7014,13 @@ public Mono getTagsAsync(String containerName, String blob, Integer ti public Mono getTagsAsync(String containerName, String blob, Integer timeout, String requestId, String snapshot, String versionId, String ifTags, String leaseId, Context context) { return getTagsWithResponseAsync(containerName, blob, timeout, requestId, snapshot, versionId, ifTags, leaseId, - context).flatMap(res -> Mono.justOrEmpty(res.getValue())); + context).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * The Get Tags operation enables users to get the tags associated with a blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -6804,13 +7046,15 @@ public Mono> getTagsNoCustomHeadersWithResponseAsync(String c Integer timeout, String requestId, String snapshot, String versionId, String ifTags, String leaseId) { final String comp = "tags"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getTagsNoCustomHeaders(this.client.getUrl(), containerName, blob, - comp, timeout, this.client.getVersion(), requestId, snapshot, versionId, ifTags, leaseId, accept, context)); + return FluxUtil + .withContext(context -> service.getTagsNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, + timeout, this.client.getVersion(), requestId, snapshot, versionId, ifTags, leaseId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Get Tags operation enables users to get the tags associated with a blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -6838,13 +7082,15 @@ public Mono> getTagsNoCustomHeadersWithResponseAsync(String c Context context) { final String comp = "tags"; final String accept = "application/xml"; - return service.getTagsNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, - this.client.getVersion(), requestId, snapshot, versionId, ifTags, leaseId, accept, context); + return service + .getTagsNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, this.client.getVersion(), + requestId, snapshot, versionId, ifTags, leaseId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Set Tags operation enables users to set tags on a blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -6872,14 +7118,16 @@ public Mono> setTagsWithResponseAsync(St final String accept = "application/xml"; String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return FluxUtil.withContext(context -> service.setTags(this.client.getUrl(), containerName, blob, comp, - this.client.getVersion(), timeout, versionId, transactionalContentMD5Converted, - transactionalContentCrc64Converted, requestId, ifTags, leaseId, tags, accept, context)); + return FluxUtil + .withContext(context -> service.setTags(this.client.getUrl(), containerName, blob, comp, + this.client.getVersion(), timeout, versionId, transactionalContentMD5Converted, + transactionalContentCrc64Converted, requestId, ifTags, leaseId, tags, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Set Tags operation enables users to set tags on a blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -6908,14 +7156,16 @@ public Mono> setTagsWithResponseAsync(St final String accept = "application/xml"; String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return service.setTags(this.client.getUrl(), containerName, blob, comp, this.client.getVersion(), timeout, - versionId, transactionalContentMD5Converted, transactionalContentCrc64Converted, requestId, ifTags, leaseId, - tags, accept, context); + return service + .setTags(this.client.getUrl(), containerName, blob, comp, this.client.getVersion(), timeout, versionId, + transactionalContentMD5Converted, transactionalContentCrc64Converted, requestId, ifTags, leaseId, tags, + accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Set Tags operation enables users to set tags on a blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -6940,12 +7190,14 @@ public Mono setTagsAsync(String containerName, String blob, Integer timeou byte[] transactionalContentMD5, byte[] transactionalContentCrc64, String requestId, String ifTags, String leaseId, BlobTags tags) { return setTagsWithResponseAsync(containerName, blob, timeout, versionId, transactionalContentMD5, - transactionalContentCrc64, requestId, ifTags, leaseId, tags).flatMap(ignored -> Mono.empty()); + transactionalContentCrc64, requestId, ifTags, leaseId, tags) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * The Set Tags operation enables users to set tags on a blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -6971,12 +7223,14 @@ public Mono setTagsAsync(String containerName, String blob, Integer timeou byte[] transactionalContentMD5, byte[] transactionalContentCrc64, String requestId, String ifTags, String leaseId, BlobTags tags, Context context) { return setTagsWithResponseAsync(containerName, blob, timeout, versionId, transactionalContentMD5, - transactionalContentCrc64, requestId, ifTags, leaseId, tags, context).flatMap(ignored -> Mono.empty()); + transactionalContentCrc64, requestId, ifTags, leaseId, tags, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * The Set Tags operation enables users to set tags on a blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -7004,14 +7258,16 @@ public Mono> setTagsNoCustomHeadersWithResponseAsync(String conta final String accept = "application/xml"; String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return FluxUtil.withContext(context -> service.setTagsNoCustomHeaders(this.client.getUrl(), containerName, blob, - comp, this.client.getVersion(), timeout, versionId, transactionalContentMD5Converted, - transactionalContentCrc64Converted, requestId, ifTags, leaseId, tags, accept, context)); + return FluxUtil + .withContext(context -> service.setTagsNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, + this.client.getVersion(), timeout, versionId, transactionalContentMD5Converted, + transactionalContentCrc64Converted, requestId, ifTags, leaseId, tags, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Set Tags operation enables users to set tags on a blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -7040,8 +7296,10 @@ public Mono> setTagsNoCustomHeadersWithResponseAsync(String conta final String accept = "application/xml"; String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return service.setTagsNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, this.client.getVersion(), - timeout, versionId, transactionalContentMD5Converted, transactionalContentCrc64Converted, requestId, ifTags, - leaseId, tags, accept, context); + return service + .setTagsNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, this.client.getVersion(), timeout, + versionId, transactionalContentMD5Converted, transactionalContentCrc64Converted, requestId, ifTags, + leaseId, tags, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlockBlobsImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlockBlobsImpl.java index 5ae070424204..43e1069e53a9 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlockBlobsImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlockBlobsImpl.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.storage.blob.implementation; import com.azure.core.annotation.BodyParam; @@ -47,11 +46,13 @@ import java.util.Map; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import com.azure.storage.blob.implementation.util.ModelHelper; /** * An instance of this class provides access to all the operations defined in BlockBlobs. */ public final class BlockBlobsImpl { + /** * The proxy service used to perform REST calls. */ @@ -64,7 +65,7 @@ public final class BlockBlobsImpl { /** * Initializes an instance of BlockBlobsImpl. - * + * * @param client the instance of the service client containing this operation class. */ BlockBlobsImpl(AzureBlobStorageImpl client) { @@ -80,6 +81,7 @@ public final class BlockBlobsImpl { @Host("{url}") @ServiceInterface(name = "AzureBlobStorageBloc") public interface BlockBlobsService { + @Put("/{containerName}/{blob}") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -482,7 +484,7 @@ Mono> getBlockListNoCustomHeaders(@HostParam("url") String u * overwrites any existing metadata on the blob. Partial updates are not supported with Put Blob; the content of the * existing blob is overwritten with the content of the new blob. To perform a partial update of the content of a * block blob, use the Put Block List operation. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -590,13 +592,15 @@ public Mono> uploadWithResponseAsync DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return FluxUtil.withContext(context -> service.upload(this.client.getUrl(), containerName, blob, blobType, - timeout, transactionalContentMD5Converted, contentLength, contentType, contentEncoding, contentLanguage, - contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, - blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, - transactionalContentCrc64Converted, body, accept, context)); + return FluxUtil + .withContext(context -> service.upload(this.client.getUrl(), containerName, blob, blobType, timeout, + transactionalContentMD5Converted, contentLength, contentType, contentEncoding, contentLanguage, + contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, + blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, + transactionalContentCrc64Converted, body, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -604,7 +608,7 @@ public Mono> uploadWithResponseAsync * overwrites any existing metadata on the blob. Partial updates are not supported with Put Blob; the content of the * existing blob is overwritten with the content of the new blob. To perform a partial update of the content of a * block blob, use the Put Block List operation. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -713,13 +717,14 @@ public Mono> uploadWithResponseAsync DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return service.upload(this.client.getUrl(), containerName, blob, blobType, timeout, - transactionalContentMD5Converted, contentLength, contentType, contentEncoding, contentLanguage, - contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, - blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, - transactionalContentCrc64Converted, body, accept, context); + return service + .upload(this.client.getUrl(), containerName, blob, blobType, timeout, transactionalContentMD5Converted, + contentLength, contentType, contentEncoding, contentLanguage, contentMd5Converted, cacheControl, + metadata, leaseId, contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, + encryptionScope, tier, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, + ifTags, this.client.getVersion(), requestId, blobTagsString, immutabilityPolicyExpiryConverted, + immutabilityPolicyMode, legalHold, transactionalContentCrc64Converted, body, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -727,7 +732,7 @@ public Mono> uploadWithResponseAsync * overwrites any existing metadata on the blob. Partial updates are not supported with Put Blob; the content of the * existing blob is overwritten with the content of the new blob. To perform a partial update of the content of a * block blob, use the Put Block List operation. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -776,7 +781,9 @@ public Mono uploadAsync(String containerName, String blob, long contentLen return uploadWithResponseAsync(containerName, blob, contentLength, body, timeout, transactionalContentMD5, metadata, leaseId, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, transactionalContentCrc64, - blobHttpHeaders, cpkInfo, encryptionScopeParam).flatMap(ignored -> Mono.empty()); + blobHttpHeaders, cpkInfo, encryptionScopeParam) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** @@ -784,7 +791,7 @@ public Mono uploadAsync(String containerName, String blob, long contentLen * overwrites any existing metadata on the blob. Partial updates are not supported with Put Blob; the content of the * existing blob is overwritten with the content of the new blob. To perform a partial update of the content of a * block blob, use the Put Block List operation. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -834,7 +841,9 @@ public Mono uploadAsync(String containerName, String blob, long contentLen return uploadWithResponseAsync(containerName, blob, contentLength, body, timeout, transactionalContentMD5, metadata, leaseId, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, transactionalContentCrc64, - blobHttpHeaders, cpkInfo, encryptionScopeParam, context).flatMap(ignored -> Mono.empty()); + blobHttpHeaders, cpkInfo, encryptionScopeParam, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** @@ -842,7 +851,7 @@ public Mono uploadAsync(String containerName, String blob, long contentLen * overwrites any existing metadata on the blob. Partial updates are not supported with Put Blob; the content of the * existing blob is overwritten with the content of the new blob. To perform a partial update of the content of a * block blob, use the Put Block List operation. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -950,13 +959,15 @@ public Mono> uploadNoCustomHeadersWithResponseAsync(String contai DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return FluxUtil.withContext(context -> service.uploadNoCustomHeaders(this.client.getUrl(), containerName, blob, - blobType, timeout, transactionalContentMD5Converted, contentLength, contentType, contentEncoding, - contentLanguage, contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, - blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, - transactionalContentCrc64Converted, body, accept, context)); + return FluxUtil + .withContext(context -> service.uploadNoCustomHeaders(this.client.getUrl(), containerName, blob, blobType, + timeout, transactionalContentMD5Converted, contentLength, contentType, contentEncoding, contentLanguage, + contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, + blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, + transactionalContentCrc64Converted, body, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -964,7 +975,7 @@ public Mono> uploadNoCustomHeadersWithResponseAsync(String contai * overwrites any existing metadata on the blob. Partial updates are not supported with Put Blob; the content of the * existing blob is overwritten with the content of the new blob. To perform a partial update of the content of a * block blob, use the Put Block List operation. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1073,13 +1084,15 @@ public Mono> uploadNoCustomHeadersWithResponseAsync(String contai DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return service.uploadNoCustomHeaders(this.client.getUrl(), containerName, blob, blobType, timeout, - transactionalContentMD5Converted, contentLength, contentType, contentEncoding, contentLanguage, - contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, - blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, - transactionalContentCrc64Converted, body, accept, context); + return service + .uploadNoCustomHeaders(this.client.getUrl(), containerName, blob, blobType, timeout, + transactionalContentMD5Converted, contentLength, contentType, contentEncoding, contentLanguage, + contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, + blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, + transactionalContentCrc64Converted, body, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -1087,7 +1100,7 @@ public Mono> uploadNoCustomHeadersWithResponseAsync(String contai * overwrites any existing metadata on the blob. Partial updates are not supported with Put Blob; the content of the * existing blob is overwritten with the content of the new blob. To perform a partial update of the content of a * block blob, use the Put Block List operation. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1195,13 +1208,15 @@ public Mono> uploadWithResponseAsync DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return FluxUtil.withContext(context -> service.upload(this.client.getUrl(), containerName, blob, blobType, - timeout, transactionalContentMD5Converted, contentLength, contentType, contentEncoding, contentLanguage, - contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, - blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, - transactionalContentCrc64Converted, body, accept, context)); + return FluxUtil + .withContext(context -> service.upload(this.client.getUrl(), containerName, blob, blobType, timeout, + transactionalContentMD5Converted, contentLength, contentType, contentEncoding, contentLanguage, + contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, + blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, + transactionalContentCrc64Converted, body, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -1209,7 +1224,7 @@ public Mono> uploadWithResponseAsync * overwrites any existing metadata on the blob. Partial updates are not supported with Put Blob; the content of the * existing blob is overwritten with the content of the new blob. To perform a partial update of the content of a * block blob, use the Put Block List operation. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1318,13 +1333,14 @@ public Mono> uploadWithResponseAsync DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return service.upload(this.client.getUrl(), containerName, blob, blobType, timeout, - transactionalContentMD5Converted, contentLength, contentType, contentEncoding, contentLanguage, - contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, - blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, - transactionalContentCrc64Converted, body, accept, context); + return service + .upload(this.client.getUrl(), containerName, blob, blobType, timeout, transactionalContentMD5Converted, + contentLength, contentType, contentEncoding, contentLanguage, contentMd5Converted, cacheControl, + metadata, leaseId, contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, + encryptionScope, tier, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, + ifTags, this.client.getVersion(), requestId, blobTagsString, immutabilityPolicyExpiryConverted, + immutabilityPolicyMode, legalHold, transactionalContentCrc64Converted, body, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -1332,7 +1348,7 @@ public Mono> uploadWithResponseAsync * overwrites any existing metadata on the blob. Partial updates are not supported with Put Blob; the content of the * existing blob is overwritten with the content of the new blob. To perform a partial update of the content of a * block blob, use the Put Block List operation. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1381,7 +1397,9 @@ public Mono uploadAsync(String containerName, String blob, long contentLen return uploadWithResponseAsync(containerName, blob, contentLength, body, timeout, transactionalContentMD5, metadata, leaseId, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, transactionalContentCrc64, - blobHttpHeaders, cpkInfo, encryptionScopeParam).flatMap(ignored -> Mono.empty()); + blobHttpHeaders, cpkInfo, encryptionScopeParam) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** @@ -1389,7 +1407,7 @@ public Mono uploadAsync(String containerName, String blob, long contentLen * overwrites any existing metadata on the blob. Partial updates are not supported with Put Blob; the content of the * existing blob is overwritten with the content of the new blob. To perform a partial update of the content of a * block blob, use the Put Block List operation. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1439,7 +1457,9 @@ public Mono uploadAsync(String containerName, String blob, long contentLen return uploadWithResponseAsync(containerName, blob, contentLength, body, timeout, transactionalContentMD5, metadata, leaseId, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, transactionalContentCrc64, - blobHttpHeaders, cpkInfo, encryptionScopeParam, context).flatMap(ignored -> Mono.empty()); + blobHttpHeaders, cpkInfo, encryptionScopeParam, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** @@ -1447,7 +1467,7 @@ public Mono uploadAsync(String containerName, String blob, long contentLen * overwrites any existing metadata on the blob. Partial updates are not supported with Put Blob; the content of the * existing blob is overwritten with the content of the new blob. To perform a partial update of the content of a * block blob, use the Put Block List operation. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1555,13 +1575,15 @@ public Mono> uploadNoCustomHeadersWithResponseAsync(String contai DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return FluxUtil.withContext(context -> service.uploadNoCustomHeaders(this.client.getUrl(), containerName, blob, - blobType, timeout, transactionalContentMD5Converted, contentLength, contentType, contentEncoding, - contentLanguage, contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, - blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, - transactionalContentCrc64Converted, body, accept, context)); + return FluxUtil + .withContext(context -> service.uploadNoCustomHeaders(this.client.getUrl(), containerName, blob, blobType, + timeout, transactionalContentMD5Converted, contentLength, contentType, contentEncoding, contentLanguage, + contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, + blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, + transactionalContentCrc64Converted, body, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -1569,7 +1591,7 @@ public Mono> uploadNoCustomHeadersWithResponseAsync(String contai * overwrites any existing metadata on the blob. Partial updates are not supported with Put Blob; the content of the * existing blob is overwritten with the content of the new blob. To perform a partial update of the content of a * block blob, use the Put Block List operation. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1678,13 +1700,15 @@ public Mono> uploadNoCustomHeadersWithResponseAsync(String contai DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return service.uploadNoCustomHeaders(this.client.getUrl(), containerName, blob, blobType, timeout, - transactionalContentMD5Converted, contentLength, contentType, contentEncoding, contentLanguage, - contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, - blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, - transactionalContentCrc64Converted, body, accept, context); + return service + .uploadNoCustomHeaders(this.client.getUrl(), containerName, blob, blobType, timeout, + transactionalContentMD5Converted, contentLength, contentType, contentEncoding, contentLanguage, + contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, + blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, + transactionalContentCrc64Converted, body, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -1693,7 +1717,7 @@ public Mono> uploadNoCustomHeadersWithResponseAsync(String contai * from URL; the content of an existing blob is overwritten with the content of the new blob. To perform partial * updates to a block blob's contents using a source URL, use the Put Block from URL API in conjunction with Put * Block List. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1817,14 +1841,16 @@ public Mono> putBlobFromUrlW DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); - return FluxUtil.withContext(context -> service.putBlobFromUrl(this.client.getUrl(), containerName, blob, - blobType, timeout, transactionalContentMD5Converted, contentLength, contentType, contentEncoding, - contentLanguage, contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSinceConverted, - sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, this.client.getVersion(), - requestId, sourceContentMD5Converted, blobTagsString, copySource, copySourceBlobProperties, - copySourceAuthorization, copySourceTags, accept, context)); + return FluxUtil + .withContext(context -> service.putBlobFromUrl(this.client.getUrl(), containerName, blob, blobType, timeout, + transactionalContentMD5Converted, contentLength, contentType, contentEncoding, contentLanguage, + contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSinceConverted, + sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, + this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, copySource, + copySourceBlobProperties, copySourceAuthorization, copySourceTags, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -1833,7 +1859,7 @@ public Mono> putBlobFromUrlW * from URL; the content of an existing blob is overwritten with the content of the new blob. To perform partial * updates to a block blob's contents using a source URL, use the Put Block from URL API in conjunction with Put * Block List. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1958,14 +1984,16 @@ public Mono> putBlobFromUrlW DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); - return service.putBlobFromUrl(this.client.getUrl(), containerName, blob, blobType, timeout, - transactionalContentMD5Converted, contentLength, contentType, contentEncoding, contentLanguage, - contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSinceConverted, - sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, this.client.getVersion(), - requestId, sourceContentMD5Converted, blobTagsString, copySource, copySourceBlobProperties, - copySourceAuthorization, copySourceTags, accept, context); + return service + .putBlobFromUrl(this.client.getUrl(), containerName, blob, blobType, timeout, + transactionalContentMD5Converted, contentLength, contentType, contentEncoding, contentLanguage, + contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSinceConverted, + sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, + this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, copySource, + copySourceBlobProperties, copySourceAuthorization, copySourceTags, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -1974,7 +2002,7 @@ public Mono> putBlobFromUrlW * from URL; the content of an existing blob is overwritten with the content of the new blob. To perform partial * updates to a block blob's contents using a source URL, use the Put Block from URL API in conjunction with Put * Block List. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -2038,7 +2066,9 @@ public Mono putBlobFromUrlAsync(String containerName, String blob, long co transactionalContentMD5, metadata, leaseId, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, requestId, sourceContentMD5, blobTagsString, copySourceBlobProperties, copySourceAuthorization, - copySourceTags, blobHttpHeaders, cpkInfo, encryptionScopeParam).flatMap(ignored -> Mono.empty()); + copySourceTags, blobHttpHeaders, cpkInfo, encryptionScopeParam) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** @@ -2047,7 +2077,7 @@ public Mono putBlobFromUrlAsync(String containerName, String blob, long co * from URL; the content of an existing blob is overwritten with the content of the new blob. To perform partial * updates to a block blob's contents using a source URL, use the Put Block from URL API in conjunction with Put * Block List. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -2112,7 +2142,9 @@ public Mono putBlobFromUrlAsync(String containerName, String blob, long co transactionalContentMD5, metadata, leaseId, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, requestId, sourceContentMD5, blobTagsString, copySourceBlobProperties, copySourceAuthorization, - copySourceTags, blobHttpHeaders, cpkInfo, encryptionScopeParam, context).flatMap(ignored -> Mono.empty()); + copySourceTags, blobHttpHeaders, cpkInfo, encryptionScopeParam, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** @@ -2121,7 +2153,7 @@ public Mono putBlobFromUrlAsync(String containerName, String blob, long co * from URL; the content of an existing blob is overwritten with the content of the new blob. To perform partial * updates to a block blob's contents using a source URL, use the Put Block from URL API in conjunction with Put * Block List. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -2244,14 +2276,16 @@ public Mono> putBlobFromUrlNoCustomHeadersWithResponseAsync(Strin DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); - return FluxUtil.withContext(context -> service.putBlobFromUrlNoCustomHeaders(this.client.getUrl(), - containerName, blob, blobType, timeout, transactionalContentMD5Converted, contentLength, contentType, - contentEncoding, contentLanguage, contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSinceConverted, - sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, this.client.getVersion(), - requestId, sourceContentMD5Converted, blobTagsString, copySource, copySourceBlobProperties, - copySourceAuthorization, copySourceTags, accept, context)); + return FluxUtil + .withContext(context -> service.putBlobFromUrlNoCustomHeaders(this.client.getUrl(), containerName, blob, + blobType, timeout, transactionalContentMD5Converted, contentLength, contentType, contentEncoding, + contentLanguage, contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, + encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, + sourceIfTags, this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, + copySource, copySourceBlobProperties, copySourceAuthorization, copySourceTags, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -2260,7 +2294,7 @@ public Mono> putBlobFromUrlNoCustomHeadersWithResponseAsync(Strin * from URL; the content of an existing blob is overwritten with the content of the new blob. To perform partial * updates to a block blob's contents using a source URL, use the Put Block from URL API in conjunction with Put * Block List. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -2384,19 +2418,21 @@ public Mono> putBlobFromUrlNoCustomHeadersWithResponseAsync(Strin DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); - return service.putBlobFromUrlNoCustomHeaders(this.client.getUrl(), containerName, blob, blobType, timeout, - transactionalContentMD5Converted, contentLength, contentType, contentEncoding, contentLanguage, - contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSinceConverted, - sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, this.client.getVersion(), - requestId, sourceContentMD5Converted, blobTagsString, copySource, copySourceBlobProperties, - copySourceAuthorization, copySourceTags, accept, context); + return service + .putBlobFromUrlNoCustomHeaders(this.client.getUrl(), containerName, blob, blobType, timeout, + transactionalContentMD5Converted, contentLength, contentType, contentEncoding, contentLanguage, + contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSinceConverted, + sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, + this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, copySource, + copySourceBlobProperties, copySourceAuthorization, copySourceTags, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Stage Block operation creates a new block to be committed as part of a blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less @@ -2448,15 +2484,17 @@ public Mono> stageBlockWithRespo String encryptionScope = encryptionScopeInternal; String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return FluxUtil.withContext(context -> service.stageBlock(this.client.getUrl(), containerName, blob, comp, - blockId, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, - leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, this.client.getVersion(), - requestId, body, accept, context)); + return FluxUtil + .withContext(context -> service.stageBlock(this.client.getUrl(), containerName, blob, comp, blockId, + contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, leaseId, + encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, this.client.getVersion(), + requestId, body, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Stage Block operation creates a new block to be committed as part of a blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less @@ -2509,15 +2547,17 @@ public Mono> stageBlockWithRespo String encryptionScope = encryptionScopeInternal; String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return service.stageBlock(this.client.getUrl(), containerName, blob, comp, blockId, contentLength, - transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, leaseId, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, this.client.getVersion(), requestId, body, - accept, context); + return service + .stageBlock(this.client.getUrl(), containerName, blob, comp, blockId, contentLength, + transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, leaseId, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, this.client.getVersion(), requestId, body, + accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Stage Block operation creates a new block to be committed as part of a blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less @@ -2546,12 +2586,13 @@ public Mono stageBlockAsync(String containerName, String blob, String bloc String leaseId, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { return stageBlockWithResponseAsync(containerName, blob, blockId, contentLength, body, transactionalContentMD5, transactionalContentCrc64, timeout, leaseId, requestId, cpkInfo, encryptionScopeParam) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Stage Block operation creates a new block to be committed as part of a blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less @@ -2581,12 +2622,13 @@ public Mono stageBlockAsync(String containerName, String blob, String bloc String leaseId, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { return stageBlockWithResponseAsync(containerName, blob, blockId, contentLength, body, transactionalContentMD5, transactionalContentCrc64, timeout, leaseId, requestId, cpkInfo, encryptionScopeParam, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Stage Block operation creates a new block to be committed as part of a blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less @@ -2638,15 +2680,17 @@ public Mono> stageBlockNoCustomHeadersWithResponseAsync(String co String encryptionScope = encryptionScopeInternal; String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return FluxUtil.withContext(context -> service.stageBlockNoCustomHeaders(this.client.getUrl(), containerName, - blob, comp, blockId, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, - timeout, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - this.client.getVersion(), requestId, body, accept, context)); + return FluxUtil + .withContext(context -> service.stageBlockNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, + blockId, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, + leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, + this.client.getVersion(), requestId, body, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Stage Block operation creates a new block to be committed as part of a blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less @@ -2699,15 +2743,17 @@ public Mono> stageBlockNoCustomHeadersWithResponseAsync(String co String encryptionScope = encryptionScopeInternal; String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return service.stageBlockNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, blockId, - contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, leaseId, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, this.client.getVersion(), - requestId, body, accept, context); + return service + .stageBlockNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, blockId, contentLength, + transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, leaseId, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, this.client.getVersion(), requestId, body, + accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Stage Block operation creates a new block to be committed as part of a blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less @@ -2759,15 +2805,17 @@ public Mono> stageBlockWithRespo String encryptionScope = encryptionScopeInternal; String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return FluxUtil.withContext(context -> service.stageBlock(this.client.getUrl(), containerName, blob, comp, - blockId, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, - leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, this.client.getVersion(), - requestId, body, accept, context)); + return FluxUtil + .withContext(context -> service.stageBlock(this.client.getUrl(), containerName, blob, comp, blockId, + contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, leaseId, + encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, this.client.getVersion(), + requestId, body, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Stage Block operation creates a new block to be committed as part of a blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less @@ -2820,15 +2868,17 @@ public Mono> stageBlockWithRespo String encryptionScope = encryptionScopeInternal; String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return service.stageBlock(this.client.getUrl(), containerName, blob, comp, blockId, contentLength, - transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, leaseId, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, this.client.getVersion(), requestId, body, - accept, context); + return service + .stageBlock(this.client.getUrl(), containerName, blob, comp, blockId, contentLength, + transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, leaseId, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, this.client.getVersion(), requestId, body, + accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Stage Block operation creates a new block to be committed as part of a blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less @@ -2857,12 +2907,13 @@ public Mono stageBlockAsync(String containerName, String blob, String bloc String leaseId, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { return stageBlockWithResponseAsync(containerName, blob, blockId, contentLength, body, transactionalContentMD5, transactionalContentCrc64, timeout, leaseId, requestId, cpkInfo, encryptionScopeParam) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Stage Block operation creates a new block to be committed as part of a blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less @@ -2892,12 +2943,13 @@ public Mono stageBlockAsync(String containerName, String blob, String bloc String leaseId, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { return stageBlockWithResponseAsync(containerName, blob, blockId, contentLength, body, transactionalContentMD5, transactionalContentCrc64, timeout, leaseId, requestId, cpkInfo, encryptionScopeParam, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Stage Block operation creates a new block to be committed as part of a blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less @@ -2949,15 +3001,17 @@ public Mono> stageBlockNoCustomHeadersWithResponseAsync(String co String encryptionScope = encryptionScopeInternal; String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return FluxUtil.withContext(context -> service.stageBlockNoCustomHeaders(this.client.getUrl(), containerName, - blob, comp, blockId, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, - timeout, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - this.client.getVersion(), requestId, body, accept, context)); + return FluxUtil + .withContext(context -> service.stageBlockNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, + blockId, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, + leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, + this.client.getVersion(), requestId, body, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Stage Block operation creates a new block to be committed as part of a blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less @@ -3010,16 +3064,18 @@ public Mono> stageBlockNoCustomHeadersWithResponseAsync(String co String encryptionScope = encryptionScopeInternal; String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return service.stageBlockNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, blockId, - contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, leaseId, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, this.client.getVersion(), - requestId, body, accept, context); + return service + .stageBlockNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, blockId, contentLength, + transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, leaseId, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, this.client.getVersion(), requestId, body, + accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Stage Block operation creates a new block to be committed as part of a blob where the contents are read from * a URL. - * + * * @param containerName The container name. * @param blob The blob name. * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less @@ -3087,17 +3143,19 @@ public Mono> stageBlockFr = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - return FluxUtil.withContext(context -> service.stageBlockFromURL(this.client.getUrl(), containerName, blob, - comp, blockId, contentLength, sourceUrl, sourceRange, sourceContentMD5Converted, - sourceContentcrc64Converted, timeout, encryptionKey, encryptionKeySha256, encryptionAlgorithm, - encryptionScope, leaseId, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, - sourceIfNoneMatch, this.client.getVersion(), requestId, copySourceAuthorization, accept, context)); + return FluxUtil + .withContext(context -> service.stageBlockFromURL(this.client.getUrl(), containerName, blob, comp, blockId, + contentLength, sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, timeout, + encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, leaseId, + sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, + this.client.getVersion(), requestId, copySourceAuthorization, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Stage Block operation creates a new block to be committed as part of a blob where the contents are read from * a URL. - * + * * @param containerName The container name. * @param blob The blob name. * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less @@ -3166,17 +3224,19 @@ public Mono> stageBlockFr = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - return service.stageBlockFromURL(this.client.getUrl(), containerName, blob, comp, blockId, contentLength, - sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, timeout, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, leaseId, sourceIfModifiedSinceConverted, - sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, this.client.getVersion(), requestId, - copySourceAuthorization, accept, context); + return service + .stageBlockFromURL(this.client.getUrl(), containerName, blob, comp, blockId, contentLength, sourceUrl, + sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, timeout, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, leaseId, sourceIfModifiedSinceConverted, + sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, this.client.getVersion(), requestId, + copySourceAuthorization, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Stage Block operation creates a new block to be committed as part of a blob where the contents are read from * a URL. - * + * * @param containerName The container name. * @param blob The blob name. * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less @@ -3218,13 +3278,14 @@ public Mono stageBlockFromURLAsync(String containerName, String blob, Stri return stageBlockFromURLWithResponseAsync(containerName, blob, blockId, contentLength, sourceUrl, sourceRange, sourceContentMD5, sourceContentcrc64, timeout, leaseId, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, requestId, copySourceAuthorization, cpkInfo, encryptionScopeParam) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Stage Block operation creates a new block to be committed as part of a blob where the contents are read from * a URL. - * + * * @param containerName The container name. * @param blob The blob name. * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less @@ -3267,13 +3328,14 @@ public Mono stageBlockFromURLAsync(String containerName, String blob, Stri return stageBlockFromURLWithResponseAsync(containerName, blob, blockId, contentLength, sourceUrl, sourceRange, sourceContentMD5, sourceContentcrc64, timeout, leaseId, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, requestId, copySourceAuthorization, cpkInfo, encryptionScopeParam, - context).flatMap(ignored -> Mono.empty()); + context).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * The Stage Block operation creates a new block to be committed as part of a blob where the contents are read from * a URL. - * + * * @param containerName The container name. * @param blob The blob name. * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less @@ -3344,13 +3406,14 @@ public Mono> stageBlockFromURLNoCustomHeadersWithResponseAsync(St containerName, blob, comp, blockId, contentLength, sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, timeout, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, leaseId, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, - sourceIfNoneMatch, this.client.getVersion(), requestId, copySourceAuthorization, accept, context)); + sourceIfNoneMatch, this.client.getVersion(), requestId, copySourceAuthorization, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Stage Block operation creates a new block to be committed as part of a blob where the contents are read from * a URL. - * + * * @param containerName The container name. * @param blob The blob name. * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less @@ -3418,11 +3481,13 @@ public Mono> stageBlockFromURLNoCustomHeadersWithResponseAsync(St = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - return service.stageBlockFromURLNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, blockId, - contentLength, sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, timeout, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, leaseId, - sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, - this.client.getVersion(), requestId, copySourceAuthorization, accept, context); + return service + .stageBlockFromURLNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, blockId, contentLength, + sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, timeout, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, leaseId, sourceIfModifiedSinceConverted, + sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, this.client.getVersion(), requestId, + copySourceAuthorization, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -3432,7 +3497,7 @@ public Mono> stageBlockFromURLNoCustomHeadersWithResponseAsync(St * committing the new and existing blocks together. You can do this by specifying whether to commit a block from the * committed block list or from the uncommitted block list, or to commit the most recently uploaded version of the * block, whichever list it may belong to. - * + * * @param containerName The container name. * @param blob The blob name. * @param blocks Blob Blocks. @@ -3539,13 +3604,15 @@ public Mono> commitBlockLis = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return FluxUtil.withContext(context -> service.commitBlockList(this.client.getUrl(), containerName, blob, comp, - timeout, cacheControl, contentType, contentEncoding, contentLanguage, contentMd5Converted, - transactionalContentMD5Converted, transactionalContentCrc64Converted, metadata, leaseId, contentDisposition, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, - blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, blocks, accept, - context)); + return FluxUtil + .withContext(context -> service.commitBlockList(this.client.getUrl(), containerName, blob, comp, timeout, + cacheControl, contentType, contentEncoding, contentLanguage, contentMd5Converted, + transactionalContentMD5Converted, transactionalContentCrc64Converted, metadata, leaseId, + contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, blobTagsString, immutabilityPolicyExpiryConverted, + immutabilityPolicyMode, legalHold, blocks, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -3555,7 +3622,7 @@ public Mono> commitBlockLis * committing the new and existing blocks together. You can do this by specifying whether to commit a block from the * committed block list or from the uncommitted block list, or to commit the most recently uploaded version of the * block, whichever list it may belong to. - * + * * @param containerName The container name. * @param blob The blob name. * @param blocks Blob Blocks. @@ -3663,13 +3730,15 @@ public Mono> commitBlockLis = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return service.commitBlockList(this.client.getUrl(), containerName, blob, comp, timeout, cacheControl, - contentType, contentEncoding, contentLanguage, contentMd5Converted, transactionalContentMD5Converted, - transactionalContentCrc64Converted, metadata, leaseId, contentDisposition, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, - blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, blocks, accept, - context); + return service + .commitBlockList(this.client.getUrl(), containerName, blob, comp, timeout, cacheControl, contentType, + contentEncoding, contentLanguage, contentMd5Converted, transactionalContentMD5Converted, + transactionalContentCrc64Converted, metadata, leaseId, contentDisposition, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, + blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, blocks, accept, + context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -3679,7 +3748,7 @@ public Mono> commitBlockLis * committing the new and existing blocks together. You can do this by specifying whether to commit a block from the * committed block list or from the uncommitted block list, or to commit the most recently uploaded version of the * block, whichever list it may belong to. - * + * * @param containerName The container name. * @param blob The blob name. * @param blocks Blob Blocks. @@ -3727,7 +3796,9 @@ public Mono commitBlockListAsync(String containerName, String blob, BlockL return commitBlockListWithResponseAsync(containerName, blob, blocks, timeout, transactionalContentMD5, transactionalContentCrc64, metadata, leaseId, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, - blobHttpHeaders, cpkInfo, encryptionScopeParam).flatMap(ignored -> Mono.empty()); + blobHttpHeaders, cpkInfo, encryptionScopeParam) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** @@ -3737,7 +3808,7 @@ public Mono commitBlockListAsync(String containerName, String blob, BlockL * committing the new and existing blocks together. You can do this by specifying whether to commit a block from the * committed block list or from the uncommitted block list, or to commit the most recently uploaded version of the * block, whichever list it may belong to. - * + * * @param containerName The container name. * @param blob The blob name. * @param blocks Blob Blocks. @@ -3786,7 +3857,9 @@ public Mono commitBlockListAsync(String containerName, String blob, BlockL return commitBlockListWithResponseAsync(containerName, blob, blocks, timeout, transactionalContentMD5, transactionalContentCrc64, metadata, leaseId, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, - blobHttpHeaders, cpkInfo, encryptionScopeParam, context).flatMap(ignored -> Mono.empty()); + blobHttpHeaders, cpkInfo, encryptionScopeParam, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** @@ -3796,7 +3869,7 @@ public Mono commitBlockListAsync(String containerName, String blob, BlockL * committing the new and existing blocks together. You can do this by specifying whether to commit a block from the * committed block list or from the uncommitted block list, or to commit the most recently uploaded version of the * block, whichever list it may belong to. - * + * * @param containerName The container name. * @param blob The blob name. * @param blocks Blob Blocks. @@ -3903,13 +3976,15 @@ public Mono> commitBlockListNoCustomHeadersWithResponseAsync(Stri = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return FluxUtil.withContext(context -> service.commitBlockListNoCustomHeaders(this.client.getUrl(), - containerName, blob, comp, timeout, cacheControl, contentType, contentEncoding, contentLanguage, - contentMd5Converted, transactionalContentMD5Converted, transactionalContentCrc64Converted, metadata, - leaseId, contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, blobTagsString, immutabilityPolicyExpiryConverted, - immutabilityPolicyMode, legalHold, blocks, accept, context)); + return FluxUtil + .withContext(context -> service.commitBlockListNoCustomHeaders(this.client.getUrl(), containerName, blob, + comp, timeout, cacheControl, contentType, contentEncoding, contentLanguage, contentMd5Converted, + transactionalContentMD5Converted, transactionalContentCrc64Converted, metadata, leaseId, + contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, blobTagsString, immutabilityPolicyExpiryConverted, + immutabilityPolicyMode, legalHold, blocks, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -3919,7 +3994,7 @@ public Mono> commitBlockListNoCustomHeadersWithResponseAsync(Stri * committing the new and existing blocks together. You can do this by specifying whether to commit a block from the * committed block list or from the uncommitted block list, or to commit the most recently uploaded version of the * block, whichever list it may belong to. - * + * * @param containerName The container name. * @param blob The blob name. * @param blocks Blob Blocks. @@ -4027,18 +4102,20 @@ public Mono> commitBlockListNoCustomHeadersWithResponseAsync(Stri = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return service.commitBlockListNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, - cacheControl, contentType, contentEncoding, contentLanguage, contentMd5Converted, - transactionalContentMD5Converted, transactionalContentCrc64Converted, metadata, leaseId, contentDisposition, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, - blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, blocks, accept, - context); + return service + .commitBlockListNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, cacheControl, + contentType, contentEncoding, contentLanguage, contentMd5Converted, transactionalContentMD5Converted, + transactionalContentCrc64Converted, metadata, leaseId, contentDisposition, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, + blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, blocks, accept, + context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param listType Specifies whether to return the list of committed blocks, the list of uncommitted blocks, or both @@ -4065,13 +4142,15 @@ public Mono> getBlockList String ifTags, String requestId) { final String comp = "blocklist"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getBlockList(this.client.getUrl(), containerName, blob, comp, - snapshot, listType, timeout, leaseId, ifTags, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.getBlockList(this.client.getUrl(), containerName, blob, comp, snapshot, + listType, timeout, leaseId, ifTags, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param listType Specifies whether to return the list of committed blocks, the list of uncommitted blocks, or both @@ -4099,13 +4178,15 @@ public Mono> getBlockList String ifTags, String requestId, Context context) { final String comp = "blocklist"; final String accept = "application/xml"; - return service.getBlockList(this.client.getUrl(), containerName, blob, comp, snapshot, listType, timeout, - leaseId, ifTags, this.client.getVersion(), requestId, accept, context); + return service + .getBlockList(this.client.getUrl(), containerName, blob, comp, snapshot, listType, timeout, leaseId, ifTags, + this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param listType Specifies whether to return the list of committed blocks, the list of uncommitted blocks, or both @@ -4130,12 +4211,13 @@ public Mono> getBlockList public Mono getBlockListAsync(String containerName, String blob, BlockListType listType, String snapshot, Integer timeout, String leaseId, String ifTags, String requestId) { return getBlockListWithResponseAsync(containerName, blob, listType, snapshot, timeout, leaseId, ifTags, - requestId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + requestId).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param listType Specifies whether to return the list of committed blocks, the list of uncommitted blocks, or both @@ -4161,12 +4243,13 @@ public Mono getBlockListAsync(String containerName, String blob, Bloc public Mono getBlockListAsync(String containerName, String blob, BlockListType listType, String snapshot, Integer timeout, String leaseId, String ifTags, String requestId, Context context) { return getBlockListWithResponseAsync(containerName, blob, listType, snapshot, timeout, leaseId, ifTags, - requestId, context).flatMap(res -> Mono.justOrEmpty(res.getValue())); + requestId, context).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param listType Specifies whether to return the list of committed blocks, the list of uncommitted blocks, or both @@ -4194,12 +4277,13 @@ public Mono> getBlockListNoCustomHeadersWithResponseAsync(St final String accept = "application/xml"; return FluxUtil .withContext(context -> service.getBlockListNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, - snapshot, listType, timeout, leaseId, ifTags, this.client.getVersion(), requestId, accept, context)); + snapshot, listType, timeout, leaseId, ifTags, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param listType Specifies whether to return the list of committed blocks, the list of uncommitted blocks, or both @@ -4227,7 +4311,9 @@ public Mono> getBlockListNoCustomHeadersWithResponseAsync(St Context context) { final String comp = "blocklist"; final String accept = "application/xml"; - return service.getBlockListNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, snapshot, listType, - timeout, leaseId, ifTags, this.client.getVersion(), requestId, accept, context); + return service + .getBlockListNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, snapshot, listType, timeout, + leaseId, ifTags, this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ContainersImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ContainersImpl.java index 804f32d8a8b9..ab18e0932842 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ContainersImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ContainersImpl.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.storage.blob.implementation; import com.azure.core.annotation.BodyParam; @@ -63,11 +62,13 @@ import java.util.stream.Collectors; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import com.azure.storage.blob.implementation.util.ModelHelper; /** * An instance of this class provides access to all the operations defined in Containers. */ public final class ContainersImpl { + /** * The proxy service used to perform REST calls. */ @@ -80,7 +81,7 @@ public final class ContainersImpl { /** * Initializes an instance of ContainersImpl. - * + * * @param client the instance of the service client containing this operation class. */ ContainersImpl(AzureBlobStorageImpl client) { @@ -96,6 +97,7 @@ public final class ContainersImpl { @Host("{url}") @ServiceInterface(name = "AzureBlobStorageCont") public interface ContainersService { + @Put("/{containerName}") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -526,7 +528,7 @@ Mono> getAccountInfoNoCustomHeaders(@HostParam("url") String url, /** * creates a new container under the specified account. If the container with the same name already exists, the * operation fails. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -563,15 +565,17 @@ public Mono> createWithResponseAsync = blobContainerEncryptionScope.isEncryptionScopeOverridePrevented(); } Boolean encryptionScopeOverridePrevented = encryptionScopeOverridePreventedInternal; - return FluxUtil.withContext(context -> service.create(this.client.getUrl(), containerName, restype, timeout, - metadata, access, this.client.getVersion(), requestId, defaultEncryptionScope, - encryptionScopeOverridePrevented, accept, context)); + return FluxUtil + .withContext(context -> service.create(this.client.getUrl(), containerName, restype, timeout, metadata, + access, this.client.getVersion(), requestId, defaultEncryptionScope, encryptionScopeOverridePrevented, + accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * creates a new container under the specified account. If the container with the same name already exists, the * operation fails. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -609,15 +613,16 @@ public Mono> createWithResponseAsync = blobContainerEncryptionScope.isEncryptionScopeOverridePrevented(); } Boolean encryptionScopeOverridePrevented = encryptionScopeOverridePreventedInternal; - return service.create(this.client.getUrl(), containerName, restype, timeout, metadata, access, - this.client.getVersion(), requestId, defaultEncryptionScope, encryptionScopeOverridePrevented, accept, - context); + return service + .create(this.client.getUrl(), containerName, restype, timeout, metadata, access, this.client.getVersion(), + requestId, defaultEncryptionScope, encryptionScopeOverridePrevented, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * creates a new container under the specified account. If the container with the same name already exists, the * operation fails. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -641,13 +646,15 @@ public Mono> createWithResponseAsync public Mono createAsync(String containerName, Integer timeout, Map metadata, PublicAccessType access, String requestId, BlobContainerEncryptionScope blobContainerEncryptionScope) { return createWithResponseAsync(containerName, timeout, metadata, access, requestId, - blobContainerEncryptionScope).flatMap(ignored -> Mono.empty()); + blobContainerEncryptionScope) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * creates a new container under the specified account. If the container with the same name already exists, the * operation fails. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -673,13 +680,15 @@ public Mono createAsync(String containerName, Integer timeout, Map Mono.empty()); + blobContainerEncryptionScope, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * creates a new container under the specified account. If the container with the same name already exists, the * operation fails. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -716,15 +725,17 @@ public Mono> createNoCustomHeadersWithResponseAsync(String contai = blobContainerEncryptionScope.isEncryptionScopeOverridePrevented(); } Boolean encryptionScopeOverridePrevented = encryptionScopeOverridePreventedInternal; - return FluxUtil.withContext(context -> service.createNoCustomHeaders(this.client.getUrl(), containerName, - restype, timeout, metadata, access, this.client.getVersion(), requestId, defaultEncryptionScope, - encryptionScopeOverridePrevented, accept, context)); + return FluxUtil + .withContext(context -> service.createNoCustomHeaders(this.client.getUrl(), containerName, restype, timeout, + metadata, access, this.client.getVersion(), requestId, defaultEncryptionScope, + encryptionScopeOverridePrevented, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * creates a new container under the specified account. If the container with the same name already exists, the * operation fails. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -762,15 +773,17 @@ public Mono> createNoCustomHeadersWithResponseAsync(String contai = blobContainerEncryptionScope.isEncryptionScopeOverridePrevented(); } Boolean encryptionScopeOverridePrevented = encryptionScopeOverridePreventedInternal; - return service.createNoCustomHeaders(this.client.getUrl(), containerName, restype, timeout, metadata, access, - this.client.getVersion(), requestId, defaultEncryptionScope, encryptionScopeOverridePrevented, accept, - context); + return service + .createNoCustomHeaders(this.client.getUrl(), containerName, restype, timeout, metadata, access, + this.client.getVersion(), requestId, defaultEncryptionScope, encryptionScopeOverridePrevented, accept, + context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * returns all user-defined metadata and system properties for the specified container. The data returned does not * include the container's list of blobs. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -788,14 +801,16 @@ public Mono> getPropertiesWit Integer timeout, String leaseId, String requestId) { final String restype = "container"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getProperties(this.client.getUrl(), containerName, restype, - timeout, leaseId, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.getProperties(this.client.getUrl(), containerName, restype, timeout, + leaseId, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * returns all user-defined metadata and system properties for the specified container. The data returned does not * include the container's list of blobs. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -814,14 +829,16 @@ public Mono> getPropertiesWit Integer timeout, String leaseId, String requestId, Context context) { final String restype = "container"; final String accept = "application/xml"; - return service.getProperties(this.client.getUrl(), containerName, restype, timeout, leaseId, - this.client.getVersion(), requestId, accept, context); + return service + .getProperties(this.client.getUrl(), containerName, restype, timeout, leaseId, this.client.getVersion(), + requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * returns all user-defined metadata and system properties for the specified container. The data returned does not * include the container's list of blobs. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -837,13 +854,14 @@ public Mono> getPropertiesWit @ServiceMethod(returns = ReturnType.SINGLE) public Mono getPropertiesAsync(String containerName, Integer timeout, String leaseId, String requestId) { return getPropertiesWithResponseAsync(containerName, timeout, leaseId, requestId) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * returns all user-defined metadata and system properties for the specified container. The data returned does not * include the container's list of blobs. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -861,13 +879,14 @@ public Mono getPropertiesAsync(String containerName, Integer timeout, Stri public Mono getPropertiesAsync(String containerName, Integer timeout, String leaseId, String requestId, Context context) { return getPropertiesWithResponseAsync(containerName, timeout, leaseId, requestId, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * returns all user-defined metadata and system properties for the specified container. The data returned does not * include the container's list of blobs. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -885,14 +904,16 @@ public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String String leaseId, String requestId) { final String restype = "container"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getPropertiesNoCustomHeaders(this.client.getUrl(), containerName, - restype, timeout, leaseId, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.getPropertiesNoCustomHeaders(this.client.getUrl(), containerName, restype, + timeout, leaseId, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * returns all user-defined metadata and system properties for the specified container. The data returned does not * include the container's list of blobs. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -911,14 +932,16 @@ public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String String leaseId, String requestId, Context context) { final String restype = "container"; final String accept = "application/xml"; - return service.getPropertiesNoCustomHeaders(this.client.getUrl(), containerName, restype, timeout, leaseId, - this.client.getVersion(), requestId, accept, context); + return service + .getPropertiesNoCustomHeaders(this.client.getUrl(), containerName, restype, timeout, leaseId, + this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * operation marks the specified container for deletion. The container and any blobs contained within it are later * deleted during garbage collection. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -947,13 +970,13 @@ public Mono> deleteWithResponseAsync = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); return FluxUtil.withContext(context -> service.delete(this.client.getUrl(), containerName, restype, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, - context)); + context)).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * operation marks the specified container for deletion. The container and any blobs contained within it are later * deleted during garbage collection. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -981,14 +1004,16 @@ public Mono> deleteWithResponseAsync = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.delete(this.client.getUrl(), containerName, restype, timeout, leaseId, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, context); + return service + .delete(this.client.getUrl(), containerName, restype, timeout, leaseId, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * operation marks the specified container for deletion. The container and any blobs contained within it are later * deleted during garbage collection. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1009,13 +1034,14 @@ public Mono> deleteWithResponseAsync public Mono deleteAsync(String containerName, Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { return deleteWithResponseAsync(containerName, timeout, leaseId, ifModifiedSince, ifUnmodifiedSince, requestId) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * operation marks the specified container for deletion. The container and any blobs contained within it are later * deleted during garbage collection. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1037,13 +1063,14 @@ public Mono deleteAsync(String containerName, Integer timeout, String leas public Mono deleteAsync(String containerName, Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId, Context context) { return deleteWithResponseAsync(containerName, timeout, leaseId, ifModifiedSince, ifUnmodifiedSince, requestId, - context).flatMap(ignored -> Mono.empty()); + context).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * operation marks the specified container for deletion. The container and any blobs contained within it are later * deleted during garbage collection. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1069,15 +1096,17 @@ public Mono> deleteNoCustomHeadersWithResponseAsync(String contai = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.deleteNoCustomHeaders(this.client.getUrl(), containerName, - restype, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), - requestId, accept, context)); + return FluxUtil + .withContext(context -> service.deleteNoCustomHeaders(this.client.getUrl(), containerName, restype, timeout, + leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, + accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * operation marks the specified container for deletion. The container and any blobs contained within it are later * deleted during garbage collection. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1106,12 +1135,13 @@ public Mono> deleteNoCustomHeadersWithResponseAsync(String contai DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); return service.deleteNoCustomHeaders(this.client.getUrl(), containerName, restype, timeout, leaseId, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, context); + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * operation sets one or more user-defined name-value pairs for the specified container. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1143,12 +1173,13 @@ public Mono> setMetadataWithRes = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); return FluxUtil .withContext(context -> service.setMetadata(this.client.getUrl(), containerName, restype, comp, timeout, - leaseId, metadata, ifModifiedSinceConverted, this.client.getVersion(), requestId, accept, context)); + leaseId, metadata, ifModifiedSinceConverted, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * operation sets one or more user-defined name-value pairs for the specified container. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1179,13 +1210,15 @@ public Mono> setMetadataWithRes final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - return service.setMetadata(this.client.getUrl(), containerName, restype, comp, timeout, leaseId, metadata, - ifModifiedSinceConverted, this.client.getVersion(), requestId, accept, context); + return service + .setMetadata(this.client.getUrl(), containerName, restype, comp, timeout, leaseId, metadata, + ifModifiedSinceConverted, this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * operation sets one or more user-defined name-value pairs for the specified container. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1210,12 +1243,13 @@ public Mono> setMetadataWithRes public Mono setMetadataAsync(String containerName, Integer timeout, String leaseId, Map metadata, OffsetDateTime ifModifiedSince, String requestId) { return setMetadataWithResponseAsync(containerName, timeout, leaseId, metadata, ifModifiedSince, requestId) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * operation sets one or more user-defined name-value pairs for the specified container. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1241,12 +1275,13 @@ public Mono setMetadataAsync(String containerName, Integer timeout, String public Mono setMetadataAsync(String containerName, Integer timeout, String leaseId, Map metadata, OffsetDateTime ifModifiedSince, String requestId, Context context) { return setMetadataWithResponseAsync(containerName, timeout, leaseId, metadata, ifModifiedSince, requestId, - context).flatMap(ignored -> Mono.empty()); + context).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * operation sets one or more user-defined name-value pairs for the specified container. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1275,14 +1310,16 @@ public Mono> setMetadataNoCustomHeadersWithResponseAsync(String c final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - return FluxUtil.withContext( - context -> service.setMetadataNoCustomHeaders(this.client.getUrl(), containerName, restype, comp, timeout, - leaseId, metadata, ifModifiedSinceConverted, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.setMetadataNoCustomHeaders(this.client.getUrl(), containerName, restype, + comp, timeout, leaseId, metadata, ifModifiedSinceConverted, this.client.getVersion(), requestId, accept, + context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * operation sets one or more user-defined name-value pairs for the specified container. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1313,14 +1350,16 @@ public Mono> setMetadataNoCustomHeadersWithResponseAsync(String c final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - return service.setMetadataNoCustomHeaders(this.client.getUrl(), containerName, restype, comp, timeout, leaseId, - metadata, ifModifiedSinceConverted, this.client.getVersion(), requestId, accept, context); + return service + .setMetadataNoCustomHeaders(this.client.getUrl(), containerName, restype, comp, timeout, leaseId, metadata, + ifModifiedSinceConverted, this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * gets the permissions for the specified container. The permissions indicate whether container data may be accessed * publicly. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1340,14 +1379,16 @@ public Mono> setMetadataNoCustomHeadersWithResponseAsync(String c final String restype = "container"; final String comp = "acl"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getAccessPolicy(this.client.getUrl(), containerName, restype, - comp, timeout, leaseId, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.getAccessPolicy(this.client.getUrl(), containerName, restype, comp, timeout, + leaseId, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * gets the permissions for the specified container. The permissions indicate whether container data may be accessed * publicly. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1369,14 +1410,16 @@ public Mono> setMetadataNoCustomHeadersWithResponseAsync(String c final String restype = "container"; final String comp = "acl"; final String accept = "application/xml"; - return service.getAccessPolicy(this.client.getUrl(), containerName, restype, comp, timeout, leaseId, - this.client.getVersion(), requestId, accept, context); + return service + .getAccessPolicy(this.client.getUrl(), containerName, restype, comp, timeout, leaseId, + this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * gets the permissions for the specified container. The permissions indicate whether container data may be accessed * publicly. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1393,13 +1436,14 @@ public Mono> setMetadataNoCustomHeadersWithResponseAsync(String c public Mono getAccessPolicyAsync(String containerName, Integer timeout, String leaseId, String requestId) { return getAccessPolicyWithResponseAsync(containerName, timeout, leaseId, requestId) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * gets the permissions for the specified container. The permissions indicate whether container data may be accessed * publicly. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1417,13 +1461,14 @@ public Mono getAccessPolicyAsync(String containerNa public Mono getAccessPolicyAsync(String containerName, Integer timeout, String leaseId, String requestId, Context context) { return getAccessPolicyWithResponseAsync(containerName, timeout, leaseId, requestId, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * gets the permissions for the specified container. The permissions indicate whether container data may be accessed * publicly. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1443,14 +1488,16 @@ public Mono> getAccessPolicyNoCustomHeader final String restype = "container"; final String comp = "acl"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getAccessPolicyNoCustomHeaders(this.client.getUrl(), - containerName, restype, comp, timeout, leaseId, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.getAccessPolicyNoCustomHeaders(this.client.getUrl(), containerName, restype, + comp, timeout, leaseId, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * gets the permissions for the specified container. The permissions indicate whether container data may be accessed * publicly. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1471,14 +1518,16 @@ public Mono> getAccessPolicyNoCustomHeader final String restype = "container"; final String comp = "acl"; final String accept = "application/xml"; - return service.getAccessPolicyNoCustomHeaders(this.client.getUrl(), containerName, restype, comp, timeout, - leaseId, this.client.getVersion(), requestId, accept, context); + return service + .getAccessPolicyNoCustomHeaders(this.client.getUrl(), containerName, restype, comp, timeout, leaseId, + this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * sets the permissions for the specified container. The permissions indicate whether blobs in a container may be * accessed publicly. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1509,15 +1558,17 @@ public Mono> setAccessPolic DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); BlobSignedIdentifierWrapper containerAclConverted = new BlobSignedIdentifierWrapper(containerAcl); - return FluxUtil.withContext(context -> service.setAccessPolicy(this.client.getUrl(), containerName, restype, - comp, timeout, leaseId, access, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - this.client.getVersion(), requestId, containerAclConverted, accept, context)); + return FluxUtil + .withContext(context -> service.setAccessPolicy(this.client.getUrl(), containerName, restype, comp, timeout, + leaseId, access, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), + requestId, containerAclConverted, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * sets the permissions for the specified container. The permissions indicate whether blobs in a container may be * accessed publicly. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1549,15 +1600,17 @@ public Mono> setAccessPolic DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); BlobSignedIdentifierWrapper containerAclConverted = new BlobSignedIdentifierWrapper(containerAcl); - return service.setAccessPolicy(this.client.getUrl(), containerName, restype, comp, timeout, leaseId, access, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, - containerAclConverted, accept, context); + return service + .setAccessPolicy(this.client.getUrl(), containerName, restype, comp, timeout, leaseId, access, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, + containerAclConverted, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * sets the permissions for the specified container. The permissions indicate whether blobs in a container may be * accessed publicly. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1581,13 +1634,15 @@ public Mono setAccessPolicyAsync(String containerName, Integer timeout, St PublicAccessType access, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId, List containerAcl) { return setAccessPolicyWithResponseAsync(containerName, timeout, leaseId, access, ifModifiedSince, - ifUnmodifiedSince, requestId, containerAcl).flatMap(ignored -> Mono.empty()); + ifUnmodifiedSince, requestId, containerAcl) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * sets the permissions for the specified container. The permissions indicate whether blobs in a container may be * accessed publicly. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1612,13 +1667,15 @@ public Mono setAccessPolicyAsync(String containerName, Integer timeout, St PublicAccessType access, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId, List containerAcl, Context context) { return setAccessPolicyWithResponseAsync(containerName, timeout, leaseId, access, ifModifiedSince, - ifUnmodifiedSince, requestId, containerAcl, context).flatMap(ignored -> Mono.empty()); + ifUnmodifiedSince, requestId, containerAcl, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * sets the permissions for the specified container. The permissions indicate whether blobs in a container may be * accessed publicly. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1649,15 +1706,17 @@ public Mono> setAccessPolicyNoCustomHeadersWithResponseAsync(Stri DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); BlobSignedIdentifierWrapper containerAclConverted = new BlobSignedIdentifierWrapper(containerAcl); - return FluxUtil.withContext(context -> service.setAccessPolicyNoCustomHeaders(this.client.getUrl(), - containerName, restype, comp, timeout, leaseId, access, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, containerAclConverted, accept, context)); + return FluxUtil + .withContext(context -> service.setAccessPolicyNoCustomHeaders(this.client.getUrl(), containerName, restype, + comp, timeout, leaseId, access, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, + this.client.getVersion(), requestId, containerAclConverted, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * sets the permissions for the specified container. The permissions indicate whether blobs in a container may be * accessed publicly. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1689,14 +1748,16 @@ public Mono> setAccessPolicyNoCustomHeadersWithResponseAsync(Stri DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); BlobSignedIdentifierWrapper containerAclConverted = new BlobSignedIdentifierWrapper(containerAcl); - return service.setAccessPolicyNoCustomHeaders(this.client.getUrl(), containerName, restype, comp, timeout, - leaseId, access, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, - containerAclConverted, accept, context); + return service + .setAccessPolicyNoCustomHeaders(this.client.getUrl(), containerName, restype, comp, timeout, leaseId, + access, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, + containerAclConverted, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Restores a previously-deleted container. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1720,12 +1781,13 @@ public Mono> restoreWithResponseAsy final String accept = "application/xml"; return FluxUtil .withContext(context -> service.restore(this.client.getUrl(), containerName, restype, comp, timeout, - this.client.getVersion(), requestId, deletedContainerName, deletedContainerVersion, accept, context)); + this.client.getVersion(), requestId, deletedContainerName, deletedContainerVersion, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Restores a previously-deleted container. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1749,13 +1811,15 @@ public Mono> restoreWithResponseAsy final String restype = "container"; final String comp = "undelete"; final String accept = "application/xml"; - return service.restore(this.client.getUrl(), containerName, restype, comp, timeout, this.client.getVersion(), - requestId, deletedContainerName, deletedContainerVersion, accept, context); + return service + .restore(this.client.getUrl(), containerName, restype, comp, timeout, this.client.getVersion(), requestId, + deletedContainerName, deletedContainerVersion, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Restores a previously-deleted container. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1775,12 +1839,14 @@ public Mono> restoreWithResponseAsy public Mono restoreAsync(String containerName, Integer timeout, String requestId, String deletedContainerName, String deletedContainerVersion) { return restoreWithResponseAsync(containerName, timeout, requestId, deletedContainerName, - deletedContainerVersion).flatMap(ignored -> Mono.empty()); + deletedContainerVersion) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Restores a previously-deleted container. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1801,12 +1867,14 @@ public Mono restoreAsync(String containerName, Integer timeout, String req public Mono restoreAsync(String containerName, Integer timeout, String requestId, String deletedContainerName, String deletedContainerVersion, Context context) { return restoreWithResponseAsync(containerName, timeout, requestId, deletedContainerName, - deletedContainerVersion, context).flatMap(ignored -> Mono.empty()); + deletedContainerVersion, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Restores a previously-deleted container. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1830,12 +1898,13 @@ public Mono> restoreNoCustomHeadersWithResponseAsync(String conta final String accept = "application/xml"; return FluxUtil.withContext( context -> service.restoreNoCustomHeaders(this.client.getUrl(), containerName, restype, comp, timeout, - this.client.getVersion(), requestId, deletedContainerName, deletedContainerVersion, accept, context)); + this.client.getVersion(), requestId, deletedContainerName, deletedContainerVersion, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Restores a previously-deleted container. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1858,13 +1927,15 @@ public Mono> restoreNoCustomHeadersWithResponseAsync(String conta final String restype = "container"; final String comp = "undelete"; final String accept = "application/xml"; - return service.restoreNoCustomHeaders(this.client.getUrl(), containerName, restype, comp, timeout, - this.client.getVersion(), requestId, deletedContainerName, deletedContainerVersion, accept, context); + return service + .restoreNoCustomHeaders(this.client.getUrl(), containerName, restype, comp, timeout, + this.client.getVersion(), requestId, deletedContainerName, deletedContainerVersion, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Renames an existing container. - * + * * @param containerName The container name. * @param sourceContainerName Required. Specifies the name of the container to rename. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1885,13 +1956,15 @@ public Mono> renameWithResponseAsync final String restype = "container"; final String comp = "rename"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.rename(this.client.getUrl(), containerName, restype, comp, - timeout, this.client.getVersion(), requestId, sourceContainerName, sourceLeaseId, accept, context)); + return FluxUtil + .withContext(context -> service.rename(this.client.getUrl(), containerName, restype, comp, timeout, + this.client.getVersion(), requestId, sourceContainerName, sourceLeaseId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Renames an existing container. - * + * * @param containerName The container name. * @param sourceContainerName Required. Specifies the name of the container to rename. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1913,13 +1986,15 @@ public Mono> renameWithResponseAsync final String restype = "container"; final String comp = "rename"; final String accept = "application/xml"; - return service.rename(this.client.getUrl(), containerName, restype, comp, timeout, this.client.getVersion(), - requestId, sourceContainerName, sourceLeaseId, accept, context); + return service + .rename(this.client.getUrl(), containerName, restype, comp, timeout, this.client.getVersion(), requestId, + sourceContainerName, sourceLeaseId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Renames an existing container. - * + * * @param containerName The container name. * @param sourceContainerName Required. Specifies the name of the container to rename. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1938,12 +2013,13 @@ public Mono> renameWithResponseAsync public Mono renameAsync(String containerName, String sourceContainerName, Integer timeout, String requestId, String sourceLeaseId) { return renameWithResponseAsync(containerName, sourceContainerName, timeout, requestId, sourceLeaseId) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * Renames an existing container. - * + * * @param containerName The container name. * @param sourceContainerName Required. Specifies the name of the container to rename. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1963,12 +2039,13 @@ public Mono renameAsync(String containerName, String sourceContainerName, public Mono renameAsync(String containerName, String sourceContainerName, Integer timeout, String requestId, String sourceLeaseId, Context context) { return renameWithResponseAsync(containerName, sourceContainerName, timeout, requestId, sourceLeaseId, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * Renames an existing container. - * + * * @param containerName The container name. * @param sourceContainerName Required. Specifies the name of the container to rename. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1991,12 +2068,13 @@ public Mono> renameNoCustomHeadersWithResponseAsync(String contai final String accept = "application/xml"; return FluxUtil .withContext(context -> service.renameNoCustomHeaders(this.client.getUrl(), containerName, restype, comp, - timeout, this.client.getVersion(), requestId, sourceContainerName, sourceLeaseId, accept, context)); + timeout, this.client.getVersion(), requestId, sourceContainerName, sourceLeaseId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Renames an existing container. - * + * * @param containerName The container name. * @param sourceContainerName Required. Specifies the name of the container to rename. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2018,13 +2096,15 @@ public Mono> renameNoCustomHeadersWithResponseAsync(String contai final String restype = "container"; final String comp = "rename"; final String accept = "application/xml"; - return service.renameNoCustomHeaders(this.client.getUrl(), containerName, restype, comp, timeout, - this.client.getVersion(), requestId, sourceContainerName, sourceLeaseId, accept, context); + return service + .renameNoCustomHeaders(this.client.getUrl(), containerName, restype, comp, timeout, + this.client.getVersion(), requestId, sourceContainerName, sourceLeaseId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * + * * @param containerName The container name. * @param contentLength The length of the request. * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch boundary. @@ -2047,13 +2127,16 @@ public Mono>> submit final String restype = "container"; final String comp = "batch"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.submitBatch(this.client.getUrl(), containerName, restype, comp, - contentLength, multipartContentType, timeout, this.client.getVersion(), requestId, body, accept, context)); + return FluxUtil + .withContext( + context -> service.submitBatch(this.client.getUrl(), containerName, restype, comp, contentLength, + multipartContentType, timeout, this.client.getVersion(), requestId, body, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * + * * @param containerName The container name. * @param contentLength The length of the request. * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch boundary. @@ -2077,13 +2160,15 @@ public Mono>> submit final String restype = "container"; final String comp = "batch"; final String accept = "application/xml"; - return service.submitBatch(this.client.getUrl(), containerName, restype, comp, contentLength, - multipartContentType, timeout, this.client.getVersion(), requestId, body, accept, context); + return service + .submitBatch(this.client.getUrl(), containerName, restype, comp, contentLength, multipartContentType, + timeout, this.client.getVersion(), requestId, body, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * + * * @param containerName The container name. * @param contentLength The length of the request. * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch boundary. @@ -2103,12 +2188,13 @@ public Mono>> submit public Flux submitBatchAsync(String containerName, long contentLength, String multipartContentType, Flux body, Integer timeout, String requestId) { return submitBatchWithResponseAsync(containerName, contentLength, multipartContentType, body, timeout, - requestId).flatMapMany(fluxByteBufferResponse -> fluxByteBufferResponse.getValue()); + requestId).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMapMany(fluxByteBufferResponse -> fluxByteBufferResponse.getValue()); } /** * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * + * * @param containerName The container name. * @param contentLength The length of the request. * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch boundary. @@ -2129,12 +2215,13 @@ public Flux submitBatchAsync(String containerName, long contentLengt public Flux submitBatchAsync(String containerName, long contentLength, String multipartContentType, Flux body, Integer timeout, String requestId, Context context) { return submitBatchWithResponseAsync(containerName, contentLength, multipartContentType, body, timeout, - requestId, context).flatMapMany(fluxByteBufferResponse -> fluxByteBufferResponse.getValue()); + requestId, context).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMapMany(fluxByteBufferResponse -> fluxByteBufferResponse.getValue()); } /** * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * + * * @param containerName The container name. * @param contentLength The length of the request. * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch boundary. @@ -2158,12 +2245,12 @@ public Mono submitBatchNoCustomHeadersWithResponseAsync(String c final String accept = "application/xml"; return FluxUtil.withContext(context -> service.submitBatchNoCustomHeaders(this.client.getUrl(), containerName, restype, comp, contentLength, multipartContentType, timeout, this.client.getVersion(), requestId, body, - accept, context)); + accept, context)).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * + * * @param containerName The container name. * @param contentLength The length of the request. * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch boundary. @@ -2186,13 +2273,15 @@ public Mono submitBatchNoCustomHeadersWithResponseAsync(String c final String restype = "container"; final String comp = "batch"; final String accept = "application/xml"; - return service.submitBatchNoCustomHeaders(this.client.getUrl(), containerName, restype, comp, contentLength, - multipartContentType, timeout, this.client.getVersion(), requestId, body, accept, context); + return service + .submitBatchNoCustomHeaders(this.client.getUrl(), containerName, restype, comp, contentLength, + multipartContentType, timeout, this.client.getVersion(), requestId, body, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * + * * @param containerName The container name. * @param contentLength The length of the request. * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch boundary. @@ -2215,13 +2304,16 @@ public Mono>> submit final String restype = "container"; final String comp = "batch"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.submitBatch(this.client.getUrl(), containerName, restype, comp, - contentLength, multipartContentType, timeout, this.client.getVersion(), requestId, body, accept, context)); + return FluxUtil + .withContext( + context -> service.submitBatch(this.client.getUrl(), containerName, restype, comp, contentLength, + multipartContentType, timeout, this.client.getVersion(), requestId, body, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * + * * @param containerName The container name. * @param contentLength The length of the request. * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch boundary. @@ -2245,13 +2337,15 @@ public Mono>> submit final String restype = "container"; final String comp = "batch"; final String accept = "application/xml"; - return service.submitBatch(this.client.getUrl(), containerName, restype, comp, contentLength, - multipartContentType, timeout, this.client.getVersion(), requestId, body, accept, context); + return service + .submitBatch(this.client.getUrl(), containerName, restype, comp, contentLength, multipartContentType, + timeout, this.client.getVersion(), requestId, body, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * + * * @param containerName The container name. * @param contentLength The length of the request. * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch boundary. @@ -2271,12 +2365,13 @@ public Mono>> submit public Flux submitBatchAsync(String containerName, long contentLength, String multipartContentType, BinaryData body, Integer timeout, String requestId) { return submitBatchWithResponseAsync(containerName, contentLength, multipartContentType, body, timeout, - requestId).flatMapMany(fluxByteBufferResponse -> fluxByteBufferResponse.getValue()); + requestId).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMapMany(fluxByteBufferResponse -> fluxByteBufferResponse.getValue()); } /** * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * + * * @param containerName The container name. * @param contentLength The length of the request. * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch boundary. @@ -2297,12 +2392,13 @@ public Flux submitBatchAsync(String containerName, long contentLengt public Flux submitBatchAsync(String containerName, long contentLength, String multipartContentType, BinaryData body, Integer timeout, String requestId, Context context) { return submitBatchWithResponseAsync(containerName, contentLength, multipartContentType, body, timeout, - requestId, context).flatMapMany(fluxByteBufferResponse -> fluxByteBufferResponse.getValue()); + requestId, context).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMapMany(fluxByteBufferResponse -> fluxByteBufferResponse.getValue()); } /** * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * + * * @param containerName The container name. * @param contentLength The length of the request. * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch boundary. @@ -2326,12 +2422,12 @@ public Mono submitBatchNoCustomHeadersWithResponseAsync(String c final String accept = "application/xml"; return FluxUtil.withContext(context -> service.submitBatchNoCustomHeaders(this.client.getUrl(), containerName, restype, comp, contentLength, multipartContentType, timeout, this.client.getVersion(), requestId, body, - accept, context)); + accept, context)).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * + * * @param containerName The container name. * @param contentLength The length of the request. * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch boundary. @@ -2354,14 +2450,16 @@ public Mono submitBatchNoCustomHeadersWithResponseAsync(String c final String restype = "container"; final String comp = "batch"; final String accept = "application/xml"; - return service.submitBatchNoCustomHeaders(this.client.getUrl(), containerName, restype, comp, contentLength, - multipartContentType, timeout, this.client.getVersion(), requestId, body, accept, context); + return service + .submitBatchNoCustomHeaders(this.client.getUrl(), containerName, restype, comp, contentLength, + multipartContentType, timeout, this.client.getVersion(), requestId, body, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Filter Blobs operation enables callers to list blobs in a container whose tags match a given search * expression. Filter blobs searches within the given container. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -2400,13 +2498,14 @@ public Mono> filte .collect(Collectors.joining(",")); return FluxUtil .withContext(context -> service.filterBlobs(this.client.getUrl(), containerName, restype, comp, timeout, - this.client.getVersion(), requestId, where, marker, maxresults, includeConverted, accept, context)); + this.client.getVersion(), requestId, where, marker, maxresults, includeConverted, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Filter Blobs operation enables callers to list blobs in a container whose tags match a given search * expression. Filter blobs searches within the given container. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -2444,14 +2543,16 @@ public Mono> filte : include.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return service.filterBlobs(this.client.getUrl(), containerName, restype, comp, timeout, - this.client.getVersion(), requestId, where, marker, maxresults, includeConverted, accept, context); + return service + .filterBlobs(this.client.getUrl(), containerName, restype, comp, timeout, this.client.getVersion(), + requestId, where, marker, maxresults, includeConverted, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Filter Blobs operation enables callers to list blobs in a container whose tags match a given search * expression. Filter blobs searches within the given container. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -2479,13 +2580,14 @@ public Mono> filte public Mono filterBlobsAsync(String containerName, Integer timeout, String requestId, String where, String marker, Integer maxresults, List include) { return filterBlobsWithResponseAsync(containerName, timeout, requestId, where, marker, maxresults, include) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * The Filter Blobs operation enables callers to list blobs in a container whose tags match a given search * expression. Filter blobs searches within the given container. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -2514,13 +2616,14 @@ public Mono filterBlobsAsync(String containerName, Integer ti public Mono filterBlobsAsync(String containerName, Integer timeout, String requestId, String where, String marker, Integer maxresults, List include, Context context) { return filterBlobsWithResponseAsync(containerName, timeout, requestId, where, marker, maxresults, include, - context).flatMap(res -> Mono.justOrEmpty(res.getValue())); + context).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * The Filter Blobs operation enables callers to list blobs in a container whose tags match a given search * expression. Filter blobs searches within the given container. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -2559,13 +2662,14 @@ public Mono> filterBlobsNoCustomHeadersWithResponseA .collect(Collectors.joining(",")); return FluxUtil.withContext( context -> service.filterBlobsNoCustomHeaders(this.client.getUrl(), containerName, restype, comp, timeout, - this.client.getVersion(), requestId, where, marker, maxresults, includeConverted, accept, context)); + this.client.getVersion(), requestId, where, marker, maxresults, includeConverted, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Filter Blobs operation enables callers to list blobs in a container whose tags match a given search * expression. Filter blobs searches within the given container. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -2603,14 +2707,16 @@ public Mono> filterBlobsNoCustomHeadersWithResponseA : include.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return service.filterBlobsNoCustomHeaders(this.client.getUrl(), containerName, restype, comp, timeout, - this.client.getVersion(), requestId, where, marker, maxresults, includeConverted, accept, context); + return service + .filterBlobsNoCustomHeaders(this.client.getUrl(), containerName, restype, comp, timeout, + this.client.getVersion(), requestId, where, marker, maxresults, includeConverted, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 * seconds, or can be infinite. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -2644,15 +2750,17 @@ public Mono> acquireLeaseWithR = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.acquireLease(this.client.getUrl(), containerName, comp, restype, - action, timeout, duration, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.acquireLease(this.client.getUrl(), containerName, comp, restype, action, + timeout, duration, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 * seconds, or can be infinite. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -2687,15 +2795,17 @@ public Mono> acquireLeaseWithR = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.acquireLease(this.client.getUrl(), containerName, comp, restype, action, timeout, duration, - proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, - accept, context); + return service + .acquireLease(this.client.getUrl(), containerName, comp, restype, action, timeout, duration, + proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), + requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 * seconds, or can be infinite. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -2721,13 +2831,15 @@ public Mono> acquireLeaseWithR public Mono acquireLeaseAsync(String containerName, Integer timeout, Integer duration, String proposedLeaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { return acquireLeaseWithResponseAsync(containerName, timeout, duration, proposedLeaseId, ifModifiedSince, - ifUnmodifiedSince, requestId).flatMap(ignored -> Mono.empty()); + ifUnmodifiedSince, requestId) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 * seconds, or can be infinite. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -2754,13 +2866,15 @@ public Mono acquireLeaseAsync(String containerName, Integer timeout, Integ public Mono acquireLeaseAsync(String containerName, Integer timeout, Integer duration, String proposedLeaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId, Context context) { return acquireLeaseWithResponseAsync(containerName, timeout, duration, proposedLeaseId, ifModifiedSince, - ifUnmodifiedSince, requestId, context).flatMap(ignored -> Mono.empty()); + ifUnmodifiedSince, requestId, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 * seconds, or can be infinite. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -2794,15 +2908,17 @@ public Mono> acquireLeaseNoCustomHeadersWithResponseAsync(String = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.acquireLeaseNoCustomHeaders(this.client.getUrl(), containerName, - comp, restype, action, timeout, duration, proposedLeaseId, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.acquireLeaseNoCustomHeaders(this.client.getUrl(), containerName, comp, + restype, action, timeout, duration, proposedLeaseId, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 * seconds, or can be infinite. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -2837,15 +2953,17 @@ public Mono> acquireLeaseNoCustomHeadersWithResponseAsync(String = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.acquireLeaseNoCustomHeaders(this.client.getUrl(), containerName, comp, restype, action, timeout, - duration, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), - requestId, accept, context); + return service + .acquireLeaseNoCustomHeaders(this.client.getUrl(), containerName, comp, restype, action, timeout, duration, + proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), + requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 * seconds, or can be infinite. - * + * * @param containerName The container name. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2874,15 +2992,17 @@ public Mono> releaseLeaseWithR = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.releaseLease(this.client.getUrl(), containerName, comp, restype, - action, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), - requestId, accept, context)); + return FluxUtil + .withContext(context -> service.releaseLease(this.client.getUrl(), containerName, comp, restype, action, + timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), + requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 * seconds, or can be infinite. - * + * * @param containerName The container name. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2913,13 +3033,14 @@ public Mono> releaseLeaseWithR DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); return service.releaseLease(this.client.getUrl(), containerName, comp, restype, action, timeout, leaseId, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, context); + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 * seconds, or can be infinite. - * + * * @param containerName The container name. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2940,13 +3061,14 @@ public Mono> releaseLeaseWithR public Mono releaseLeaseAsync(String containerName, String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { return releaseLeaseWithResponseAsync(containerName, leaseId, timeout, ifModifiedSince, ifUnmodifiedSince, - requestId).flatMap(ignored -> Mono.empty()); + requestId).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 * seconds, or can be infinite. - * + * * @param containerName The container name. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2968,13 +3090,14 @@ public Mono releaseLeaseAsync(String containerName, String leaseId, Intege public Mono releaseLeaseAsync(String containerName, String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId, Context context) { return releaseLeaseWithResponseAsync(containerName, leaseId, timeout, ifModifiedSince, ifUnmodifiedSince, - requestId, context).flatMap(ignored -> Mono.empty()); + requestId, context).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 * seconds, or can be infinite. - * + * * @param containerName The container name. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3002,15 +3125,17 @@ public Mono> releaseLeaseNoCustomHeadersWithResponseAsync(String = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.releaseLeaseNoCustomHeaders(this.client.getUrl(), containerName, - comp, restype, action, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.releaseLeaseNoCustomHeaders(this.client.getUrl(), containerName, comp, + restype, action, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 * seconds, or can be infinite. - * + * * @param containerName The container name. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3040,15 +3165,17 @@ public Mono> releaseLeaseNoCustomHeadersWithResponseAsync(String = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.releaseLeaseNoCustomHeaders(this.client.getUrl(), containerName, comp, restype, action, timeout, - leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, - context); + return service + .releaseLeaseNoCustomHeaders(this.client.getUrl(), containerName, comp, restype, action, timeout, leaseId, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, + context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 * seconds, or can be infinite. - * + * * @param containerName The container name. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3077,15 +3204,17 @@ public Mono> renewLeaseWithRespo = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.renewLease(this.client.getUrl(), containerName, comp, restype, - action, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), - requestId, accept, context)); + return FluxUtil + .withContext(context -> service.renewLease(this.client.getUrl(), containerName, comp, restype, action, + timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), + requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 * seconds, or can be infinite. - * + * * @param containerName The container name. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3116,13 +3245,14 @@ public Mono> renewLeaseWithRespo DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); return service.renewLease(this.client.getUrl(), containerName, comp, restype, action, timeout, leaseId, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, context); + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 * seconds, or can be infinite. - * + * * @param containerName The container name. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3143,13 +3273,14 @@ public Mono> renewLeaseWithRespo public Mono renewLeaseAsync(String containerName, String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { return renewLeaseWithResponseAsync(containerName, leaseId, timeout, ifModifiedSince, ifUnmodifiedSince, - requestId).flatMap(ignored -> Mono.empty()); + requestId).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 * seconds, or can be infinite. - * + * * @param containerName The container name. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3171,13 +3302,14 @@ public Mono renewLeaseAsync(String containerName, String leaseId, Integer public Mono renewLeaseAsync(String containerName, String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId, Context context) { return renewLeaseWithResponseAsync(containerName, leaseId, timeout, ifModifiedSince, ifUnmodifiedSince, - requestId, context).flatMap(ignored -> Mono.empty()); + requestId, context).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 * seconds, or can be infinite. - * + * * @param containerName The container name. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3205,15 +3337,17 @@ public Mono> renewLeaseNoCustomHeadersWithResponseAsync(String co = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.renewLeaseNoCustomHeaders(this.client.getUrl(), containerName, - comp, restype, action, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.renewLeaseNoCustomHeaders(this.client.getUrl(), containerName, comp, + restype, action, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 * seconds, or can be infinite. - * + * * @param containerName The container name. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3243,15 +3377,17 @@ public Mono> renewLeaseNoCustomHeadersWithResponseAsync(String co = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.renewLeaseNoCustomHeaders(this.client.getUrl(), containerName, comp, restype, action, timeout, - leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, - context); + return service + .renewLeaseNoCustomHeaders(this.client.getUrl(), containerName, comp, restype, action, timeout, leaseId, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, + context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 * seconds, or can be infinite. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -3285,15 +3421,17 @@ public Mono> breakLeaseWithRespo = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.breakLease(this.client.getUrl(), containerName, comp, restype, - action, timeout, breakPeriod, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.breakLease(this.client.getUrl(), containerName, comp, restype, action, + timeout, breakPeriod, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), + requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 * seconds, or can be infinite. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -3329,13 +3467,14 @@ public Mono> breakLeaseWithRespo DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); return service.breakLease(this.client.getUrl(), containerName, comp, restype, action, timeout, breakPeriod, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, context); + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 * seconds, or can be infinite. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -3361,13 +3500,14 @@ public Mono> breakLeaseWithRespo public Mono breakLeaseAsync(String containerName, Integer timeout, Integer breakPeriod, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { return breakLeaseWithResponseAsync(containerName, timeout, breakPeriod, ifModifiedSince, ifUnmodifiedSince, - requestId).flatMap(ignored -> Mono.empty()); + requestId).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 * seconds, or can be infinite. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -3394,13 +3534,14 @@ public Mono breakLeaseAsync(String containerName, Integer timeout, Integer public Mono breakLeaseAsync(String containerName, Integer timeout, Integer breakPeriod, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId, Context context) { return breakLeaseWithResponseAsync(containerName, timeout, breakPeriod, ifModifiedSince, ifUnmodifiedSince, - requestId, context).flatMap(ignored -> Mono.empty()); + requestId, context).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 * seconds, or can be infinite. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -3433,15 +3574,17 @@ public Mono> breakLeaseNoCustomHeadersWithResponseAsync(String co = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.breakLeaseNoCustomHeaders(this.client.getUrl(), containerName, - comp, restype, action, timeout, breakPeriod, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.breakLeaseNoCustomHeaders(this.client.getUrl(), containerName, comp, + restype, action, timeout, breakPeriod, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 * seconds, or can be infinite. - * + * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -3476,15 +3619,17 @@ public Mono> breakLeaseNoCustomHeadersWithResponseAsync(String co = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.breakLeaseNoCustomHeaders(this.client.getUrl(), containerName, comp, restype, action, timeout, - breakPeriod, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, - accept, context); + return service + .breakLeaseNoCustomHeaders(this.client.getUrl(), containerName, comp, restype, action, timeout, breakPeriod, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, + context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 * seconds, or can be infinite. - * + * * @param containerName The container name. * @param leaseId Specifies the current lease ID on the resource. * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) @@ -3516,15 +3661,17 @@ public Mono> changeLeaseWithRes = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.changeLease(this.client.getUrl(), containerName, comp, restype, - action, timeout, leaseId, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.changeLease(this.client.getUrl(), containerName, comp, restype, action, + timeout, leaseId, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 * seconds, or can be infinite. - * + * * @param containerName The container name. * @param leaseId Specifies the current lease ID on the resource. * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) @@ -3557,15 +3704,17 @@ public Mono> changeLeaseWithRes = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.changeLease(this.client.getUrl(), containerName, comp, restype, action, timeout, leaseId, - proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, - accept, context); + return service + .changeLease(this.client.getUrl(), containerName, comp, restype, action, timeout, leaseId, proposedLeaseId, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, + context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 * seconds, or can be infinite. - * + * * @param containerName The container name. * @param leaseId Specifies the current lease ID on the resource. * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) @@ -3589,13 +3738,15 @@ public Mono> changeLeaseWithRes public Mono changeLeaseAsync(String containerName, String leaseId, String proposedLeaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { return changeLeaseWithResponseAsync(containerName, leaseId, proposedLeaseId, timeout, ifModifiedSince, - ifUnmodifiedSince, requestId).flatMap(ignored -> Mono.empty()); + ifUnmodifiedSince, requestId) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 * seconds, or can be infinite. - * + * * @param containerName The container name. * @param leaseId Specifies the current lease ID on the resource. * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) @@ -3620,13 +3771,15 @@ public Mono changeLeaseAsync(String containerName, String leaseId, String public Mono changeLeaseAsync(String containerName, String leaseId, String proposedLeaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId, Context context) { return changeLeaseWithResponseAsync(containerName, leaseId, proposedLeaseId, timeout, ifModifiedSince, - ifUnmodifiedSince, requestId, context).flatMap(ignored -> Mono.empty()); + ifUnmodifiedSince, requestId, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 * seconds, or can be infinite. - * + * * @param containerName The container name. * @param leaseId Specifies the current lease ID on the resource. * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) @@ -3658,15 +3811,17 @@ public Mono> changeLeaseNoCustomHeadersWithResponseAsync(String c = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.changeLeaseNoCustomHeaders(this.client.getUrl(), containerName, - comp, restype, action, timeout, leaseId, proposedLeaseId, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.changeLeaseNoCustomHeaders(this.client.getUrl(), containerName, comp, + restype, action, timeout, leaseId, proposedLeaseId, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 * seconds, or can be infinite. - * + * * @param containerName The container name. * @param leaseId Specifies the current lease ID on the resource. * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) @@ -3699,14 +3854,16 @@ public Mono> changeLeaseNoCustomHeadersWithResponseAsync(String c = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.changeLeaseNoCustomHeaders(this.client.getUrl(), containerName, comp, restype, action, timeout, - leaseId, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), - requestId, accept, context); + return service + .changeLeaseNoCustomHeaders(this.client.getUrl(), containerName, comp, restype, action, timeout, leaseId, + proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), + requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The List Blobs operation returns a list of the blobs under the specified container. - * + * * @param containerName The container name. * @param prefix Filters the results to return only containers whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list of containers to be returned with the next @@ -3742,14 +3899,16 @@ public Mono> changeLeaseNoCustomHeadersWithResponseAsync(String c : include.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return FluxUtil.withContext( - context -> service.listBlobFlatSegment(this.client.getUrl(), containerName, restype, comp, prefix, marker, - maxresults, includeConverted, timeout, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.listBlobFlatSegment(this.client.getUrl(), containerName, restype, comp, + prefix, marker, maxresults, includeConverted, timeout, this.client.getVersion(), requestId, accept, + context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The List Blobs operation returns a list of the blobs under the specified container. - * + * * @param containerName The container name. * @param prefix Filters the results to return only containers whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list of containers to be returned with the next @@ -3786,13 +3945,15 @@ public Mono> changeLeaseNoCustomHeadersWithResponseAsync(String c : include.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return service.listBlobFlatSegment(this.client.getUrl(), containerName, restype, comp, prefix, marker, - maxresults, includeConverted, timeout, this.client.getVersion(), requestId, accept, context); + return service + .listBlobFlatSegment(this.client.getUrl(), containerName, restype, comp, prefix, marker, maxresults, + includeConverted, timeout, this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The List Blobs operation returns a list of the blobs under the specified container. - * + * * @param containerName The container name. * @param prefix Filters the results to return only containers whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list of containers to be returned with the next @@ -3820,12 +3981,13 @@ public Mono> changeLeaseNoCustomHeadersWithResponseAsync(String c public Mono listBlobFlatSegmentAsync(String containerName, String prefix, String marker, Integer maxresults, List include, Integer timeout, String requestId) { return listBlobFlatSegmentWithResponseAsync(containerName, prefix, marker, maxresults, include, timeout, - requestId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + requestId).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * [Update] The List Blobs operation returns a list of the blobs under the specified container. - * + * * @param containerName The container name. * @param prefix Filters the results to return only containers whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list of containers to be returned with the next @@ -3855,12 +4017,13 @@ public Mono listBlobFlatSegmentAsync(String contai String marker, Integer maxresults, List include, Integer timeout, String requestId, Context context) { return listBlobFlatSegmentWithResponseAsync(containerName, prefix, marker, maxresults, include, timeout, - requestId, context).flatMap(res -> Mono.justOrEmpty(res.getValue())); + requestId, context).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * [Update] The List Blobs operation returns a list of the blobs under the specified container. - * + * * @param containerName The container name. * @param prefix Filters the results to return only containers whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list of containers to be returned with the next @@ -3896,14 +4059,16 @@ public Mono> listBlobFlatSegmentNoCustomH : include.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return FluxUtil.withContext(context -> service.listBlobFlatSegmentNoCustomHeaders(this.client.getUrl(), - containerName, restype, comp, prefix, marker, maxresults, includeConverted, timeout, - this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.listBlobFlatSegmentNoCustomHeaders(this.client.getUrl(), containerName, + restype, comp, prefix, marker, maxresults, includeConverted, timeout, this.client.getVersion(), + requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The List Blobs operation returns a list of the blobs under the specified container. - * + * * @param containerName The container name. * @param prefix Filters the results to return only containers whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list of containers to be returned with the next @@ -3940,13 +4105,15 @@ public Mono> listBlobFlatSegmentNoCustomH : include.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return service.listBlobFlatSegmentNoCustomHeaders(this.client.getUrl(), containerName, restype, comp, prefix, - marker, maxresults, includeConverted, timeout, this.client.getVersion(), requestId, accept, context); + return service + .listBlobFlatSegmentNoCustomHeaders(this.client.getUrl(), containerName, restype, comp, prefix, marker, + maxresults, includeConverted, timeout, this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The List Blobs operation returns a list of the blobs under the specified container. - * + * * @param containerName The container name. * @param delimiter When the request includes this parameter, the operation returns a BlobPrefix element in the * response body that acts as a placeholder for all blobs whose names begin with the same substring up to the @@ -3985,14 +4152,16 @@ public Mono> listBlobFlatSegmentNoCustomH : include.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return FluxUtil.withContext(context -> service.listBlobHierarchySegment(this.client.getUrl(), containerName, - restype, comp, prefix, delimiter, marker, maxresults, includeConverted, timeout, this.client.getVersion(), - requestId, accept, context)); + return FluxUtil + .withContext(context -> service.listBlobHierarchySegment(this.client.getUrl(), containerName, restype, comp, + prefix, delimiter, marker, maxresults, includeConverted, timeout, this.client.getVersion(), requestId, + accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The List Blobs operation returns a list of the blobs under the specified container. - * + * * @param containerName The container name. * @param delimiter When the request includes this parameter, the operation returns a BlobPrefix element in the * response body that acts as a placeholder for all blobs whose names begin with the same substring up to the @@ -4033,13 +4202,15 @@ public Mono> listBlobFlatSegmentNoCustomH : include.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return service.listBlobHierarchySegment(this.client.getUrl(), containerName, restype, comp, prefix, delimiter, - marker, maxresults, includeConverted, timeout, this.client.getVersion(), requestId, accept, context); + return service + .listBlobHierarchySegment(this.client.getUrl(), containerName, restype, comp, prefix, delimiter, marker, + maxresults, includeConverted, timeout, this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The List Blobs operation returns a list of the blobs under the specified container. - * + * * @param containerName The container name. * @param delimiter When the request includes this parameter, the operation returns a BlobPrefix element in the * response body that acts as a placeholder for all blobs whose names begin with the same substring up to the @@ -4071,12 +4242,13 @@ public Mono listBlobHierarchySegmentAsync(Str String prefix, String marker, Integer maxresults, List include, Integer timeout, String requestId) { return listBlobHierarchySegmentWithResponseAsync(containerName, delimiter, prefix, marker, maxresults, include, - timeout, requestId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + timeout, requestId).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * [Update] The List Blobs operation returns a list of the blobs under the specified container. - * + * * @param containerName The container name. * @param delimiter When the request includes this parameter, the operation returns a BlobPrefix element in the * response body that acts as a placeholder for all blobs whose names begin with the same substring up to the @@ -4109,12 +4281,14 @@ public Mono listBlobHierarchySegmentAsync(Str String prefix, String marker, Integer maxresults, List include, Integer timeout, String requestId, Context context) { return listBlobHierarchySegmentWithResponseAsync(containerName, delimiter, prefix, marker, maxresults, include, - timeout, requestId, context).flatMap(res -> Mono.justOrEmpty(res.getValue())); + timeout, requestId, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * [Update] The List Blobs operation returns a list of the blobs under the specified container. - * + * * @param containerName The container name. * @param delimiter When the request includes this parameter, the operation returns a BlobPrefix element in the * response body that acts as a placeholder for all blobs whose names begin with the same substring up to the @@ -4153,14 +4327,16 @@ public Mono> listBlobHierarchySegmen : include.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return FluxUtil.withContext(context -> service.listBlobHierarchySegmentNoCustomHeaders(this.client.getUrl(), - containerName, restype, comp, prefix, delimiter, marker, maxresults, includeConverted, timeout, - this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.listBlobHierarchySegmentNoCustomHeaders(this.client.getUrl(), containerName, + restype, comp, prefix, delimiter, marker, maxresults, includeConverted, timeout, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The List Blobs operation returns a list of the blobs under the specified container. - * + * * @param containerName The container name. * @param delimiter When the request includes this parameter, the operation returns a BlobPrefix element in the * response body that acts as a placeholder for all blobs whose names begin with the same substring up to the @@ -4200,14 +4376,16 @@ public Mono> listBlobHierarchySegmen : include.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return service.listBlobHierarchySegmentNoCustomHeaders(this.client.getUrl(), containerName, restype, comp, - prefix, delimiter, marker, maxresults, includeConverted, timeout, this.client.getVersion(), requestId, - accept, context); + return service + .listBlobHierarchySegmentNoCustomHeaders(this.client.getUrl(), containerName, restype, comp, prefix, + delimiter, marker, maxresults, includeConverted, timeout, this.client.getVersion(), requestId, accept, + context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Returns the sku name and account kind. - * + * * @param containerName The container name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. @@ -4220,13 +4398,15 @@ public Mono> listBlobHierarchySegmen final String restype = "account"; final String comp = "properties"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getAccountInfo(this.client.getUrl(), containerName, restype, - comp, this.client.getVersion(), accept, context)); + return FluxUtil + .withContext(context -> service.getAccountInfo(this.client.getUrl(), containerName, restype, comp, + this.client.getVersion(), accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Returns the sku name and account kind. - * + * * @param containerName The container name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -4240,13 +4420,15 @@ public Mono> listBlobHierarchySegmen final String restype = "account"; final String comp = "properties"; final String accept = "application/xml"; - return service.getAccountInfo(this.client.getUrl(), containerName, restype, comp, this.client.getVersion(), - accept, context); + return service + .getAccountInfo(this.client.getUrl(), containerName, restype, comp, this.client.getVersion(), accept, + context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Returns the sku name and account kind. - * + * * @param containerName The container name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. @@ -4255,12 +4437,14 @@ public Mono> listBlobHierarchySegmen */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getAccountInfoAsync(String containerName) { - return getAccountInfoWithResponseAsync(containerName).flatMap(ignored -> Mono.empty()); + return getAccountInfoWithResponseAsync(containerName) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Returns the sku name and account kind. - * + * * @param containerName The container name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -4270,12 +4454,14 @@ public Mono getAccountInfoAsync(String containerName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getAccountInfoAsync(String containerName, Context context) { - return getAccountInfoWithResponseAsync(containerName, context).flatMap(ignored -> Mono.empty()); + return getAccountInfoWithResponseAsync(containerName, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Returns the sku name and account kind. - * + * * @param containerName The container name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. @@ -4287,13 +4473,15 @@ public Mono> getAccountInfoNoCustomHeadersWithResponseAsync(Strin final String restype = "account"; final String comp = "properties"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getAccountInfoNoCustomHeaders(this.client.getUrl(), - containerName, restype, comp, this.client.getVersion(), accept, context)); + return FluxUtil + .withContext(context -> service.getAccountInfoNoCustomHeaders(this.client.getUrl(), containerName, restype, + comp, this.client.getVersion(), accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Returns the sku name and account kind. - * + * * @param containerName The container name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -4306,7 +4494,9 @@ public Mono> getAccountInfoNoCustomHeadersWithResponseAsync(Strin final String restype = "account"; final String comp = "properties"; final String accept = "application/xml"; - return service.getAccountInfoNoCustomHeaders(this.client.getUrl(), containerName, restype, comp, - this.client.getVersion(), accept, context); + return service + .getAccountInfoNoCustomHeaders(this.client.getUrl(), containerName, restype, comp, this.client.getVersion(), + accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/PageBlobsImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/PageBlobsImpl.java index 5ffa8ef77ca6..f68cf7adea5a 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/PageBlobsImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/PageBlobsImpl.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.storage.blob.implementation; import com.azure.core.annotation.BodyParam; @@ -48,11 +47,13 @@ import java.util.Map; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import com.azure.storage.blob.implementation.util.ModelHelper; /** * An instance of this class provides access to all the operations defined in PageBlobs. */ public final class PageBlobsImpl { + /** * The proxy service used to perform REST calls. */ @@ -65,7 +66,7 @@ public final class PageBlobsImpl { /** * Initializes an instance of PageBlobsImpl. - * + * * @param client the instance of the service client containing this operation class. */ PageBlobsImpl(AzureBlobStorageImpl client) { @@ -81,6 +82,7 @@ public final class PageBlobsImpl { @Host("{url}") @ServiceInterface(name = "AzureBlobStoragePage") public interface PageBlobsService { + @Put("/{containerName}/{blob}") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -500,7 +502,7 @@ Mono> copyIncrementalNoCustomHeaders(@HostParam("url") String url /** * The Create operation creates a new page blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -607,17 +609,19 @@ public Mono> createWithResponseAsync( = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return FluxUtil.withContext(context -> service.create(this.client.getUrl(), containerName, blob, blobType, - timeout, contentLength, tier, contentType, contentEncoding, contentLanguage, contentMd5Converted, - cacheControl, metadata, leaseId, contentDisposition, encryptionKey, encryptionKeySha256, - encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, ifTags, blobContentLength, blobSequenceNumber, this.client.getVersion(), requestId, - blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, accept, context)); + return FluxUtil + .withContext(context -> service.create(this.client.getUrl(), containerName, blob, blobType, timeout, + contentLength, tier, contentType, contentEncoding, contentLanguage, contentMd5Converted, cacheControl, + metadata, leaseId, contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, + encryptionScope, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + blobContentLength, blobSequenceNumber, this.client.getVersion(), requestId, blobTagsString, + immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Create operation creates a new page blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -725,17 +729,19 @@ public Mono> createWithResponseAsync( = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return service.create(this.client.getUrl(), containerName, blob, blobType, timeout, contentLength, tier, - contentType, contentEncoding, contentLanguage, contentMd5Converted, cacheControl, metadata, leaseId, - contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, blobContentLength, - blobSequenceNumber, this.client.getVersion(), requestId, blobTagsString, immutabilityPolicyExpiryConverted, - immutabilityPolicyMode, legalHold, accept, context); + return service + .create(this.client.getUrl(), containerName, blob, blobType, timeout, contentLength, tier, contentType, + contentEncoding, contentLanguage, contentMd5Converted, cacheControl, metadata, leaseId, + contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, blobContentLength, + blobSequenceNumber, this.client.getVersion(), requestId, blobTagsString, + immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Create operation creates a new page blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -785,12 +791,13 @@ public Mono createAsync(String containerName, String blob, long contentLen return createWithResponseAsync(containerName, blob, contentLength, blobContentLength, timeout, tier, metadata, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, blobSequenceNumber, requestId, blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, blobHttpHeaders, cpkInfo, - encryptionScopeParam).flatMap(ignored -> Mono.empty()); + encryptionScopeParam).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * The Create operation creates a new page blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -841,12 +848,14 @@ public Mono createAsync(String containerName, String blob, long contentLen return createWithResponseAsync(containerName, blob, contentLength, blobContentLength, timeout, tier, metadata, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, blobSequenceNumber, requestId, blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, blobHttpHeaders, cpkInfo, - encryptionScopeParam, context).flatMap(ignored -> Mono.empty()); + encryptionScopeParam, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * The Create operation creates a new page blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -953,17 +962,19 @@ public Mono> createNoCustomHeadersWithResponseAsync(String contai = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return FluxUtil.withContext(context -> service.createNoCustomHeaders(this.client.getUrl(), containerName, blob, - blobType, timeout, contentLength, tier, contentType, contentEncoding, contentLanguage, contentMd5Converted, - cacheControl, metadata, leaseId, contentDisposition, encryptionKey, encryptionKeySha256, - encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, ifTags, blobContentLength, blobSequenceNumber, this.client.getVersion(), requestId, - blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, accept, context)); + return FluxUtil + .withContext(context -> service.createNoCustomHeaders(this.client.getUrl(), containerName, blob, blobType, + timeout, contentLength, tier, contentType, contentEncoding, contentLanguage, contentMd5Converted, + cacheControl, metadata, leaseId, contentDisposition, encryptionKey, encryptionKeySha256, + encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, + ifNoneMatch, ifTags, blobContentLength, blobSequenceNumber, this.client.getVersion(), requestId, + blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Create operation creates a new page blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1071,17 +1082,19 @@ public Mono> createNoCustomHeadersWithResponseAsync(String contai = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return service.createNoCustomHeaders(this.client.getUrl(), containerName, blob, blobType, timeout, - contentLength, tier, contentType, contentEncoding, contentLanguage, contentMd5Converted, cacheControl, - metadata, leaseId, contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, - encryptionScope, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - blobContentLength, blobSequenceNumber, this.client.getVersion(), requestId, blobTagsString, - immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, accept, context); + return service + .createNoCustomHeaders(this.client.getUrl(), containerName, blob, blobType, timeout, contentLength, tier, + contentType, contentEncoding, contentLanguage, contentMd5Converted, cacheControl, metadata, leaseId, + contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, blobContentLength, + blobSequenceNumber, this.client.getVersion(), requestId, blobTagsString, + immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Upload Pages operation writes a range of pages to a page blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1151,17 +1164,19 @@ public Mono> uploadPagesWithResp = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.uploadPages(this.client.getUrl(), containerName, blob, comp, - pageWrite, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, - range, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, body, accept, context)); + return FluxUtil + .withContext(context -> service.uploadPages(this.client.getUrl(), containerName, blob, comp, pageWrite, + contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, range, + leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, + ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, body, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Upload Pages operation writes a range of pages to a page blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1236,12 +1251,13 @@ public Mono> uploadPagesWithResp transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, range, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, body, accept, context); + ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, body, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Upload Pages operation writes a range of pages to a page blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1284,12 +1300,14 @@ public Mono uploadPagesAsync(String containerName, String blob, long conte return uploadPagesWithResponseAsync(containerName, blob, contentLength, body, transactionalContentMD5, transactionalContentCrc64, timeout, range, leaseId, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifTags, requestId, cpkInfo, encryptionScopeParam).flatMap(ignored -> Mono.empty()); + ifTags, requestId, cpkInfo, encryptionScopeParam) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * The Upload Pages operation writes a range of pages to a page blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1333,12 +1351,14 @@ public Mono uploadPagesAsync(String containerName, String blob, long conte return uploadPagesWithResponseAsync(containerName, blob, contentLength, body, transactionalContentMD5, transactionalContentCrc64, timeout, range, leaseId, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifTags, requestId, cpkInfo, encryptionScopeParam, context).flatMap(ignored -> Mono.empty()); + ifTags, requestId, cpkInfo, encryptionScopeParam, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * The Upload Pages operation writes a range of pages to a page blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1408,17 +1428,19 @@ public Mono> uploadPagesNoCustomHeadersWithResponseAsync(String c = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.uploadPagesNoCustomHeaders(this.client.getUrl(), containerName, - blob, comp, pageWrite, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, - timeout, range, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, body, accept, context)); + return FluxUtil + .withContext(context -> service.uploadPagesNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, + pageWrite, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, + range, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, + ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, body, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Upload Pages operation writes a range of pages to a page blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1489,17 +1511,19 @@ public Mono> uploadPagesNoCustomHeadersWithResponseAsync(String c = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.uploadPagesNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, pageWrite, - contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, range, - leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, body, accept, context); + return service + .uploadPagesNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, pageWrite, contentLength, + transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, range, leaseId, + encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, + ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, body, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Upload Pages operation writes a range of pages to a page blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1569,17 +1593,19 @@ public Mono> uploadPagesWithResp = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.uploadPages(this.client.getUrl(), containerName, blob, comp, - pageWrite, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, - range, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, body, accept, context)); + return FluxUtil + .withContext(context -> service.uploadPages(this.client.getUrl(), containerName, blob, comp, pageWrite, + contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, range, + leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, + ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, body, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Upload Pages operation writes a range of pages to a page blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1654,12 +1680,13 @@ public Mono> uploadPagesWithResp transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, range, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, body, accept, context); + ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, body, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Upload Pages operation writes a range of pages to a page blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1702,12 +1729,14 @@ public Mono uploadPagesAsync(String containerName, String blob, long conte return uploadPagesWithResponseAsync(containerName, blob, contentLength, body, transactionalContentMD5, transactionalContentCrc64, timeout, range, leaseId, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifTags, requestId, cpkInfo, encryptionScopeParam).flatMap(ignored -> Mono.empty()); + ifTags, requestId, cpkInfo, encryptionScopeParam) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * The Upload Pages operation writes a range of pages to a page blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1751,12 +1780,14 @@ public Mono uploadPagesAsync(String containerName, String blob, long conte return uploadPagesWithResponseAsync(containerName, blob, contentLength, body, transactionalContentMD5, transactionalContentCrc64, timeout, range, leaseId, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifTags, requestId, cpkInfo, encryptionScopeParam, context).flatMap(ignored -> Mono.empty()); + ifTags, requestId, cpkInfo, encryptionScopeParam, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * The Upload Pages operation writes a range of pages to a page blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1826,17 +1857,19 @@ public Mono> uploadPagesNoCustomHeadersWithResponseAsync(String c = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.uploadPagesNoCustomHeaders(this.client.getUrl(), containerName, - blob, comp, pageWrite, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, - timeout, range, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, body, accept, context)); + return FluxUtil + .withContext(context -> service.uploadPagesNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, + pageWrite, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, + range, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, + ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, body, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Upload Pages operation writes a range of pages to a page blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1907,17 +1940,19 @@ public Mono> uploadPagesNoCustomHeadersWithResponseAsync(String c = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.uploadPagesNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, pageWrite, - contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, range, - leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, body, accept, context); + return service + .uploadPagesNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, pageWrite, contentLength, + transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, range, leaseId, + encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, + ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, body, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Clear Pages operation clears a set of pages from a page blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -1981,16 +2016,18 @@ public Mono> clearPagesWithRespon = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.clearPages(this.client.getUrl(), containerName, blob, comp, - pageWrite, contentLength, timeout, range, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, - encryptionScope, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.clearPages(this.client.getUrl(), containerName, blob, comp, pageWrite, + contentLength, timeout, range, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, + encryptionScope, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Clear Pages operation clears a set of pages from a page blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -2055,16 +2092,18 @@ public Mono> clearPagesWithRespon = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.clearPages(this.client.getUrl(), containerName, blob, comp, pageWrite, contentLength, timeout, - range, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context); + return service + .clearPages(this.client.getUrl(), containerName, blob, comp, pageWrite, contentLength, timeout, range, + leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, + ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Clear Pages operation clears a set of pages from a page blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -2103,12 +2142,13 @@ public Mono clearPagesAsync(String containerName, String blob, long conten return clearPagesWithResponseAsync(containerName, blob, contentLength, timeout, range, leaseId, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, cpkInfo, encryptionScopeParam) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Clear Pages operation clears a set of pages from a page blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -2149,12 +2189,13 @@ public Mono clearPagesAsync(String containerName, String blob, long conten return clearPagesWithResponseAsync(containerName, blob, contentLength, timeout, range, leaseId, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, cpkInfo, encryptionScopeParam, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Clear Pages operation clears a set of pages from a page blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -2218,16 +2259,18 @@ public Mono> clearPagesNoCustomHeadersWithResponseAsync(String co = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.clearPagesNoCustomHeaders(this.client.getUrl(), containerName, - blob, comp, pageWrite, contentLength, timeout, range, leaseId, encryptionKey, encryptionKeySha256, - encryptionAlgorithm, encryptionScope, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.clearPagesNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, + pageWrite, contentLength, timeout, range, leaseId, encryptionKey, encryptionKeySha256, + encryptionAlgorithm, encryptionScope, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, + ifSequenceNumberEqualTo, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, + ifTags, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Clear Pages operation clears a set of pages from a page blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. @@ -2292,16 +2335,18 @@ public Mono> clearPagesNoCustomHeadersWithResponseAsync(String co = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.clearPagesNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, pageWrite, - contentLength, timeout, range, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, - encryptionScope, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context); + return service + .clearPagesNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, pageWrite, contentLength, + timeout, range, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, + ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Upload Pages operation writes a range of pages to a page blob where the contents are read from a URL. - * + * * @param containerName The container name. * @param blob The blob name. * @param sourceUrl Specify a URL to the copy source. @@ -2389,18 +2434,20 @@ public Mono> uploadPagesF = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - return FluxUtil.withContext(context -> service.uploadPagesFromURL(this.client.getUrl(), containerName, blob, - comp, pageWrite, sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, - contentLength, timeout, range, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - leaseId, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, - this.client.getVersion(), requestId, copySourceAuthorization, accept, context)); + return FluxUtil + .withContext(context -> service.uploadPagesFromURL(this.client.getUrl(), containerName, blob, comp, + pageWrite, sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, + contentLength, timeout, range, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, + leaseId, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, + this.client.getVersion(), requestId, copySourceAuthorization, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Upload Pages operation writes a range of pages to a page blob where the contents are read from a URL. - * + * * @param containerName The container name. * @param blob The blob name. * @param sourceUrl Specify a URL to the copy source. @@ -2489,18 +2536,20 @@ public Mono> uploadPagesF = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - return service.uploadPagesFromURL(this.client.getUrl(), containerName, blob, comp, pageWrite, sourceUrl, - sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, contentLength, timeout, range, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, leaseId, - ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, - this.client.getVersion(), requestId, copySourceAuthorization, accept, context); + return service + .uploadPagesFromURL(this.client.getUrl(), containerName, blob, comp, pageWrite, sourceUrl, sourceRange, + sourceContentMD5Converted, sourceContentcrc64Converted, contentLength, timeout, range, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, leaseId, ifSequenceNumberLessThanOrEqualTo, + ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, + ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, + sourceIfMatch, sourceIfNoneMatch, this.client.getVersion(), requestId, copySourceAuthorization, accept, + context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Upload Pages operation writes a range of pages to a page blob where the contents are read from a URL. - * + * * @param containerName The container name. * @param blob The blob name. * @param sourceUrl Specify a URL to the copy source. @@ -2558,12 +2607,14 @@ public Mono uploadPagesFromURLAsync(String containerName, String blob, Str sourceContentMD5, sourceContentcrc64, timeout, leaseId, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, requestId, - copySourceAuthorization, cpkInfo, encryptionScopeParam).flatMap(ignored -> Mono.empty()); + copySourceAuthorization, cpkInfo, encryptionScopeParam) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * The Upload Pages operation writes a range of pages to a page blob where the contents are read from a URL. - * + * * @param containerName The container name. * @param blob The blob name. * @param sourceUrl Specify a URL to the copy source. @@ -2622,12 +2673,14 @@ public Mono uploadPagesFromURLAsync(String containerName, String blob, Str sourceContentMD5, sourceContentcrc64, timeout, leaseId, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, requestId, - copySourceAuthorization, cpkInfo, encryptionScopeParam, context).flatMap(ignored -> Mono.empty()); + copySourceAuthorization, cpkInfo, encryptionScopeParam, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * The Upload Pages operation writes a range of pages to a page blob where the contents are read from a URL. - * + * * @param containerName The container name. * @param blob The blob name. * @param sourceUrl Specify a URL to the copy source. @@ -2715,18 +2768,20 @@ public Mono> uploadPagesFromURLNoCustomHeadersWithResponseAsync(S = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - return FluxUtil.withContext(context -> service.uploadPagesFromURLNoCustomHeaders(this.client.getUrl(), - containerName, blob, comp, pageWrite, sourceUrl, sourceRange, sourceContentMD5Converted, - sourceContentcrc64Converted, contentLength, timeout, range, encryptionKey, encryptionKeySha256, - encryptionAlgorithm, encryptionScope, leaseId, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, - this.client.getVersion(), requestId, copySourceAuthorization, accept, context)); + return FluxUtil + .withContext(context -> service.uploadPagesFromURLNoCustomHeaders(this.client.getUrl(), containerName, blob, + comp, pageWrite, sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, + contentLength, timeout, range, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, + leaseId, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, + this.client.getVersion(), requestId, copySourceAuthorization, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Upload Pages operation writes a range of pages to a page blob where the contents are read from a URL. - * + * * @param containerName The container name. * @param blob The blob name. * @param sourceUrl Specify a URL to the copy source. @@ -2815,19 +2870,21 @@ public Mono> uploadPagesFromURLNoCustomHeadersWithResponseAsync(S = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - return service.uploadPagesFromURLNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, pageWrite, - sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, contentLength, timeout, - range, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, leaseId, - ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, - this.client.getVersion(), requestId, copySourceAuthorization, accept, context); + return service + .uploadPagesFromURLNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, pageWrite, sourceUrl, + sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, contentLength, timeout, range, + encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, leaseId, + ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, + this.client.getVersion(), requestId, copySourceAuthorization, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Get Page Ranges operation returns the list of valid page ranges for a page blob, version or snapshot of a * page blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -2874,15 +2931,17 @@ public Mono> getPageRanges = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.getPageRanges(this.client.getUrl(), containerName, blob, comp, - snapshot, timeout, range, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, ifTags, this.client.getVersion(), requestId, marker, maxresults, accept, context)); + return FluxUtil + .withContext(context -> service.getPageRanges(this.client.getUrl(), containerName, blob, comp, snapshot, + timeout, range, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, + ifTags, this.client.getVersion(), requestId, marker, maxresults, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Get Page Ranges operation returns the list of valid page ranges for a page blob, version or snapshot of a * page blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -2930,15 +2989,17 @@ public Mono> getPageRanges = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.getPageRanges(this.client.getUrl(), containerName, blob, comp, snapshot, timeout, range, leaseId, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, marker, maxresults, accept, context); + return service + .getPageRanges(this.client.getUrl(), containerName, blob, comp, snapshot, timeout, range, leaseId, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, marker, maxresults, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Get Page Ranges operation returns the list of valid page ranges for a page blob, version or snapshot of a * page blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -2980,13 +3041,14 @@ public Mono getPageRangesAsync(String containerName, String blob, Stri String ifNoneMatch, String ifTags, String requestId, String marker, Integer maxresults) { return getPageRangesWithResponseAsync(containerName, blob, snapshot, timeout, range, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, marker, maxresults) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * The Get Page Ranges operation returns the list of valid page ranges for a page blob, version or snapshot of a * page blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -3029,13 +3091,14 @@ public Mono getPageRangesAsync(String containerName, String blob, Stri String ifNoneMatch, String ifTags, String requestId, String marker, Integer maxresults, Context context) { return getPageRangesWithResponseAsync(containerName, blob, snapshot, timeout, range, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, marker, maxresults, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * The Get Page Ranges operation returns the list of valid page ranges for a page blob, version or snapshot of a * page blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -3082,15 +3145,17 @@ public Mono> getPageRangesNoCustomHeadersWithResponseAsync(St = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.getPageRangesNoCustomHeaders(this.client.getUrl(), containerName, - blob, comp, snapshot, timeout, range, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, marker, maxresults, accept, context)); + return FluxUtil + .withContext(context -> service.getPageRangesNoCustomHeaders(this.client.getUrl(), containerName, blob, + comp, snapshot, timeout, range, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, + ifNoneMatch, ifTags, this.client.getVersion(), requestId, marker, maxresults, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Get Page Ranges operation returns the list of valid page ranges for a page blob, version or snapshot of a * page blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -3138,15 +3203,17 @@ public Mono> getPageRangesNoCustomHeadersWithResponseAsync(St = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.getPageRangesNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, snapshot, timeout, - range, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, marker, maxresults, accept, context); + return service + .getPageRangesNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, snapshot, timeout, range, + leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, marker, maxresults, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that were * changed between target blob and previous snapshot or version. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -3202,16 +3269,18 @@ public Mono> getPageRa = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.getPageRangesDiff(this.client.getUrl(), containerName, blob, - comp, snapshot, timeout, prevsnapshot, prevSnapshotUrl, range, leaseId, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, marker, - maxresults, accept, context)); + return FluxUtil + .withContext(context -> service.getPageRangesDiff(this.client.getUrl(), containerName, blob, comp, snapshot, + timeout, prevsnapshot, prevSnapshotUrl, range, leaseId, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, marker, + maxresults, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that were * changed between target blob and previous snapshot or version. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -3268,15 +3337,17 @@ public Mono> getPageRa = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.getPageRangesDiff(this.client.getUrl(), containerName, blob, comp, snapshot, timeout, - prevsnapshot, prevSnapshotUrl, range, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, marker, maxresults, accept, context); + return service + .getPageRangesDiff(this.client.getUrl(), containerName, blob, comp, snapshot, timeout, prevsnapshot, + prevSnapshotUrl, range, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, + ifNoneMatch, ifTags, this.client.getVersion(), requestId, marker, maxresults, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that were * changed between target blob and previous snapshot or version. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -3327,13 +3398,14 @@ public Mono getPageRangesDiffAsync(String containerName, String blob, String marker, Integer maxresults) { return getPageRangesDiffWithResponseAsync(containerName, blob, snapshot, timeout, prevsnapshot, prevSnapshotUrl, range, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, marker, - maxresults).flatMap(res -> Mono.justOrEmpty(res.getValue())); + maxresults).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * [Update] The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that were * changed between target blob and previous snapshot or version. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -3385,13 +3457,14 @@ public Mono getPageRangesDiffAsync(String containerName, String blob, String marker, Integer maxresults, Context context) { return getPageRangesDiffWithResponseAsync(containerName, blob, snapshot, timeout, prevsnapshot, prevSnapshotUrl, range, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, marker, - maxresults, context).flatMap(res -> Mono.justOrEmpty(res.getValue())); + maxresults, context).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * [Update] The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that were * changed between target blob and previous snapshot or version. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -3446,16 +3519,18 @@ public Mono> getPageRangesDiffNoCustomHeadersWithResponseAsyn = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.getPageRangesDiffNoCustomHeaders(this.client.getUrl(), - containerName, blob, comp, snapshot, timeout, prevsnapshot, prevSnapshotUrl, range, leaseId, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, marker, maxresults, accept, context)); + return FluxUtil + .withContext(context -> service.getPageRangesDiffNoCustomHeaders(this.client.getUrl(), containerName, blob, + comp, snapshot, timeout, prevsnapshot, prevSnapshotUrl, range, leaseId, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, marker, + maxresults, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * [Update] The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that were * changed between target blob and previous snapshot or version. - * + * * @param containerName The container name. * @param blob The blob name. * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob @@ -3511,15 +3586,16 @@ public Mono> getPageRangesDiffNoCustomHeadersWithResponseAsyn = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.getPageRangesDiffNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, snapshot, - timeout, prevsnapshot, prevSnapshotUrl, range, leaseId, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, marker, - maxresults, accept, context); + return service + .getPageRangesDiffNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, snapshot, timeout, + prevsnapshot, prevSnapshotUrl, range, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, + ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, marker, maxresults, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Resize the Blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The page blob size @@ -3575,15 +3651,17 @@ public Mono> resizeWithResponseAsync( = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.resize(this.client.getUrl(), containerName, blob, comp, timeout, - leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, blobContentLength, this.client.getVersion(), - requestId, accept, context)); + return FluxUtil + .withContext(context -> service.resize(this.client.getUrl(), containerName, blob, comp, timeout, leaseId, + encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, blobContentLength, this.client.getVersion(), + requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Resize the Blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The page blob size @@ -3640,15 +3718,17 @@ public Mono> resizeWithResponseAsync( = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.resize(this.client.getUrl(), containerName, blob, comp, timeout, leaseId, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, blobContentLength, this.client.getVersion(), - requestId, accept, context); + return service + .resize(this.client.getUrl(), containerName, blob, comp, timeout, leaseId, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, blobContentLength, this.client.getVersion(), + requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Resize the Blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The page blob size @@ -3679,12 +3759,13 @@ public Mono resizeAsync(String containerName, String blob, long blobConten String ifNoneMatch, String ifTags, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { return resizeWithResponseAsync(containerName, blob, blobContentLength, timeout, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, cpkInfo, encryptionScopeParam) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * Resize the Blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The page blob size @@ -3717,12 +3798,13 @@ public Mono resizeAsync(String containerName, String blob, long blobConten Context context) { return resizeWithResponseAsync(containerName, blob, blobContentLength, timeout, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, cpkInfo, encryptionScopeParam, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * Resize the Blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The page blob size @@ -3778,15 +3860,17 @@ public Mono> resizeNoCustomHeadersWithResponseAsync(String contai = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.resizeNoCustomHeaders(this.client.getUrl(), containerName, blob, - comp, timeout, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, blobContentLength, - this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.resizeNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, + timeout, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, blobContentLength, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Resize the Blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The page blob size @@ -3843,15 +3927,17 @@ public Mono> resizeNoCustomHeadersWithResponseAsync(String contai = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.resizeNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, leaseId, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, blobContentLength, this.client.getVersion(), - requestId, accept, context); + return service + .resizeNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, leaseId, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, blobContentLength, this.client.getVersion(), + requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Update the sequence number of the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param sequenceNumberAction Required if the x-ms-blob-sequence-number header is set for the request. This @@ -3888,14 +3974,16 @@ public Mono> updateSequ = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.updateSequenceNumber(this.client.getUrl(), containerName, blob, - comp, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - sequenceNumberAction, blobSequenceNumber, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.updateSequenceNumber(this.client.getUrl(), containerName, blob, comp, + timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + sequenceNumberAction, blobSequenceNumber, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Update the sequence number of the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param sequenceNumberAction Required if the x-ms-blob-sequence-number header is set for the request. This @@ -3933,14 +4021,16 @@ public Mono> updateSequ = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.updateSequenceNumber(this.client.getUrl(), containerName, blob, comp, timeout, leaseId, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, sequenceNumberAction, - blobSequenceNumber, this.client.getVersion(), requestId, accept, context); + return service + .updateSequenceNumber(this.client.getUrl(), containerName, blob, comp, timeout, leaseId, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + sequenceNumberAction, blobSequenceNumber, this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Update the sequence number of the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param sequenceNumberAction Required if the x-ms-blob-sequence-number header is set for the request. This @@ -3973,12 +4063,13 @@ public Mono updateSequenceNumberAsync(String containerName, String blob, String requestId) { return updateSequenceNumberWithResponseAsync(containerName, blob, sequenceNumberAction, timeout, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, blobSequenceNumber, requestId) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * Update the sequence number of the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param sequenceNumberAction Required if the x-ms-blob-sequence-number header is set for the request. This @@ -4012,12 +4103,13 @@ public Mono updateSequenceNumberAsync(String containerName, String blob, String requestId, Context context) { return updateSequenceNumberWithResponseAsync(containerName, blob, sequenceNumberAction, timeout, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, blobSequenceNumber, requestId, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * Update the sequence number of the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param sequenceNumberAction Required if the x-ms-blob-sequence-number header is set for the request. This @@ -4054,15 +4146,17 @@ public Mono> updateSequenceNumberNoCustomHeadersWithResponseAsync = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext( - context -> service.updateSequenceNumberNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, - timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - sequenceNumberAction, blobSequenceNumber, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.updateSequenceNumberNoCustomHeaders(this.client.getUrl(), containerName, + blob, comp, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, + ifNoneMatch, ifTags, sequenceNumberAction, blobSequenceNumber, this.client.getVersion(), requestId, + accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Update the sequence number of the blob. - * + * * @param containerName The container name. * @param blob The blob name. * @param sequenceNumberAction Required if the x-ms-blob-sequence-number header is set for the request. This @@ -4100,9 +4194,11 @@ public Mono> updateSequenceNumberNoCustomHeadersWithResponseAsync = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.updateSequenceNumberNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, - leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - sequenceNumberAction, blobSequenceNumber, this.client.getVersion(), requestId, accept, context); + return service + .updateSequenceNumberNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, leaseId, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + sequenceNumberAction, blobSequenceNumber, this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -4110,7 +4206,7 @@ public Mono> updateSequenceNumberNoCustomHeadersWithResponseAsync * is copied such that only the differential changes between the previously copied snapshot are transferred to the * destination. The copied snapshots are complete copies of the original snapshot and can be read or copied from as * usual. This API is supported since REST version 2016-05-31. - * + * * @param containerName The container name. * @param blob The blob name. * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in @@ -4143,9 +4239,11 @@ public Mono> copyIncremental = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.copyIncremental(this.client.getUrl(), containerName, blob, comp, - timeout, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, copySource, - this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.copyIncremental(this.client.getUrl(), containerName, blob, comp, timeout, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, copySource, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -4153,7 +4251,7 @@ public Mono> copyIncremental * is copied such that only the differential changes between the previously copied snapshot are transferred to the * destination. The copied snapshots are complete copies of the original snapshot and can be read or copied from as * usual. This API is supported since REST version 2016-05-31. - * + * * @param containerName The container name. * @param blob The blob name. * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in @@ -4188,9 +4286,11 @@ public Mono> copyIncremental = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.copyIncremental(this.client.getUrl(), containerName, blob, comp, timeout, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, copySource, - this.client.getVersion(), requestId, accept, context); + return service + .copyIncremental(this.client.getUrl(), containerName, blob, comp, timeout, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, copySource, this.client.getVersion(), + requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -4198,7 +4298,7 @@ public Mono> copyIncremental * is copied such that only the differential changes between the previously copied snapshot are transferred to the * destination. The copied snapshots are complete copies of the original snapshot and can be read or copied from as * usual. This API is supported since REST version 2016-05-31. - * + * * @param containerName The container name. * @param blob The blob name. * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in @@ -4226,7 +4326,9 @@ public Mono copyIncrementalAsync(String containerName, String blob, String OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId) { return copyIncrementalWithResponseAsync(containerName, blob, copySource, timeout, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId).flatMap(ignored -> Mono.empty()); + ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** @@ -4234,7 +4336,7 @@ public Mono copyIncrementalAsync(String containerName, String blob, String * is copied such that only the differential changes between the previously copied snapshot are transferred to the * destination. The copied snapshots are complete copies of the original snapshot and can be read or copied from as * usual. This API is supported since REST version 2016-05-31. - * + * * @param containerName The container name. * @param blob The blob name. * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in @@ -4263,7 +4365,9 @@ public Mono copyIncrementalAsync(String containerName, String blob, String OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, Context context) { return copyIncrementalWithResponseAsync(containerName, blob, copySource, timeout, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, context).flatMap(ignored -> Mono.empty()); + ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** @@ -4271,7 +4375,7 @@ public Mono copyIncrementalAsync(String containerName, String blob, String * is copied such that only the differential changes between the previously copied snapshot are transferred to the * destination. The copied snapshots are complete copies of the original snapshot and can be read or copied from as * usual. This API is supported since REST version 2016-05-31. - * + * * @param containerName The container name. * @param blob The blob name. * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in @@ -4304,9 +4408,11 @@ public Mono> copyIncrementalNoCustomHeadersWithResponseAsync(Stri = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.copyIncrementalNoCustomHeaders(this.client.getUrl(), - containerName, blob, comp, timeout, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, ifTags, copySource, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.copyIncrementalNoCustomHeaders(this.client.getUrl(), containerName, blob, + comp, timeout, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + copySource, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -4314,7 +4420,7 @@ public Mono> copyIncrementalNoCustomHeadersWithResponseAsync(Stri * is copied such that only the differential changes between the previously copied snapshot are transferred to the * destination. The copied snapshots are complete copies of the original snapshot and can be read or copied from as * usual. This API is supported since REST version 2016-05-31. - * + * * @param containerName The container name. * @param blob The blob name. * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in @@ -4348,8 +4454,10 @@ public Mono> copyIncrementalNoCustomHeadersWithResponseAsync(Stri = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.copyIncrementalNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, copySource, - this.client.getVersion(), requestId, accept, context); + return service + .copyIncrementalNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, copySource, + this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ServicesImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ServicesImpl.java index 470a7da71b0a..c249cabb2bff 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ServicesImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ServicesImpl.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.storage.blob.implementation; import com.azure.core.annotation.BodyParam; @@ -53,11 +52,13 @@ import java.util.stream.Collectors; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import com.azure.storage.blob.implementation.util.ModelHelper; /** * An instance of this class provides access to all the operations defined in Services. */ public final class ServicesImpl { + /** * The proxy service used to perform REST calls. */ @@ -70,7 +71,7 @@ public final class ServicesImpl { /** * Initializes an instance of ServicesImpl. - * + * * @param client the instance of the service client containing this operation class. */ ServicesImpl(AzureBlobStorageImpl client) { @@ -85,6 +86,7 @@ public final class ServicesImpl { @Host("{url}") @ServiceInterface(name = "AzureBlobStorageServ") public interface ServicesService { + @Put("/") @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -270,7 +272,7 @@ Mono> listBlobContainersSegmentNextNoCustomHeade /** * Sets properties for a storage account's Blob service endpoint, including properties for Storage Analytics and * CORS (Cross-Origin Resource Sharing) rules. - * + * * @param blobServiceProperties The StorageService properties. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -288,14 +290,16 @@ Mono> listBlobContainersSegmentNextNoCustomHeade final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.setProperties(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), requestId, blobServiceProperties, accept, context)); + return FluxUtil + .withContext(context -> service.setProperties(this.client.getUrl(), restype, comp, timeout, + this.client.getVersion(), requestId, blobServiceProperties, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Sets properties for a storage account's Blob service endpoint, including properties for Storage Analytics and * CORS (Cross-Origin Resource Sharing) rules. - * + * * @param blobServiceProperties The StorageService properties. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -314,14 +318,16 @@ public Mono> setPropertiesWithR final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return service.setProperties(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), requestId, - blobServiceProperties, accept, context); + return service + .setProperties(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), requestId, + blobServiceProperties, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Sets properties for a storage account's Blob service endpoint, including properties for Storage Analytics and * CORS (Cross-Origin Resource Sharing) rules. - * + * * @param blobServiceProperties The StorageService properties. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -337,13 +343,14 @@ public Mono> setPropertiesWithR public Mono setPropertiesAsync(BlobServiceProperties blobServiceProperties, Integer timeout, String requestId) { return setPropertiesWithResponseAsync(blobServiceProperties, timeout, requestId) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * Sets properties for a storage account's Blob service endpoint, including properties for Storage Analytics and * CORS (Cross-Origin Resource Sharing) rules. - * + * * @param blobServiceProperties The StorageService properties. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -360,13 +367,14 @@ public Mono setPropertiesAsync(BlobServiceProperties blobServiceProperties public Mono setPropertiesAsync(BlobServiceProperties blobServiceProperties, Integer timeout, String requestId, Context context) { return setPropertiesWithResponseAsync(blobServiceProperties, timeout, requestId, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** * Sets properties for a storage account's Blob service endpoint, including properties for Storage Analytics and * CORS (Cross-Origin Resource Sharing) rules. - * + * * @param blobServiceProperties The StorageService properties. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -384,14 +392,16 @@ public Mono> setPropertiesNoCustomHeadersWithResponseAsync( final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.setPropertiesNoCustomHeaders(this.client.getUrl(), restype, comp, - timeout, this.client.getVersion(), requestId, blobServiceProperties, accept, context)); + return FluxUtil + .withContext(context -> service.setPropertiesNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, + this.client.getVersion(), requestId, blobServiceProperties, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Sets properties for a storage account's Blob service endpoint, including properties for Storage Analytics and * CORS (Cross-Origin Resource Sharing) rules. - * + * * @param blobServiceProperties The StorageService properties. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -410,14 +420,16 @@ public Mono> setPropertiesNoCustomHeadersWithResponseAsync( final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return service.setPropertiesNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), requestId, blobServiceProperties, accept, context); + return service + .setPropertiesNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), + requestId, blobServiceProperties, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * gets the properties of a storage account's Blob service, including properties for Storage Analytics and CORS * (Cross-Origin Resource Sharing) rules. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -435,14 +447,16 @@ public Mono> setPropertiesNoCustomHeadersWithResponseAsync( final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getProperties(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.getProperties(this.client.getUrl(), restype, comp, timeout, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * gets the properties of a storage account's Blob service, including properties for Storage Analytics and CORS * (Cross-Origin Resource Sharing) rules. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -461,14 +475,16 @@ public Mono> setPropertiesNoCustomHeadersWithResponseAsync( final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return service.getProperties(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), requestId, - accept, context); + return service + .getProperties(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), requestId, accept, + context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * gets the properties of a storage account's Blob service, including properties for Storage Analytics and CORS * (Cross-Origin Resource Sharing) rules. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -482,13 +498,15 @@ public Mono> setPropertiesNoCustomHeadersWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getPropertiesAsync(Integer timeout, String requestId) { - return getPropertiesWithResponseAsync(timeout, requestId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + return getPropertiesWithResponseAsync(timeout, requestId) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * gets the properties of a storage account's Blob service, including properties for Storage Analytics and CORS * (Cross-Origin Resource Sharing) rules. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -504,13 +522,14 @@ public Mono getPropertiesAsync(Integer timeout, String re @ServiceMethod(returns = ReturnType.SINGLE) public Mono getPropertiesAsync(Integer timeout, String requestId, Context context) { return getPropertiesWithResponseAsync(timeout, requestId, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * gets the properties of a storage account's Blob service, including properties for Storage Analytics and CORS * (Cross-Origin Resource Sharing) rules. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -528,14 +547,16 @@ public Mono> getPropertiesNoCustomHeadersWithRes final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getPropertiesNoCustomHeaders(this.client.getUrl(), restype, comp, - timeout, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.getPropertiesNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * gets the properties of a storage account's Blob service, including properties for Storage Analytics and CORS * (Cross-Origin Resource Sharing) rules. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -554,14 +575,16 @@ public Mono> getPropertiesNoCustomHeadersWithRes final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return service.getPropertiesNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), requestId, accept, context); + return service + .getPropertiesNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), + requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Retrieves statistics related to replication for the Blob service. It is only available on the secondary location * endpoint when read-access geo-redundant replication is enabled for the storage account. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -578,14 +601,16 @@ public Mono> getPropertiesNoCustomHeadersWithRes final String restype = "service"; final String comp = "stats"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getStatistics(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.getStatistics(this.client.getUrl(), restype, comp, timeout, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Retrieves statistics related to replication for the Blob service. It is only available on the secondary location * endpoint when read-access geo-redundant replication is enabled for the storage account. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -603,14 +628,16 @@ public Mono> getPropertiesNoCustomHeadersWithRes final String restype = "service"; final String comp = "stats"; final String accept = "application/xml"; - return service.getStatistics(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), requestId, - accept, context); + return service + .getStatistics(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), requestId, accept, + context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Retrieves statistics related to replication for the Blob service. It is only available on the secondary location * endpoint when read-access geo-redundant replication is enabled for the storage account. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -623,13 +650,15 @@ public Mono> getPropertiesNoCustomHeadersWithRes */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getStatisticsAsync(Integer timeout, String requestId) { - return getStatisticsWithResponseAsync(timeout, requestId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + return getStatisticsWithResponseAsync(timeout, requestId) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Retrieves statistics related to replication for the Blob service. It is only available on the secondary location * endpoint when read-access geo-redundant replication is enabled for the storage account. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -644,13 +673,14 @@ public Mono getStatisticsAsync(Integer timeout, String re @ServiceMethod(returns = ReturnType.SINGLE) public Mono getStatisticsAsync(Integer timeout, String requestId, Context context) { return getStatisticsWithResponseAsync(timeout, requestId, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Retrieves statistics related to replication for the Blob service. It is only available on the secondary location * endpoint when read-access geo-redundant replication is enabled for the storage account. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -667,14 +697,16 @@ public Mono> getStatisticsNoCustomHeadersWithRes final String restype = "service"; final String comp = "stats"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getStatisticsNoCustomHeaders(this.client.getUrl(), restype, comp, - timeout, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.getStatisticsNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Retrieves statistics related to replication for the Blob service. It is only available on the secondary location * endpoint when read-access geo-redundant replication is enabled for the storage account. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -692,13 +724,15 @@ public Mono> getStatisticsNoCustomHeadersWithRes final String restype = "service"; final String comp = "stats"; final String accept = "application/xml"; - return service.getStatisticsNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), requestId, accept, context); + return service + .getStatisticsNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), + requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The List Containers Segment operation returns a list of the containers under the specified account. - * + * * @param prefix Filters the results to return only containers whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list of containers to be returned with the next * listing operation. The operation returns the NextMarker value within the response body if the listing operation @@ -737,13 +771,14 @@ public Mono> listBlobContainersSegmentSinglePag .withContext(context -> service.listBlobContainersSegment(this.client.getUrl(), comp, prefix, marker, maxresults, listBlobContainersIncludeTypeConverted, timeout, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().getBlobContainerItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders())); } /** * The List Containers Segment operation returns a list of the containers under the specified account. - * + * * @param prefix Filters the results to return only containers whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list of containers to be returned with the next * listing operation. The operation returns the NextMarker value within the response body if the listing operation @@ -782,13 +817,14 @@ public Mono> listBlobContainersSegmentSinglePag return service .listBlobContainersSegment(this.client.getUrl(), comp, prefix, marker, maxresults, listBlobContainersIncludeTypeConverted, timeout, this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().getBlobContainerItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders())); } /** * The List Containers Segment operation returns a list of the containers under the specified account. - * + * * @param prefix Filters the results to return only containers whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list of containers to be returned with the next * listing operation. The operation returns the NextMarker value within the response body if the listing operation @@ -822,7 +858,7 @@ public PagedFlux listBlobContainersSegmentAsync(String prefix /** * The List Containers Segment operation returns a list of the containers under the specified account. - * + * * @param prefix Filters the results to return only containers whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list of containers to be returned with the next * listing operation. The operation returns the NextMarker value within the response body if the listing operation @@ -859,7 +895,7 @@ public PagedFlux listBlobContainersSegmentAsync(String prefix /** * The List Containers Segment operation returns a list of the containers under the specified account. - * + * * @param prefix Filters the results to return only containers whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list of containers to be returned with the next * listing operation. The operation returns the NextMarker value within the response body if the listing operation @@ -898,13 +934,14 @@ public Mono> listBlobContainersSegmentNoCustomH .withContext(context -> service.listBlobContainersSegmentNoCustomHeaders(this.client.getUrl(), comp, prefix, marker, maxresults, listBlobContainersIncludeTypeConverted, timeout, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().getBlobContainerItems(), res.getValue().getNextMarker(), null)); } /** * The List Containers Segment operation returns a list of the containers under the specified account. - * + * * @param prefix Filters the results to return only containers whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list of containers to be returned with the next * listing operation. The operation returns the NextMarker value within the response body if the listing operation @@ -943,13 +980,14 @@ public Mono> listBlobContainersSegmentNoCustomH return service .listBlobContainersSegmentNoCustomHeaders(this.client.getUrl(), comp, prefix, marker, maxresults, listBlobContainersIncludeTypeConverted, timeout, this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().getBlobContainerItems(), res.getValue().getNextMarker(), null)); } /** * The List Containers Segment operation returns a list of the containers under the specified account. - * + * * @param prefix Filters the results to return only containers whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list of containers to be returned with the next * listing operation. The operation returns the NextMarker value within the response body if the listing operation @@ -985,7 +1023,7 @@ public PagedFlux listBlobContainersSegmentNoCustomHeadersAsyn /** * The List Containers Segment operation returns a list of the containers under the specified account. - * + * * @param prefix Filters the results to return only containers whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list of containers to be returned with the next * listing operation. The operation returns the NextMarker value within the response body if the listing operation @@ -1023,7 +1061,7 @@ public PagedFlux listBlobContainersSegmentNoCustomHeadersAsyn /** * Retrieves a user delegation key for the Blob service. This is only a valid operation when using bearer token * authentication. - * + * * @param keyInfo Key information. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1041,14 +1079,16 @@ public PagedFlux listBlobContainersSegmentNoCustomHeadersAsyn final String restype = "service"; final String comp = "userdelegationkey"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getUserDelegationKey(this.client.getUrl(), restype, comp, - timeout, this.client.getVersion(), requestId, keyInfo, accept, context)); + return FluxUtil + .withContext(context -> service.getUserDelegationKey(this.client.getUrl(), restype, comp, timeout, + this.client.getVersion(), requestId, keyInfo, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Retrieves a user delegation key for the Blob service. This is only a valid operation when using bearer token * authentication. - * + * * @param keyInfo Key information. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1067,14 +1107,16 @@ public PagedFlux listBlobContainersSegmentNoCustomHeadersAsyn final String restype = "service"; final String comp = "userdelegationkey"; final String accept = "application/xml"; - return service.getUserDelegationKey(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), - requestId, keyInfo, accept, context); + return service + .getUserDelegationKey(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), requestId, + keyInfo, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Retrieves a user delegation key for the Blob service. This is only a valid operation when using bearer token * authentication. - * + * * @param keyInfo Key information. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1089,13 +1131,14 @@ public PagedFlux listBlobContainersSegmentNoCustomHeadersAsyn @ServiceMethod(returns = ReturnType.SINGLE) public Mono getUserDelegationKeyAsync(KeyInfo keyInfo, Integer timeout, String requestId) { return getUserDelegationKeyWithResponseAsync(keyInfo, timeout, requestId) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Retrieves a user delegation key for the Blob service. This is only a valid operation when using bearer token * authentication. - * + * * @param keyInfo Key information. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1112,13 +1155,14 @@ public Mono getUserDelegationKeyAsync(KeyInfo keyInfo, Intege public Mono getUserDelegationKeyAsync(KeyInfo keyInfo, Integer timeout, String requestId, Context context) { return getUserDelegationKeyWithResponseAsync(keyInfo, timeout, requestId, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Retrieves a user delegation key for the Blob service. This is only a valid operation when using bearer token * authentication. - * + * * @param keyInfo Key information. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1136,14 +1180,16 @@ public Mono> getUserDelegationKeyNoCustomHeadersWith final String restype = "service"; final String comp = "userdelegationkey"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getUserDelegationKeyNoCustomHeaders(this.client.getUrl(), - restype, comp, timeout, this.client.getVersion(), requestId, keyInfo, accept, context)); + return FluxUtil + .withContext(context -> service.getUserDelegationKeyNoCustomHeaders(this.client.getUrl(), restype, comp, + timeout, this.client.getVersion(), requestId, keyInfo, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Retrieves a user delegation key for the Blob service. This is only a valid operation when using bearer token * authentication. - * + * * @param keyInfo Key information. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -1162,13 +1208,15 @@ public Mono> getUserDelegationKeyNoCustomHeadersWith final String restype = "service"; final String comp = "userdelegationkey"; final String accept = "application/xml"; - return service.getUserDelegationKeyNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), requestId, keyInfo, accept, context); + return service + .getUserDelegationKeyNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), + requestId, keyInfo, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Returns the sku name and account kind. - * + * * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link ResponseBase} on successful completion of {@link Mono}. @@ -1178,13 +1226,15 @@ public Mono> getAccountInfoWit final String restype = "account"; final String comp = "properties"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getAccountInfo(this.client.getUrl(), restype, comp, - this.client.getVersion(), accept, context)); + return FluxUtil + .withContext(context -> service.getAccountInfo(this.client.getUrl(), restype, comp, + this.client.getVersion(), accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Returns the sku name and account kind. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. @@ -1196,24 +1246,27 @@ public Mono> getAccountInfoWit final String restype = "account"; final String comp = "properties"; final String accept = "application/xml"; - return service.getAccountInfo(this.client.getUrl(), restype, comp, this.client.getVersion(), accept, context); + return service.getAccountInfo(this.client.getUrl(), restype, comp, this.client.getVersion(), accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Returns the sku name and account kind. - * + * * @throws BlobStorageExceptionInternal 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) public Mono getAccountInfoAsync() { - return getAccountInfoWithResponseAsync().flatMap(ignored -> Mono.empty()); + return getAccountInfoWithResponseAsync() + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Returns the sku name and account kind. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. @@ -1222,12 +1275,14 @@ public Mono getAccountInfoAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getAccountInfoAsync(Context context) { - return getAccountInfoWithResponseAsync(context).flatMap(ignored -> Mono.empty()); + return getAccountInfoWithResponseAsync(context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Returns the sku name and account kind. - * + * * @throws BlobStorageExceptionInternal thrown if 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}. @@ -1237,13 +1292,15 @@ public Mono> getAccountInfoNoCustomHeadersWithResponseAsync() { final String restype = "account"; final String comp = "properties"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getAccountInfoNoCustomHeaders(this.client.getUrl(), restype, - comp, this.client.getVersion(), accept, context)); + return FluxUtil + .withContext(context -> service.getAccountInfoNoCustomHeaders(this.client.getUrl(), restype, comp, + this.client.getVersion(), accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Returns the sku name and account kind. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. @@ -1255,13 +1312,15 @@ public Mono> getAccountInfoNoCustomHeadersWithResponseAsync(Conte final String restype = "account"; final String comp = "properties"; final String accept = "application/xml"; - return service.getAccountInfoNoCustomHeaders(this.client.getUrl(), restype, comp, this.client.getVersion(), - accept, context); + return service + .getAccountInfoNoCustomHeaders(this.client.getUrl(), restype, comp, this.client.getVersion(), accept, + context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * + * * @param contentLength The length of the request. * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch boundary. * Example header value: multipart/mixed; boundary=batch_<GUID>. @@ -1281,13 +1340,15 @@ public Mono>> submitBa long contentLength, String multipartContentType, Flux body, Integer timeout, String requestId) { final String comp = "batch"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.submitBatch(this.client.getUrl(), comp, contentLength, - multipartContentType, timeout, this.client.getVersion(), requestId, body, accept, context)); + return FluxUtil + .withContext(context -> service.submitBatch(this.client.getUrl(), comp, contentLength, multipartContentType, + timeout, this.client.getVersion(), requestId, body, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * + * * @param contentLength The length of the request. * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch boundary. * Example header value: multipart/mixed; boundary=batch_<GUID>. @@ -1309,13 +1370,15 @@ public Mono>> submitBa Context context) { final String comp = "batch"; final String accept = "application/xml"; - return service.submitBatch(this.client.getUrl(), comp, contentLength, multipartContentType, timeout, - this.client.getVersion(), requestId, body, accept, context); + return service + .submitBatch(this.client.getUrl(), comp, contentLength, multipartContentType, timeout, + this.client.getVersion(), requestId, body, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * + * * @param contentLength The length of the request. * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch boundary. * Example header value: multipart/mixed; boundary=batch_<GUID>. @@ -1334,12 +1397,13 @@ public Mono>> submitBa public Flux submitBatchAsync(long contentLength, String multipartContentType, Flux body, Integer timeout, String requestId) { return submitBatchWithResponseAsync(contentLength, multipartContentType, body, timeout, requestId) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMapMany(fluxByteBufferResponse -> fluxByteBufferResponse.getValue()); } /** * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * + * * @param contentLength The length of the request. * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch boundary. * Example header value: multipart/mixed; boundary=batch_<GUID>. @@ -1359,12 +1423,13 @@ public Flux submitBatchAsync(long contentLength, String multipartCon public Flux submitBatchAsync(long contentLength, String multipartContentType, Flux body, Integer timeout, String requestId, Context context) { return submitBatchWithResponseAsync(contentLength, multipartContentType, body, timeout, requestId, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMapMany(fluxByteBufferResponse -> fluxByteBufferResponse.getValue()); } /** * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * + * * @param contentLength The length of the request. * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch boundary. * Example header value: multipart/mixed; boundary=batch_<GUID>. @@ -1384,13 +1449,15 @@ public Mono submitBatchNoCustomHeadersWithResponseAsync(long con String multipartContentType, Flux body, Integer timeout, String requestId) { final String comp = "batch"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.submitBatchNoCustomHeaders(this.client.getUrl(), comp, - contentLength, multipartContentType, timeout, this.client.getVersion(), requestId, body, accept, context)); + return FluxUtil + .withContext(context -> service.submitBatchNoCustomHeaders(this.client.getUrl(), comp, contentLength, + multipartContentType, timeout, this.client.getVersion(), requestId, body, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * + * * @param contentLength The length of the request. * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch boundary. * Example header value: multipart/mixed; boundary=batch_<GUID>. @@ -1411,13 +1478,15 @@ public Mono submitBatchNoCustomHeadersWithResponseAsync(long con String multipartContentType, Flux body, Integer timeout, String requestId, Context context) { final String comp = "batch"; final String accept = "application/xml"; - return service.submitBatchNoCustomHeaders(this.client.getUrl(), comp, contentLength, multipartContentType, - timeout, this.client.getVersion(), requestId, body, accept, context); + return service + .submitBatchNoCustomHeaders(this.client.getUrl(), comp, contentLength, multipartContentType, timeout, + this.client.getVersion(), requestId, body, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * + * * @param contentLength The length of the request. * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch boundary. * Example header value: multipart/mixed; boundary=batch_<GUID>. @@ -1437,13 +1506,15 @@ public Mono>> submitBa long contentLength, String multipartContentType, BinaryData body, Integer timeout, String requestId) { final String comp = "batch"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.submitBatch(this.client.getUrl(), comp, contentLength, - multipartContentType, timeout, this.client.getVersion(), requestId, body, accept, context)); + return FluxUtil + .withContext(context -> service.submitBatch(this.client.getUrl(), comp, contentLength, multipartContentType, + timeout, this.client.getVersion(), requestId, body, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * + * * @param contentLength The length of the request. * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch boundary. * Example header value: multipart/mixed; boundary=batch_<GUID>. @@ -1465,13 +1536,15 @@ public Mono>> submitBa Context context) { final String comp = "batch"; final String accept = "application/xml"; - return service.submitBatch(this.client.getUrl(), comp, contentLength, multipartContentType, timeout, - this.client.getVersion(), requestId, body, accept, context); + return service + .submitBatch(this.client.getUrl(), comp, contentLength, multipartContentType, timeout, + this.client.getVersion(), requestId, body, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * + * * @param contentLength The length of the request. * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch boundary. * Example header value: multipart/mixed; boundary=batch_<GUID>. @@ -1490,12 +1563,13 @@ public Mono>> submitBa public Flux submitBatchAsync(long contentLength, String multipartContentType, BinaryData body, Integer timeout, String requestId) { return submitBatchWithResponseAsync(contentLength, multipartContentType, body, timeout, requestId) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMapMany(fluxByteBufferResponse -> fluxByteBufferResponse.getValue()); } /** * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * + * * @param contentLength The length of the request. * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch boundary. * Example header value: multipart/mixed; boundary=batch_<GUID>. @@ -1515,12 +1589,13 @@ public Flux submitBatchAsync(long contentLength, String multipartCon public Flux submitBatchAsync(long contentLength, String multipartContentType, BinaryData body, Integer timeout, String requestId, Context context) { return submitBatchWithResponseAsync(contentLength, multipartContentType, body, timeout, requestId, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMapMany(fluxByteBufferResponse -> fluxByteBufferResponse.getValue()); } /** * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * + * * @param contentLength The length of the request. * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch boundary. * Example header value: multipart/mixed; boundary=batch_<GUID>. @@ -1540,13 +1615,15 @@ public Mono submitBatchNoCustomHeadersWithResponseAsync(long con String multipartContentType, BinaryData body, Integer timeout, String requestId) { final String comp = "batch"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.submitBatchNoCustomHeaders(this.client.getUrl(), comp, - contentLength, multipartContentType, timeout, this.client.getVersion(), requestId, body, accept, context)); + return FluxUtil + .withContext(context -> service.submitBatchNoCustomHeaders(this.client.getUrl(), comp, contentLength, + multipartContentType, timeout, this.client.getVersion(), requestId, body, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * + * * @param contentLength The length of the request. * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch boundary. * Example header value: multipart/mixed; boundary=batch_<GUID>. @@ -1567,15 +1644,17 @@ public Mono submitBatchNoCustomHeadersWithResponseAsync(long con String multipartContentType, BinaryData body, Integer timeout, String requestId, Context context) { final String comp = "batch"; final String accept = "application/xml"; - return service.submitBatchNoCustomHeaders(this.client.getUrl(), comp, contentLength, multipartContentType, - timeout, this.client.getVersion(), requestId, body, accept, context); + return service + .submitBatchNoCustomHeaders(this.client.getUrl(), comp, contentLength, multipartContentType, timeout, + this.client.getVersion(), requestId, body, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Filter Blobs operation enables callers to list blobs across all containers whose tags match a given search * expression. Filter blobs searches across all containers within a storage account but can be scoped within the * expression to a single container. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -1610,15 +1689,17 @@ public Mono> filterB : include.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return FluxUtil.withContext(context -> service.filterBlobs(this.client.getUrl(), comp, timeout, - this.client.getVersion(), requestId, where, marker, maxresults, includeConverted, accept, context)); + return FluxUtil + .withContext(context -> service.filterBlobs(this.client.getUrl(), comp, timeout, this.client.getVersion(), + requestId, where, marker, maxresults, includeConverted, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Filter Blobs operation enables callers to list blobs across all containers whose tags match a given search * expression. Filter blobs searches across all containers within a storage account but can be scoped within the * expression to a single container. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -1654,15 +1735,17 @@ public Mono> filterB : include.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return service.filterBlobs(this.client.getUrl(), comp, timeout, this.client.getVersion(), requestId, where, - marker, maxresults, includeConverted, accept, context); + return service + .filterBlobs(this.client.getUrl(), comp, timeout, this.client.getVersion(), requestId, where, marker, + maxresults, includeConverted, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Filter Blobs operation enables callers to list blobs across all containers whose tags match a given search * expression. Filter blobs searches across all containers within a storage account but can be scoped within the * expression to a single container. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -1689,6 +1772,7 @@ public Mono> filterB public Mono filterBlobsAsync(Integer timeout, String requestId, String where, String marker, Integer maxresults, List include) { return filterBlobsWithResponseAsync(timeout, requestId, where, marker, maxresults, include) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -1696,7 +1780,7 @@ public Mono filterBlobsAsync(Integer timeout, String requestI * The Filter Blobs operation enables callers to list blobs across all containers whose tags match a given search * expression. Filter blobs searches across all containers within a storage account but can be scoped within the * expression to a single container. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -1724,6 +1808,7 @@ public Mono filterBlobsAsync(Integer timeout, String requestI public Mono filterBlobsAsync(Integer timeout, String requestId, String where, String marker, Integer maxresults, List include, Context context) { return filterBlobsWithResponseAsync(timeout, requestId, where, marker, maxresults, include, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -1731,7 +1816,7 @@ public Mono filterBlobsAsync(Integer timeout, String requestI * The Filter Blobs operation enables callers to list blobs across all containers whose tags match a given search * expression. Filter blobs searches across all containers within a storage account but can be scoped within the * expression to a single container. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -1765,15 +1850,17 @@ public Mono> filterBlobsNoCustomHeadersWithResponseA : include.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return FluxUtil.withContext(context -> service.filterBlobsNoCustomHeaders(this.client.getUrl(), comp, timeout, - this.client.getVersion(), requestId, where, marker, maxresults, includeConverted, accept, context)); + return FluxUtil + .withContext(context -> service.filterBlobsNoCustomHeaders(this.client.getUrl(), comp, timeout, + this.client.getVersion(), requestId, where, marker, maxresults, includeConverted, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * The Filter Blobs operation enables callers to list blobs across all containers whose tags match a given search * expression. Filter blobs searches across all containers within a storage account but can be scoped within the * expression to a single container. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -1809,15 +1896,17 @@ public Mono> filterBlobsNoCustomHeadersWithResponseA : include.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return service.filterBlobsNoCustomHeaders(this.client.getUrl(), comp, timeout, this.client.getVersion(), - requestId, where, marker, maxresults, includeConverted, accept, context); + return service + .filterBlobsNoCustomHeaders(this.client.getUrl(), comp, timeout, this.client.getVersion(), requestId, where, + marker, maxresults, includeConverted, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - * + * * The nextLink parameter. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. @@ -1833,15 +1922,16 @@ public Mono> listBlobContainersSegmentNextSingl return FluxUtil .withContext(context -> service.listBlobContainersSegmentNext(nextLink, this.client.getUrl(), this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().getBlobContainerItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - * + * * The nextLink parameter. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. @@ -1858,15 +1948,16 @@ public Mono> listBlobContainersSegmentNextSingl return service .listBlobContainersSegmentNext(nextLink, this.client.getUrl(), this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().getBlobContainerItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - * + * * The nextLink parameter. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. @@ -1882,15 +1973,16 @@ public Mono> listBlobContainersSegmentNextSingl return FluxUtil .withContext(context -> service.listBlobContainersSegmentNextNoCustomHeaders(nextLink, this.client.getUrl(), this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().getBlobContainerItems(), res.getValue().getNextMarker(), null)); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - * + * * The nextLink parameter. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. @@ -1907,6 +1999,7 @@ public Mono> listBlobContainersSegmentNextNoCus return service .listBlobContainersSegmentNextNoCustomHeaders(nextLink, this.client.getUrl(), this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().getBlobContainerItems(), res.getValue().getNextMarker(), null)); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobStorageError.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobStorageError.java index 2b39250728ff..9ae705adf845 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobStorageError.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobStorageError.java @@ -70,7 +70,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { */ public static BlobStorageError fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - // Buffer the next JSON object as ResponseError can take two forms: + // Buffer the next JSON object as BlobStorageError can take two forms: // // - A BlobStorageError object // - A BlobStorageError object wrapped in an "error" node. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/util/ModelHelper.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/util/ModelHelper.java index 79419e3c67d1..1e6d4e950840 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/util/ModelHelper.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/util/ModelHelper.java @@ -479,14 +479,8 @@ public static long getBlobLength(BlobDownloadHeaders headers) { * @param internal The internal exception. * @return The public exception. */ - public static Throwable mapToBlobStorageException(Throwable internal) { - if (internal instanceof BlobStorageExceptionInternal) { - BlobStorageExceptionInternal internalException = (BlobStorageExceptionInternal) internal; - return new BlobStorageException(internalException.getMessage(), internalException.getResponse(), - internalException.getValue()); - } - - return internal; + public static BlobStorageException mapToBlobStorageException(BlobStorageExceptionInternal internal) { + return new BlobStorageException(internal.getMessage(), internal.getResponse(), internal.getValue()); } private ModelHelper() { diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/AppendBlobAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/AppendBlobAsyncClient.java index 21627137d816..c448b13923a4 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/AppendBlobAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/AppendBlobAsyncClient.java @@ -22,7 +22,6 @@ import com.azure.storage.blob.implementation.models.AppendBlobsAppendBlockHeaders; import com.azure.storage.blob.implementation.models.AppendBlobsCreateHeaders; import com.azure.storage.blob.implementation.models.EncryptionScope; -import com.azure.storage.blob.implementation.util.ModelHelper; import com.azure.storage.blob.models.AppendBlobItem; import com.azure.storage.blob.models.AppendBlobRequestConditions; import com.azure.storage.blob.models.BlobHttpHeaders; @@ -32,12 +31,13 @@ import com.azure.storage.blob.models.BlobStorageException; import com.azure.storage.blob.models.CpkInfo; import com.azure.storage.blob.models.CustomerProvidedKey; +import com.azure.storage.blob.options.AppendBlobAppendBlockFromUrlOptions; import com.azure.storage.blob.options.AppendBlobCreateOptions; import com.azure.storage.blob.options.AppendBlobSealOptions; -import com.azure.storage.blob.options.AppendBlobAppendBlockFromUrlOptions; import com.azure.storage.common.implementation.Constants; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; + import java.net.MalformedURLException; import java.net.URL; import java.nio.ByteBuffer; @@ -294,7 +294,6 @@ Mono> createWithResponse(AppendBlobCreateOptions option tagsToString(options.getTags()), immutabilityPolicy.getExpiryTime(), immutabilityPolicy.getPolicyMode(), options.hasLegalHold(), options.getHeaders(), getCustomerProvidedKey(), encryptionScope, context) - .onErrorMap(ModelHelper::mapToBlobStorageException) .map(rb -> { AppendBlobsCreateHeaders hd = rb.getDeserializedHeaders(); AppendBlobItem item = new AppendBlobItem(hd.getETag(), hd.getLastModified(), hd.getContentMD5(), @@ -475,7 +474,6 @@ Mono> appendBlockWithResponse(Flux data, lo appendBlobRequestConditions.getIfMatch(), appendBlobRequestConditions.getIfNoneMatch(), appendBlobRequestConditions.getTagsConditions(), null, getCustomerProvidedKey(), encryptionScope, context) - .onErrorMap(ModelHelper::mapToBlobStorageException) .map(rb -> { AppendBlobsAppendBlockHeaders hd = rb.getDeserializedHeaders(); AppendBlobItem item = new AppendBlobItem(hd.getETag(), hd.getLastModified(), hd.getContentMD5(), @@ -611,7 +609,6 @@ Mono> appendBlockFromUrlWithResponse(AppendBlobAppendBl sourceRequestConditions.getIfUnmodifiedSince(), sourceRequestConditions.getIfMatch(), sourceRequestConditions.getIfNoneMatch(), null, sourceAuth, getCustomerProvidedKey(), encryptionScope, context) - .onErrorMap(ModelHelper::mapToBlobStorageException) .map(rb -> { AppendBlobsAppendBlockFromUrlHeaders hd = rb.getDeserializedHeaders(); AppendBlobItem item = new AppendBlobItem(hd.getETag(), hd.getLastModified(), hd.getContentMD5(), @@ -676,8 +673,7 @@ Mono> sealWithResponse(AppendBlobSealOptions options, Context con return this.azureBlobStorage.getAppendBlobs().sealNoCustomHeadersWithResponseAsync(containerName, blobName, null, null, requestConditions.getLeaseId(), requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), - requestConditions.getIfNoneMatch(), requestConditions.getAppendPosition(), context) - .onErrorMap(ModelHelper::mapToBlobStorageException); + requestConditions.getIfNoneMatch(), requestConditions.getAppendPosition(), context); } /** diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java index 2723d5c1c685..a9d489c13feb 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java @@ -766,7 +766,6 @@ private Mono onStart(String sourceUrl, Map metadat destinationRequestConditions.getTagsConditions(), destinationRequestConditions.getLeaseId(), null, tagsToString(tags), sealBlob, immutabilityPolicy.getExpiryTime(), immutabilityPolicy.getPolicyMode(), legalHold, context)) - .onErrorMap(ModelHelper::mapToBlobStorageException) .map(response -> { final BlobsStartCopyFromURLHeaders headers = response.getDeserializedHeaders(); @@ -897,8 +896,7 @@ public Mono> abortCopyFromUrlWithResponse(String copyId, String l Mono> abortCopyFromUrlWithResponse(String copyId, String leaseId, Context context) { return this.azureBlobStorage.getBlobs().abortCopyFromURLNoCustomHeadersWithResponseAsync( - containerName, blobName, copyId, null, leaseId, null, context) - .onErrorMap(ModelHelper::mapToBlobStorageException); + containerName, blobName, copyId, null, leaseId, null, context); } /** @@ -1038,7 +1036,6 @@ Mono> copyFromUrlWithResponse(BlobCopyFromUrlOptions options, C destRequestConditions.getLeaseId(), null, null, tagsToString(options.getTags()), immutabilityPolicy.getExpiryTime(), immutabilityPolicy.getPolicyMode(), options.hasLegalHold(), sourceAuth, options.getCopySourceTagsMode(), this.encryptionScope, context) - .onErrorMap(ModelHelper::mapToBlobStorageException) .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getXMsCopyId())); } @@ -1335,8 +1332,7 @@ private Mono downloadRange(BlobRange range, BlobRequestCondition versionId, null, range.toHeaderValue(), requestConditions.getLeaseId(), getMD5, null, requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), eTag, requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, - customerProvidedKey, context) - .onErrorMap(ModelHelper::mapToBlobStorageException); + customerProvidedKey, context); } /** @@ -1685,8 +1681,7 @@ Mono> deleteWithResponse(DeleteSnapshotsOptionType deleteBlobSnap snapshot, versionId, null, requestConditions.getLeaseId(), deleteBlobSnapshotOptions, requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), - null, null, context) - .onErrorMap(ModelHelper::mapToBlobStorageException); + null, null, context); } /** @@ -1833,7 +1828,6 @@ Mono> getPropertiesWithResponse(BlobRequestConditions r requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, customerProvidedKey, context) - .onErrorMap(ModelHelper::mapToBlobStorageException) .map(rb -> new SimpleResponse<>(rb, BlobPropertiesConstructorProxy .create(new BlobPropertiesInternalGetProperties(rb.getDeserializedHeaders())))); } @@ -1842,8 +1836,7 @@ Mono> getPropertiesWithResponseNoHeaders(Context context) { context = context == null ? Context.NONE : context; return this.azureBlobStorage.getBlobs().getPropertiesNoCustomHeadersWithResponseAsync(containerName, blobName, - snapshot, versionId, null, null, null, null, null, null, null, null, customerProvidedKey, context) - .onErrorMap(ModelHelper::mapToBlobStorageException); + snapshot, versionId, null, null, null, null, null, null, null, null, customerProvidedKey, context); } /** @@ -1914,8 +1907,7 @@ Mono> setHttpHeadersWithResponse(BlobHttpHeaders headers, BlobReq return this.azureBlobStorage.getBlobs().setHttpHeadersNoCustomHeadersWithResponseAsync(containerName, blobName, null, requestConditions.getLeaseId(), requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), - requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, headers, context) - .onErrorMap(ModelHelper::mapToBlobStorageException); + requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, headers, context); } /** @@ -1984,8 +1976,7 @@ Mono> setMetadataWithResponse(Map metadata, BlobR null, metadata, requestConditions.getLeaseId(), requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, customerProvidedKey, - encryptionScope, context) - .onErrorMap(ModelHelper::mapToBlobStorageException); + encryptionScope, context); } /** @@ -2043,7 +2034,6 @@ Mono>> getTagsWithResponse(BlobGetTagsOptions optio ? new BlobRequestConditions() : options.getRequestConditions(); return this.azureBlobStorage.getBlobs().getTagsWithResponseAsync(containerName, blobName, null, null, snapshot, versionId, requestConditions.getTagsConditions(), requestConditions.getLeaseId(), context) - .onErrorMap(ModelHelper::mapToBlobStorageException) .map(response -> { Map tags = new HashMap<>(); for (BlobTag tag : response.getValue().getBlobTagSet()) { @@ -2122,8 +2112,7 @@ Mono> setTagsWithResponse(BlobSetTagsOptions options, Context con BlobTags t = new BlobTags().setBlobTagSet(tagList); return this.azureBlobStorage.getBlobs().setTagsNoCustomHeadersWithResponseAsync(containerName, blobName, null, versionId, null, null, null, requestConditions.getTagsConditions(), requestConditions.getLeaseId(), t, - context) - .onErrorMap(ModelHelper::mapToBlobStorageException); + context); } /** @@ -2193,7 +2182,6 @@ Mono> createSnapshotWithResponse(Map new SimpleResponse<>(rb, this.getSnapshotClient(rb.getDeserializedHeaders().getXMsSnapshot()))); } @@ -2298,8 +2286,7 @@ Mono> setTierWithResponse(BlobSetAccessTierOptions options, Conte return this.azureBlobStorage.getBlobs().setTierNoCustomHeadersWithResponseAsync(containerName, blobName, options.getTier(), snapshot, versionId, null, options.getPriority(), null, options.getLeaseId(), - options.getTagsConditions(), context) - .onErrorMap(ModelHelper::mapToBlobStorageException); + options.getTagsConditions(), context); } /** @@ -2351,8 +2338,7 @@ public Mono> undeleteWithResponse() { Mono> undeleteWithResponse(Context context) { return this.azureBlobStorage.getBlobs().undeleteNoCustomHeadersWithResponseAsync(containerName, blobName, null, - null, context) - .onErrorMap(ModelHelper::mapToBlobStorageException); + null, context); } /** @@ -2405,7 +2391,6 @@ public Mono> getAccountInfoWithResponse() { Mono> getAccountInfoWithResponse(Context context) { return this.azureBlobStorage.getBlobs().getAccountInfoWithResponseAsync(containerName, blobName, context) - .onErrorMap(ModelHelper::mapToBlobStorageException) .map(rb -> { BlobsGetAccountInfoHeaders hd = rb.getDeserializedHeaders(); return new SimpleResponse<>(rb, new StorageAccountInfo(hd.getXMsSkuName(), hd.getXMsAccountKind())); @@ -2683,7 +2668,6 @@ Mono queryWithResponse(BlobQueryOptions queryOptions, Co requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, qr, getCustomerProvidedKey(), context) - .onErrorMap(ModelHelper::mapToBlobStorageException) .map(response -> new BlobQueryAsyncResponse(response.getRequest(), response.getStatusCode(), response.getHeaders(), /* Parse the avro reactive stream. */ @@ -2775,7 +2759,6 @@ Mono> setImmutabilityPolicyWithResponse( return this.azureBlobStorage.getBlobs().setImmutabilityPolicyWithResponseAsync(containerName, blobName, null, null, finalRequestConditions.getIfUnmodifiedSince(), finalImmutabilityPolicy.getExpiryTime(), finalImmutabilityPolicy.getPolicyMode(), context) - .onErrorMap(ModelHelper::mapToBlobStorageException) .map(response -> { BlobsSetImmutabilityPolicyHeaders headers = response.getDeserializedHeaders(); BlobImmutabilityPolicy responsePolicy = new BlobImmutabilityPolicy() @@ -2834,8 +2817,7 @@ public Mono> deleteImmutabilityPolicyWithResponse() { Mono> deleteImmutabilityPolicyWithResponse(Context context) { context = context == null ? Context.NONE : context; return this.azureBlobStorage.getBlobs() - .deleteImmutabilityPolicyNoCustomHeadersWithResponseAsync(containerName, blobName, null, null, context) - .onErrorMap(ModelHelper::mapToBlobStorageException); + .deleteImmutabilityPolicyNoCustomHeadersWithResponseAsync(containerName, blobName, null, null, context); } /** @@ -2890,7 +2872,6 @@ Mono> setLegalHoldWithResponse(boolean legalHold, context = context == null ? Context.NONE : context; return this.azureBlobStorage.getBlobs().setLegalHoldWithResponseAsync(containerName, blobName, legalHold, null, null, context) - .onErrorMap(ModelHelper::mapToBlobStorageException) .map(response -> new SimpleResponse<>(response, new InternalBlobLegalHoldResult(response.getDeserializedHeaders().isXMsLegalHold()))); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobLeaseAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobLeaseAsyncClient.java index 67874c1057b5..978be71bba68 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobLeaseAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobLeaseAsyncClient.java @@ -205,15 +205,12 @@ Mono> acquireLeaseWithResponse(BlobAcquireLeaseOptions options, response = this.client.getBlobs().acquireLeaseWithResponseAsync(containerName, blobName, null, options.getDuration(), this.leaseId, requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), - requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, - context) - .onErrorMap(ModelHelper::mapToBlobStorageException) + requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, context) .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getXMsLeaseId())); } else { response = this.client.getContainers().acquireLeaseWithResponseAsync(containerName, null, options.getDuration(), this.leaseId, requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), null, context) - .onErrorMap(ModelHelper::mapToBlobStorageException) .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getXMsLeaseId())); } @@ -306,15 +303,11 @@ Mono> renewLeaseWithResponse(BlobRenewLeaseOptions options, Con response = this.client.getBlobs().renewLeaseWithResponseAsync(containerName, blobName, this.leaseId, null, requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), - requestConditions.getTagsConditions(), null, - context) - .onErrorMap(ModelHelper::mapToBlobStorageException) + requestConditions.getTagsConditions(), null, context) .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getXMsLeaseId())); } else { response = this.client.getContainers().renewLeaseWithResponseAsync(containerName, this.leaseId, null, - requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), - null, context) - .onErrorMap(ModelHelper::mapToBlobStorageException) + requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), null, context) .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getXMsLeaseId())); } @@ -406,12 +399,10 @@ Mono> releaseLeaseWithResponse(BlobReleaseLeaseOptions options, C return this.client.getBlobs().releaseLeaseNoCustomHeadersWithResponseAsync(containerName, blobName, this.leaseId, null, requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), - requestConditions.getTagsConditions(), null, context) - .onErrorMap(ModelHelper::mapToBlobStorageException); + requestConditions.getTagsConditions(), null, context); } else { return this.client.getContainers().releaseLeaseNoCustomHeadersWithResponseAsync(containerName, this.leaseId, - null, requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), null, context) - .onErrorMap(ModelHelper::mapToBlobStorageException); + null, requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), null, context); } } @@ -517,15 +508,12 @@ Mono> breakLeaseWithResponse(BlobBreakLeaseOptions options, Co return this.client.getBlobs().breakLeaseWithResponseAsync(containerName, blobName, null, breakPeriod, requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), - requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, - context) - .onErrorMap(ModelHelper::mapToBlobStorageException) + requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, context) .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getXMsLeaseTime())); } else { return this.client.getContainers().breakLeaseWithResponseAsync(containerName, null, breakPeriod, requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), null, context) - .onErrorMap(ModelHelper::mapToBlobStorageException) .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getXMsLeaseTime())); } } @@ -618,16 +606,12 @@ Mono> changeLeaseWithResponse(BlobChangeLeaseOptions options, C response = this.client.getBlobs().changeLeaseWithResponseAsync(containerName, blobName, this.leaseId, options.getProposedId(), null, requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), - requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, - context) - .onErrorMap(ModelHelper::mapToBlobStorageException) + requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, context) .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getXMsLeaseId())); } else { response = this.client.getContainers().changeLeaseWithResponseAsync(containerName, this.leaseId, options.getProposedId(), null, requestConditions.getIfModifiedSince(), - requestConditions.getIfUnmodifiedSince(), null, - context) - .onErrorMap(ModelHelper::mapToBlobStorageException) + requestConditions.getIfUnmodifiedSince(), null, context) .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getXMsLeaseId())); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlockBlobAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlockBlobAsyncClient.java index 22c3c46ca4ab..25e5a953c667 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlockBlobAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlockBlobAsyncClient.java @@ -19,7 +19,6 @@ import com.azure.storage.blob.implementation.models.BlockBlobsPutBlobFromUrlHeaders; import com.azure.storage.blob.implementation.models.BlockBlobsUploadHeaders; import com.azure.storage.blob.implementation.models.EncryptionScope; -import com.azure.storage.blob.implementation.util.ModelHelper; import com.azure.storage.blob.models.AccessTier; import com.azure.storage.blob.models.BlobHttpHeaders; import com.azure.storage.blob.models.BlobImmutabilityPolicy; @@ -438,7 +437,6 @@ Mono> uploadWithResponse(BlockBlobSimpleUploadOptions op tagsToString(options.getTags()), immutabilityPolicy.getExpiryTime(), immutabilityPolicy.getPolicyMode(), options.isLegalHold(), null, options.getHeaders(), getCustomerProvidedKey(), encryptionScope, finalContext) - .onErrorMap(ModelHelper::mapToBlobStorageException) .map(rb -> { BlockBlobsUploadHeaders hd = rb.getDeserializedHeaders(); BlockBlobItem item = new BlockBlobItem(hd.getETag(), hd.getLastModified(), hd.getContentMD5(), @@ -590,9 +588,7 @@ Mono> uploadFromUrlWithResponse(BlobUploadFromUrlOptions sourceRequestConditions.getTagsConditions(), null, options.getContentMd5(), tagsToString(options.getTags()), options.isCopySourceBlobProperties(), sourceAuth, options.getCopySourceTagsMode(), options.getHeaders(), - getCustomerProvidedKey(), encryptionScope, - context) - .onErrorMap(ModelHelper::mapToBlobStorageException) + getCustomerProvidedKey(), encryptionScope, context) .map(rb -> { BlockBlobsPutBlobFromUrlHeaders hd = rb.getDeserializedHeaders(); BlockBlobItem item = new BlockBlobItem(hd.getETag(), hd.getLastModified(), hd.getContentMD5(), @@ -761,8 +757,7 @@ Mono> stageBlockWithResponse(String base64BlockId, BinaryData dat context = context == null ? Context.NONE : context; return this.azureBlobStorage.getBlockBlobs().stageBlockNoCustomHeadersWithResponseAsync(containerName, blobName, base64BlockId, data.getLength(), data, contentMd5, null, null, leaseId, null, getCustomerProvidedKey(), - encryptionScope, context) - .onErrorMap(ModelHelper::mapToBlobStorageException); + encryptionScope, context); } /** @@ -888,8 +883,7 @@ Mono> stageBlockFromUrlWithResponse(BlockBlobStageBlockFromUrlOpt options.getSourceContentMd5(), null, null, options.getLeaseId(), sourceRequestConditions.getIfModifiedSince(), sourceRequestConditions.getIfUnmodifiedSince(), sourceRequestConditions.getIfMatch(), sourceRequestConditions.getIfNoneMatch(), null, sourceAuth, - getCustomerProvidedKey(), encryptionScope, context) - .onErrorMap(ModelHelper::mapToBlobStorageException); + getCustomerProvidedKey(), encryptionScope, context); } /** @@ -993,7 +987,6 @@ Mono> listBlocksWithResponse(BlockBlobListBlocksOptions opti return this.azureBlobStorage.getBlockBlobs().getBlockListWithResponseAsync( containerName, blobName, options.getType(), getSnapshotId(), null, options.getLeaseId(), options.getIfTagsMatch(), null, context) - .onErrorMap(ModelHelper::mapToBlobStorageException) .map(response -> new SimpleResponse<>(response, response.getValue())); } @@ -1158,9 +1151,7 @@ Mono> commitBlockListWithResponse(BlockBlobCommitBlockLi requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, tagsToString(options.getTags()), immutabilityPolicy.getExpiryTime(), immutabilityPolicy.getPolicyMode(), - options.isLegalHold(), options.getHeaders(), getCustomerProvidedKey(), - encryptionScope, context) - .onErrorMap(ModelHelper::mapToBlobStorageException) + options.isLegalHold(), options.getHeaders(), getCustomerProvidedKey(), encryptionScope, context) .map(rb -> { BlockBlobsCommitBlockListHeaders hd = rb.getDeserializedHeaders(); BlockBlobItem item = new BlockBlobItem(hd.getETag(), hd.getLastModified(), hd.getContentMD5(), diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java index 46321992d4e4..dd92e87a943f 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java @@ -341,9 +341,7 @@ Mono> createWithResponse(PageBlobCreateOptions options, C requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), options.getSequenceNumber(), null, tagsToString(options.getTags()), immutabilityPolicy.getExpiryTime(), immutabilityPolicy.getPolicyMode(), options.isLegalHold(), - options.getHeaders(), getCustomerProvidedKey(), encryptionScope, - context) - .onErrorMap(ModelHelper::mapToBlobStorageException) + options.getHeaders(), getCustomerProvidedKey(), encryptionScope, context) .map(rb -> { PageBlobsCreateHeaders hd = rb.getDeserializedHeaders(); PageBlobItem item = new PageBlobItem(hd.getETag(), hd.getLastModified(), hd.getContentMD5(), @@ -542,9 +540,7 @@ Mono> uploadPagesWithResponse(PageRange pageRange, Flux { PageBlobsUploadPagesHeaders hd = rb.getDeserializedHeaders(); PageBlobItem item = new PageBlobItem(hd.getETag(), hd.getLastModified(), hd.getContentMD5(), @@ -724,7 +720,6 @@ Mono> uploadPagesFromUrlWithResponse(PageBlobUploadPagesF sourceRequestConditions.getIfUnmodifiedSince(), sourceRequestConditions.getIfMatch(), sourceRequestConditions.getIfNoneMatch(), null, sourceAuth, getCustomerProvidedKey(), encryptionScope, context) - .onErrorMap(ModelHelper::mapToBlobStorageException) .map(rb -> { PageBlobsUploadPagesFromURLHeaders hd = rb.getDeserializedHeaders(); PageBlobItem item = new PageBlobItem(hd.getETag(), hd.getLastModified(), hd.getContentMD5(), @@ -819,7 +814,6 @@ Mono> clearPagesWithResponse(PageRange pageRange, pageBlobRequestConditions.getIfUnmodifiedSince(), pageBlobRequestConditions.getIfMatch(), pageBlobRequestConditions.getIfNoneMatch(), pageBlobRequestConditions.getTagsConditions(), null, getCustomerProvidedKey(), encryptionScope, context) - .onErrorMap(ModelHelper::mapToBlobStorageException) .map(rb -> { PageBlobsClearPagesHeaders hd = rb.getDeserializedHeaders(); PageBlobItem item = new PageBlobItem(hd.getETag(), hd.getLastModified(), hd.getContentMD5(), @@ -906,9 +900,7 @@ Mono> getPageRangesWithResponse(BlobRange blobRange, BlobRequ getSnapshotId(), null, blobRange.toHeaderValue(), requestConditions.getLeaseId(), requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), - requestConditions.getTagsConditions(), null, null, null, - context) - .onErrorMap(ModelHelper::mapToBlobStorageException) + requestConditions.getTagsConditions(), null, null, null, context) .map(response -> new SimpleResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), response.getValue())); } @@ -1023,8 +1015,7 @@ private Mono> getPageRange requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, marker, options.getMaxResultsPerPage(), context), - timeout) - .onErrorMap(ModelHelper::mapToBlobStorageException); + timeout); } private static PageRangeItem toPageBlobRange(PageRange range) { @@ -1280,9 +1271,7 @@ Mono> getPageRangesDiffWithResponse(BlobRange blobRange, Stri getSnapshotId(), null, prevSnapshot, prevSnapshotUrl, blobRange.toHeaderValue(), requestConditions.getLeaseId(), requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), - requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, null, null, - context) - .onErrorMap(ModelHelper::mapToBlobStorageException) + requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, null, null, context) .map(response -> new SimpleResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), response.getValue())); } @@ -1345,10 +1334,8 @@ private Mono> getPageR options.getRange().toHeaderValue(), requestConditions.getLeaseId(), requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), - requestConditions.getTagsConditions(), null, marker, options.getMaxResultsPerPage(), - context), - timeout) - .onErrorMap(ModelHelper::mapToBlobStorageException); + requestConditions.getTagsConditions(), null, marker, options.getMaxResultsPerPage(), context), + timeout); } /** @@ -1421,9 +1408,7 @@ Mono> resizeWithResponse(long size, BlobRequestConditions requestConditions.getLeaseId(), requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, - getCustomerProvidedKey(), encryptionScope, - context) - .onErrorMap(ModelHelper::mapToBlobStorageException) + getCustomerProvidedKey(), encryptionScope, context) .map(rb -> { PageBlobsResizeHeaders hd = rb.getDeserializedHeaders(); PageBlobItem item = new PageBlobItem(hd.getETag(), hd.getLastModified(), null, null, null, null, @@ -1508,9 +1493,7 @@ Mono> updateSequenceNumberWithResponse(SequenceNumberActi return this.azureBlobStorage.getPageBlobs().updateSequenceNumberWithResponseAsync(containerName, blobName, action, null, requestConditions.getLeaseId(), requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), - requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), sequenceNumber, null, - context) - .onErrorMap(ModelHelper::mapToBlobStorageException) + requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), sequenceNumber, null, context) .map(rb -> { PageBlobsUpdateSequenceNumberHeaders hd = rb.getDeserializedHeaders(); PageBlobItem item = new PageBlobItem(hd.getETag(), hd.getLastModified(), null, null, null, null, @@ -1703,7 +1686,6 @@ Mono> copyIncrementalWithResponse(PageBlobCopyIncrement modifiedRequestConditions.getIfUnmodifiedSince(), modifiedRequestConditions.getIfMatch(), modifiedRequestConditions.getIfNoneMatch(), modifiedRequestConditions.getTagsConditions(), null, context) - .onErrorMap(ModelHelper::mapToBlobStorageException) .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getXMsCopyStatus())); } } diff --git a/sdk/storage/azure-storage-blob/swagger/src/main/java/BlobStorageCustomization.java b/sdk/storage/azure-storage-blob/swagger/src/main/java/BlobStorageCustomization.java index f4e696142b16..5c3cd0b277ec 100644 --- a/sdk/storage/azure-storage-blob/swagger/src/main/java/BlobStorageCustomization.java +++ b/sdk/storage/azure-storage-blob/swagger/src/main/java/BlobStorageCustomization.java @@ -6,13 +6,25 @@ import com.azure.autorest.customization.JavadocCustomization; import com.azure.autorest.customization.LibraryCustomization; import com.azure.autorest.customization.PackageCustomization; +import com.github.javaparser.ParseProblemException; import com.github.javaparser.StaticJavaParser; import com.github.javaparser.ast.NodeList; import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; -import com.github.javaparser.ast.expr.MemberValuePair; -import com.github.javaparser.ast.expr.StringLiteralExpr; +import com.github.javaparser.ast.body.MethodDeclaration; +import com.github.javaparser.ast.body.Parameter; +import com.github.javaparser.ast.expr.MethodCallExpr; +import com.github.javaparser.ast.stmt.BlockStmt; +import com.github.javaparser.ast.stmt.CatchClause; +import com.github.javaparser.ast.stmt.ReturnStmt; +import com.github.javaparser.ast.stmt.Statement; +import com.github.javaparser.ast.stmt.TryStmt; +import com.github.javaparser.ast.type.ClassOrInterfaceType; +import com.github.javaparser.ast.type.Type; import org.slf4j.Logger; +import java.util.Arrays; +import java.util.List; + /** * Customization class for Blob Storage. */ @@ -100,22 +112,20 @@ public void customize(LibraryCustomization customization, Logger logger) { .setDeprecated("Please use {@link BlobErrorCode#INCREMENTAL_COPY_OF_EARLIER_VERSION_SNAPSHOT_NOT_ALLOWED}"); //QueryFormat - ClassCustomization queryFormat = implementationModels.getClass("QueryFormat"); - customizeQueryFormat(queryFormat); + customizeQueryFormat(implementationModels.getClass("QueryFormat")); //BlobHierarchyListSegment - ClassCustomization blobHierarchyListSegment = implementationModels.getClass("BlobHierarchyListSegment"); - customizeBlobHierarchyListSegment(blobHierarchyListSegment); + customizeBlobHierarchyListSegment(implementationModels.getClass("BlobHierarchyListSegment")); //BlobFlatListSegment - ClassCustomization blobFlatListSegment = implementationModels.getClass("BlobFlatListSegment"); - customizeBlobFlatListSegment(blobFlatListSegment); + customizeBlobFlatListSegment(implementationModels.getClass("BlobFlatListSegment")); //BlobSignedIdentifierWrapper - ClassCustomization blobSignedIdentifierWrapper = implementationModels.getClass("BlobSignedIdentifierWrapper"); - customizeBlobSignedIdentifierWrapper(blobSignedIdentifierWrapper); + customizeBlobSignedIdentifierWrapper(implementationModels.getClass("BlobSignedIdentifierWrapper")); + updateImplToMapInternalException(customization.getPackage("com.azure.storage.blob.implementation")); } + private static void customizeQueryFormat(ClassCustomization classCustomization) { String fileContent = classCustomization.getEditor().getFileContent(classCustomization.getFileName()); fileContent = fileContent.replace("xmlWriter.nullElement(\"ParquetTextConfiguration\", this.parquetTextConfiguration);", @@ -241,4 +251,110 @@ private static void customizeBlobSignedIdentifierWrapper(ClassCustomization clas "instance of it, or null if it was pointing to XML null."); javadocfromXmlWithRoot.addThrows("XMLStreamException", "If an error occurs while reading the BlobSignedIdentifierWrapper."); } + + /** + * Customizes the implementation classes that will perform calls to the service. The following logic is used: + *

+ * - Check for the return of the method not equaling to PagedFlux, PagedIterable, PollerFlux, or SyncPoller. Those + * types wrap other APIs and those APIs being update is the correct change. + * - For asynchronous methods, add a call to + * {@code .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException)} to handle + * mapping BlobStorageExceptionInternal to BlobStorageException. + * - For synchronous methods, wrap the return statement in a try-catch block that catches + * BlobStorageExceptionInternal and rethrows {@code ModelHelper.mapToBlobStorageException(e)}. Or, for void methods + * wrap the last statement. + * + * @param implPackage The implementation package. + */ + private static void updateImplToMapInternalException(PackageCustomization implPackage) { + List implsToUpdate = Arrays.asList("AppendBlobsImpl", "BlobsImpl", "BlockBlobsImpl", "ContainersImpl", + "PageBlobsImpl", "ServicesImpl"); + for (String implToUpdate : implsToUpdate) { + implPackage.getClass(implToUpdate).customizeAst(ast -> { + ast.addImport("com.azure.storage.blob.implementation.util.ModelHelper"); + ast.addImport("com.azure.storage.blob.models.BlobStorageException"); + ast.addImport("com.azure.storage.blob.implementation.models.BlobStorageExceptionInternal"); + ast.getClassByName(implToUpdate).ifPresent(clazz -> { + clazz.getFields(); + + clazz.getMethods().forEach(methodDeclaration -> { + Type returnType = methodDeclaration.getType(); + // The way code generation works we only need to update the methods that have a class return type. + // As non-class return types, such as "void", call into the Response methods. + if (!returnType.isClassOrInterfaceType()) { + return; + } + + ClassOrInterfaceType returnTypeClass = returnType.asClassOrInterfaceType(); + String returnTypeName = returnTypeClass.getNameAsString(); + if (returnTypeName.equals("PagedFlux") || returnTypeName.equals("PagedIterable") + || returnTypeName.equals("PollerFlux") || returnTypeName.equals("SyncPoller")) { + return; + } + + if (returnTypeName.equals("Mono") || returnTypeName.equals("Flux")) { + addErrorMappingToAsyncMethod(methodDeclaration); + } else { + addErrorMappingToSyncMethod(methodDeclaration); + } + }); + }); + }); + } + } + + private static void addErrorMappingToAsyncMethod(MethodDeclaration method) { + BlockStmt body = method.getBody().get(); + + // Bit of hack to insert the 'onErrorMap' in the right location. + // Unfortunately, 'onErrorMap' returns which for some calls breaks typing, such as Void -> Object or + // PagedResponse -> PagedResponseBase. So, 'onErrorMap' needs to be inserted after the first method call. + // To do this, we track the first found '(' and the associated closing ')' to insert 'onErrorMap' after the ')'. + // So, 'service.methodCall(parameters).map()' becomes 'service.methodCall(parameters).onErrorMap().map()'. + String originalReturnStatement = body.getStatement(body.getStatements().size() - 1).asReturnStmt() + .getExpression().get().toString(); + int insertionPoint = findAsyncOnErrorMapInsertionPoint(originalReturnStatement); + String newReturnStatement = "return " + originalReturnStatement.substring(0, insertionPoint) + + ".onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException)" + + originalReturnStatement.substring(insertionPoint) + ";"; + try { + Statement newReturn = StaticJavaParser.parseStatement(newReturnStatement); + body.getStatements().set(body.getStatements().size() - 1, newReturn); + } catch (ParseProblemException ex) { + throw new RuntimeException("Failed to parse: " + newReturnStatement, ex); + } + } + + private static int findAsyncOnErrorMapInsertionPoint(String returnStatement) { + int openParenthesis = 0; + int closeParenthesis = 0; + for (int i = 0; i < returnStatement.length(); i++) { + char c = returnStatement.charAt(i); + if (c == '(') { + openParenthesis++; + } else if (c == ')') { + closeParenthesis++; + if (openParenthesis == closeParenthesis) { + return i + 1; + } + } + } + return -1; + } + + private static void addErrorMappingToSyncMethod(MethodDeclaration method) { + BlockStmt body = method.getBody().get(); + + // Turn the last statement into a BlockStmt that will be used as the try block. + BlockStmt tryBlock = new BlockStmt(new NodeList<>(body.getStatement(body.getStatements().size() - 1))); + BlockStmt catchBlock = new BlockStmt(new NodeList<>(StaticJavaParser.parseStatement( + "throw ModelHelper.mapToBlobStorageException(internalException);"))); + Parameter catchParameter = new Parameter().setType("BlobStorageExceptionInternal") + .setName("internalException"); + CatchClause catchClause = new CatchClause(catchParameter, catchBlock); + TryStmt tryCatchMap = new TryStmt(tryBlock, new NodeList<>(catchClause), null); + + // Replace the last statement with the try-catch block. + body.getStatements().set(body.getStatements().size() - 1, tryCatchMap); + } } diff --git a/sdk/storage/azure-storage-file-datalake/checkstyle-suppressions.xml b/sdk/storage/azure-storage-file-datalake/checkstyle-suppressions.xml index 424f4847030b..980882cadcf3 100644 --- a/sdk/storage/azure-storage-file-datalake/checkstyle-suppressions.xml +++ b/sdk/storage/azure-storage-file-datalake/checkstyle-suppressions.xml @@ -24,4 +24,12 @@ + + + + + + + + diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeDirectoryAsyncClient.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeDirectoryAsyncClient.java index 06f25edfe533..9584a4728b3f 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeDirectoryAsyncClient.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeDirectoryAsyncClient.java @@ -29,7 +29,6 @@ import com.azure.storage.file.datalake.implementation.models.PathList; import com.azure.storage.file.datalake.implementation.models.PathResourceType; import com.azure.storage.file.datalake.implementation.util.DataLakeImplUtils; -import com.azure.storage.file.datalake.implementation.util.ModelHelper; import com.azure.storage.file.datalake.implementation.util.TransformUtils; import com.azure.storage.file.datalake.models.CustomerProvidedKey; import com.azure.storage.file.datalake.models.DataLakeRequestConditions; @@ -1287,8 +1286,7 @@ private Mono> listPathsSegme return StorageImplUtils.applyOptionalTimeout( this.fileSystemDataLakeStorage.getFileSystems().listPathsWithResponseAsync( recursive, null, null, marker, getDirectoryPath(), maxResults, userPrincipleNameReturned, - Context.NONE), timeout) - .onErrorMap(ModelHelper::mapToDataLakeStorageException); + Context.NONE), timeout); } /** diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeDirectoryClient.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeDirectoryClient.java index 5fb2a3917ddb..789b24893042 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeDirectoryClient.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeDirectoryClient.java @@ -44,8 +44,6 @@ import java.util.function.BiFunction; import java.util.stream.Collectors; -import static com.azure.storage.file.datalake.implementation.util.DataLakeImplUtils.wrapServiceCallWithExceptionMapping; - /** * This class provides a client that contains directory operations for Azure Storage Data Lake. Operations provided by * this client include creating a directory, deleting a directory, renaming a directory, setting metadata and @@ -1154,9 +1152,9 @@ public PagedIterable listPaths(boolean recursive, boolean userPrincipl Duration timeout) { BiFunction> retriever = (marker, pageSize) -> { Callable> operation - = wrapServiceCallWithExceptionMapping(() -> this.fileSystemDataLakeStorage.getFileSystems() + = () -> this.fileSystemDataLakeStorage.getFileSystems() .listPathsWithResponse(recursive, null, null, marker, getDirectoryPath(), - pageSize == null ? maxResults : pageSize, userPrincipleNameReturned, Context.NONE)); + pageSize == null ? maxResults : pageSize, userPrincipleNameReturned, Context.NONE); ResponseBase response = StorageImplUtils.sendRequest(operation, timeout, DataLakeStorageException.class); diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileAsyncClient.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileAsyncClient.java index 1a1f6a336af1..c73e200219ac 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileAsyncClient.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileAsyncClient.java @@ -1178,8 +1178,7 @@ Mono> appendWithResponse(Flux data, long fileOffset, return this.dataLakeStorage.getPaths().appendDataNoCustomHeadersWithResponseAsync( data, fileOffset, null, length, null, appendOptions.getLeaseAction(), leaseDuration, appendOptions.getProposedLeaseId(), null, appendOptions.isFlush(), headers, leaseAccessConditions, - getCpkInfo(), context) - .onErrorMap(ModelHelper::mapToDataLakeStorageException); + getCpkInfo(), context); } /** @@ -1368,7 +1367,6 @@ Mono> flushWithResponse(long position, DataLakeFileFlushOptio return this.dataLakeStorage.getPaths().flushDataWithResponseAsync(null, position, flushOptions.isUncommittedDataRetained(), flushOptions.isClose(), (long) 0, flushOptions.getLeaseAction(), leaseDuration, flushOptions.getProposedLeaseId(), null, httpHeaders, lac, mac, getCpkInfo(), context) - .onErrorMap(ModelHelper::mapToDataLakeStorageException) .map(response -> new SimpleResponse<>(response, new PathInfo(response.getDeserializedHeaders().getETag(), response.getDeserializedHeaders().getLastModified(), response.getDeserializedHeaders().isXMsRequestServerEncrypted() != null, @@ -1849,8 +1847,7 @@ Mono> scheduleDeletionWithResponse(FileScheduleDeletionOptions op pathExpiryOptions = PathExpiryOptions.NEVER_EXPIRE; } return this.blobDataLakeStorage.getPaths() - .setExpiryNoCustomHeadersWithResponseAsync(pathExpiryOptions, null, null, expiresOn, context) - .onErrorMap(ModelHelper::mapToDataLakeStorageException); + .setExpiryNoCustomHeadersWithResponseAsync(pathExpiryOptions, null, null, expiresOn, context); } } diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileClient.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileClient.java index 6814d1c8254c..b18497d32f5d 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileClient.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileClient.java @@ -76,8 +76,6 @@ import java.util.Set; import java.util.concurrent.Callable; -import static com.azure.storage.file.datalake.implementation.util.DataLakeImplUtils.wrapServiceCallWithExceptionMapping; - /** * This class provides a client that contains file operations for Azure Storage Data Lake. Operations provided by * this client include creating a file, deleting a file, renaming a file, setting metadata and @@ -1686,9 +1684,8 @@ public Response scheduleDeletionWithResponse(FileScheduleDeletionOptions o expiresOn = null; } - Callable> operation = wrapServiceCallWithExceptionMapping(() -> - this.blobDataLakeStorage.getPaths().setExpiryWithResponse(pathExpiryOptions, null, null, expiresOn, - finalContext)); + Callable> operation = () -> this.blobDataLakeStorage.getPaths() + .setExpiryWithResponse(pathExpiryOptions, null, null, expiresOn, finalContext); ResponseBase response = StorageImplUtils.sendRequest(operation, timeout, DataLakeStorageException.class); diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileSystemAsyncClient.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileSystemAsyncClient.java index b0f83bae862e..81894e82ec06 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileSystemAsyncClient.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileSystemAsyncClient.java @@ -38,7 +38,6 @@ import com.azure.storage.file.datalake.implementation.models.PathResourceType; import com.azure.storage.file.datalake.implementation.util.DataLakeImplUtils; import com.azure.storage.file.datalake.implementation.util.DataLakeSasImplUtil; -import com.azure.storage.file.datalake.implementation.util.ModelHelper; import com.azure.storage.file.datalake.implementation.util.TransformUtils; import com.azure.storage.file.datalake.models.DataLakeRequestConditions; import com.azure.storage.file.datalake.models.DataLakeSignedIdentifier; @@ -779,9 +778,8 @@ private Mono> listPathsSegme return StorageImplUtils.applyOptionalTimeout( this.azureDataLakeStorage.getFileSystems().listPathsWithResponseAsync(options.isRecursive(), null, null, - marker, options.getPath(), options.getMaxResults(), - options.isUserPrincipalNameReturned(), Context.NONE), timeout) - .onErrorMap(ModelHelper::mapToDataLakeStorageException); + marker, options.getPath(), options.getMaxResults(), options.isUserPrincipalNameReturned(), + Context.NONE), timeout); } /** @@ -870,10 +868,8 @@ private Mono> listDeletedPaths(String marker, Int context = context == null ? Context.NONE : context; return StorageImplUtils.applyOptionalTimeout( - this.blobDataLakeStorageFs.getFileSystems().listBlobHierarchySegmentWithResponseAsync( - prefix, null, marker, maxResults, - null, ListBlobsShowOnly.DELETED, null, null, context), timeout) - .onErrorMap(ModelHelper::mapToDataLakeStorageException); + this.blobDataLakeStorageFs.getFileSystems().listBlobHierarchySegmentWithResponseAsync(prefix, null, marker, + maxResults, null, ListBlobsShowOnly.DELETED, null, null, context), timeout); } /** @@ -1673,7 +1669,6 @@ Mono> undeletePathWithResponse(String deletedP // Initial rest call return blobDataLakeStoragePath.getPaths().undeleteWithResponseAsync(null, String.format("?%s=%s", Constants.UrlConstants.DELETIONID_QUERY_PARAMETER, deletionId), null, context) - .onErrorMap(ModelHelper::mapToDataLakeStorageException) .onErrorMap(DataLakeImplUtils::transformBlobStorageException) // Construct the new client and final response from the undelete + getProperties responses .map(response -> { diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileSystemClient.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileSystemClient.java index 562a04eb215f..c166385ae15f 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileSystemClient.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileSystemClient.java @@ -64,8 +64,6 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import static com.azure.storage.file.datalake.implementation.util.DataLakeImplUtils.wrapServiceCallWithExceptionMapping; - /** * Client to a file system. It may only be instantiated through a {@link DataLakeFileSystemClientBuilder} or via the * method {@link DataLakeServiceClient#getFileSystemClient(String)}. This class does not hold any state about a @@ -725,9 +723,8 @@ public PagedIterable listPaths(ListPathsOptions options, Duration time BiFunction> pageRetriever = (continuation, pageSize) -> { Callable> operation - = wrapServiceCallWithExceptionMapping(() -> this.azureDataLakeStorage.getFileSystems() - .listPathsWithResponse(recursive, null, null, continuation, path, - pageSize == null ? maxResults : pageSize, upn, Context.NONE)); + = () -> this.azureDataLakeStorage.getFileSystems().listPathsWithResponse(recursive, null, null, + continuation, path, pageSize == null ? maxResults : pageSize, upn, Context.NONE); ResponseBase response = StorageImplUtils.sendRequest(operation, timeout, DataLakeStorageException.class); @@ -799,10 +796,9 @@ public PagedIterable listDeletedPaths() { public PagedIterable listDeletedPaths(String prefix, Duration timeout, Context context) { BiFunction> retriever = (marker, pageSize) -> { - Callable> operation = - wrapServiceCallWithExceptionMapping(() -> this.blobDataLakeStorageFs.getFileSystems() - .listBlobHierarchySegmentWithResponse(prefix, null, marker, pageSize, null, - ListBlobsShowOnly.DELETED, null, null, context)); + Callable> operation + = () -> this.blobDataLakeStorageFs.getFileSystems().listBlobHierarchySegmentWithResponse(prefix, null, + marker, pageSize, null, ListBlobsShowOnly.DELETED, null, null, context); ResponseBase response = StorageImplUtils.sendRequest(operation, timeout, DataLakeStorageException.class); @@ -1566,11 +1562,9 @@ public Response undeletePathWithResponse(String deletedPath, .buildClient(); // Initial rest call - Callable> operation = wrapServiceCallWithExceptionMapping(() -> - blobDataLakeStoragePath.getPaths() - .undeleteWithResponse(null, - String.format("?%s=%s", Constants.UrlConstants.DELETIONID_QUERY_PARAMETER, deletionId), null, - finalContext)); + Callable> operation = () -> blobDataLakeStoragePath.getPaths() + .undeleteWithResponse(null, "?" + Constants.UrlConstants.DELETIONID_QUERY_PARAMETER + "=" + deletionId, + null, finalContext); ResponseBase response = StorageImplUtils.sendRequest(operation, timeout, DataLakeStorageException.class); diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakePathAsyncClient.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakePathAsyncClient.java index ae65b5303514..2705209971aa 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakePathAsyncClient.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakePathAsyncClient.java @@ -468,7 +468,6 @@ Mono> createWithResponse(DataLakePathCreateOptions options, C options.getProposedLeaseId(), leaseDuration, expiryOptions, expiresOnString, options.getEncryptionContext(), options.getPathHttpHeaders(), lac, mac, null, customerProvidedKey, context) - .onErrorMap(ModelHelper::mapToDataLakeStorageException) .map(response -> new SimpleResponse<>(response, new PathInfo( response.getDeserializedHeaders().getETag(), response.getDeserializedHeaders().getLastModified(), @@ -552,7 +551,6 @@ Mono> createIfNotExistsWithResponse(DataLakePathCreateOptions options.setRequestConditions(new DataLakeRequestConditions() .setIfNoneMatch(Constants.HeaderConstants.ETAG_WILDCARD)); return createWithResponse(options, context) - .onErrorMap(ModelHelper::mapToDataLakeStorageException) .onErrorResume(t -> t instanceof DataLakeStorageException && ((DataLakeStorageException) t).getStatusCode() == 409, t -> { @@ -592,7 +590,6 @@ Mono> deleteWithResponse(Boolean recursive, DataLakeRequestCondit Context finalContext = context == null ? Context.NONE : context; return this.dataLakeStorage.getPaths() .deleteNoCustomHeadersWithResponseAsync(null, null, recursive, null, paginated, lac, mac, context) - .onErrorMap(ModelHelper::mapToDataLakeStorageException) .expand(resp -> { String continuation = resp.getHeaders().getValue(Transforms.X_MS_CONTINUATION); if (continuation != null && !continuation.isEmpty()) { @@ -675,7 +672,6 @@ Mono> deleteIfExistsWithResponse(DataLakePathDeleteOptions opt try { options = options == null ? new DataLakePathDeleteOptions() : options; return deleteWithResponse(options.getIsRecursive(), options.getRequestConditions(), context) - .onErrorMap(ModelHelper::mapToDataLakeStorageException) .map(response -> (Response) new SimpleResponse<>(response, true)) .onErrorResume(t -> t instanceof DataLakeStorageException && ((DataLakeStorageException) t).getStatusCode() == 404, @@ -1108,7 +1104,6 @@ Mono> setAccessControlWithResponse(List new SimpleResponse<>(response, new PathInfo(response.getDeserializedHeaders().getETag(), response.getDeserializedHeaders().getLastModified()))); } @@ -1400,9 +1395,8 @@ Mono> setAccessControlRecursiveWithResponse( AtomicInteger failureCount = new AtomicInteger(0); AtomicInteger batchesCount = new AtomicInteger(0); - return this.dataLakeStorage.getPaths().setAccessControlRecursiveWithResponseAsync(mode, null, - continuationToken, continueOnFailure, batchSize, accessControlList, null, contextFinal) - .onErrorMap(ModelHelper::mapToDataLakeStorageException) + return this.dataLakeStorage.getPaths().setAccessControlRecursiveWithResponseAsync(mode, null, continuationToken, + continueOnFailure, batchSize, accessControlList, null, contextFinal) .onErrorMap(e -> { if (e instanceof DataLakeStorageException) { return LOGGER.logExceptionAsError(ModelHelper.changeAclRequestFailed((DataLakeStorageException) e, @@ -1515,8 +1509,7 @@ Determine if we are finished either because there is no new continuation (failur // If we're not finished, issue another request return this.dataLakeStorage.getPaths().setAccessControlRecursiveWithResponseAsync(mode, null, - effectiveNextToken, continueOnFailure, batchSize, accessControlStr, null, context) - .onErrorMap(ModelHelper::mapToDataLakeStorageException) + effectiveNextToken, continueOnFailure, batchSize, accessControlStr, null, context) .onErrorMap(e -> { if (e instanceof DataLakeStorageException) { return LOGGER.logExceptionAsError(ModelHelper.changeAclRequestFailed((DataLakeStorageException) e, @@ -1605,7 +1598,6 @@ Mono> getAccessControlWithResponse(boolean userPrinc context = context == null ? Context.NONE : context; return this.dataLakeStorage.getPaths().getPropertiesWithResponseAsync(null, null, PathGetPropertiesAction.GET_ACCESS_CONTROL, userPrincipalNameReturned, lac, mac, context) - .onErrorMap(ModelHelper::mapToDataLakeStorageException) .map(response -> new SimpleResponse<>(response, new PathAccessControl( PathAccessControlEntry.parseList(response.getDeserializedHeaders().getXMsAcl()), PathPermissions.parseSymbolic(response.getDeserializedHeaders().getXMsPermissions()), @@ -1671,9 +1663,7 @@ Mono> renameWithResponse(String destinationFil null /* properties */, null /* permissions */, null /* umask */, null /* owner */, null /* group */, null /* acl */, null /* proposedLeaseId */, null /* leaseDuration */, null /* expiryOptions */, null /* expiresOn */, null /* encryptionContext */, - null /* pathHttpHeaders */, destLac, destMac, sourceConditions, null /* cpkInfo */, - context) - .onErrorMap(ModelHelper::mapToDataLakeStorageException) + null /* pathHttpHeaders */, destLac, destMac, sourceConditions, null /* cpkInfo */, context) .map(response -> new SimpleResponse<>(response, dataLakePathAsyncClient)); } diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakePathClient.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakePathClient.java index e6a8f35e1159..6f8bf4e8e6c9 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakePathClient.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakePathClient.java @@ -72,7 +72,6 @@ import java.util.function.Consumer; import static com.azure.storage.common.implementation.StorageImplUtils.sendRequest; -import static com.azure.storage.file.datalake.implementation.util.DataLakeImplUtils.wrapServiceCallWithExceptionMapping; /** * This class provides a client that contains all operations that apply to any path object. @@ -435,13 +434,13 @@ public Response createWithResponse(DataLakePathCreateOptions options, Context finalContext = context == null ? Context.NONE : context; - Callable> operation = wrapServiceCallWithExceptionMapping(() -> - this.dataLakeStorage.getPaths().createWithResponse(null, null, pathResourceType, null, null, null, - finalOptions.getSourceLeaseId(), ModelHelper.buildMetadataString(finalOptions.getMetadata()), - finalOptions.getPermissions(), finalOptions.getUmask(), finalOptions.getOwner(), - finalOptions.getGroup(), acl, finalOptions.getProposedLeaseId(), leaseDuration, expiryOptions, - finalExpiresOnString, finalOptions.getEncryptionContext(), finalOptions.getPathHttpHeaders(), lac, mac, - null, customerProvidedKey, finalContext)); + Callable> operation = () -> this.dataLakeStorage.getPaths() + .createWithResponse(null, null, pathResourceType, null, null, null, finalOptions.getSourceLeaseId(), + ModelHelper.buildMetadataString(finalOptions.getMetadata()), finalOptions.getPermissions(), + finalOptions.getUmask(), finalOptions.getOwner(), finalOptions.getGroup(), acl, + finalOptions.getProposedLeaseId(), leaseDuration, expiryOptions, finalExpiresOnString, + finalOptions.getEncryptionContext(), finalOptions.getPathHttpHeaders(), lac, mac, null, + customerProvidedKey, finalContext); ResponseBase response = sendRequest(operation, timeout, DataLakeStorageException.class); @@ -638,7 +637,7 @@ Response deleteWithResponse(Boolean recursive, DataLakeRequestConditions r Context finalContext = context == null ? Context.NONE : context; - Callable> operation = wrapServiceCallWithExceptionMapping(() -> { + Callable> operation = () -> { String continuation = null; ResponseBase lastResponse; do { @@ -648,7 +647,7 @@ Response deleteWithResponse(Boolean recursive, DataLakeRequestConditions r } while (continuation != null && !continuation.isEmpty()); return lastResponse; - }); + }; ResponseBase response = sendRequest(operation, timeout, DataLakeStorageException.class); return new SimpleResponse<>(response, null); @@ -865,10 +864,9 @@ Response setAccessControlWithResponse(List acc Context finalContext = context == null ? Context.NONE : context; - Callable> operation - = wrapServiceCallWithExceptionMapping(() -> this.dataLakeStorage.getPaths() + Callable> operation = () -> this.dataLakeStorage.getPaths() .setAccessControlWithResponse(null, owner, group, permissionsString, accessControlListString, null, lac, - mac, finalContext)); + mac, finalContext); ResponseBase response = sendRequest(operation, timeout, DataLakeStorageException.class); @@ -1370,9 +1368,9 @@ public Response getAccessControlWithResponse(boolean userPrin .setIfUnmodifiedSince(requestConditions.getIfUnmodifiedSince()); Context finalContext = context == null ? Context.NONE : context; - Callable> operation = - wrapServiceCallWithExceptionMapping(() -> this.dataLakeStorage.getPaths().getPropertiesWithResponse(null, - null, PathGetPropertiesAction.GET_ACCESS_CONTROL, userPrincipalNameReturned, lac, mac, finalContext)); + Callable> operation = () -> this.dataLakeStorage.getPaths() + .getPropertiesWithResponse(null, null, PathGetPropertiesAction.GET_ACCESS_CONTROL, + userPrincipalNameReturned, lac, mac, finalContext); ResponseBase response = sendRequest(operation, timeout, DataLakeStorageException.class); @@ -1419,14 +1417,13 @@ Response renameWithResponseWithTimeout(String destinationFil } String finalRenameSource = signature != null ? renameSource + "?" + signature : renameSource; - Callable> operation = wrapServiceCallWithExceptionMapping(() -> - dataLakePathClient.dataLakeStorage.getPaths().createWithResponse(null /* request id */, null /* timeout */, - null /* pathResourceType */, null /* continuation */, PathRenameMode.LEGACY, finalRenameSource, + Callable> operation = () -> dataLakePathClient.dataLakeStorage.getPaths() + .createWithResponse(null /* request id */, null /* timeout */, null /* pathResourceType */, + null /* continuation */, PathRenameMode.LEGACY, finalRenameSource, finalSourceRequestConditions.getLeaseId(), null /* properties */, null /* permissions */, null /* umask */, null /* owner */, null /* group */, null /* acl */, null /* proposedLeaseId */, - null /* leaseDuration */, null /* expiryOptions */, null /* expiresOn */, - null /* encryptionContext */, null /* pathHttpHeaders */, destLac, destMac, sourceConditions, - null /* cpkInfo */, finalContext)); + null /* leaseDuration */, null /* expiryOptions */, null /* expiresOn */, null /* encryptionContext */, + null /* pathHttpHeaders */, destLac, destMac, sourceConditions, null /* cpkInfo */, finalContext); ResponseBase response = sendRequest(operation, timeout, DataLakeStorageException.class); diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/FileSystemsImpl.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/FileSystemsImpl.java index 60671f979fad..156ce359dfd7 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/FileSystemsImpl.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/FileSystemsImpl.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.storage.file.datalake.implementation; import com.azure.core.annotation.Delete; @@ -42,11 +41,13 @@ import java.util.Objects; import java.util.stream.Collectors; import reactor.core.publisher.Mono; +import com.azure.storage.file.datalake.implementation.util.ModelHelper; /** * An instance of this class provides access to all the operations defined in FileSystems. */ public final class FileSystemsImpl { + /** * The proxy service used to perform REST calls. */ @@ -59,7 +60,7 @@ public final class FileSystemsImpl { /** * Initializes an instance of FileSystemsImpl. - * + * * @param client the instance of the service client containing this operation class. */ FileSystemsImpl(AzureDataLakeStorageRestAPIImpl client) { @@ -75,6 +76,7 @@ public final class FileSystemsImpl { @Host("{url}") @ServiceInterface(name = "AzureDataLakeStorage") public interface FileSystemsService { + @Put("/{filesystem}") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(DataLakeStorageExceptionInternal.class) @@ -328,10 +330,10 @@ Response listBlobHierarchySegmentNoCustomHead /** * Create FileSystem - * + * * Create a FileSystem rooted at the specified location. If the FileSystem already exists, the operation fails. This * operation does not support conditional HTTP requests. - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -352,16 +354,18 @@ Response listBlobHierarchySegmentNoCustomHead public Mono> createWithResponseAsync(String requestId, Integer timeout, String properties) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.create(this.client.getUrl(), this.client.getFileSystem(), - this.client.getResource(), requestId, timeout, this.client.getVersion(), properties, accept, context)); + return FluxUtil + .withContext(context -> service.create(this.client.getUrl(), this.client.getFileSystem(), + this.client.getResource(), requestId, timeout, this.client.getVersion(), properties, accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Create FileSystem - * + * * Create a FileSystem rooted at the specified location. If the FileSystem already exists, the operation fails. This * operation does not support conditional HTTP requests. - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -383,16 +387,18 @@ public Mono> createWithResponseAsyn public Mono> createWithResponseAsync(String requestId, Integer timeout, String properties, Context context) { final String accept = "application/json"; - return service.create(this.client.getUrl(), this.client.getFileSystem(), this.client.getResource(), requestId, - timeout, this.client.getVersion(), properties, accept, context); + return service + .create(this.client.getUrl(), this.client.getFileSystem(), this.client.getResource(), requestId, timeout, + this.client.getVersion(), properties, accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Create FileSystem - * + * * Create a FileSystem rooted at the specified location. If the FileSystem already exists, the operation fails. This * operation does not support conditional HTTP requests. - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -411,15 +417,17 @@ public Mono> createWithResponseAsyn */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono createAsync(String requestId, Integer timeout, String properties) { - return createWithResponseAsync(requestId, timeout, properties).flatMap(ignored -> Mono.empty()); + return createWithResponseAsync(requestId, timeout, properties) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Create FileSystem - * + * * Create a FileSystem rooted at the specified location. If the FileSystem already exists, the operation fails. This * operation does not support conditional HTTP requests. - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -439,15 +447,17 @@ public Mono createAsync(String requestId, Integer timeout, String properti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono createAsync(String requestId, Integer timeout, String properties, Context context) { - return createWithResponseAsync(requestId, timeout, properties, context).flatMap(ignored -> Mono.empty()); + return createWithResponseAsync(requestId, timeout, properties, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Create FileSystem - * + * * Create a FileSystem rooted at the specified location. If the FileSystem already exists, the operation fails. This * operation does not support conditional HTTP requests. - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -470,15 +480,16 @@ public Mono> createNoCustomHeadersWithResponseAsync(String reques final String accept = "application/json"; return FluxUtil .withContext(context -> service.createNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), - this.client.getResource(), requestId, timeout, this.client.getVersion(), properties, accept, context)); + this.client.getResource(), requestId, timeout, this.client.getVersion(), properties, accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Create FileSystem - * + * * Create a FileSystem rooted at the specified location. If the FileSystem already exists, the operation fails. This * operation does not support conditional HTTP requests. - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -500,16 +511,18 @@ public Mono> createNoCustomHeadersWithResponseAsync(String reques public Mono> createNoCustomHeadersWithResponseAsync(String requestId, Integer timeout, String properties, Context context) { final String accept = "application/json"; - return service.createNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), - this.client.getResource(), requestId, timeout, this.client.getVersion(), properties, accept, context); + return service + .createNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), this.client.getResource(), + requestId, timeout, this.client.getVersion(), properties, accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Create FileSystem - * + * * Create a FileSystem rooted at the specified location. If the FileSystem already exists, the operation fails. This * operation does not support conditional HTTP requests. - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -531,16 +544,20 @@ public Mono> createNoCustomHeadersWithResponseAsync(String reques public ResponseBase createWithResponse(String requestId, Integer timeout, String properties, Context context) { final String accept = "application/json"; - return service.createSync(this.client.getUrl(), this.client.getFileSystem(), this.client.getResource(), - requestId, timeout, this.client.getVersion(), properties, accept, context); + try { + return service.createSync(this.client.getUrl(), this.client.getFileSystem(), this.client.getResource(), + requestId, timeout, this.client.getVersion(), properties, accept, context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Create FileSystem - * + * * Create a FileSystem rooted at the specified location. If the FileSystem already exists, the operation fails. This * operation does not support conditional HTTP requests. - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -563,10 +580,10 @@ public void create(String requestId, Integer timeout, String properties) { /** * Create FileSystem - * + * * Create a FileSystem rooted at the specified location. If the FileSystem already exists, the operation fails. This * operation does not support conditional HTTP requests. - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -588,17 +605,21 @@ public void create(String requestId, Integer timeout, String properties) { public Response createNoCustomHeadersWithResponse(String requestId, Integer timeout, String properties, Context context) { final String accept = "application/json"; - return service.createNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), - this.client.getResource(), requestId, timeout, this.client.getVersion(), properties, accept, context); + try { + return service.createNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), + this.client.getResource(), requestId, timeout, this.client.getVersion(), properties, accept, context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Set FileSystem Properties - * + * * Set properties for the FileSystem. This operation supports conditional HTTP requests. For more information, see * [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -634,18 +655,20 @@ public Mono> setPropertiesWi = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.setProperties(this.client.getUrl(), this.client.getFileSystem(), - this.client.getResource(), requestId, timeout, this.client.getVersion(), properties, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, accept, context)); + return FluxUtil + .withContext(context -> service.setProperties(this.client.getUrl(), this.client.getFileSystem(), + this.client.getResource(), requestId, timeout, this.client.getVersion(), properties, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Set FileSystem Properties - * + * * Set properties for the FileSystem. This operation supports conditional HTTP requests. For more information, see * [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -682,18 +705,20 @@ public Mono> setPropertiesWi = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.setProperties(this.client.getUrl(), this.client.getFileSystem(), this.client.getResource(), - requestId, timeout, this.client.getVersion(), properties, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, accept, context); + return service + .setProperties(this.client.getUrl(), this.client.getFileSystem(), this.client.getResource(), requestId, + timeout, this.client.getVersion(), properties, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, + accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Set FileSystem Properties - * + * * Set properties for the FileSystem. This operation supports conditional HTTP requests. For more information, see * [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -715,16 +740,17 @@ public Mono> setPropertiesWi public Mono setPropertiesAsync(String requestId, Integer timeout, String properties, ModifiedAccessConditions modifiedAccessConditions) { return setPropertiesWithResponseAsync(requestId, timeout, properties, modifiedAccessConditions) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) .flatMap(ignored -> Mono.empty()); } /** * Set FileSystem Properties - * + * * Set properties for the FileSystem. This operation supports conditional HTTP requests. For more information, see * [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -747,16 +773,17 @@ public Mono setPropertiesAsync(String requestId, Integer timeout, String p public Mono setPropertiesAsync(String requestId, Integer timeout, String properties, ModifiedAccessConditions modifiedAccessConditions, Context context) { return setPropertiesWithResponseAsync(requestId, timeout, properties, modifiedAccessConditions, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) .flatMap(ignored -> Mono.empty()); } /** * Set FileSystem Properties - * + * * Set properties for the FileSystem. This operation supports conditional HTTP requests. For more information, see * [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -792,18 +819,20 @@ public Mono> setPropertiesNoCustomHeadersWithResponseAsync(String = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.setPropertiesNoCustomHeaders(this.client.getUrl(), - this.client.getFileSystem(), this.client.getResource(), requestId, timeout, this.client.getVersion(), - properties, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, accept, context)); + return FluxUtil + .withContext(context -> service.setPropertiesNoCustomHeaders(this.client.getUrl(), + this.client.getFileSystem(), this.client.getResource(), requestId, timeout, this.client.getVersion(), + properties, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Set FileSystem Properties - * + * * Set properties for the FileSystem. This operation supports conditional HTTP requests. For more information, see * [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -840,18 +869,20 @@ public Mono> setPropertiesNoCustomHeadersWithResponseAsync(String = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.setPropertiesNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), - this.client.getResource(), requestId, timeout, this.client.getVersion(), properties, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, accept, context); + return service + .setPropertiesNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), this.client.getResource(), + requestId, timeout, this.client.getVersion(), properties, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Set FileSystem Properties - * + * * Set properties for the FileSystem. This operation supports conditional HTTP requests. For more information, see * [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -888,18 +919,22 @@ public ResponseBase setPropertiesWithResp = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.setPropertiesSync(this.client.getUrl(), this.client.getFileSystem(), this.client.getResource(), - requestId, timeout, this.client.getVersion(), properties, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, accept, context); + try { + return service.setPropertiesSync(this.client.getUrl(), this.client.getFileSystem(), + this.client.getResource(), requestId, timeout, this.client.getVersion(), properties, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, accept, context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Set FileSystem Properties - * + * * Set properties for the FileSystem. This operation supports conditional HTTP requests. For more information, see * [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -924,11 +959,11 @@ public void setProperties(String requestId, Integer timeout, String properties, /** * Set FileSystem Properties - * + * * Set properties for the FileSystem. This operation supports conditional HTTP requests. For more information, see * [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -965,16 +1000,20 @@ public Response setPropertiesNoCustomHeadersWithResponse(String requestId, = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.setPropertiesNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), - this.client.getResource(), requestId, timeout, this.client.getVersion(), properties, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, accept, context); + try { + return service.setPropertiesNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), + this.client.getResource(), requestId, timeout, this.client.getVersion(), properties, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, accept, context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Get FileSystem Properties. - * + * * All system and user-defined filesystem properties are specified in the response headers. - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -989,15 +1028,17 @@ public Response setPropertiesNoCustomHeadersWithResponse(String requestId, public Mono> getPropertiesWithResponseAsync(String requestId, Integer timeout) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getProperties(this.client.getUrl(), this.client.getFileSystem(), - this.client.getResource(), requestId, timeout, this.client.getVersion(), accept, context)); + return FluxUtil + .withContext(context -> service.getProperties(this.client.getUrl(), this.client.getFileSystem(), + this.client.getResource(), requestId, timeout, this.client.getVersion(), accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Get FileSystem Properties. - * + * * All system and user-defined filesystem properties are specified in the response headers. - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1013,15 +1054,17 @@ public Mono> getPropertiesWi public Mono> getPropertiesWithResponseAsync(String requestId, Integer timeout, Context context) { final String accept = "application/json"; - return service.getProperties(this.client.getUrl(), this.client.getFileSystem(), this.client.getResource(), - requestId, timeout, this.client.getVersion(), accept, context); + return service + .getProperties(this.client.getUrl(), this.client.getFileSystem(), this.client.getResource(), requestId, + timeout, this.client.getVersion(), accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Get FileSystem Properties. - * + * * All system and user-defined filesystem properties are specified in the response headers. - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1034,14 +1077,16 @@ public Mono> getPropertiesWi */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getPropertiesAsync(String requestId, Integer timeout) { - return getPropertiesWithResponseAsync(requestId, timeout).flatMap(ignored -> Mono.empty()); + return getPropertiesWithResponseAsync(requestId, timeout) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Get FileSystem Properties. - * + * * All system and user-defined filesystem properties are specified in the response headers. - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1055,14 +1100,16 @@ public Mono getPropertiesAsync(String requestId, Integer timeout) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getPropertiesAsync(String requestId, Integer timeout, Context context) { - return getPropertiesWithResponseAsync(requestId, timeout, context).flatMap(ignored -> Mono.empty()); + return getPropertiesWithResponseAsync(requestId, timeout, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Get FileSystem Properties. - * + * * All system and user-defined filesystem properties are specified in the response headers. - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1076,16 +1123,18 @@ public Mono getPropertiesAsync(String requestId, Integer timeout, Context @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String requestId, Integer timeout) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getPropertiesNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), - this.client.getResource(), requestId, timeout, this.client.getVersion(), accept, context)); + return FluxUtil + .withContext( + context -> service.getPropertiesNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), + this.client.getResource(), requestId, timeout, this.client.getVersion(), accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Get FileSystem Properties. - * + * * All system and user-defined filesystem properties are specified in the response headers. - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1101,15 +1150,17 @@ public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String requestId, Integer timeout, Context context) { final String accept = "application/json"; - return service.getPropertiesNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), - this.client.getResource(), requestId, timeout, this.client.getVersion(), accept, context); + return service + .getPropertiesNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), this.client.getResource(), + requestId, timeout, this.client.getVersion(), accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Get FileSystem Properties. - * + * * All system and user-defined filesystem properties are specified in the response headers. - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1125,15 +1176,19 @@ public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String public ResponseBase getPropertiesWithResponse(String requestId, Integer timeout, Context context) { final String accept = "application/json"; - return service.getPropertiesSync(this.client.getUrl(), this.client.getFileSystem(), this.client.getResource(), - requestId, timeout, this.client.getVersion(), accept, context); + try { + return service.getPropertiesSync(this.client.getUrl(), this.client.getFileSystem(), + this.client.getResource(), requestId, timeout, this.client.getVersion(), accept, context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Get FileSystem Properties. - * + * * All system and user-defined filesystem properties are specified in the response headers. - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1150,9 +1205,9 @@ public void getProperties(String requestId, Integer timeout) { /** * Get FileSystem Properties. - * + * * All system and user-defined filesystem properties are specified in the response headers. - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1167,13 +1222,17 @@ public void getProperties(String requestId, Integer timeout) { @ServiceMethod(returns = ReturnType.SINGLE) public Response getPropertiesNoCustomHeadersWithResponse(String requestId, Integer timeout, Context context) { final String accept = "application/json"; - return service.getPropertiesNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), - this.client.getResource(), requestId, timeout, this.client.getVersion(), accept, context); + try { + return service.getPropertiesNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), + this.client.getResource(), requestId, timeout, this.client.getVersion(), accept, context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Delete FileSystem - * + * * Marks the FileSystem for deletion. When a FileSystem is deleted, a FileSystem with the same identifier cannot be * created for at least 30 seconds. While the filesystem is being deleted, attempts to create a filesystem with the * same identifier will fail with status code 409 (Conflict), with the service returning additional error @@ -1182,7 +1241,7 @@ public Response getPropertiesNoCustomHeadersWithResponse(String requestId, * being deleted. This operation supports conditional HTTP requests. For more information, see [Specifying * Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1212,14 +1271,16 @@ public Mono> deleteWithResponseAsyn = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.delete(this.client.getUrl(), this.client.getFileSystem(), - this.client.getResource(), requestId, timeout, this.client.getVersion(), ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, accept, context)); + return FluxUtil + .withContext(context -> service.delete(this.client.getUrl(), this.client.getFileSystem(), + this.client.getResource(), requestId, timeout, this.client.getVersion(), ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Delete FileSystem - * + * * Marks the FileSystem for deletion. When a FileSystem is deleted, a FileSystem with the same identifier cannot be * created for at least 30 seconds. While the filesystem is being deleted, attempts to create a filesystem with the * same identifier will fail with status code 409 (Conflict), with the service returning additional error @@ -1228,7 +1289,7 @@ public Mono> deleteWithResponseAsyn * being deleted. This operation supports conditional HTTP requests. For more information, see [Specifying * Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1259,13 +1320,15 @@ public Mono> deleteWithResponseAsyn = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.delete(this.client.getUrl(), this.client.getFileSystem(), this.client.getResource(), requestId, - timeout, this.client.getVersion(), ifModifiedSinceConverted, ifUnmodifiedSinceConverted, accept, context); + return service + .delete(this.client.getUrl(), this.client.getFileSystem(), this.client.getResource(), requestId, timeout, + this.client.getVersion(), ifModifiedSinceConverted, ifUnmodifiedSinceConverted, accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Delete FileSystem - * + * * Marks the FileSystem for deletion. When a FileSystem is deleted, a FileSystem with the same identifier cannot be * created for at least 30 seconds. While the filesystem is being deleted, attempts to create a filesystem with the * same identifier will fail with status code 409 (Conflict), with the service returning additional error @@ -1274,7 +1337,7 @@ public Mono> deleteWithResponseAsyn * being deleted. This operation supports conditional HTTP requests. For more information, see [Specifying * Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1289,12 +1352,14 @@ public Mono> deleteWithResponseAsyn @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String requestId, Integer timeout, ModifiedAccessConditions modifiedAccessConditions) { - return deleteWithResponseAsync(requestId, timeout, modifiedAccessConditions).flatMap(ignored -> Mono.empty()); + return deleteWithResponseAsync(requestId, timeout, modifiedAccessConditions) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Delete FileSystem - * + * * Marks the FileSystem for deletion. When a FileSystem is deleted, a FileSystem with the same identifier cannot be * created for at least 30 seconds. While the filesystem is being deleted, attempts to create a filesystem with the * same identifier will fail with status code 409 (Conflict), with the service returning additional error @@ -1303,7 +1368,7 @@ public Mono deleteAsync(String requestId, Integer timeout, * being deleted. This operation supports conditional HTTP requests. For more information, see [Specifying * Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1320,12 +1385,13 @@ public Mono deleteAsync(String requestId, Integer timeout, public Mono deleteAsync(String requestId, Integer timeout, ModifiedAccessConditions modifiedAccessConditions, Context context) { return deleteWithResponseAsync(requestId, timeout, modifiedAccessConditions, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) .flatMap(ignored -> Mono.empty()); } /** * Delete FileSystem - * + * * Marks the FileSystem for deletion. When a FileSystem is deleted, a FileSystem with the same identifier cannot be * created for at least 30 seconds. While the filesystem is being deleted, attempts to create a filesystem with the * same identifier will fail with status code 409 (Conflict), with the service returning additional error @@ -1334,7 +1400,7 @@ public Mono deleteAsync(String requestId, Integer timeout, ModifiedAccessC * being deleted. This operation supports conditional HTTP requests. For more information, see [Specifying * Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1364,14 +1430,16 @@ public Mono> deleteNoCustomHeadersWithResponseAsync(String reques = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.deleteNoCustomHeaders(this.client.getUrl(), - this.client.getFileSystem(), this.client.getResource(), requestId, timeout, this.client.getVersion(), - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, accept, context)); + return FluxUtil + .withContext(context -> service.deleteNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), + this.client.getResource(), requestId, timeout, this.client.getVersion(), ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Delete FileSystem - * + * * Marks the FileSystem for deletion. When a FileSystem is deleted, a FileSystem with the same identifier cannot be * created for at least 30 seconds. While the filesystem is being deleted, attempts to create a filesystem with the * same identifier will fail with status code 409 (Conflict), with the service returning additional error @@ -1380,7 +1448,7 @@ public Mono> deleteNoCustomHeadersWithResponseAsync(String reques * being deleted. This operation supports conditional HTTP requests. For more information, see [Specifying * Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1411,14 +1479,16 @@ public Mono> deleteNoCustomHeadersWithResponseAsync(String reques = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.deleteNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), - this.client.getResource(), requestId, timeout, this.client.getVersion(), ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, accept, context); + return service + .deleteNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), this.client.getResource(), + requestId, timeout, this.client.getVersion(), ifModifiedSinceConverted, ifUnmodifiedSinceConverted, + accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Delete FileSystem - * + * * Marks the FileSystem for deletion. When a FileSystem is deleted, a FileSystem with the same identifier cannot be * created for at least 30 seconds. While the filesystem is being deleted, attempts to create a filesystem with the * same identifier will fail with status code 409 (Conflict), with the service returning additional error @@ -1427,7 +1497,7 @@ public Mono> deleteNoCustomHeadersWithResponseAsync(String reques * being deleted. This operation supports conditional HTTP requests. For more information, see [Specifying * Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1458,14 +1528,18 @@ public ResponseBase deleteWithResponse(String re = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.deleteSync(this.client.getUrl(), this.client.getFileSystem(), this.client.getResource(), - requestId, timeout, this.client.getVersion(), ifModifiedSinceConverted, ifUnmodifiedSinceConverted, accept, - context); + try { + return service.deleteSync(this.client.getUrl(), this.client.getFileSystem(), this.client.getResource(), + requestId, timeout, this.client.getVersion(), ifModifiedSinceConverted, ifUnmodifiedSinceConverted, + accept, context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Delete FileSystem - * + * * Marks the FileSystem for deletion. When a FileSystem is deleted, a FileSystem with the same identifier cannot be * created for at least 30 seconds. While the filesystem is being deleted, attempts to create a filesystem with the * same identifier will fail with status code 409 (Conflict), with the service returning additional error @@ -1474,7 +1548,7 @@ public ResponseBase deleteWithResponse(String re * being deleted. This operation supports conditional HTTP requests. For more information, see [Specifying * Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1492,7 +1566,7 @@ public void delete(String requestId, Integer timeout, ModifiedAccessConditions m /** * Delete FileSystem - * + * * Marks the FileSystem for deletion. When a FileSystem is deleted, a FileSystem with the same identifier cannot be * created for at least 30 seconds. While the filesystem is being deleted, attempts to create a filesystem with the * same identifier will fail with status code 409 (Conflict), with the service returning additional error @@ -1501,7 +1575,7 @@ public void delete(String requestId, Integer timeout, ModifiedAccessConditions m * being deleted. This operation supports conditional HTTP requests. For more information, see [Specifying * Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1532,16 +1606,20 @@ public Response deleteNoCustomHeadersWithResponse(String requestId, Intege = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.deleteNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), - this.client.getResource(), requestId, timeout, this.client.getVersion(), ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, accept, context); + try { + return service.deleteNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), + this.client.getResource(), requestId, timeout, this.client.getVersion(), ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, accept, context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * List Paths - * + * * List FileSystem paths and their properties. - * + * * @param recursive Required. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. @@ -1570,16 +1648,18 @@ public Response deleteNoCustomHeadersWithResponse(String requestId, Intege public Mono> listPathsWithResponseAsync(boolean recursive, String requestId, Integer timeout, String continuation, String path, Integer maxResults, Boolean upn) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listPaths(this.client.getUrl(), this.client.getFileSystem(), - this.client.getResource(), requestId, timeout, this.client.getVersion(), continuation, path, recursive, - maxResults, upn, accept, context)); + return FluxUtil + .withContext(context -> service.listPaths(this.client.getUrl(), this.client.getFileSystem(), + this.client.getResource(), requestId, timeout, this.client.getVersion(), continuation, path, recursive, + maxResults, upn, accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * List Paths - * + * * List FileSystem paths and their properties. - * + * * @param recursive Required. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. @@ -1610,16 +1690,17 @@ public Mono> listPathsWithRe String requestId, Integer timeout, String continuation, String path, Integer maxResults, Boolean upn, Context context) { final String accept = "application/json"; - return service.listPaths(this.client.getUrl(), this.client.getFileSystem(), this.client.getResource(), - requestId, timeout, this.client.getVersion(), continuation, path, recursive, maxResults, upn, accept, - context); + return service + .listPaths(this.client.getUrl(), this.client.getFileSystem(), this.client.getResource(), requestId, timeout, + this.client.getVersion(), continuation, path, recursive, maxResults, upn, accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * List Paths - * + * * List FileSystem paths and their properties. - * + * * @param recursive Required. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. @@ -1648,14 +1729,15 @@ public Mono> listPathsWithRe public Mono listPathsAsync(boolean recursive, String requestId, Integer timeout, String continuation, String path, Integer maxResults, Boolean upn) { return listPathsWithResponseAsync(recursive, requestId, timeout, continuation, path, maxResults, upn) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * List Paths - * + * * List FileSystem paths and their properties. - * + * * @param recursive Required. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. @@ -1685,14 +1767,15 @@ public Mono listPathsAsync(boolean recursive, String requestId, Intege public Mono listPathsAsync(boolean recursive, String requestId, Integer timeout, String continuation, String path, Integer maxResults, Boolean upn, Context context) { return listPathsWithResponseAsync(recursive, requestId, timeout, continuation, path, maxResults, upn, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * List Paths - * + * * List FileSystem paths and their properties. - * + * * @param recursive Required. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. @@ -1721,16 +1804,18 @@ public Mono listPathsAsync(boolean recursive, String requestId, Intege public Mono> listPathsNoCustomHeadersWithResponseAsync(boolean recursive, String requestId, Integer timeout, String continuation, String path, Integer maxResults, Boolean upn) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listPathsNoCustomHeaders(this.client.getUrl(), - this.client.getFileSystem(), this.client.getResource(), requestId, timeout, this.client.getVersion(), - continuation, path, recursive, maxResults, upn, accept, context)); + return FluxUtil + .withContext(context -> service.listPathsNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), + this.client.getResource(), requestId, timeout, this.client.getVersion(), continuation, path, recursive, + maxResults, upn, accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * List Paths - * + * * List FileSystem paths and their properties. - * + * * @param recursive Required. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. @@ -1760,16 +1845,18 @@ public Mono> listPathsNoCustomHeadersWithResponseAsync(boolea public Mono> listPathsNoCustomHeadersWithResponseAsync(boolean recursive, String requestId, Integer timeout, String continuation, String path, Integer maxResults, Boolean upn, Context context) { final String accept = "application/json"; - return service.listPathsNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), - this.client.getResource(), requestId, timeout, this.client.getVersion(), continuation, path, recursive, - maxResults, upn, accept, context); + return service + .listPathsNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), this.client.getResource(), + requestId, timeout, this.client.getVersion(), continuation, path, recursive, maxResults, upn, accept, + context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * List Paths - * + * * List FileSystem paths and their properties. - * + * * @param recursive Required. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. @@ -1800,16 +1887,20 @@ public ResponseBase listPathsWithResponse String requestId, Integer timeout, String continuation, String path, Integer maxResults, Boolean upn, Context context) { final String accept = "application/json"; - return service.listPathsSync(this.client.getUrl(), this.client.getFileSystem(), this.client.getResource(), - requestId, timeout, this.client.getVersion(), continuation, path, recursive, maxResults, upn, accept, - context); + try { + return service.listPathsSync(this.client.getUrl(), this.client.getFileSystem(), this.client.getResource(), + requestId, timeout, this.client.getVersion(), continuation, path, recursive, maxResults, upn, accept, + context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * List Paths - * + * * List FileSystem paths and their properties. - * + * * @param recursive Required. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. @@ -1837,15 +1928,19 @@ public ResponseBase listPathsWithResponse @ServiceMethod(returns = ReturnType.SINGLE) public PathList listPaths(boolean recursive, String requestId, Integer timeout, String continuation, String path, Integer maxResults, Boolean upn) { - return listPathsWithResponse(recursive, requestId, timeout, continuation, path, maxResults, upn, Context.NONE) - .getValue(); + try { + return listPathsWithResponse(recursive, requestId, timeout, continuation, path, maxResults, upn, + Context.NONE).getValue(); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * List Paths - * + * * List FileSystem paths and their properties. - * + * * @param recursive Required. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. @@ -1875,14 +1970,18 @@ public PathList listPaths(boolean recursive, String requestId, Integer timeout, public Response listPathsNoCustomHeadersWithResponse(boolean recursive, String requestId, Integer timeout, String continuation, String path, Integer maxResults, Boolean upn, Context context) { final String accept = "application/json"; - return service.listPathsNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), - this.client.getResource(), requestId, timeout, this.client.getVersion(), continuation, path, recursive, - maxResults, upn, accept, context); + try { + return service.listPathsNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), + this.client.getResource(), requestId, timeout, this.client.getVersion(), continuation, path, recursive, + maxResults, upn, accept, context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * The List Blobs operation returns a list of the blobs under the specified container. - * + * * @param prefix Filters results to filesystems within the specified prefix. * @param delimiter When the request includes this parameter, the operation returns a BlobPrefix element in the * response body that acts as a placeholder for all blobs whose names begin with the same substring up to the @@ -1918,14 +2017,16 @@ public Response listPathsNoCustomHeadersWithResponse(boolean recursive : include.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return FluxUtil.withContext(context -> service.listBlobHierarchySegment(this.client.getUrl(), - this.client.getFileSystem(), restype, comp, prefix, delimiter, marker, maxResults, includeConverted, - showonly, timeout, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.listBlobHierarchySegment(this.client.getUrl(), this.client.getFileSystem(), + restype, comp, prefix, delimiter, marker, maxResults, includeConverted, showonly, timeout, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * The List Blobs operation returns a list of the blobs under the specified container. - * + * * @param prefix Filters results to filesystems within the specified prefix. * @param delimiter When the request includes this parameter, the operation returns a BlobPrefix element in the * response body that acts as a placeholder for all blobs whose names begin with the same substring up to the @@ -1963,14 +2064,16 @@ public Response listPathsNoCustomHeadersWithResponse(boolean recursive : include.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return service.listBlobHierarchySegment(this.client.getUrl(), this.client.getFileSystem(), restype, comp, - prefix, delimiter, marker, maxResults, includeConverted, showonly, timeout, this.client.getVersion(), - requestId, accept, context); + return service + .listBlobHierarchySegment(this.client.getUrl(), this.client.getFileSystem(), restype, comp, prefix, + delimiter, marker, maxResults, includeConverted, showonly, timeout, this.client.getVersion(), requestId, + accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * The List Blobs operation returns a list of the blobs under the specified container. - * + * * @param prefix Filters results to filesystems within the specified prefix. * @param delimiter When the request includes this parameter, the operation returns a BlobPrefix element in the * response body that acts as a placeholder for all blobs whose names begin with the same substring up to the @@ -1999,12 +2102,14 @@ public Mono listBlobHierarchySegmentAsync(Str String marker, Integer maxResults, List include, ListBlobsShowOnly showonly, Integer timeout, String requestId) { return listBlobHierarchySegmentWithResponseAsync(prefix, delimiter, marker, maxResults, include, showonly, - timeout, requestId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + timeout, requestId) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * The List Blobs operation returns a list of the blobs under the specified container. - * + * * @param prefix Filters results to filesystems within the specified prefix. * @param delimiter When the request includes this parameter, the operation returns a BlobPrefix element in the * response body that acts as a placeholder for all blobs whose names begin with the same substring up to the @@ -2034,12 +2139,14 @@ public Mono listBlobHierarchySegmentAsync(Str String marker, Integer maxResults, List include, ListBlobsShowOnly showonly, Integer timeout, String requestId, Context context) { return listBlobHierarchySegmentWithResponseAsync(prefix, delimiter, marker, maxResults, include, showonly, - timeout, requestId, context).flatMap(res -> Mono.justOrEmpty(res.getValue())); + timeout, requestId, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * The List Blobs operation returns a list of the blobs under the specified container. - * + * * @param prefix Filters results to filesystems within the specified prefix. * @param delimiter When the request includes this parameter, the operation returns a BlobPrefix element in the * response body that acts as a placeholder for all blobs whose names begin with the same substring up to the @@ -2075,14 +2182,16 @@ public Mono> listBlobHierarchySegmen : include.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return FluxUtil.withContext(context -> service.listBlobHierarchySegmentNoCustomHeaders(this.client.getUrl(), - this.client.getFileSystem(), restype, comp, prefix, delimiter, marker, maxResults, includeConverted, - showonly, timeout, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.listBlobHierarchySegmentNoCustomHeaders(this.client.getUrl(), + this.client.getFileSystem(), restype, comp, prefix, delimiter, marker, maxResults, includeConverted, + showonly, timeout, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * The List Blobs operation returns a list of the blobs under the specified container. - * + * * @param prefix Filters results to filesystems within the specified prefix. * @param delimiter When the request includes this parameter, the operation returns a BlobPrefix element in the * response body that acts as a placeholder for all blobs whose names begin with the same substring up to the @@ -2119,14 +2228,16 @@ public Mono> listBlobHierarchySegmen : include.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return service.listBlobHierarchySegmentNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), - restype, comp, prefix, delimiter, marker, maxResults, includeConverted, showonly, timeout, - this.client.getVersion(), requestId, accept, context); + return service + .listBlobHierarchySegmentNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), restype, comp, + prefix, delimiter, marker, maxResults, includeConverted, showonly, timeout, this.client.getVersion(), + requestId, accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * The List Blobs operation returns a list of the blobs under the specified container. - * + * * @param prefix Filters results to filesystems within the specified prefix. * @param delimiter When the request includes this parameter, the operation returns a BlobPrefix element in the * response body that acts as a placeholder for all blobs whose names begin with the same substring up to the @@ -2164,14 +2275,18 @@ public Mono> listBlobHierarchySegmen : include.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return service.listBlobHierarchySegmentSync(this.client.getUrl(), this.client.getFileSystem(), restype, comp, - prefix, delimiter, marker, maxResults, includeConverted, showonly, timeout, this.client.getVersion(), - requestId, accept, context); + try { + return service.listBlobHierarchySegmentSync(this.client.getUrl(), this.client.getFileSystem(), restype, + comp, prefix, delimiter, marker, maxResults, includeConverted, showonly, timeout, + this.client.getVersion(), requestId, accept, context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * The List Blobs operation returns a list of the blobs under the specified container. - * + * * @param prefix Filters results to filesystems within the specified prefix. * @param delimiter When the request includes this parameter, the operation returns a BlobPrefix element in the * response body that acts as a placeholder for all blobs whose names begin with the same substring up to the @@ -2199,13 +2314,17 @@ public Mono> listBlobHierarchySegmen public ListBlobsHierarchySegmentResponse listBlobHierarchySegment(String prefix, String delimiter, String marker, Integer maxResults, List include, ListBlobsShowOnly showonly, Integer timeout, String requestId) { - return listBlobHierarchySegmentWithResponse(prefix, delimiter, marker, maxResults, include, showonly, timeout, - requestId, Context.NONE).getValue(); + try { + return listBlobHierarchySegmentWithResponse(prefix, delimiter, marker, maxResults, include, showonly, + timeout, requestId, Context.NONE).getValue(); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * The List Blobs operation returns a list of the blobs under the specified container. - * + * * @param prefix Filters results to filesystems within the specified prefix. * @param delimiter When the request includes this parameter, the operation returns a BlobPrefix element in the * response body that acts as a placeholder for all blobs whose names begin with the same substring up to the @@ -2242,8 +2361,12 @@ public Response listBlobHierarchySegmentNoCus : include.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return service.listBlobHierarchySegmentNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), - restype, comp, prefix, delimiter, marker, maxResults, includeConverted, showonly, timeout, - this.client.getVersion(), requestId, accept, context); + try { + return service.listBlobHierarchySegmentNoCustomHeadersSync(this.client.getUrl(), + this.client.getFileSystem(), restype, comp, prefix, delimiter, marker, maxResults, includeConverted, + showonly, timeout, this.client.getVersion(), requestId, accept, context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } } diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/PathsImpl.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/PathsImpl.java index a93b48b5fcdd..364b39ddcf40 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/PathsImpl.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/PathsImpl.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.storage.file.datalake.implementation; import com.azure.core.annotation.BodyParam; @@ -63,11 +62,13 @@ import java.time.OffsetDateTime; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import com.azure.storage.file.datalake.implementation.util.ModelHelper; /** * An instance of this class provides access to all the operations defined in Paths. */ public final class PathsImpl { + /** * The proxy service used to perform REST calls. */ @@ -80,7 +81,7 @@ public final class PathsImpl { /** * Initializes an instance of PathsImpl. - * + * * @param client the instance of the service client containing this operation class. */ PathsImpl(AzureDataLakeStorageRestAPIImpl client) { @@ -95,6 +96,7 @@ public final class PathsImpl { @Host("{url}") @ServiceInterface(name = "AzureDataLakeStorage") public interface PathsService { + @Put("/{filesystem}/{path}") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(DataLakeStorageExceptionInternal.class) @@ -1030,13 +1032,13 @@ Response undeleteNoCustomHeadersSync(@HostParam("url") String url, /** * Create File | Create Directory | Rename File | Rename Directory - * + * * Create or rename a file or directory. By default, the destination is overwritten and if the destination already * exists and has a lease the lease is broken. This operation supports conditional HTTP requests. For more * information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). * To fail if the destination already exists, use a conditional request with If-None-Match: "*". - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1196,24 +1198,26 @@ public Mono> createWithResponseAsync(Stri = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - return FluxUtil.withContext(context -> service.create(this.client.getUrl(), this.client.getFileSystem(), - this.client.getPath(), requestId, timeout, this.client.getVersion(), resource, continuation, mode, - cacheControl, contentEncoding, contentLanguage, contentDisposition, contentType, renameSource, leaseId, - sourceLeaseId, properties, permissions, umask, ifMatch, ifNoneMatch, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, sourceIfModifiedSinceConverted, - sourceIfUnmodifiedSinceConverted, encryptionKey, encryptionKeySha256, encryptionAlgorithm, owner, group, - acl, proposedLeaseId, leaseDuration, expiryOptions, expiresOn, encryptionContext, accept, context)); + return FluxUtil + .withContext(context -> service.create(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), requestId, timeout, this.client.getVersion(), resource, continuation, mode, + cacheControl, contentEncoding, contentLanguage, contentDisposition, contentType, renameSource, leaseId, + sourceLeaseId, properties, permissions, umask, ifMatch, ifNoneMatch, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, sourceIfModifiedSinceConverted, + sourceIfUnmodifiedSinceConverted, encryptionKey, encryptionKeySha256, encryptionAlgorithm, owner, group, + acl, proposedLeaseId, leaseDuration, expiryOptions, expiresOn, encryptionContext, accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Create File | Create Directory | Rename File | Rename Directory - * + * * Create or rename a file or directory. By default, the destination is overwritten and if the destination already * exists and has a lease the lease is broken. This operation supports conditional HTTP requests. For more * information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). * To fail if the destination already exists, use a conditional request with If-None-Match: "*". - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1374,24 +1378,26 @@ public Mono> createWithResponseAsync(Stri = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - return service.create(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), requestId, - timeout, this.client.getVersion(), resource, continuation, mode, cacheControl, contentEncoding, - contentLanguage, contentDisposition, contentType, renameSource, leaseId, sourceLeaseId, properties, - permissions, umask, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - sourceIfMatch, sourceIfNoneMatch, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, owner, group, acl, proposedLeaseId, leaseDuration, - expiryOptions, expiresOn, encryptionContext, accept, context); + return service + .create(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), requestId, timeout, + this.client.getVersion(), resource, continuation, mode, cacheControl, contentEncoding, contentLanguage, + contentDisposition, contentType, renameSource, leaseId, sourceLeaseId, properties, permissions, umask, + ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, sourceIfMatch, + sourceIfNoneMatch, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, owner, group, acl, proposedLeaseId, leaseDuration, + expiryOptions, expiresOn, encryptionContext, accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Create File | Create Directory | Rename File | Rename Directory - * + * * Create or rename a file or directory. By default, the destination is overwritten and if the destination already * exists and has a lease the lease is broken. This operation supports conditional HTTP requests. For more * information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). * To fail if the destination already exists, use a conditional request with If-None-Match: "*". - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1459,18 +1465,20 @@ public Mono createAsync(String requestId, Integer timeout, PathResourceTyp return createWithResponseAsync(requestId, timeout, resource, continuation, mode, renameSource, sourceLeaseId, properties, permissions, umask, owner, group, acl, proposedLeaseId, leaseDuration, expiryOptions, expiresOn, encryptionContext, pathHttpHeaders, leaseAccessConditions, modifiedAccessConditions, - sourceModifiedAccessConditions, cpkInfo).flatMap(ignored -> Mono.empty()); + sourceModifiedAccessConditions, cpkInfo) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Create File | Create Directory | Rename File | Rename Directory - * + * * Create or rename a file or directory. By default, the destination is overwritten and if the destination already * exists and has a lease the lease is broken. This operation supports conditional HTTP requests. For more * information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). * To fail if the destination already exists, use a conditional request with If-None-Match: "*". - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1539,18 +1547,20 @@ public Mono createAsync(String requestId, Integer timeout, PathResourceTyp return createWithResponseAsync(requestId, timeout, resource, continuation, mode, renameSource, sourceLeaseId, properties, permissions, umask, owner, group, acl, proposedLeaseId, leaseDuration, expiryOptions, expiresOn, encryptionContext, pathHttpHeaders, leaseAccessConditions, modifiedAccessConditions, - sourceModifiedAccessConditions, cpkInfo, context).flatMap(ignored -> Mono.empty()); + sourceModifiedAccessConditions, cpkInfo, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Create File | Create Directory | Rename File | Rename Directory - * + * * Create or rename a file or directory. By default, the destination is overwritten and if the destination already * exists and has a lease the lease is broken. This operation supports conditional HTTP requests. For more * information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). * To fail if the destination already exists, use a conditional request with If-None-Match: "*". - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1717,18 +1727,19 @@ public Mono> createNoCustomHeadersWithResponseAsync(String reques sourceLeaseId, properties, permissions, umask, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, encryptionKey, encryptionKeySha256, encryptionAlgorithm, owner, group, - acl, proposedLeaseId, leaseDuration, expiryOptions, expiresOn, encryptionContext, accept, context)); + acl, proposedLeaseId, leaseDuration, expiryOptions, expiresOn, encryptionContext, accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Create File | Create Directory | Rename File | Rename Directory - * + * * Create or rename a file or directory. By default, the destination is overwritten and if the destination already * exists and has a lease the lease is broken. This operation supports conditional HTTP requests. For more * information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). * To fail if the destination already exists, use a conditional request with If-None-Match: "*". - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1889,24 +1900,26 @@ public Mono> createNoCustomHeadersWithResponseAsync(String reques = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - return service.createNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), - requestId, timeout, this.client.getVersion(), resource, continuation, mode, cacheControl, contentEncoding, - contentLanguage, contentDisposition, contentType, renameSource, leaseId, sourceLeaseId, properties, - permissions, umask, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - sourceIfMatch, sourceIfNoneMatch, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, owner, group, acl, proposedLeaseId, leaseDuration, - expiryOptions, expiresOn, encryptionContext, accept, context); + return service + .createNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), requestId, + timeout, this.client.getVersion(), resource, continuation, mode, cacheControl, contentEncoding, + contentLanguage, contentDisposition, contentType, renameSource, leaseId, sourceLeaseId, properties, + permissions, umask, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, + sourceIfMatch, sourceIfNoneMatch, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, + encryptionKey, encryptionKeySha256, encryptionAlgorithm, owner, group, acl, proposedLeaseId, + leaseDuration, expiryOptions, expiresOn, encryptionContext, accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Create File | Create Directory | Rename File | Rename Directory - * + * * Create or rename a file or directory. By default, the destination is overwritten and if the destination already * exists and has a lease the lease is broken. This operation supports conditional HTTP requests. For more * information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). * To fail if the destination already exists, use a conditional request with If-None-Match: "*". - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2067,24 +2080,28 @@ public ResponseBase createWithResponse(String requestI = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - return service.createSync(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), requestId, - timeout, this.client.getVersion(), resource, continuation, mode, cacheControl, contentEncoding, - contentLanguage, contentDisposition, contentType, renameSource, leaseId, sourceLeaseId, properties, - permissions, umask, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - sourceIfMatch, sourceIfNoneMatch, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, owner, group, acl, proposedLeaseId, leaseDuration, - expiryOptions, expiresOn, encryptionContext, accept, context); + try { + return service.createSync(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), + requestId, timeout, this.client.getVersion(), resource, continuation, mode, cacheControl, + contentEncoding, contentLanguage, contentDisposition, contentType, renameSource, leaseId, sourceLeaseId, + properties, permissions, umask, ifMatch, ifNoneMatch, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, sourceIfModifiedSinceConverted, + sourceIfUnmodifiedSinceConverted, encryptionKey, encryptionKeySha256, encryptionAlgorithm, owner, group, + acl, proposedLeaseId, leaseDuration, expiryOptions, expiresOn, encryptionContext, accept, context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Create File | Create Directory | Rename File | Rename Directory - * + * * Create or rename a file or directory. By default, the destination is overwritten and if the destination already * exists and has a lease the lease is broken. This operation supports conditional HTTP requests. For more * information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). * To fail if the destination already exists, use a conditional request with If-None-Match: "*". - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2156,13 +2173,13 @@ public void create(String requestId, Integer timeout, PathResourceType resource, /** * Create File | Create Directory | Rename File | Rename Directory - * + * * Create or rename a file or directory. By default, the destination is overwritten and if the destination already * exists and has a lease the lease is broken. This operation supports conditional HTTP requests. For more * information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). * To fail if the destination already exists, use a conditional request with If-None-Match: "*". - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2323,24 +2340,28 @@ public Response createNoCustomHeadersWithResponse(String requestId, Intege = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - return service.createNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), - this.client.getPath(), requestId, timeout, this.client.getVersion(), resource, continuation, mode, - cacheControl, contentEncoding, contentLanguage, contentDisposition, contentType, renameSource, leaseId, - sourceLeaseId, properties, permissions, umask, ifMatch, ifNoneMatch, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, sourceIfModifiedSinceConverted, - sourceIfUnmodifiedSinceConverted, encryptionKey, encryptionKeySha256, encryptionAlgorithm, owner, group, - acl, proposedLeaseId, leaseDuration, expiryOptions, expiresOn, encryptionContext, accept, context); + try { + return service.createNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), requestId, timeout, this.client.getVersion(), resource, continuation, mode, + cacheControl, contentEncoding, contentLanguage, contentDisposition, contentType, renameSource, leaseId, + sourceLeaseId, properties, permissions, umask, ifMatch, ifNoneMatch, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, sourceIfModifiedSinceConverted, + sourceIfUnmodifiedSinceConverted, encryptionKey, encryptionKeySha256, encryptionAlgorithm, owner, group, + acl, proposedLeaseId, leaseDuration, expiryOptions, expiresOn, encryptionContext, accept, context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Append Data | Flush Data | Set Properties | Set Access Control - * + * * Uploads data to be appended to a file, flushes (writes) previously uploaded data to a file, sets properties for a * file or directory, or sets access control for a file or directory. Data can only be appended to a file. * Concurrent writes to the same file using multiple clients are not supported. This operation supports conditional * HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param action The action must be "append" to upload data to be appended to a file, "flush" to flush previously * uploaded data to a file, "setProperties" to set the properties of a file or directory, "setAccessControl" to set * the owner, group, permissions, or access control list for a file or directory, or "setAccessControlRecursive" to @@ -2478,23 +2499,25 @@ public Mono> = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.update(this.client.getUrl(), this.client.getFileSystem(), - this.client.getPath(), requestId, timeout, this.client.getVersion(), action, maxRecords, continuation, mode, - forceFlag, position, retainUncommittedData, close, contentLength, contentMd5Converted, leaseId, - cacheControl, contentType, contentDisposition, contentEncoding, contentLanguage, properties, owner, group, - permissions, acl, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, body, accept, - context)); + return FluxUtil + .withContext(context -> service.update(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), requestId, timeout, this.client.getVersion(), action, maxRecords, continuation, + mode, forceFlag, position, retainUncommittedData, close, contentLength, contentMd5Converted, leaseId, + cacheControl, contentType, contentDisposition, contentEncoding, contentLanguage, properties, owner, + group, permissions, acl, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, + body, accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Append Data | Flush Data | Set Properties | Set Access Control - * + * * Uploads data to be appended to a file, flushes (writes) previously uploaded data to a file, sets properties for a * file or directory, or sets access control for a file or directory. Data can only be appended to a file. * Concurrent writes to the same file using multiple clients are not supported. This operation supports conditional * HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param action The action must be "append" to upload data to be appended to a file, "flush" to flush previously * uploaded data to a file, "setProperties" to set the properties of a file or directory, "setAccessControl" to set * the owner, group, permissions, or access control list for a file or directory, or "setAccessControlRecursive" to @@ -2633,22 +2656,24 @@ public Mono> = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.update(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), requestId, - timeout, this.client.getVersion(), action, maxRecords, continuation, mode, forceFlag, position, - retainUncommittedData, close, contentLength, contentMd5Converted, leaseId, cacheControl, contentType, - contentDisposition, contentEncoding, contentLanguage, properties, owner, group, permissions, acl, ifMatch, - ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, body, accept, context); + return service + .update(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), requestId, timeout, + this.client.getVersion(), action, maxRecords, continuation, mode, forceFlag, position, + retainUncommittedData, close, contentLength, contentMd5Converted, leaseId, cacheControl, contentType, + contentDisposition, contentEncoding, contentLanguage, properties, owner, group, permissions, acl, + ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, body, accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Append Data | Flush Data | Set Properties | Set Access Control - * + * * Uploads data to be appended to a file, flushes (writes) previously uploaded data to a file, sets properties for a * file or directory, or sets access control for a file or directory. Data can only be appended to a file. * Concurrent writes to the same file using multiple clients are not supported. This operation supports conditional * HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param action The action must be "append" to upload data to be appended to a file, "flush" to flush previously * uploaded data to a file, "setProperties" to set the properties of a file or directory, "setAccessControl" to set * the owner, group, permissions, or access control list for a file or directory, or "setAccessControlRecursive" to @@ -2728,18 +2753,19 @@ public Mono updateAsync(PathUpdateAction acti return updateWithResponseAsync(action, mode, body, requestId, timeout, maxRecords, continuation, forceFlag, position, retainUncommittedData, close, contentLength, properties, owner, group, permissions, acl, pathHttpHeaders, leaseAccessConditions, modifiedAccessConditions) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Append Data | Flush Data | Set Properties | Set Access Control - * + * * Uploads data to be appended to a file, flushes (writes) previously uploaded data to a file, sets properties for a * file or directory, or sets access control for a file or directory. Data can only be appended to a file. * Concurrent writes to the same file using multiple clients are not supported. This operation supports conditional * HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param action The action must be "append" to upload data to be appended to a file, "flush" to flush previously * uploaded data to a file, "setProperties" to set the properties of a file or directory, "setAccessControl" to set * the owner, group, permissions, or access control list for a file or directory, or "setAccessControlRecursive" to @@ -2820,18 +2846,19 @@ public Mono updateAsync(PathUpdateAction acti return updateWithResponseAsync(action, mode, body, requestId, timeout, maxRecords, continuation, forceFlag, position, retainUncommittedData, close, contentLength, properties, owner, group, permissions, acl, pathHttpHeaders, leaseAccessConditions, modifiedAccessConditions, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Append Data | Flush Data | Set Properties | Set Access Control - * + * * Uploads data to be appended to a file, flushes (writes) previously uploaded data to a file, sets properties for a * file or directory, or sets access control for a file or directory. Data can only be appended to a file. * Concurrent writes to the same file using multiple clients are not supported. This operation supports conditional * HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param action The action must be "append" to upload data to be appended to a file, "flush" to flush previously * uploaded data to a file, "setProperties" to set the properties of a file or directory, "setAccessControl" to set * the owner, group, permissions, or access control list for a file or directory, or "setAccessControlRecursive" to @@ -2969,23 +2996,25 @@ public Mono> updateNoCustomHeadersWi = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.updateNoCustomHeaders(this.client.getUrl(), - this.client.getFileSystem(), this.client.getPath(), requestId, timeout, this.client.getVersion(), action, - maxRecords, continuation, mode, forceFlag, position, retainUncommittedData, close, contentLength, - contentMd5Converted, leaseId, cacheControl, contentType, contentDisposition, contentEncoding, - contentLanguage, properties, owner, group, permissions, acl, ifMatch, ifNoneMatch, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, body, accept, context)); + return FluxUtil + .withContext(context -> service.updateNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), requestId, timeout, this.client.getVersion(), action, maxRecords, continuation, + mode, forceFlag, position, retainUncommittedData, close, contentLength, contentMd5Converted, leaseId, + cacheControl, contentType, contentDisposition, contentEncoding, contentLanguage, properties, owner, + group, permissions, acl, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, + body, accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Append Data | Flush Data | Set Properties | Set Access Control - * + * * Uploads data to be appended to a file, flushes (writes) previously uploaded data to a file, sets properties for a * file or directory, or sets access control for a file or directory. Data can only be appended to a file. * Concurrent writes to the same file using multiple clients are not supported. This operation supports conditional * HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param action The action must be "append" to upload data to be appended to a file, "flush" to flush previously * uploaded data to a file, "setProperties" to set the properties of a file or directory, "setAccessControl" to set * the owner, group, permissions, or access control list for a file or directory, or "setAccessControlRecursive" to @@ -3124,22 +3153,24 @@ public Mono> updateNoCustomHeadersWi = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.updateNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), - requestId, timeout, this.client.getVersion(), action, maxRecords, continuation, mode, forceFlag, position, - retainUncommittedData, close, contentLength, contentMd5Converted, leaseId, cacheControl, contentType, - contentDisposition, contentEncoding, contentLanguage, properties, owner, group, permissions, acl, ifMatch, - ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, body, accept, context); + return service + .updateNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), requestId, + timeout, this.client.getVersion(), action, maxRecords, continuation, mode, forceFlag, position, + retainUncommittedData, close, contentLength, contentMd5Converted, leaseId, cacheControl, contentType, + contentDisposition, contentEncoding, contentLanguage, properties, owner, group, permissions, acl, + ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, body, accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Append Data | Flush Data | Set Properties | Set Access Control - * + * * Uploads data to be appended to a file, flushes (writes) previously uploaded data to a file, sets properties for a * file or directory, or sets access control for a file or directory. Data can only be appended to a file. * Concurrent writes to the same file using multiple clients are not supported. This operation supports conditional * HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param action The action must be "append" to upload data to be appended to a file, "flush" to flush previously * uploaded data to a file, "setProperties" to set the properties of a file or directory, "setAccessControl" to set * the owner, group, permissions, or access control list for a file or directory, or "setAccessControlRecursive" to @@ -3277,23 +3308,25 @@ public Mono> = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.update(this.client.getUrl(), this.client.getFileSystem(), - this.client.getPath(), requestId, timeout, this.client.getVersion(), action, maxRecords, continuation, mode, - forceFlag, position, retainUncommittedData, close, contentLength, contentMd5Converted, leaseId, - cacheControl, contentType, contentDisposition, contentEncoding, contentLanguage, properties, owner, group, - permissions, acl, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, body, accept, - context)); + return FluxUtil + .withContext(context -> service.update(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), requestId, timeout, this.client.getVersion(), action, maxRecords, continuation, + mode, forceFlag, position, retainUncommittedData, close, contentLength, contentMd5Converted, leaseId, + cacheControl, contentType, contentDisposition, contentEncoding, contentLanguage, properties, owner, + group, permissions, acl, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, + body, accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Append Data | Flush Data | Set Properties | Set Access Control - * + * * Uploads data to be appended to a file, flushes (writes) previously uploaded data to a file, sets properties for a * file or directory, or sets access control for a file or directory. Data can only be appended to a file. * Concurrent writes to the same file using multiple clients are not supported. This operation supports conditional * HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param action The action must be "append" to upload data to be appended to a file, "flush" to flush previously * uploaded data to a file, "setProperties" to set the properties of a file or directory, "setAccessControl" to set * the owner, group, permissions, or access control list for a file or directory, or "setAccessControlRecursive" to @@ -3432,22 +3465,24 @@ public Mono> = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.update(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), requestId, - timeout, this.client.getVersion(), action, maxRecords, continuation, mode, forceFlag, position, - retainUncommittedData, close, contentLength, contentMd5Converted, leaseId, cacheControl, contentType, - contentDisposition, contentEncoding, contentLanguage, properties, owner, group, permissions, acl, ifMatch, - ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, body, accept, context); + return service + .update(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), requestId, timeout, + this.client.getVersion(), action, maxRecords, continuation, mode, forceFlag, position, + retainUncommittedData, close, contentLength, contentMd5Converted, leaseId, cacheControl, contentType, + contentDisposition, contentEncoding, contentLanguage, properties, owner, group, permissions, acl, + ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, body, accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Append Data | Flush Data | Set Properties | Set Access Control - * + * * Uploads data to be appended to a file, flushes (writes) previously uploaded data to a file, sets properties for a * file or directory, or sets access control for a file or directory. Data can only be appended to a file. * Concurrent writes to the same file using multiple clients are not supported. This operation supports conditional * HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param action The action must be "append" to upload data to be appended to a file, "flush" to flush previously * uploaded data to a file, "setProperties" to set the properties of a file or directory, "setAccessControl" to set * the owner, group, permissions, or access control list for a file or directory, or "setAccessControlRecursive" to @@ -3527,18 +3562,19 @@ public Mono updateAsync(PathUpdateAction acti return updateWithResponseAsync(action, mode, body, requestId, timeout, maxRecords, continuation, forceFlag, position, retainUncommittedData, close, contentLength, properties, owner, group, permissions, acl, pathHttpHeaders, leaseAccessConditions, modifiedAccessConditions) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Append Data | Flush Data | Set Properties | Set Access Control - * + * * Uploads data to be appended to a file, flushes (writes) previously uploaded data to a file, sets properties for a * file or directory, or sets access control for a file or directory. Data can only be appended to a file. * Concurrent writes to the same file using multiple clients are not supported. This operation supports conditional * HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param action The action must be "append" to upload data to be appended to a file, "flush" to flush previously * uploaded data to a file, "setProperties" to set the properties of a file or directory, "setAccessControl" to set * the owner, group, permissions, or access control list for a file or directory, or "setAccessControlRecursive" to @@ -3619,18 +3655,19 @@ public Mono updateAsync(PathUpdateAction acti return updateWithResponseAsync(action, mode, body, requestId, timeout, maxRecords, continuation, forceFlag, position, retainUncommittedData, close, contentLength, properties, owner, group, permissions, acl, pathHttpHeaders, leaseAccessConditions, modifiedAccessConditions, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Append Data | Flush Data | Set Properties | Set Access Control - * + * * Uploads data to be appended to a file, flushes (writes) previously uploaded data to a file, sets properties for a * file or directory, or sets access control for a file or directory. Data can only be appended to a file. * Concurrent writes to the same file using multiple clients are not supported. This operation supports conditional * HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param action The action must be "append" to upload data to be appended to a file, "flush" to flush previously * uploaded data to a file, "setProperties" to set the properties of a file or directory, "setAccessControl" to set * the owner, group, permissions, or access control list for a file or directory, or "setAccessControlRecursive" to @@ -3768,23 +3805,25 @@ public Mono> updateNoCustomHeadersWi = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.updateNoCustomHeaders(this.client.getUrl(), - this.client.getFileSystem(), this.client.getPath(), requestId, timeout, this.client.getVersion(), action, - maxRecords, continuation, mode, forceFlag, position, retainUncommittedData, close, contentLength, - contentMd5Converted, leaseId, cacheControl, contentType, contentDisposition, contentEncoding, - contentLanguage, properties, owner, group, permissions, acl, ifMatch, ifNoneMatch, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, body, accept, context)); + return FluxUtil + .withContext(context -> service.updateNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), requestId, timeout, this.client.getVersion(), action, maxRecords, continuation, + mode, forceFlag, position, retainUncommittedData, close, contentLength, contentMd5Converted, leaseId, + cacheControl, contentType, contentDisposition, contentEncoding, contentLanguage, properties, owner, + group, permissions, acl, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, + body, accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Append Data | Flush Data | Set Properties | Set Access Control - * + * * Uploads data to be appended to a file, flushes (writes) previously uploaded data to a file, sets properties for a * file or directory, or sets access control for a file or directory. Data can only be appended to a file. * Concurrent writes to the same file using multiple clients are not supported. This operation supports conditional * HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param action The action must be "append" to upload data to be appended to a file, "flush" to flush previously * uploaded data to a file, "setProperties" to set the properties of a file or directory, "setAccessControl" to set * the owner, group, permissions, or access control list for a file or directory, or "setAccessControlRecursive" to @@ -3923,22 +3962,24 @@ public Mono> updateNoCustomHeadersWi = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.updateNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), - requestId, timeout, this.client.getVersion(), action, maxRecords, continuation, mode, forceFlag, position, - retainUncommittedData, close, contentLength, contentMd5Converted, leaseId, cacheControl, contentType, - contentDisposition, contentEncoding, contentLanguage, properties, owner, group, permissions, acl, ifMatch, - ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, body, accept, context); + return service + .updateNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), requestId, + timeout, this.client.getVersion(), action, maxRecords, continuation, mode, forceFlag, position, + retainUncommittedData, close, contentLength, contentMd5Converted, leaseId, cacheControl, contentType, + contentDisposition, contentEncoding, contentLanguage, properties, owner, group, permissions, acl, + ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, body, accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Append Data | Flush Data | Set Properties | Set Access Control - * + * * Uploads data to be appended to a file, flushes (writes) previously uploaded data to a file, sets properties for a * file or directory, or sets access control for a file or directory. Data can only be appended to a file. * Concurrent writes to the same file using multiple clients are not supported. This operation supports conditional * HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param action The action must be "append" to upload data to be appended to a file, "flush" to flush previously * uploaded data to a file, "setProperties" to set the properties of a file or directory, "setAccessControl" to set * the owner, group, permissions, or access control list for a file or directory, or "setAccessControlRecursive" to @@ -4077,22 +4118,27 @@ public ResponseBase updat = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.updateSync(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), requestId, - timeout, this.client.getVersion(), action, maxRecords, continuation, mode, forceFlag, position, - retainUncommittedData, close, contentLength, contentMd5Converted, leaseId, cacheControl, contentType, - contentDisposition, contentEncoding, contentLanguage, properties, owner, group, permissions, acl, ifMatch, - ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, body, accept, context); + try { + return service.updateSync(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), + requestId, timeout, this.client.getVersion(), action, maxRecords, continuation, mode, forceFlag, + position, retainUncommittedData, close, contentLength, contentMd5Converted, leaseId, cacheControl, + contentType, contentDisposition, contentEncoding, contentLanguage, properties, owner, group, + permissions, acl, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, body, + accept, context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Append Data | Flush Data | Set Properties | Set Access Control - * + * * Uploads data to be appended to a file, flushes (writes) previously uploaded data to a file, sets properties for a * file or directory, or sets access control for a file or directory. Data can only be appended to a file. * Concurrent writes to the same file using multiple clients are not supported. This operation supports conditional * HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param action The action must be "append" to upload data to be appended to a file, "flush" to flush previously * uploaded data to a file, "setProperties" to set the properties of a file or directory, "setAccessControl" to set * the owner, group, permissions, or access control list for a file or directory, or "setAccessControlRecursive" to @@ -4168,20 +4214,24 @@ public SetAccessControlRecursiveResponse update(PathUpdateAction action, PathSet Long position, Boolean retainUncommittedData, Boolean close, Long contentLength, String properties, String owner, String group, String permissions, String acl, PathHttpHeaders pathHttpHeaders, LeaseAccessConditions leaseAccessConditions, ModifiedAccessConditions modifiedAccessConditions) { - return updateWithResponse(action, mode, body, requestId, timeout, maxRecords, continuation, forceFlag, position, - retainUncommittedData, close, contentLength, properties, owner, group, permissions, acl, pathHttpHeaders, - leaseAccessConditions, modifiedAccessConditions, Context.NONE).getValue(); + try { + return updateWithResponse(action, mode, body, requestId, timeout, maxRecords, continuation, forceFlag, + position, retainUncommittedData, close, contentLength, properties, owner, group, permissions, acl, + pathHttpHeaders, leaseAccessConditions, modifiedAccessConditions, Context.NONE).getValue(); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Append Data | Flush Data | Set Properties | Set Access Control - * + * * Uploads data to be appended to a file, flushes (writes) previously uploaded data to a file, sets properties for a * file or directory, or sets access control for a file or directory. Data can only be appended to a file. * Concurrent writes to the same file using multiple clients are not supported. This operation supports conditional * HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param action The action must be "append" to upload data to be appended to a file, "flush" to flush previously * uploaded data to a file, "setProperties" to set the properties of a file or directory, "setAccessControl" to set * the owner, group, permissions, or access control list for a file or directory, or "setAccessControlRecursive" to @@ -4320,21 +4370,25 @@ public Response updateNoCustomHeadersWithResp = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.updateNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), - this.client.getPath(), requestId, timeout, this.client.getVersion(), action, maxRecords, continuation, mode, - forceFlag, position, retainUncommittedData, close, contentLength, contentMd5Converted, leaseId, - cacheControl, contentType, contentDisposition, contentEncoding, contentLanguage, properties, owner, group, - permissions, acl, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, body, accept, - context); + try { + return service.updateNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), requestId, timeout, this.client.getVersion(), action, maxRecords, continuation, + mode, forceFlag, position, retainUncommittedData, close, contentLength, contentMd5Converted, leaseId, + cacheControl, contentType, contentDisposition, contentEncoding, contentLanguage, properties, owner, + group, permissions, acl, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, + body, accept, context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Lease Path - * + * * Create and manage a lease to restrict write and delete access to the path. This operation supports conditional * HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param xMsLeaseAction There are five lease actions: "acquire", "break", "change", "renew", and "release". Use * "acquire" and specify the "x-ms-proposed-lease-id" and "x-ms-lease-duration" to acquire a new lease. Use "break" * to break an existing lease. When a lease is broken, the lease break period is allowed to elapse, during which @@ -4394,19 +4448,21 @@ public Mono> leaseWithResponseAsync(PathLe = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.lease(this.client.getUrl(), this.client.getFileSystem(), - this.client.getPath(), requestId, timeout, this.client.getVersion(), xMsLeaseAction, - this.client.getXMsLeaseDuration(), xMsLeaseBreakPeriod, leaseId, proposedLeaseId, ifMatch, ifNoneMatch, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, accept, context)); + return FluxUtil + .withContext(context -> service.lease(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), requestId, timeout, this.client.getVersion(), xMsLeaseAction, + this.client.getXMsLeaseDuration(), xMsLeaseBreakPeriod, leaseId, proposedLeaseId, ifMatch, ifNoneMatch, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Lease Path - * + * * Create and manage a lease to restrict write and delete access to the path. This operation supports conditional * HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param xMsLeaseAction There are five lease actions: "acquire", "break", "change", "renew", and "release". Use * "acquire" and specify the "x-ms-proposed-lease-id" and "x-ms-lease-duration" to acquire a new lease. Use "break" * to break an existing lease. When a lease is broken, the lease break period is allowed to elapse, during which @@ -4468,19 +4524,21 @@ public Mono> leaseWithResponseAsync(PathLe = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.lease(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), requestId, - timeout, this.client.getVersion(), xMsLeaseAction, this.client.getXMsLeaseDuration(), xMsLeaseBreakPeriod, - leaseId, proposedLeaseId, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - accept, context); + return service + .lease(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), requestId, timeout, + this.client.getVersion(), xMsLeaseAction, this.client.getXMsLeaseDuration(), xMsLeaseBreakPeriod, + leaseId, proposedLeaseId, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, + accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Lease Path - * + * * Create and manage a lease to restrict write and delete access to the path. This operation supports conditional * HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param xMsLeaseAction There are five lease actions: "acquire", "break", "change", "renew", and "release". Use * "acquire" and specify the "x-ms-proposed-lease-id" and "x-ms-lease-duration" to acquire a new lease. Use "break" * to break an existing lease. When a lease is broken, the lease break period is allowed to elapse, during which @@ -4511,16 +4569,18 @@ public Mono leaseAsync(PathLeaseAction xMsLeaseAction, String requestId, I Integer xMsLeaseBreakPeriod, String proposedLeaseId, LeaseAccessConditions leaseAccessConditions, ModifiedAccessConditions modifiedAccessConditions) { return leaseWithResponseAsync(xMsLeaseAction, requestId, timeout, xMsLeaseBreakPeriod, proposedLeaseId, - leaseAccessConditions, modifiedAccessConditions).flatMap(ignored -> Mono.empty()); + leaseAccessConditions, modifiedAccessConditions) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Lease Path - * + * * Create and manage a lease to restrict write and delete access to the path. This operation supports conditional * HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param xMsLeaseAction There are five lease actions: "acquire", "break", "change", "renew", and "release". Use * "acquire" and specify the "x-ms-proposed-lease-id" and "x-ms-lease-duration" to acquire a new lease. Use "break" * to break an existing lease. When a lease is broken, the lease break period is allowed to elapse, during which @@ -4552,16 +4612,18 @@ public Mono leaseAsync(PathLeaseAction xMsLeaseAction, String requestId, I Integer xMsLeaseBreakPeriod, String proposedLeaseId, LeaseAccessConditions leaseAccessConditions, ModifiedAccessConditions modifiedAccessConditions, Context context) { return leaseWithResponseAsync(xMsLeaseAction, requestId, timeout, xMsLeaseBreakPeriod, proposedLeaseId, - leaseAccessConditions, modifiedAccessConditions, context).flatMap(ignored -> Mono.empty()); + leaseAccessConditions, modifiedAccessConditions, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Lease Path - * + * * Create and manage a lease to restrict write and delete access to the path. This operation supports conditional * HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param xMsLeaseAction There are five lease actions: "acquire", "break", "change", "renew", and "release". Use * "acquire" and specify the "x-ms-proposed-lease-id" and "x-ms-lease-duration" to acquire a new lease. Use "break" * to break an existing lease. When a lease is broken, the lease break period is allowed to elapse, during which @@ -4621,19 +4683,21 @@ public Mono> leaseNoCustomHeadersWithResponseAsync(PathLeaseActio = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.leaseNoCustomHeaders(this.client.getUrl(), - this.client.getFileSystem(), this.client.getPath(), requestId, timeout, this.client.getVersion(), - xMsLeaseAction, this.client.getXMsLeaseDuration(), xMsLeaseBreakPeriod, leaseId, proposedLeaseId, ifMatch, - ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, accept, context)); + return FluxUtil + .withContext(context -> service.leaseNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), requestId, timeout, this.client.getVersion(), xMsLeaseAction, + this.client.getXMsLeaseDuration(), xMsLeaseBreakPeriod, leaseId, proposedLeaseId, ifMatch, ifNoneMatch, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Lease Path - * + * * Create and manage a lease to restrict write and delete access to the path. This operation supports conditional * HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param xMsLeaseAction There are five lease actions: "acquire", "break", "change", "renew", and "release". Use * "acquire" and specify the "x-ms-proposed-lease-id" and "x-ms-lease-duration" to acquire a new lease. Use "break" * to break an existing lease. When a lease is broken, the lease break period is allowed to elapse, during which @@ -4695,19 +4759,21 @@ public Mono> leaseNoCustomHeadersWithResponseAsync(PathLeaseActio = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.leaseNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), - requestId, timeout, this.client.getVersion(), xMsLeaseAction, this.client.getXMsLeaseDuration(), - xMsLeaseBreakPeriod, leaseId, proposedLeaseId, ifMatch, ifNoneMatch, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, accept, context); + return service + .leaseNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), requestId, + timeout, this.client.getVersion(), xMsLeaseAction, this.client.getXMsLeaseDuration(), + xMsLeaseBreakPeriod, leaseId, proposedLeaseId, ifMatch, ifNoneMatch, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Lease Path - * + * * Create and manage a lease to restrict write and delete access to the path. This operation supports conditional * HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param xMsLeaseAction There are five lease actions: "acquire", "break", "change", "renew", and "release". Use * "acquire" and specify the "x-ms-proposed-lease-id" and "x-ms-lease-duration" to acquire a new lease. Use "break" * to break an existing lease. When a lease is broken, the lease break period is allowed to elapse, during which @@ -4769,19 +4835,23 @@ public ResponseBase leaseWithResponse(PathLeaseAction x = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.leaseSync(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), requestId, - timeout, this.client.getVersion(), xMsLeaseAction, this.client.getXMsLeaseDuration(), xMsLeaseBreakPeriod, - leaseId, proposedLeaseId, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - accept, context); + try { + return service.leaseSync(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), + requestId, timeout, this.client.getVersion(), xMsLeaseAction, this.client.getXMsLeaseDuration(), + xMsLeaseBreakPeriod, leaseId, proposedLeaseId, ifMatch, ifNoneMatch, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, accept, context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Lease Path - * + * * Create and manage a lease to restrict write and delete access to the path. This operation supports conditional * HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param xMsLeaseAction There are five lease actions: "acquire", "break", "change", "renew", and "release". Use * "acquire" and specify the "x-ms-proposed-lease-id" and "x-ms-lease-duration" to acquire a new lease. Use "break" * to break an existing lease. When a lease is broken, the lease break period is allowed to elapse, during which @@ -4816,11 +4886,11 @@ public void lease(PathLeaseAction xMsLeaseAction, String requestId, Integer time /** * Lease Path - * + * * Create and manage a lease to restrict write and delete access to the path. This operation supports conditional * HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param xMsLeaseAction There are five lease actions: "acquire", "break", "change", "renew", and "release". Use * "acquire" and specify the "x-ms-proposed-lease-id" and "x-ms-lease-duration" to acquire a new lease. Use "break" * to break an existing lease. When a lease is broken, the lease break period is allowed to elapse, during which @@ -4882,19 +4952,23 @@ public Response leaseNoCustomHeadersWithResponse(PathLeaseAction xMsLeaseA = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.leaseNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), - this.client.getPath(), requestId, timeout, this.client.getVersion(), xMsLeaseAction, - this.client.getXMsLeaseDuration(), xMsLeaseBreakPeriod, leaseId, proposedLeaseId, ifMatch, ifNoneMatch, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, accept, context); + try { + return service.leaseNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), requestId, timeout, this.client.getVersion(), xMsLeaseAction, + this.client.getXMsLeaseDuration(), xMsLeaseBreakPeriod, leaseId, proposedLeaseId, ifMatch, ifNoneMatch, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, accept, context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Read File - * + * * Read the contents of a file. For read operations, range requests are supported. This operation supports * conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -4963,19 +5037,21 @@ public Mono>> readWithResponseAs = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.read(this.client.getUrl(), this.client.getFileSystem(), - this.client.getPath(), requestId, timeout, this.client.getVersion(), range, leaseId, xMsRangeGetContentMd5, - ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, accept, context)); + return FluxUtil + .withContext(context -> service.read(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), requestId, timeout, this.client.getVersion(), range, leaseId, + xMsRangeGetContentMd5, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, + encryptionKey, encryptionKeySha256, encryptionAlgorithm, accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Read File - * + * * Read the contents of a file. For read operations, range requests are supported. This operation supports * conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -5045,19 +5121,21 @@ public Mono>> readWithResponseAs = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.read(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), requestId, - timeout, this.client.getVersion(), range, leaseId, xMsRangeGetContentMd5, ifMatch, ifNoneMatch, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, encryptionKey, encryptionKeySha256, - encryptionAlgorithm, accept, context); + return service + .read(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), requestId, timeout, + this.client.getVersion(), range, leaseId, xMsRangeGetContentMd5, ifMatch, ifNoneMatch, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, encryptionKey, encryptionKeySha256, + encryptionAlgorithm, accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Read File - * + * * Read the contents of a file. For read operations, range requests are supported. This operation supports * conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -5082,16 +5160,18 @@ public Flux readAsync(String requestId, Integer timeout, String rang LeaseAccessConditions leaseAccessConditions, ModifiedAccessConditions modifiedAccessConditions, CpkInfo cpkInfo) { return readWithResponseAsync(requestId, timeout, range, xMsRangeGetContentMd5, leaseAccessConditions, - modifiedAccessConditions, cpkInfo).flatMapMany(fluxByteBufferResponse -> fluxByteBufferResponse.getValue()); + modifiedAccessConditions, cpkInfo) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) + .flatMapMany(fluxByteBufferResponse -> fluxByteBufferResponse.getValue()); } /** * Read File - * + * * Read the contents of a file. For read operations, range requests are supported. This operation supports * conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -5118,16 +5198,17 @@ public Flux readAsync(String requestId, Integer timeout, String rang Context context) { return readWithResponseAsync(requestId, timeout, range, xMsRangeGetContentMd5, leaseAccessConditions, modifiedAccessConditions, cpkInfo, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) .flatMapMany(fluxByteBufferResponse -> fluxByteBufferResponse.getValue()); } /** * Read File - * + * * Read the contents of a file. For read operations, range requests are supported. This operation supports * conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -5196,19 +5277,21 @@ public Mono readNoCustomHeadersWithResponseAsync(String requestI = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.readNoCustomHeaders(this.client.getUrl(), - this.client.getFileSystem(), this.client.getPath(), requestId, timeout, this.client.getVersion(), range, - leaseId, xMsRangeGetContentMd5, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, accept, context)); + return FluxUtil + .withContext(context -> service.readNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), requestId, timeout, this.client.getVersion(), range, leaseId, + xMsRangeGetContentMd5, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, + encryptionKey, encryptionKeySha256, encryptionAlgorithm, accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Read File - * + * * Read the contents of a file. For read operations, range requests are supported. This operation supports * conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -5278,19 +5361,21 @@ public Mono readNoCustomHeadersWithResponseAsync(String requestI = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.readNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), - requestId, timeout, this.client.getVersion(), range, leaseId, xMsRangeGetContentMd5, ifMatch, ifNoneMatch, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, encryptionKey, encryptionKeySha256, - encryptionAlgorithm, accept, context); + return service + .readNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), requestId, + timeout, this.client.getVersion(), range, leaseId, xMsRangeGetContentMd5, ifMatch, ifNoneMatch, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, encryptionKey, encryptionKeySha256, + encryptionAlgorithm, accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Read File - * + * * Read the contents of a file. For read operations, range requests are supported. This operation supports * conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -5360,19 +5445,23 @@ public ResponseBase readWithResponse(String reque = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.readSync(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), requestId, - timeout, this.client.getVersion(), range, leaseId, xMsRangeGetContentMd5, ifMatch, ifNoneMatch, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, encryptionKey, encryptionKeySha256, - encryptionAlgorithm, accept, context); + try { + return service.readSync(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), requestId, + timeout, this.client.getVersion(), range, leaseId, xMsRangeGetContentMd5, ifMatch, ifNoneMatch, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, encryptionKey, encryptionKeySha256, + encryptionAlgorithm, accept, context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Read File - * + * * Read the contents of a file. For read operations, range requests are supported. This operation supports * conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -5396,17 +5485,21 @@ public ResponseBase readWithResponse(String reque public InputStream read(String requestId, Integer timeout, String range, Boolean xMsRangeGetContentMd5, LeaseAccessConditions leaseAccessConditions, ModifiedAccessConditions modifiedAccessConditions, CpkInfo cpkInfo) { - return readWithResponse(requestId, timeout, range, xMsRangeGetContentMd5, leaseAccessConditions, - modifiedAccessConditions, cpkInfo, Context.NONE).getValue(); + try { + return readWithResponse(requestId, timeout, range, xMsRangeGetContentMd5, leaseAccessConditions, + modifiedAccessConditions, cpkInfo, Context.NONE).getValue(); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Read File - * + * * Read the contents of a file. For read operations, range requests are supported. This operation supports * conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -5476,20 +5569,24 @@ public Response readNoCustomHeadersWithResponse(String requestId, I = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.readNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), - requestId, timeout, this.client.getVersion(), range, leaseId, xMsRangeGetContentMd5, ifMatch, ifNoneMatch, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, encryptionKey, encryptionKeySha256, - encryptionAlgorithm, accept, context); + try { + return service.readNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), requestId, timeout, this.client.getVersion(), range, leaseId, + xMsRangeGetContentMd5, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, + encryptionKey, encryptionKeySha256, encryptionAlgorithm, accept, context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Get Properties | Get Status | Get Access Control List - * + * * Get Properties returns all system and user defined properties for a path. Get Status returns all system defined * properties for a path. Get Access Control List returns the access control list for a path. This operation * supports conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -5545,19 +5642,21 @@ public Mono> getPropertiesWithResp = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.getProperties(this.client.getUrl(), this.client.getFileSystem(), - this.client.getPath(), requestId, timeout, this.client.getVersion(), action, upn, leaseId, ifMatch, - ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, accept, context)); + return FluxUtil + .withContext(context -> service.getProperties(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), requestId, timeout, this.client.getVersion(), action, upn, leaseId, ifMatch, + ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Get Properties | Get Status | Get Access Control List - * + * * Get Properties returns all system and user defined properties for a path. Get Status returns all system defined * properties for a path. Get Access Control List returns the access control list for a path. This operation * supports conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -5614,19 +5713,21 @@ public Mono> getPropertiesWithResp = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.getProperties(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), - requestId, timeout, this.client.getVersion(), action, upn, leaseId, ifMatch, ifNoneMatch, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, accept, context); + return service + .getProperties(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), requestId, timeout, + this.client.getVersion(), action, upn, leaseId, ifMatch, ifNoneMatch, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Get Properties | Get Status | Get Access Control List - * + * * Get Properties returns all system and user defined properties for a path. Get Status returns all system defined * properties for a path. Get Access Control List returns the access control list for a path. This operation * supports conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -5652,17 +5753,19 @@ public Mono> getPropertiesWithResp public Mono getPropertiesAsync(String requestId, Integer timeout, PathGetPropertiesAction action, Boolean upn, LeaseAccessConditions leaseAccessConditions, ModifiedAccessConditions modifiedAccessConditions) { return getPropertiesWithResponseAsync(requestId, timeout, action, upn, leaseAccessConditions, - modifiedAccessConditions).flatMap(ignored -> Mono.empty()); + modifiedAccessConditions) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Get Properties | Get Status | Get Access Control List - * + * * Get Properties returns all system and user defined properties for a path. Get Status returns all system defined * properties for a path. Get Access Control List returns the access control list for a path. This operation * supports conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -5690,17 +5793,19 @@ public Mono getPropertiesAsync(String requestId, Integer timeout, PathGetP LeaseAccessConditions leaseAccessConditions, ModifiedAccessConditions modifiedAccessConditions, Context context) { return getPropertiesWithResponseAsync(requestId, timeout, action, upn, leaseAccessConditions, - modifiedAccessConditions, context).flatMap(ignored -> Mono.empty()); + modifiedAccessConditions, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Get Properties | Get Status | Get Access Control List - * + * * Get Properties returns all system and user defined properties for a path. Get Status returns all system defined * properties for a path. Get Access Control List returns the access control list for a path. This operation * supports conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -5756,19 +5861,22 @@ public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.getPropertiesNoCustomHeaders(this.client.getUrl(), - this.client.getFileSystem(), this.client.getPath(), requestId, timeout, this.client.getVersion(), action, - upn, leaseId, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, accept, context)); + return FluxUtil + .withContext( + context -> service.getPropertiesNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), requestId, timeout, this.client.getVersion(), action, upn, leaseId, ifMatch, + ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Get Properties | Get Status | Get Access Control List - * + * * Get Properties returns all system and user defined properties for a path. Get Status returns all system defined * properties for a path. Get Access Control List returns the access control list for a path. This operation * supports conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -5825,19 +5933,21 @@ public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.getPropertiesNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), - this.client.getPath(), requestId, timeout, this.client.getVersion(), action, upn, leaseId, ifMatch, - ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, accept, context); + return service + .getPropertiesNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), + requestId, timeout, this.client.getVersion(), action, upn, leaseId, ifMatch, ifNoneMatch, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Get Properties | Get Status | Get Access Control List - * + * * Get Properties returns all system and user defined properties for a path. Get Status returns all system defined * properties for a path. Get Access Control List returns the access control list for a path. This operation * supports conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -5893,19 +6003,23 @@ public ResponseBase getPropertiesWithResponse(S = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.getPropertiesSync(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), - requestId, timeout, this.client.getVersion(), action, upn, leaseId, ifMatch, ifNoneMatch, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, accept, context); + try { + return service.getPropertiesSync(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), + requestId, timeout, this.client.getVersion(), action, upn, leaseId, ifMatch, ifNoneMatch, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, accept, context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Get Properties | Get Status | Get Access Control List - * + * * Get Properties returns all system and user defined properties for a path. Get Status returns all system defined * properties for a path. Get Access Control List returns the access control list for a path. This operation * supports conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -5934,12 +6048,12 @@ public void getProperties(String requestId, Integer timeout, PathGetPropertiesAc /** * Get Properties | Get Status | Get Access Control List - * + * * Get Properties returns all system and user defined properties for a path. Get Status returns all system defined * properties for a path. Get Access Control List returns the access control list for a path. This operation * supports conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -5995,18 +6109,22 @@ public Response getPropertiesNoCustomHeadersWithResponse(String requestId, = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.getPropertiesNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), - this.client.getPath(), requestId, timeout, this.client.getVersion(), action, upn, leaseId, ifMatch, - ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, accept, context); + try { + return service.getPropertiesNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), requestId, timeout, this.client.getVersion(), action, upn, leaseId, ifMatch, + ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, accept, context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Delete File | Delete Directory - * + * * Delete the file or directory. This operation supports conditional HTTP requests. For more information, see * [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -6062,18 +6180,20 @@ public Mono> deleteWithResponseAsync(Stri = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.delete(this.client.getUrl(), this.client.getFileSystem(), - this.client.getPath(), requestId, timeout, this.client.getVersion(), recursive, continuation, leaseId, - ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, paginated, accept, context)); + return FluxUtil + .withContext(context -> service.delete(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), requestId, timeout, this.client.getVersion(), recursive, continuation, leaseId, + ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, paginated, accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Delete File | Delete Directory - * + * * Delete the file or directory. This operation supports conditional HTTP requests. For more information, see * [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -6130,18 +6250,20 @@ public Mono> deleteWithResponseAsync(Stri = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.delete(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), requestId, - timeout, this.client.getVersion(), recursive, continuation, leaseId, ifMatch, ifNoneMatch, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, paginated, accept, context); + return service + .delete(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), requestId, timeout, + this.client.getVersion(), recursive, continuation, leaseId, ifMatch, ifNoneMatch, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, paginated, accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Delete File | Delete Directory - * + * * Delete the file or directory. This operation supports conditional HTTP requests. For more information, see * [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -6168,16 +6290,18 @@ public Mono deleteAsync(String requestId, Integer timeout, Boolean recursi Boolean paginated, LeaseAccessConditions leaseAccessConditions, ModifiedAccessConditions modifiedAccessConditions) { return deleteWithResponseAsync(requestId, timeout, recursive, continuation, paginated, leaseAccessConditions, - modifiedAccessConditions).flatMap(ignored -> Mono.empty()); + modifiedAccessConditions) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Delete File | Delete Directory - * + * * Delete the file or directory. This operation supports conditional HTTP requests. For more information, see * [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -6205,16 +6329,18 @@ public Mono deleteAsync(String requestId, Integer timeout, Boolean recursi Boolean paginated, LeaseAccessConditions leaseAccessConditions, ModifiedAccessConditions modifiedAccessConditions, Context context) { return deleteWithResponseAsync(requestId, timeout, recursive, continuation, paginated, leaseAccessConditions, - modifiedAccessConditions, context).flatMap(ignored -> Mono.empty()); + modifiedAccessConditions, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Delete File | Delete Directory - * + * * Delete the file or directory. This operation supports conditional HTTP requests. For more information, see * [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -6270,19 +6396,20 @@ public Mono> deleteNoCustomHeadersWithResponseAsync(String reques = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.deleteNoCustomHeaders(this.client.getUrl(), - this.client.getFileSystem(), this.client.getPath(), requestId, timeout, this.client.getVersion(), recursive, - continuation, leaseId, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - paginated, accept, context)); + return FluxUtil + .withContext(context -> service.deleteNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), requestId, timeout, this.client.getVersion(), recursive, continuation, leaseId, + ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, paginated, accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Delete File | Delete Directory - * + * * Delete the file or directory. This operation supports conditional HTTP requests. For more information, see * [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -6339,18 +6466,20 @@ public Mono> deleteNoCustomHeadersWithResponseAsync(String reques = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.deleteNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), - requestId, timeout, this.client.getVersion(), recursive, continuation, leaseId, ifMatch, ifNoneMatch, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, paginated, accept, context); + return service + .deleteNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), requestId, + timeout, this.client.getVersion(), recursive, continuation, leaseId, ifMatch, ifNoneMatch, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, paginated, accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Delete File | Delete Directory - * + * * Delete the file or directory. This operation supports conditional HTTP requests. For more information, see * [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -6407,18 +6536,22 @@ public ResponseBase deleteWithResponse(String requestI = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.deleteSync(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), requestId, - timeout, this.client.getVersion(), recursive, continuation, leaseId, ifMatch, ifNoneMatch, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, paginated, accept, context); + try { + return service.deleteSync(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), + requestId, timeout, this.client.getVersion(), recursive, continuation, leaseId, ifMatch, ifNoneMatch, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, paginated, accept, context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Delete File | Delete Directory - * + * * Delete the file or directory. This operation supports conditional HTTP requests. For more information, see * [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -6448,11 +6581,11 @@ public void delete(String requestId, Integer timeout, Boolean recursive, String /** * Delete File | Delete Directory - * + * * Delete the file or directory. This operation supports conditional HTTP requests. For more information, see * [Specifying Conditional Headers for Blob Service * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - * + * * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -6509,14 +6642,18 @@ public Response deleteNoCustomHeadersWithResponse(String requestId, Intege = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.deleteNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), - this.client.getPath(), requestId, timeout, this.client.getVersion(), recursive, continuation, leaseId, - ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, paginated, accept, context); + try { + return service.deleteNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), requestId, timeout, this.client.getVersion(), recursive, continuation, leaseId, + ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, paginated, accept, context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Set the owner, group, permissions, or access control list for a path. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -6573,15 +6710,17 @@ public Mono> setAccessControlWi = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.setAccessControl(this.client.getUrl(), - this.client.getFileSystem(), this.client.getPath(), action, timeout, leaseId, owner, group, permissions, - acl, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, requestId, - this.client.getVersion(), accept, context)); + return FluxUtil + .withContext(context -> service.setAccessControl(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), action, timeout, leaseId, owner, group, permissions, acl, ifMatch, ifNoneMatch, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, requestId, this.client.getVersion(), accept, + context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Set the owner, group, permissions, or access control list for a path. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -6640,14 +6779,16 @@ public Mono> setAccessControlWi = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.setAccessControl(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), - action, timeout, leaseId, owner, group, permissions, acl, ifMatch, ifNoneMatch, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, requestId, this.client.getVersion(), accept, context); + return service + .setAccessControl(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), action, timeout, + leaseId, owner, group, permissions, acl, ifMatch, ifNoneMatch, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, requestId, this.client.getVersion(), accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Set the owner, group, permissions, or access control list for a path. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -6674,12 +6815,14 @@ public Mono setAccessControlAsync(Integer timeout, String owner, String gr String requestId, LeaseAccessConditions leaseAccessConditions, ModifiedAccessConditions modifiedAccessConditions) { return setAccessControlWithResponseAsync(timeout, owner, group, permissions, acl, requestId, - leaseAccessConditions, modifiedAccessConditions).flatMap(ignored -> Mono.empty()); + leaseAccessConditions, modifiedAccessConditions) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Set the owner, group, permissions, or access control list for a path. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -6707,12 +6850,14 @@ public Mono setAccessControlAsync(Integer timeout, String owner, String gr String requestId, LeaseAccessConditions leaseAccessConditions, ModifiedAccessConditions modifiedAccessConditions, Context context) { return setAccessControlWithResponseAsync(timeout, owner, group, permissions, acl, requestId, - leaseAccessConditions, modifiedAccessConditions, context).flatMap(ignored -> Mono.empty()); + leaseAccessConditions, modifiedAccessConditions, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Set the owner, group, permissions, or access control list for a path. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -6769,15 +6914,17 @@ public Mono> setAccessControlNoCustomHeadersWithResponseAsync(Int = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.setAccessControlNoCustomHeaders(this.client.getUrl(), - this.client.getFileSystem(), this.client.getPath(), action, timeout, leaseId, owner, group, permissions, - acl, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, requestId, - this.client.getVersion(), accept, context)); + return FluxUtil + .withContext(context -> service.setAccessControlNoCustomHeaders(this.client.getUrl(), + this.client.getFileSystem(), this.client.getPath(), action, timeout, leaseId, owner, group, permissions, + acl, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, requestId, + this.client.getVersion(), accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Set the owner, group, permissions, or access control list for a path. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -6837,12 +6984,13 @@ public Mono> setAccessControlNoCustomHeadersWithResponseAsync(Int = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); return service.setAccessControlNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), action, timeout, leaseId, owner, group, permissions, acl, ifMatch, ifNoneMatch, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, requestId, this.client.getVersion(), accept, context); + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, requestId, this.client.getVersion(), accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Set the owner, group, permissions, or access control list for a path. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -6900,14 +7048,19 @@ public ResponseBase setAccessControlWithResp = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.setAccessControlSync(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), - action, timeout, leaseId, owner, group, permissions, acl, ifMatch, ifNoneMatch, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, requestId, this.client.getVersion(), accept, context); + try { + return service.setAccessControlSync(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), action, timeout, leaseId, owner, group, permissions, acl, ifMatch, ifNoneMatch, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, requestId, this.client.getVersion(), accept, + context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Set the owner, group, permissions, or access control list for a path. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -6938,7 +7091,7 @@ public void setAccessControl(Integer timeout, String owner, String group, String /** * Set the owner, group, permissions, or access control list for a path. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -6996,14 +7149,19 @@ public Response setAccessControlNoCustomHeadersWithResponse(Integer timeou = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.setAccessControlNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), - this.client.getPath(), action, timeout, leaseId, owner, group, permissions, acl, ifMatch, ifNoneMatch, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, requestId, this.client.getVersion(), accept, context); + try { + return service.setAccessControlNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), action, timeout, leaseId, owner, group, permissions, acl, ifMatch, ifNoneMatch, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, requestId, this.client.getVersion(), accept, + context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Set the access control list for a path and sub-paths. - * + * * @param mode Mode "set" sets POSIX access control rights on files and directories, "modify" modifies one or more * POSIX access control rights that pre-exist on files and directories, "remove" removes one or more POSIX access * control rights that were present earlier on files and directories. @@ -7036,14 +7194,16 @@ public Response setAccessControlNoCustomHeadersWithResponse(Integer timeou String continuation, Boolean forceFlag, Integer maxRecords, String acl, String requestId) { final String action = "setAccessControlRecursive"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.setAccessControlRecursive(this.client.getUrl(), - this.client.getFileSystem(), this.client.getPath(), action, timeout, continuation, mode, forceFlag, - maxRecords, acl, requestId, this.client.getVersion(), accept, context)); + return FluxUtil + .withContext(context -> service.setAccessControlRecursive(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), action, timeout, continuation, mode, forceFlag, maxRecords, acl, requestId, + this.client.getVersion(), accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Set the access control list for a path and sub-paths. - * + * * @param mode Mode "set" sets POSIX access control rights on files and directories, "modify" modifies one or more * POSIX access control rights that pre-exist on files and directories, "remove" removes one or more POSIX access * control rights that were present earlier on files and directories. @@ -7077,14 +7237,16 @@ public Response setAccessControlNoCustomHeadersWithResponse(Integer timeou String continuation, Boolean forceFlag, Integer maxRecords, String acl, String requestId, Context context) { final String action = "setAccessControlRecursive"; final String accept = "application/json"; - return service.setAccessControlRecursive(this.client.getUrl(), this.client.getFileSystem(), - this.client.getPath(), action, timeout, continuation, mode, forceFlag, maxRecords, acl, requestId, - this.client.getVersion(), accept, context); + return service + .setAccessControlRecursive(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), action, + timeout, continuation, mode, forceFlag, maxRecords, acl, requestId, this.client.getVersion(), accept, + context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Set the access control list for a path and sub-paths. - * + * * @param mode Mode "set" sets POSIX access control rights on files and directories, "modify" modifies one or more * POSIX access control rights that pre-exist on files and directories, "remove" removes one or more POSIX access * control rights that were present earlier on files and directories. @@ -7116,12 +7278,13 @@ public Mono setAccessControlRecursiveAsync( PathSetAccessControlRecursiveMode mode, Integer timeout, String continuation, Boolean forceFlag, Integer maxRecords, String acl, String requestId) { return setAccessControlRecursiveWithResponseAsync(mode, timeout, continuation, forceFlag, maxRecords, acl, - requestId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + requestId).onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Set the access control list for a path and sub-paths. - * + * * @param mode Mode "set" sets POSIX access control rights on files and directories, "modify" modifies one or more * POSIX access control rights that pre-exist on files and directories, "remove" removes one or more POSIX access * control rights that were present earlier on files and directories. @@ -7154,12 +7317,14 @@ public Mono setAccessControlRecursiveAsync( PathSetAccessControlRecursiveMode mode, Integer timeout, String continuation, Boolean forceFlag, Integer maxRecords, String acl, String requestId, Context context) { return setAccessControlRecursiveWithResponseAsync(mode, timeout, continuation, forceFlag, maxRecords, acl, - requestId, context).flatMap(res -> Mono.justOrEmpty(res.getValue())); + requestId, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Set the access control list for a path and sub-paths. - * + * * @param mode Mode "set" sets POSIX access control rights on files and directories, "modify" modifies one or more * POSIX access control rights that pre-exist on files and directories, "remove" removes one or more POSIX access * control rights that were present earlier on files and directories. @@ -7192,14 +7357,16 @@ public Mono> setAccessControlRecursi Integer maxRecords, String acl, String requestId) { final String action = "setAccessControlRecursive"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.setAccessControlRecursiveNoCustomHeaders(this.client.getUrl(), - this.client.getFileSystem(), this.client.getPath(), action, timeout, continuation, mode, forceFlag, - maxRecords, acl, requestId, this.client.getVersion(), accept, context)); + return FluxUtil + .withContext(context -> service.setAccessControlRecursiveNoCustomHeaders(this.client.getUrl(), + this.client.getFileSystem(), this.client.getPath(), action, timeout, continuation, mode, forceFlag, + maxRecords, acl, requestId, this.client.getVersion(), accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Set the access control list for a path and sub-paths. - * + * * @param mode Mode "set" sets POSIX access control rights on files and directories, "modify" modifies one or more * POSIX access control rights that pre-exist on files and directories, "remove" removes one or more POSIX access * control rights that were present earlier on files and directories. @@ -7233,14 +7400,16 @@ public Mono> setAccessControlRecursi Integer maxRecords, String acl, String requestId, Context context) { final String action = "setAccessControlRecursive"; final String accept = "application/json"; - return service.setAccessControlRecursiveNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), - this.client.getPath(), action, timeout, continuation, mode, forceFlag, maxRecords, acl, requestId, - this.client.getVersion(), accept, context); + return service + .setAccessControlRecursiveNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), action, timeout, continuation, mode, forceFlag, maxRecords, acl, requestId, + this.client.getVersion(), accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Set the access control list for a path and sub-paths. - * + * * @param mode Mode "set" sets POSIX access control rights on files and directories, "modify" modifies one or more * POSIX access control rights that pre-exist on files and directories, "remove" removes one or more POSIX access * control rights that were present earlier on files and directories. @@ -7274,14 +7443,18 @@ public Mono> setAccessControlRecursi String continuation, Boolean forceFlag, Integer maxRecords, String acl, String requestId, Context context) { final String action = "setAccessControlRecursive"; final String accept = "application/json"; - return service.setAccessControlRecursiveSync(this.client.getUrl(), this.client.getFileSystem(), - this.client.getPath(), action, timeout, continuation, mode, forceFlag, maxRecords, acl, requestId, - this.client.getVersion(), accept, context); + try { + return service.setAccessControlRecursiveSync(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), action, timeout, continuation, mode, forceFlag, maxRecords, acl, requestId, + this.client.getVersion(), accept, context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Set the access control list for a path and sub-paths. - * + * * @param mode Mode "set" sets POSIX access control rights on files and directories, "modify" modifies one or more * POSIX access control rights that pre-exist on files and directories, "remove" removes one or more POSIX access * control rights that were present earlier on files and directories. @@ -7311,13 +7484,17 @@ public Mono> setAccessControlRecursi @ServiceMethod(returns = ReturnType.SINGLE) public SetAccessControlRecursiveResponse setAccessControlRecursive(PathSetAccessControlRecursiveMode mode, Integer timeout, String continuation, Boolean forceFlag, Integer maxRecords, String acl, String requestId) { - return setAccessControlRecursiveWithResponse(mode, timeout, continuation, forceFlag, maxRecords, acl, requestId, - Context.NONE).getValue(); + try { + return setAccessControlRecursiveWithResponse(mode, timeout, continuation, forceFlag, maxRecords, acl, + requestId, Context.NONE).getValue(); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Set the access control list for a path and sub-paths. - * + * * @param mode Mode "set" sets POSIX access control rights on files and directories, "modify" modifies one or more * POSIX access control rights that pre-exist on files and directories, "remove" removes one or more POSIX access * control rights that were present earlier on files and directories. @@ -7351,14 +7528,18 @@ public Response setAccessControlRecursiveNoCu Integer maxRecords, String acl, String requestId, Context context) { final String action = "setAccessControlRecursive"; final String accept = "application/json"; - return service.setAccessControlRecursiveNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), - this.client.getPath(), action, timeout, continuation, mode, forceFlag, maxRecords, acl, requestId, - this.client.getVersion(), accept, context); + try { + return service.setAccessControlRecursiveNoCustomHeadersSync(this.client.getUrl(), + this.client.getFileSystem(), this.client.getPath(), action, timeout, continuation, mode, forceFlag, + maxRecords, acl, requestId, this.client.getVersion(), accept, context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Set the owner, group, permissions, or access control list for a path. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -7484,17 +7665,19 @@ public Mono> flushDataWithResponseAsyn = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.flushData(this.client.getUrl(), this.client.getFileSystem(), - this.client.getPath(), action, timeout, position, retainUncommittedData, close, contentLength, - contentMd5Converted, leaseId, leaseAction, leaseDuration, proposedLeaseId, cacheControl, contentType, - contentDisposition, contentEncoding, contentLanguage, ifMatch, ifNoneMatch, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, requestId, this.client.getVersion(), encryptionKey, encryptionKeySha256, - encryptionAlgorithm, accept, context)); + return FluxUtil + .withContext(context -> service.flushData(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), action, timeout, position, retainUncommittedData, close, contentLength, + contentMd5Converted, leaseId, leaseAction, leaseDuration, proposedLeaseId, cacheControl, contentType, + contentDisposition, contentEncoding, contentLanguage, ifMatch, ifNoneMatch, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, requestId, this.client.getVersion(), encryptionKey, encryptionKeySha256, + encryptionAlgorithm, accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Set the owner, group, permissions, or access control list for a path. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -7621,16 +7804,18 @@ public Mono> flushDataWithResponseAsyn = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.flushData(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), action, - timeout, position, retainUncommittedData, close, contentLength, contentMd5Converted, leaseId, leaseAction, - leaseDuration, proposedLeaseId, cacheControl, contentType, contentDisposition, contentEncoding, - contentLanguage, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, requestId, - this.client.getVersion(), encryptionKey, encryptionKeySha256, encryptionAlgorithm, accept, context); + return service + .flushData(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), action, timeout, + position, retainUncommittedData, close, contentLength, contentMd5Converted, leaseId, leaseAction, + leaseDuration, proposedLeaseId, cacheControl, contentType, contentDisposition, contentEncoding, + contentLanguage, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, requestId, + this.client.getVersion(), encryptionKey, encryptionKeySha256, encryptionAlgorithm, accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Set the owner, group, permissions, or access control list for a path. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -7680,12 +7865,13 @@ public Mono flushDataAsync(Integer timeout, Long position, Boolean retainU ModifiedAccessConditions modifiedAccessConditions, CpkInfo cpkInfo) { return flushDataWithResponseAsync(timeout, position, retainUncommittedData, close, contentLength, leaseAction, leaseDuration, proposedLeaseId, requestId, pathHttpHeaders, leaseAccessConditions, modifiedAccessConditions, - cpkInfo).flatMap(ignored -> Mono.empty()); + cpkInfo).onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Set the owner, group, permissions, or access control list for a path. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -7736,12 +7922,14 @@ public Mono flushDataAsync(Integer timeout, Long position, Boolean retainU ModifiedAccessConditions modifiedAccessConditions, CpkInfo cpkInfo, Context context) { return flushDataWithResponseAsync(timeout, position, retainUncommittedData, close, contentLength, leaseAction, leaseDuration, proposedLeaseId, requestId, pathHttpHeaders, leaseAccessConditions, modifiedAccessConditions, - cpkInfo, context).flatMap(ignored -> Mono.empty()); + cpkInfo, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Set the owner, group, permissions, or access control list for a path. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -7867,17 +8055,19 @@ public Mono> flushDataNoCustomHeadersWithResponseAsync(Integer ti = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil.withContext(context -> service.flushDataNoCustomHeaders(this.client.getUrl(), - this.client.getFileSystem(), this.client.getPath(), action, timeout, position, retainUncommittedData, close, - contentLength, contentMd5Converted, leaseId, leaseAction, leaseDuration, proposedLeaseId, cacheControl, - contentType, contentDisposition, contentEncoding, contentLanguage, ifMatch, ifNoneMatch, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, requestId, this.client.getVersion(), encryptionKey, - encryptionKeySha256, encryptionAlgorithm, accept, context)); + return FluxUtil + .withContext(context -> service.flushDataNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), action, timeout, position, retainUncommittedData, close, contentLength, + contentMd5Converted, leaseId, leaseAction, leaseDuration, proposedLeaseId, cacheControl, contentType, + contentDisposition, contentEncoding, contentLanguage, ifMatch, ifNoneMatch, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, requestId, this.client.getVersion(), encryptionKey, encryptionKeySha256, + encryptionAlgorithm, accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Set the owner, group, permissions, or access control list for a path. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -8004,17 +8194,19 @@ public Mono> flushDataNoCustomHeadersWithResponseAsync(Integer ti = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.flushDataNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), - this.client.getPath(), action, timeout, position, retainUncommittedData, close, contentLength, - contentMd5Converted, leaseId, leaseAction, leaseDuration, proposedLeaseId, cacheControl, contentType, - contentDisposition, contentEncoding, contentLanguage, ifMatch, ifNoneMatch, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, requestId, this.client.getVersion(), encryptionKey, encryptionKeySha256, - encryptionAlgorithm, accept, context); + return service + .flushDataNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), action, + timeout, position, retainUncommittedData, close, contentLength, contentMd5Converted, leaseId, + leaseAction, leaseDuration, proposedLeaseId, cacheControl, contentType, contentDisposition, + contentEncoding, contentLanguage, ifMatch, ifNoneMatch, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, requestId, this.client.getVersion(), encryptionKey, encryptionKeySha256, + encryptionAlgorithm, accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Set the owner, group, permissions, or access control list for a path. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -8141,16 +8333,21 @@ public ResponseBase flushDataWithResponse(Integer t = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.flushDataSync(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), action, - timeout, position, retainUncommittedData, close, contentLength, contentMd5Converted, leaseId, leaseAction, - leaseDuration, proposedLeaseId, cacheControl, contentType, contentDisposition, contentEncoding, - contentLanguage, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, requestId, - this.client.getVersion(), encryptionKey, encryptionKeySha256, encryptionAlgorithm, accept, context); + try { + return service.flushDataSync(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), + action, timeout, position, retainUncommittedData, close, contentLength, contentMd5Converted, leaseId, + leaseAction, leaseDuration, proposedLeaseId, cacheControl, contentType, contentDisposition, + contentEncoding, contentLanguage, ifMatch, ifNoneMatch, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, requestId, this.client.getVersion(), encryptionKey, encryptionKeySha256, + encryptionAlgorithm, accept, context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Set the owner, group, permissions, or access control list for a path. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -8204,7 +8401,7 @@ public void flushData(Integer timeout, Long position, Boolean retainUncommittedD /** * Set the owner, group, permissions, or access control list for a path. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -8331,17 +8528,21 @@ public Response flushDataNoCustomHeadersWithResponse(Integer timeout, Long = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.flushDataNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), - this.client.getPath(), action, timeout, position, retainUncommittedData, close, contentLength, - contentMd5Converted, leaseId, leaseAction, leaseDuration, proposedLeaseId, cacheControl, contentType, - contentDisposition, contentEncoding, contentLanguage, ifMatch, ifNoneMatch, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, requestId, this.client.getVersion(), encryptionKey, encryptionKeySha256, - encryptionAlgorithm, accept, context); + try { + return service.flushDataNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), action, timeout, position, retainUncommittedData, close, contentLength, + contentMd5Converted, leaseId, leaseAction, leaseDuration, proposedLeaseId, cacheControl, contentType, + contentDisposition, contentEncoding, contentLanguage, ifMatch, ifNoneMatch, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, requestId, this.client.getVersion(), encryptionKey, encryptionKeySha256, + encryptionAlgorithm, accept, context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Append data to the file. - * + * * @param body Initial data. * @param position This parameter allows the caller to upload data in parallel and control the order in which it is * appended to the file. It is required when uploading data to be appended to the file and when flushing previously @@ -8408,16 +8609,18 @@ public Mono> appendDataWithResponseAs EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; String transactionalContentHashConverted = Base64Util.encodeToString(transactionalContentHash); String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return FluxUtil.withContext(context -> service.appendData(this.client.getUrl(), this.client.getFileSystem(), - this.client.getPath(), action, position, timeout, contentLength, transactionalContentHashConverted, - transactionalContentCrc64Converted, leaseId, leaseAction, leaseDuration, proposedLeaseId, requestId, - this.client.getVersion(), encryptionKey, encryptionKeySha256, encryptionAlgorithm, flush, body, accept, - context)); + return FluxUtil + .withContext(context -> service.appendData(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), action, position, timeout, contentLength, transactionalContentHashConverted, + transactionalContentCrc64Converted, leaseId, leaseAction, leaseDuration, proposedLeaseId, requestId, + this.client.getVersion(), encryptionKey, encryptionKeySha256, encryptionAlgorithm, flush, body, accept, + context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Append data to the file. - * + * * @param body Initial data. * @param position This parameter allows the caller to upload data in parallel and control the order in which it is * appended to the file. It is required when uploading data to be appended to the file and when flushing previously @@ -8485,15 +8688,17 @@ public Mono> appendDataWithResponseAs EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; String transactionalContentHashConverted = Base64Util.encodeToString(transactionalContentHash); String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return service.appendData(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), action, - position, timeout, contentLength, transactionalContentHashConverted, transactionalContentCrc64Converted, - leaseId, leaseAction, leaseDuration, proposedLeaseId, requestId, this.client.getVersion(), encryptionKey, - encryptionKeySha256, encryptionAlgorithm, flush, body, accept, context); + return service + .appendData(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), action, position, + timeout, contentLength, transactionalContentHashConverted, transactionalContentCrc64Converted, leaseId, + leaseAction, leaseDuration, proposedLeaseId, requestId, this.client.getVersion(), encryptionKey, + encryptionKeySha256, encryptionAlgorithm, flush, body, accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Append data to the file. - * + * * @param body Initial data. * @param position This parameter allows the caller to upload data in parallel and control the order in which it is * appended to the file. It is required when uploading data to be appended to the file and when flushing previously @@ -8533,12 +8738,13 @@ public Mono appendDataAsync(Flux body, Long position, Integer CpkInfo cpkInfo) { return appendDataWithResponseAsync(body, position, timeout, contentLength, transactionalContentCrc64, leaseAction, leaseDuration, proposedLeaseId, requestId, flush, pathHttpHeaders, leaseAccessConditions, - cpkInfo).flatMap(ignored -> Mono.empty()); + cpkInfo).onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Append data to the file. - * + * * @param body Initial data. * @param position This parameter allows the caller to upload data in parallel and control the order in which it is * appended to the file. It is required when uploading data to be appended to the file and when flushing previously @@ -8579,12 +8785,14 @@ public Mono appendDataAsync(Flux body, Long position, Integer CpkInfo cpkInfo, Context context) { return appendDataWithResponseAsync(body, position, timeout, contentLength, transactionalContentCrc64, leaseAction, leaseDuration, proposedLeaseId, requestId, flush, pathHttpHeaders, leaseAccessConditions, - cpkInfo, context).flatMap(ignored -> Mono.empty()); + cpkInfo, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Append data to the file. - * + * * @param body Initial data. * @param position This parameter allows the caller to upload data in parallel and control the order in which it is * appended to the file. It is required when uploading data to be appended to the file and when flushing previously @@ -8651,16 +8859,18 @@ public Mono> appendDataNoCustomHeadersWithResponseAsync(Flux service.appendDataNoCustomHeaders(this.client.getUrl(), - this.client.getFileSystem(), this.client.getPath(), action, position, timeout, contentLength, - transactionalContentHashConverted, transactionalContentCrc64Converted, leaseId, leaseAction, leaseDuration, - proposedLeaseId, requestId, this.client.getVersion(), encryptionKey, encryptionKeySha256, - encryptionAlgorithm, flush, body, accept, context)); + return FluxUtil + .withContext(context -> service.appendDataNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), action, position, timeout, contentLength, transactionalContentHashConverted, + transactionalContentCrc64Converted, leaseId, leaseAction, leaseDuration, proposedLeaseId, requestId, + this.client.getVersion(), encryptionKey, encryptionKeySha256, encryptionAlgorithm, flush, body, accept, + context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Append data to the file. - * + * * @param body Initial data. * @param position This parameter allows the caller to upload data in parallel and control the order in which it is * appended to the file. It is required when uploading data to be appended to the file and when flushing previously @@ -8728,16 +8938,17 @@ public Mono> appendDataNoCustomHeadersWithResponseAsync(Flux> appendDataWithResponseAs EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; String transactionalContentHashConverted = Base64Util.encodeToString(transactionalContentHash); String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return FluxUtil.withContext(context -> service.appendData(this.client.getUrl(), this.client.getFileSystem(), - this.client.getPath(), action, position, timeout, contentLength, transactionalContentHashConverted, - transactionalContentCrc64Converted, leaseId, leaseAction, leaseDuration, proposedLeaseId, requestId, - this.client.getVersion(), encryptionKey, encryptionKeySha256, encryptionAlgorithm, flush, body, accept, - context)); + return FluxUtil + .withContext(context -> service.appendData(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), action, position, timeout, contentLength, transactionalContentHashConverted, + transactionalContentCrc64Converted, leaseId, leaseAction, leaseDuration, proposedLeaseId, requestId, + this.client.getVersion(), encryptionKey, encryptionKeySha256, encryptionAlgorithm, flush, body, accept, + context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Append data to the file. - * + * * @param body Initial data. * @param position This parameter allows the caller to upload data in parallel and control the order in which it is * appended to the file. It is required when uploading data to be appended to the file and when flushing previously @@ -8881,15 +9094,17 @@ public Mono> appendDataWithResponseAs EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; String transactionalContentHashConverted = Base64Util.encodeToString(transactionalContentHash); String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return service.appendData(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), action, - position, timeout, contentLength, transactionalContentHashConverted, transactionalContentCrc64Converted, - leaseId, leaseAction, leaseDuration, proposedLeaseId, requestId, this.client.getVersion(), encryptionKey, - encryptionKeySha256, encryptionAlgorithm, flush, body, accept, context); + return service + .appendData(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), action, position, + timeout, contentLength, transactionalContentHashConverted, transactionalContentCrc64Converted, leaseId, + leaseAction, leaseDuration, proposedLeaseId, requestId, this.client.getVersion(), encryptionKey, + encryptionKeySha256, encryptionAlgorithm, flush, body, accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Append data to the file. - * + * * @param body Initial data. * @param position This parameter allows the caller to upload data in parallel and control the order in which it is * appended to the file. It is required when uploading data to be appended to the file and when flushing previously @@ -8929,12 +9144,13 @@ public Mono appendDataAsync(BinaryData body, Long position, Integer timeou CpkInfo cpkInfo) { return appendDataWithResponseAsync(body, position, timeout, contentLength, transactionalContentCrc64, leaseAction, leaseDuration, proposedLeaseId, requestId, flush, pathHttpHeaders, leaseAccessConditions, - cpkInfo).flatMap(ignored -> Mono.empty()); + cpkInfo).onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Append data to the file. - * + * * @param body Initial data. * @param position This parameter allows the caller to upload data in parallel and control the order in which it is * appended to the file. It is required when uploading data to be appended to the file and when flushing previously @@ -8975,12 +9191,14 @@ public Mono appendDataAsync(BinaryData body, Long position, Integer timeou CpkInfo cpkInfo, Context context) { return appendDataWithResponseAsync(body, position, timeout, contentLength, transactionalContentCrc64, leaseAction, leaseDuration, proposedLeaseId, requestId, flush, pathHttpHeaders, leaseAccessConditions, - cpkInfo, context).flatMap(ignored -> Mono.empty()); + cpkInfo, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Append data to the file. - * + * * @param body Initial data. * @param position This parameter allows the caller to upload data in parallel and control the order in which it is * appended to the file. It is required when uploading data to be appended to the file and when flushing previously @@ -9047,16 +9265,18 @@ public Mono> appendDataNoCustomHeadersWithResponseAsync(BinaryDat EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; String transactionalContentHashConverted = Base64Util.encodeToString(transactionalContentHash); String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return FluxUtil.withContext(context -> service.appendDataNoCustomHeaders(this.client.getUrl(), - this.client.getFileSystem(), this.client.getPath(), action, position, timeout, contentLength, - transactionalContentHashConverted, transactionalContentCrc64Converted, leaseId, leaseAction, leaseDuration, - proposedLeaseId, requestId, this.client.getVersion(), encryptionKey, encryptionKeySha256, - encryptionAlgorithm, flush, body, accept, context)); + return FluxUtil + .withContext(context -> service.appendDataNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), action, position, timeout, contentLength, transactionalContentHashConverted, + transactionalContentCrc64Converted, leaseId, leaseAction, leaseDuration, proposedLeaseId, requestId, + this.client.getVersion(), encryptionKey, encryptionKeySha256, encryptionAlgorithm, flush, body, accept, + context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Append data to the file. - * + * * @param body Initial data. * @param position This parameter allows the caller to upload data in parallel and control the order in which it is * appended to the file. It is required when uploading data to be appended to the file and when flushing previously @@ -9124,16 +9344,17 @@ public Mono> appendDataNoCustomHeadersWithResponseAsync(BinaryDat EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; String transactionalContentHashConverted = Base64Util.encodeToString(transactionalContentHash); String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return service.appendDataNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), - this.client.getPath(), action, position, timeout, contentLength, transactionalContentHashConverted, - transactionalContentCrc64Converted, leaseId, leaseAction, leaseDuration, proposedLeaseId, requestId, - this.client.getVersion(), encryptionKey, encryptionKeySha256, encryptionAlgorithm, flush, body, accept, - context); + return service + .appendDataNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), action, + position, timeout, contentLength, transactionalContentHashConverted, transactionalContentCrc64Converted, + leaseId, leaseAction, leaseDuration, proposedLeaseId, requestId, this.client.getVersion(), + encryptionKey, encryptionKeySha256, encryptionAlgorithm, flush, body, accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Append data to the file. - * + * * @param body Initial data. * @param position This parameter allows the caller to upload data in parallel and control the order in which it is * appended to the file. It is required when uploading data to be appended to the file and when flushing previously @@ -9201,15 +9422,20 @@ public ResponseBase appendDataWithResponse(BinaryD EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; String transactionalContentHashConverted = Base64Util.encodeToString(transactionalContentHash); String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return service.appendDataSync(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), action, - position, timeout, contentLength, transactionalContentHashConverted, transactionalContentCrc64Converted, - leaseId, leaseAction, leaseDuration, proposedLeaseId, requestId, this.client.getVersion(), encryptionKey, - encryptionKeySha256, encryptionAlgorithm, flush, body, accept, context); + try { + return service.appendDataSync(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), + action, position, timeout, contentLength, transactionalContentHashConverted, + transactionalContentCrc64Converted, leaseId, leaseAction, leaseDuration, proposedLeaseId, requestId, + this.client.getVersion(), encryptionKey, encryptionKeySha256, encryptionAlgorithm, flush, body, accept, + context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Append data to the file. - * + * * @param body Initial data. * @param position This parameter allows the caller to upload data in parallel and control the order in which it is * appended to the file. It is required when uploading data to be appended to the file and when flushing previously @@ -9253,7 +9479,7 @@ public void appendData(BinaryData body, Long position, Integer timeout, Long con /** * Append data to the file. - * + * * @param body Initial data. * @param position This parameter allows the caller to upload data in parallel and control the order in which it is * appended to the file. It is required when uploading data to be appended to the file and when flushing previously @@ -9321,16 +9547,20 @@ public Response appendDataNoCustomHeadersWithResponse(BinaryData body, Lon EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; String transactionalContentHashConverted = Base64Util.encodeToString(transactionalContentHash); String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return service.appendDataNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), - this.client.getPath(), action, position, timeout, contentLength, transactionalContentHashConverted, - transactionalContentCrc64Converted, leaseId, leaseAction, leaseDuration, proposedLeaseId, requestId, - this.client.getVersion(), encryptionKey, encryptionKeySha256, encryptionAlgorithm, flush, body, accept, - context); + try { + return service.appendDataNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), action, position, timeout, contentLength, transactionalContentHashConverted, + transactionalContentCrc64Converted, leaseId, leaseAction, leaseDuration, proposedLeaseId, requestId, + this.client.getVersion(), encryptionKey, encryptionKeySha256, encryptionAlgorithm, flush, body, accept, + context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Sets the time a blob will expire and be deleted. - * + * * @param expiryOptions Required. Indicates mode of the expiry time. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -9348,14 +9578,16 @@ public Mono> setExpiryWithResponseAsyn Integer timeout, String requestId, String expiresOn) { final String comp = "expiry"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.setExpiry(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), comp, - timeout, this.client.getVersion(), requestId, expiryOptions, expiresOn, accept, context)); + return FluxUtil + .withContext( + context -> service.setExpiry(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), + comp, timeout, this.client.getVersion(), requestId, expiryOptions, expiresOn, accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Sets the time a blob will expire and be deleted. - * + * * @param expiryOptions Required. Indicates mode of the expiry time. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -9374,13 +9606,15 @@ public Mono> setExpiryWithResponseAsyn Integer timeout, String requestId, String expiresOn, Context context) { final String comp = "expiry"; final String accept = "application/json"; - return service.setExpiry(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), comp, - timeout, this.client.getVersion(), requestId, expiryOptions, expiresOn, accept, context); + return service + .setExpiry(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), comp, timeout, + this.client.getVersion(), requestId, expiryOptions, expiresOn, accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Sets the time a blob will expire and be deleted. - * + * * @param expiryOptions Required. Indicates mode of the expiry time. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -9397,12 +9631,13 @@ public Mono> setExpiryWithResponseAsyn public Mono setExpiryAsync(PathExpiryOptions expiryOptions, Integer timeout, String requestId, String expiresOn) { return setExpiryWithResponseAsync(expiryOptions, timeout, requestId, expiresOn) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) .flatMap(ignored -> Mono.empty()); } /** * Sets the time a blob will expire and be deleted. - * + * * @param expiryOptions Required. Indicates mode of the expiry time. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -9420,12 +9655,13 @@ public Mono setExpiryAsync(PathExpiryOptions expiryOptions, Integer timeou public Mono setExpiryAsync(PathExpiryOptions expiryOptions, Integer timeout, String requestId, String expiresOn, Context context) { return setExpiryWithResponseAsync(expiryOptions, timeout, requestId, expiresOn, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) .flatMap(ignored -> Mono.empty()); } /** * Sets the time a blob will expire and be deleted. - * + * * @param expiryOptions Required. Indicates mode of the expiry time. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -9443,14 +9679,16 @@ public Mono> setExpiryNoCustomHeadersWithResponseAsync(PathExpiry Integer timeout, String requestId, String expiresOn) { final String comp = "expiry"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.setExpiryNoCustomHeaders(this.client.getUrl(), - this.client.getFileSystem(), this.client.getPath(), comp, timeout, this.client.getVersion(), requestId, - expiryOptions, expiresOn, accept, context)); + return FluxUtil + .withContext(context -> service.setExpiryNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), comp, timeout, this.client.getVersion(), requestId, expiryOptions, expiresOn, + accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Sets the time a blob will expire and be deleted. - * + * * @param expiryOptions Required. Indicates mode of the expiry time. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -9469,14 +9707,15 @@ public Mono> setExpiryNoCustomHeadersWithResponseAsync(PathExpiry Integer timeout, String requestId, String expiresOn, Context context) { final String comp = "expiry"; final String accept = "application/json"; - return service.setExpiryNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), - this.client.getPath(), comp, timeout, this.client.getVersion(), requestId, expiryOptions, expiresOn, accept, - context); + return service + .setExpiryNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), comp, + timeout, this.client.getVersion(), requestId, expiryOptions, expiresOn, accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Sets the time a blob will expire and be deleted. - * + * * @param expiryOptions Required. Indicates mode of the expiry time. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -9495,13 +9734,17 @@ public ResponseBase setExpiryWithResponse(PathExpir Integer timeout, String requestId, String expiresOn, Context context) { final String comp = "expiry"; final String accept = "application/json"; - return service.setExpirySync(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), comp, - timeout, this.client.getVersion(), requestId, expiryOptions, expiresOn, accept, context); + try { + return service.setExpirySync(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), comp, + timeout, this.client.getVersion(), requestId, expiryOptions, expiresOn, accept, context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Sets the time a blob will expire and be deleted. - * + * * @param expiryOptions Required. Indicates mode of the expiry time. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -9520,7 +9763,7 @@ public void setExpiry(PathExpiryOptions expiryOptions, Integer timeout, String r /** * Sets the time a blob will expire and be deleted. - * + * * @param expiryOptions Required. Indicates mode of the expiry time. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -9539,14 +9782,18 @@ public Response setExpiryNoCustomHeadersWithResponse(PathExpiryOptions exp String requestId, String expiresOn, Context context) { final String comp = "expiry"; final String accept = "application/json"; - return service.setExpiryNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), - this.client.getPath(), comp, timeout, this.client.getVersion(), requestId, expiryOptions, expiresOn, accept, - context); + try { + return service.setExpiryNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), comp, timeout, this.client.getVersion(), requestId, expiryOptions, expiresOn, + accept, context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Undelete a path that was previously soft deleted. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -9564,14 +9811,16 @@ public Mono> undeleteWithResponseAsync( String undeleteSource, String requestId) { final String comp = "undelete"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.undelete(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), comp, - timeout, undeleteSource, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext( + context -> service.undelete(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), + comp, timeout, undeleteSource, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Undelete a path that was previously soft deleted. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -9590,13 +9839,15 @@ public Mono> undeleteWithResponseAsync( String undeleteSource, String requestId, Context context) { final String comp = "undelete"; final String accept = "application/json"; - return service.undelete(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), comp, timeout, - undeleteSource, this.client.getVersion(), requestId, accept, context); + return service + .undelete(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), comp, timeout, + undeleteSource, this.client.getVersion(), requestId, accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Undelete a path that was previously soft deleted. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -9611,12 +9862,14 @@ public Mono> undeleteWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono undeleteAsync(Integer timeout, String undeleteSource, String requestId) { - return undeleteWithResponseAsync(timeout, undeleteSource, requestId).flatMap(ignored -> Mono.empty()); + return undeleteWithResponseAsync(timeout, undeleteSource, requestId) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Undelete a path that was previously soft deleted. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -9632,12 +9885,14 @@ public Mono undeleteAsync(Integer timeout, String undeleteSource, String r */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono undeleteAsync(Integer timeout, String undeleteSource, String requestId, Context context) { - return undeleteWithResponseAsync(timeout, undeleteSource, requestId, context).flatMap(ignored -> Mono.empty()); + return undeleteWithResponseAsync(timeout, undeleteSource, requestId, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Undelete a path that was previously soft deleted. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -9655,14 +9910,16 @@ public Mono> undeleteNoCustomHeadersWithResponseAsync(Integer tim String requestId) { final String comp = "undelete"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.undeleteNoCustomHeaders(this.client.getUrl(), - this.client.getFileSystem(), this.client.getPath(), comp, timeout, undeleteSource, this.client.getVersion(), - requestId, accept, context)); + return FluxUtil + .withContext(context -> service.undeleteNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), comp, timeout, undeleteSource, this.client.getVersion(), requestId, accept, + context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Undelete a path that was previously soft deleted. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -9681,13 +9938,15 @@ public Mono> undeleteNoCustomHeadersWithResponseAsync(Integer tim String requestId, Context context) { final String comp = "undelete"; final String accept = "application/json"; - return service.undeleteNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), - comp, timeout, undeleteSource, this.client.getVersion(), requestId, accept, context); + return service + .undeleteNoCustomHeaders(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), comp, + timeout, undeleteSource, this.client.getVersion(), requestId, accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException); } /** * Undelete a path that was previously soft deleted. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -9706,13 +9965,17 @@ public ResponseBase undeleteWithResponse(Integer tim String requestId, Context context) { final String comp = "undelete"; final String accept = "application/json"; - return service.undeleteSync(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), comp, - timeout, undeleteSource, this.client.getVersion(), requestId, accept, context); + try { + return service.undeleteSync(this.client.getUrl(), this.client.getFileSystem(), this.client.getPath(), comp, + timeout, undeleteSource, this.client.getVersion(), requestId, accept, context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * Undelete a path that was previously soft deleted. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -9731,7 +9994,7 @@ public void undelete(Integer timeout, String undeleteSource, String requestId) { /** * Undelete a path that was previously soft deleted. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -9750,7 +10013,12 @@ public Response undeleteNoCustomHeadersWithResponse(Integer timeout, Strin Context context) { final String comp = "undelete"; final String accept = "application/json"; - return service.undeleteNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), - this.client.getPath(), comp, timeout, undeleteSource, this.client.getVersion(), requestId, accept, context); + try { + return service.undeleteNoCustomHeadersSync(this.client.getUrl(), this.client.getFileSystem(), + this.client.getPath(), comp, timeout, undeleteSource, this.client.getVersion(), requestId, accept, + context); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } } diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/ServicesImpl.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/ServicesImpl.java index aaf199beb2e1..f22d6462d40f 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/ServicesImpl.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/ServicesImpl.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.storage.file.datalake.implementation; import com.azure.core.annotation.ExpectedResponses; @@ -28,11 +27,13 @@ import com.azure.storage.file.datalake.implementation.models.FileSystemList; import com.azure.storage.file.datalake.implementation.models.ServicesListFileSystemsHeaders; import reactor.core.publisher.Mono; +import com.azure.storage.file.datalake.implementation.util.ModelHelper; /** * An instance of this class provides access to all the operations defined in Services. */ public final class ServicesImpl { + /** * The proxy service used to perform REST calls. */ @@ -45,7 +46,7 @@ public final class ServicesImpl { /** * Initializes an instance of ServicesImpl. - * + * * @param client the instance of the service client containing this operation class. */ ServicesImpl(AzureDataLakeStorageRestAPIImpl client) { @@ -60,6 +61,7 @@ public final class ServicesImpl { @Host("{url}") @ServiceInterface(name = "AzureDataLakeStorage") public interface ServicesService { + @Get("/") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DataLakeStorageExceptionInternal.class) @@ -99,9 +101,9 @@ Response listFileSystemsNoCustomHeadersSync(@HostParam("url") St /** * List FileSystems - * + * * List filesystems and their properties in given account. - * + * * @param prefix Filters results to filesystems within the specified prefix. * @param continuation Optional. When deleting a directory, the number of paths that are deleted with each * invocation is limited. If the number of paths to be deleted exceeds this limit, a continuation token is returned @@ -127,15 +129,16 @@ public Mono> listFileSystemsSinglePageAsync(String pre return FluxUtil .withContext(context -> service.listFileSystems(this.client.getUrl(), resource, prefix, continuation, maxResults, requestId, timeout, this.client.getVersion(), accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().getFilesystems(), null, res.getDeserializedHeaders())); } /** * List FileSystems - * + * * List filesystems and their properties in given account. - * + * * @param prefix Filters results to filesystems within the specified prefix. * @param continuation Optional. When deleting a directory, the number of paths that are deleted with each * invocation is limited. If the number of paths to be deleted exceeds this limit, a continuation token is returned @@ -162,15 +165,16 @@ public Mono> listFileSystemsSinglePageAsync(String pre return service .listFileSystems(this.client.getUrl(), resource, prefix, continuation, maxResults, requestId, timeout, this.client.getVersion(), accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().getFilesystems(), null, res.getDeserializedHeaders())); } /** * List FileSystems - * + * * List filesystems and their properties in given account. - * + * * @param prefix Filters results to filesystems within the specified prefix. * @param continuation Optional. When deleting a directory, the number of paths that are deleted with each * invocation is limited. If the number of paths to be deleted exceeds this limit, a continuation token is returned @@ -197,9 +201,9 @@ public PagedFlux listFileSystemsAsync(String prefix, String continua /** * List FileSystems - * + * * List filesystems and their properties in given account. - * + * * @param prefix Filters results to filesystems within the specified prefix. * @param continuation Optional. When deleting a directory, the number of paths that are deleted with each * invocation is limited. If the number of paths to be deleted exceeds this limit, a continuation token is returned @@ -227,9 +231,9 @@ public PagedFlux listFileSystemsAsync(String prefix, String continua /** * List FileSystems - * + * * List filesystems and their properties in given account. - * + * * @param prefix Filters results to filesystems within the specified prefix. * @param continuation Optional. When deleting a directory, the number of paths that are deleted with each * invocation is limited. If the number of paths to be deleted exceeds this limit, a continuation token is returned @@ -255,15 +259,16 @@ public Mono> listFileSystemsNoCustomHeadersSinglePageA return FluxUtil .withContext(context -> service.listFileSystemsNoCustomHeaders(this.client.getUrl(), resource, prefix, continuation, maxResults, requestId, timeout, this.client.getVersion(), accept, context)) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().getFilesystems(), null, null)); } /** * List FileSystems - * + * * List filesystems and their properties in given account. - * + * * @param prefix Filters results to filesystems within the specified prefix. * @param continuation Optional. When deleting a directory, the number of paths that are deleted with each * invocation is limited. If the number of paths to be deleted exceeds this limit, a continuation token is returned @@ -290,15 +295,16 @@ public Mono> listFileSystemsNoCustomHeadersSinglePageA return service .listFileSystemsNoCustomHeaders(this.client.getUrl(), resource, prefix, continuation, maxResults, requestId, timeout, this.client.getVersion(), accept, context) + .onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().getFilesystems(), null, null)); } /** * List FileSystems - * + * * List filesystems and their properties in given account. - * + * * @param prefix Filters results to filesystems within the specified prefix. * @param continuation Optional. When deleting a directory, the number of paths that are deleted with each * invocation is limited. If the number of paths to be deleted exceeds this limit, a continuation token is returned @@ -325,9 +331,9 @@ public PagedFlux listFileSystemsNoCustomHeadersAsync(String prefix, /** * List FileSystems - * + * * List filesystems and their properties in given account. - * + * * @param prefix Filters results to filesystems within the specified prefix. * @param continuation Optional. When deleting a directory, the number of paths that are deleted with each * invocation is limited. If the number of paths to be deleted exceeds this limit, a continuation token is returned @@ -355,9 +361,9 @@ public PagedFlux listFileSystemsNoCustomHeadersAsync(String prefix, /** * List FileSystems - * + * * List filesystems and their properties in given account. - * + * * @param prefix Filters results to filesystems within the specified prefix. * @param continuation Optional. When deleting a directory, the number of paths that are deleted with each * invocation is limited. If the number of paths to be deleted exceeds this limit, a continuation token is returned @@ -383,15 +389,19 @@ public PagedResponse listFileSystemsSinglePage(String prefix, String ResponseBase res = service.listFileSystemsSync(this.client.getUrl(), resource, prefix, continuation, maxResults, requestId, timeout, this.client.getVersion(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getFilesystems(), null, res.getDeserializedHeaders()); + try { + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getFilesystems(), null, res.getDeserializedHeaders()); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * List FileSystems - * + * * List filesystems and their properties in given account. - * + * * @param prefix Filters results to filesystems within the specified prefix. * @param continuation Optional. When deleting a directory, the number of paths that are deleted with each * invocation is limited. If the number of paths to be deleted exceeds this limit, a continuation token is returned @@ -418,15 +428,19 @@ public PagedResponse listFileSystemsSinglePage(String prefix, String ResponseBase res = service.listFileSystemsSync(this.client.getUrl(), resource, prefix, continuation, maxResults, requestId, timeout, this.client.getVersion(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getFilesystems(), null, res.getDeserializedHeaders()); + try { + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getFilesystems(), null, res.getDeserializedHeaders()); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * List FileSystems - * + * * List filesystems and their properties in given account. - * + * * @param prefix Filters results to filesystems within the specified prefix. * @param continuation Optional. When deleting a directory, the number of paths that are deleted with each * invocation is limited. If the number of paths to be deleted exceeds this limit, a continuation token is returned @@ -453,9 +467,9 @@ public PagedIterable listFileSystems(String prefix, String continuat /** * List FileSystems - * + * * List filesystems and their properties in given account. - * + * * @param prefix Filters results to filesystems within the specified prefix. * @param continuation Optional. When deleting a directory, the number of paths that are deleted with each * invocation is limited. If the number of paths to be deleted exceeds this limit, a continuation token is returned @@ -483,9 +497,9 @@ public PagedIterable listFileSystems(String prefix, String continuat /** * List FileSystems - * + * * List filesystems and their properties in given account. - * + * * @param prefix Filters results to filesystems within the specified prefix. * @param continuation Optional. When deleting a directory, the number of paths that are deleted with each * invocation is limited. If the number of paths to be deleted exceeds this limit, a continuation token is returned @@ -510,15 +524,19 @@ public PagedResponse listFileSystemsNoCustomHeadersSinglePage(String final String accept = "application/json"; Response res = service.listFileSystemsNoCustomHeadersSync(this.client.getUrl(), resource, prefix, continuation, maxResults, requestId, timeout, this.client.getVersion(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getFilesystems(), null, null); + try { + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getFilesystems(), null, null); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * List FileSystems - * + * * List filesystems and their properties in given account. - * + * * @param prefix Filters results to filesystems within the specified prefix. * @param continuation Optional. When deleting a directory, the number of paths that are deleted with each * invocation is limited. If the number of paths to be deleted exceeds this limit, a continuation token is returned @@ -544,15 +562,19 @@ public PagedResponse listFileSystemsNoCustomHeadersSinglePage(String final String accept = "application/json"; Response res = service.listFileSystemsNoCustomHeadersSync(this.client.getUrl(), resource, prefix, continuation, maxResults, requestId, timeout, this.client.getVersion(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getFilesystems(), null, null); + try { + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getFilesystems(), null, null); + } catch (DataLakeStorageExceptionInternal internalException) { + throw ModelHelper.mapToDataLakeStorageException(internalException); + } } /** * List FileSystems - * + * * List filesystems and their properties in given account. - * + * * @param prefix Filters results to filesystems within the specified prefix. * @param continuation Optional. When deleting a directory, the number of paths that are deleted with each * invocation is limited. If the number of paths to be deleted exceeds this limit, a continuation token is returned @@ -579,9 +601,9 @@ public PagedIterable listFileSystemsNoCustomHeaders(String prefix, S /** * List FileSystems - * + * * List filesystems and their properties in given account. - * + * * @param prefix Filters results to filesystems within the specified prefix. * @param continuation Optional. When deleting a directory, the number of paths that are deleted with each * invocation is limited. If the number of paths to be deleted exceeds this limit, a continuation token is returned diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/util/DataLakeImplUtils.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/util/DataLakeImplUtils.java index 155b0e25bfdb..91dd6be1332c 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/util/DataLakeImplUtils.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/util/DataLakeImplUtils.java @@ -5,12 +5,10 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.storage.blob.models.BlobStorageException; -import com.azure.storage.file.datalake.implementation.models.DataLakeStorageExceptionInternal; import com.azure.storage.file.datalake.models.DataLakeStorageException; import reactor.core.Exceptions; import java.util.List; -import java.util.concurrent.Callable; import java.util.function.Supplier; import java.util.stream.Collectors; @@ -57,13 +55,4 @@ public static T returnOrConvertException(Supplier supplier, ClientLogger } } - public static Callable wrapServiceCallWithExceptionMapping(Supplier serviceCall) { - return () -> { - try { - return serviceCall.get(); - } catch (DataLakeStorageExceptionInternal internal) { - throw (DataLakeStorageException) ModelHelper.mapToDataLakeStorageException(internal); - } - }; - } } diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/util/ModelHelper.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/util/ModelHelper.java index c4042c44331a..74b16d85dfba 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/util/ModelHelper.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/util/ModelHelper.java @@ -197,13 +197,7 @@ public static String buildMetadataString(Map metadata) { * @param internal The internal exception. * @return The public exception. */ - public static Throwable mapToDataLakeStorageException(Throwable internal) { - if (internal instanceof DataLakeStorageExceptionInternal) { - DataLakeStorageExceptionInternal internalException = (DataLakeStorageExceptionInternal) internal; - return new DataLakeStorageException(internalException.getMessage(), internalException.getResponse(), - internalException.getValue()); - } - - return internal; + public static DataLakeStorageException mapToDataLakeStorageException(DataLakeStorageExceptionInternal internal) { + return new DataLakeStorageException(internal.getMessage(), internal.getResponse(), internal.getValue()); } } diff --git a/sdk/storage/azure-storage-file-datalake/swagger/src/main/java/DataLakeStorageCustomization.java b/sdk/storage/azure-storage-file-datalake/swagger/src/main/java/DataLakeStorageCustomization.java index de49dd7aa246..8502908cd9f5 100644 --- a/sdk/storage/azure-storage-file-datalake/swagger/src/main/java/DataLakeStorageCustomization.java +++ b/sdk/storage/azure-storage-file-datalake/swagger/src/main/java/DataLakeStorageCustomization.java @@ -6,11 +6,23 @@ import com.azure.autorest.customization.LibraryCustomization; import com.azure.autorest.customization.PackageCustomization; import com.azure.autorest.customization.JavadocCustomization; +import com.github.javaparser.ParseProblemException; import com.github.javaparser.StaticJavaParser; +import com.github.javaparser.ast.NodeList; import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; import com.github.javaparser.ast.body.MethodDeclaration; +import com.github.javaparser.ast.body.Parameter; +import com.github.javaparser.ast.stmt.BlockStmt; +import com.github.javaparser.ast.stmt.CatchClause; +import com.github.javaparser.ast.stmt.Statement; +import com.github.javaparser.ast.stmt.TryStmt; +import com.github.javaparser.ast.type.ClassOrInterfaceType; +import com.github.javaparser.ast.type.Type; import org.slf4j.Logger; +import java.util.Arrays; +import java.util.List; + /** * Customization class for File DataLake Storage. */ @@ -165,6 +177,8 @@ public void customize(LibraryCustomization customization, Logger logger) { JavadocCustomization setActiveJavadoc = path.getMethod("fromJson").getJavadoc(); setActiveJavadoc.addThrows("IllegalStateException", "If a token is not an allowed type."); + + updateImplToMapInternalException(customization.getPackage("com.azure.storage.file.datalake.implementation")); } private static void replaceMethodToJson(ClassOrInterfaceDeclaration clazz, String newBody) { @@ -186,4 +200,109 @@ private static void replaceMethodFromXml(ClassOrInterfaceDeclaration clazz, Stri MethodDeclaration method = clazz.getMethodsBySignature("fromXml", "XmlReader", "String").get(0); method.setBody(StaticJavaParser.parseBlock(newBody)); } + + /** + * Customizes the implementation classes that will perform calls to the service. The following logic is used: + *

+ * - Check for the return of the method not equaling to PagedFlux, PagedIterable, PollerFlux, or SyncPoller. Those + * types wrap other APIs and those APIs being update is the correct change. + * - For asynchronous methods, add a call to + * {@code .onErrorMap(DataLakeStorageException.class, ModelHelper::mapToDataLakeStorageException)} to + * handle mapping DataLakeStorageExceptionInternal to DataLakeStorageException. + * - For synchronous methods, wrap the return statement in a try-catch block that catches + * DataLakeStorageExceptionInternal and rethrows {@code ModelHelper.mapToDataLakeStorageException(e)}. Or, for void + * methods wrap the last statement. + * + * @param implPackage The implementation package. + */ + private static void updateImplToMapInternalException(PackageCustomization implPackage) { + List implsToUpdate = Arrays.asList("FileSystemsImpl", "PathsImpl", "ServicesImpl"); + for (String implToUpdate : implsToUpdate) { + implPackage.getClass(implToUpdate).customizeAst(ast -> { + ast.addImport("com.azure.storage.file.datalake.implementation.util.ModelHelper"); + ast.addImport("com.azure.storage.file.datalake.models.DataLakeStorageException"); + ast.addImport("com.azure.storage.file.datalake.implementation.models.DataLakeStorageExceptionInternal"); + ast.getClassByName(implToUpdate).ifPresent(clazz -> { + clazz.getFields(); + + clazz.getMethods().forEach(methodDeclaration -> { + Type returnType = methodDeclaration.getType(); + // The way code generation works we only need to update the methods that have a class return type. + // As non-class return types, such as "void", call into the Response methods. + if (!returnType.isClassOrInterfaceType()) { + return; + } + + ClassOrInterfaceType returnTypeClass = returnType.asClassOrInterfaceType(); + String returnTypeName = returnTypeClass.getNameAsString(); + if (returnTypeName.equals("PagedFlux") || returnTypeName.equals("PagedIterable") + || returnTypeName.equals("PollerFlux") || returnTypeName.equals("SyncPoller")) { + return; + } + + if (returnTypeName.equals("Mono") || returnTypeName.equals("Flux")) { + addErrorMappingToAsyncMethod(methodDeclaration); + } else { + addErrorMappingToSyncMethod(methodDeclaration); + } + }); + }); + }); + } + } + + private static void addErrorMappingToAsyncMethod(MethodDeclaration method) { + BlockStmt body = method.getBody().get(); + + // Bit of hack to insert the 'onErrorMap' in the right location. + // Unfortunately, 'onErrorMap' returns which for some calls breaks typing, such as Void -> Object or + // PagedResponse -> PagedResponseBase. So, 'onErrorMap' needs to be inserted after the first method call. + // To do this, we track the first found '(' and the associated closing ')' to insert 'onErrorMap' after the ')'. + // So, 'service.methodCall(parameters).map()' becomes 'service.methodCall(parameters).onErrorMap().map()'. + String originalReturnStatement = body.getStatement(body.getStatements().size() - 1).asReturnStmt() + .getExpression().get().toString(); + int insertionPoint = findAsyncOnErrorMapInsertionPoint(originalReturnStatement); + String newReturnStatement = "return " + originalReturnStatement.substring(0, insertionPoint) + + ".onErrorMap(DataLakeStorageExceptionInternal.class, ModelHelper::mapToDataLakeStorageException)" + + originalReturnStatement.substring(insertionPoint) + ";"; + try { + Statement newReturn = StaticJavaParser.parseStatement(newReturnStatement); + body.getStatements().set(body.getStatements().size() - 1, newReturn); + } catch (ParseProblemException ex) { + throw new RuntimeException("Failed to parse: " + newReturnStatement, ex); + } + } + + private static int findAsyncOnErrorMapInsertionPoint(String returnStatement) { + int openParenthesis = 0; + int closeParenthesis = 0; + for (int i = 0; i < returnStatement.length(); i++) { + char c = returnStatement.charAt(i); + if (c == '(') { + openParenthesis++; + } else if (c == ')') { + closeParenthesis++; + if (openParenthesis == closeParenthesis) { + return i + 1; + } + } + } + return -1; + } + + private static void addErrorMappingToSyncMethod(MethodDeclaration method) { + BlockStmt body = method.getBody().get(); + + // Turn the last statement into a BlockStmt that will be used as the try block. + BlockStmt tryBlock = new BlockStmt(new NodeList<>(body.getStatement(body.getStatements().size() - 1))); + BlockStmt catchBlock = new BlockStmt(new NodeList<>(StaticJavaParser.parseStatement( + "throw ModelHelper.mapToDataLakeStorageException(internalException);"))); + Parameter catchParameter = new Parameter().setType("DataLakeStorageExceptionInternal") + .setName("internalException"); + CatchClause catchClause = new CatchClause(catchParameter, catchBlock); + TryStmt tryCatchMap = new TryStmt(tryBlock, new NodeList<>(catchClause), null); + + // Replace the last statement with the try-catch block. + body.getStatements().set(body.getStatements().size() - 1, tryCatchMap); + } } diff --git a/sdk/storage/azure-storage-file-share/checkstyle-suppressions.xml b/sdk/storage/azure-storage-file-share/checkstyle-suppressions.xml index 536c2cb61b0b..92c75cee61fa 100644 --- a/sdk/storage/azure-storage-file-share/checkstyle-suppressions.xml +++ b/sdk/storage/azure-storage-file-share/checkstyle-suppressions.xml @@ -18,4 +18,14 @@ + + + + + + + + + + diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareAsyncClient.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareAsyncClient.java index ed9cae6362f8..dd4868aee881 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareAsyncClient.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareAsyncClient.java @@ -376,7 +376,6 @@ Mono> createWithResponse(ShareCreateOptions options, Context options.getAccessTier(), enabledProtocol, options.getRootSquash(), options.isSnapshotVirtualDirectoryAccessEnabled(), options.isPaidBurstingEnabled(), options.getPaidBurstingMaxBandwidthMibps(), options.getPaidBurstingMaxIops(), context) - .onErrorMap(ModelHelper::mapToShareStorageException) .map(ModelHelper::mapToShareInfoResponse); } @@ -526,7 +525,6 @@ public Mono> createSnapshotWithResponse(Map> createSnapshotWithResponse(Map metadata, Context context) { context = context == null ? Context.NONE : context; return azureFileStorageClient.getShares().createSnapshotWithResponseAsync(shareName, null, metadata, context) - .onErrorMap(ModelHelper::mapToShareStorageException) .map(ModelHelper::mapCreateSnapshotResponse); } @@ -628,8 +626,7 @@ Mono> deleteWithResponse(ShareDeleteOptions options, Context cont context = context == null ? Context.NONE : context; return azureFileStorageClient.getShares().deleteNoCustomHeadersWithResponseAsync(shareName, snapshot, null, ModelHelper.toDeleteSnapshotsOptionType(options.getDeleteSnapshotsOptions()), - requestConditions.getLeaseId(), context) - .onErrorMap(ModelHelper::mapToShareStorageException); + requestConditions.getLeaseId(), context); } /** @@ -810,7 +807,6 @@ Mono> getPropertiesWithResponse(ShareGetPropertiesOpti context = context == null ? Context.NONE : context; return azureFileStorageClient.getShares() .getPropertiesWithResponseAsync(shareName, snapshot, null, requestConditions.getLeaseId(), context) - .onErrorMap(ModelHelper::mapToShareStorageException) .map(ModelHelper::mapGetPropertiesResponse); } @@ -945,7 +941,6 @@ Mono> setPropertiesWithResponse(ShareSetPropertiesOptions op options.getQuotaInGb(), options.getAccessTier(), requestConditions.getLeaseId(), options.getRootSquash(), options.isSnapshotVirtualDirectoryAccessEnabled(), options.isPaidBurstingEnabled(), options.getPaidBurstingMaxBandwidthMibps(), options.getPaidBurstingMaxIops(), context) - .onErrorMap(ModelHelper::mapToShareStorageException) .map(ModelHelper::mapToShareInfoResponse); } @@ -1070,7 +1065,6 @@ Mono> setMetadataWithResponse(ShareSetMetadataOptions option context = context == null ? Context.NONE : context; return azureFileStorageClient.getShares().setMetadataNoCustomHeadersWithResponseAsync(shareName, null, options.getMetadata(), requestConditions.getLeaseId(), context) - .onErrorMap(ModelHelper::mapToShareStorageException) .map(ModelHelper::mapToShareInfoResponse); } @@ -1135,7 +1129,6 @@ public PagedFlux getAccessPolicy(ShareGetAccessPolicyOpti marker -> this.azureFileStorageClient.getShares() .getAccessPolicyWithResponseAsync(shareName, null, requestConditions.getLeaseId(), Context.NONE) - .onErrorMap(ModelHelper::mapToShareStorageException) .map(response -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), @@ -1266,7 +1259,6 @@ Mono> setAccessPolicyWithResponse(ShareSetAccessPolicyOption return azureFileStorageClient.getShares().setAccessPolicyNoCustomHeadersWithResponseAsync(shareName, null, requestConditions.getLeaseId(), permissions, context) - .onErrorMap(ModelHelper::mapToShareStorageException) .map(ModelHelper::mapToShareInfoResponse); } @@ -1358,7 +1350,6 @@ Mono> getStatisticsWithResponse(ShareGetStatisticsOpti context = context == null ? Context.NONE : context; return azureFileStorageClient.getShares().getStatisticsNoCustomHeadersWithResponseAsync(shareName, null, requestConditions.getLeaseId(), context) - .onErrorMap(ModelHelper::mapToShareStorageException) .map(ModelHelper::mapGetStatisticsResponse); } @@ -2144,10 +2135,10 @@ public Mono> createPermissionWithResponse(ShareFilePermission f Mono> createPermissionWithResponse(String filePermission, FilePermissionFormat filePermissionFormat, Context context) { // NOTE: Should we check for null or empty? - SharePermission sharePermission = new SharePermission().setPermission(filePermission).setFormat(filePermissionFormat); + SharePermission sharePermission = new SharePermission().setPermission(filePermission) + .setFormat(filePermissionFormat); return azureFileStorageClient.getShares() .createPermissionWithResponseAsync(shareName, sharePermission, null, context) - .onErrorMap(ModelHelper::mapToShareStorageException) .map(response -> new SimpleResponse<>(response, response.getDeserializedHeaders().getXMsFilePermissionKey())); } @@ -2255,7 +2246,6 @@ Mono> getPermissionWithResponse(String filePermissionKey, FileP Context context) { return azureFileStorageClient.getShares() .getPermissionWithResponseAsync(shareName, filePermissionKey, filePermissionFormat, null, context) - .onErrorMap(ModelHelper::mapToShareStorageException) .map(response -> new SimpleResponse<>(response, response.getValue().getPermission())); } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareClient.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareClient.java index 7fc1a899dcc0..e61fa58dcf0e 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareClient.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareClient.java @@ -64,8 +64,6 @@ import java.util.function.Supplier; import static com.azure.storage.common.implementation.StorageImplUtils.sendRequest; -import static com.azure.storage.file.share.implementation.util.ModelHelper.wrapServiceCallWithExceptionMapping; -import static com.azure.storage.file.share.implementation.util.ModelHelper.wrapTimeoutServiceCallWithExceptionMapping; /** * This class provides a client that contains all the operations for interacting with a share in Azure Storage Share. @@ -364,11 +362,11 @@ public Response createWithResponse(ShareCreateOptions options, Durati String enabledProtocol = finalOptions.getProtocols() == null ? null : finalOptions.getProtocols().toString(); String finalEnabledProtocol = "".equals(enabledProtocol) ? null : enabledProtocol; - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() -> azureFileStorageClient.getShares() + Callable> operation = () -> azureFileStorageClient.getShares() .createNoCustomHeadersWithResponse(shareName, null, finalOptions.getMetadata(), finalOptions.getQuotaInGb(), finalOptions.getAccessTier(), finalEnabledProtocol, finalOptions.getRootSquash(), finalOptions.isSnapshotVirtualDirectoryAccessEnabled(), finalOptions.isPaidBurstingEnabled(), - finalOptions.getPaidBurstingMaxBandwidthMibps(), finalOptions.getPaidBurstingMaxIops(), finalContext)); + finalOptions.getPaidBurstingMaxBandwidthMibps(), finalOptions.getPaidBurstingMaxIops(), finalContext); return ModelHelper.mapToShareInfoResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -503,9 +501,8 @@ public ShareSnapshotInfo createSnapshot() { public Response createSnapshotWithResponse(Map metadata, Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureFileStorageClient.getShares().createSnapshotWithResponse(shareName, null, metadata, - finalContext)); + Callable> operation = () -> azureFileStorageClient.getShares() + .createSnapshotWithResponse(shareName, null, metadata, finalContext); return ModelHelper.mapCreateSnapshotResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -597,10 +594,10 @@ public Response deleteWithResponse(ShareDeleteOptions options, Duration ti ShareRequestConditions requestConditions = finalOptions.getRequestConditions() == null ? new ShareRequestConditions() : finalOptions.getRequestConditions(); - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureFileStorageClient.getShares().deleteNoCustomHeadersWithResponse(shareName, snapshot, null, + Callable> operation = () -> this.azureFileStorageClient.getShares() + .deleteNoCustomHeadersWithResponse(shareName, snapshot, null, ModelHelper.toDeleteSnapshotsOptionType(finalOptions.getDeleteSnapshotsOptions()), - requestConditions.getLeaseId(), finalContext)); + requestConditions.getLeaseId(), finalContext); return sendRequest(operation, timeout, ShareStorageException.class); } @@ -764,9 +761,8 @@ public Response getPropertiesWithResponse(ShareGetPropertiesOpt Context finalContext = context == null ? Context.NONE : context; ShareRequestConditions requestConditions = options.getRequestConditions() == null ? new ShareRequestConditions() : options.getRequestConditions(); - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureFileStorageClient.getShares() - .getPropertiesWithResponse(shareName, snapshot, null, requestConditions.getLeaseId(), finalContext)); + Callable> operation = () -> azureFileStorageClient.getShares() + .getPropertiesWithResponse(shareName, snapshot, null, requestConditions.getLeaseId(), finalContext); return ModelHelper.mapGetPropertiesResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -891,12 +887,11 @@ public Response setPropertiesWithResponse(ShareSetPropertiesOptions o ? new ShareRequestConditions() : options.getRequestConditions(); Context finalContext = context == null ? Context.NONE : context; - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureFileStorageClient.getShares().setPropertiesNoCustomHeadersWithResponse(shareName, null, - options.getQuotaInGb(), options.getAccessTier(), requestConditions.getLeaseId(), - options.getRootSquash(), options.isSnapshotVirtualDirectoryAccessEnabled(), - options.isPaidBurstingEnabled(), options.getPaidBurstingMaxBandwidthMibps(), - options.getPaidBurstingMaxIops(), finalContext)); + Callable> operation = () -> this.azureFileStorageClient.getShares() + .setPropertiesNoCustomHeadersWithResponse(shareName, null, options.getQuotaInGb(), options.getAccessTier(), + requestConditions.getLeaseId(), options.getRootSquash(), + options.isSnapshotVirtualDirectoryAccessEnabled(), options.isPaidBurstingEnabled(), + options.getPaidBurstingMaxBandwidthMibps(), options.getPaidBurstingMaxIops(), finalContext); return ModelHelper.mapToShareInfoResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -1012,9 +1007,9 @@ public Response setMetadataWithResponse(ShareSetMetadataOptions optio ? new ShareRequestConditions() : options.getRequestConditions(); Context finalContext = context == null ? Context.NONE : context; - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> this.azureFileStorageClient.getShares().setMetadataNoCustomHeadersWithResponse(shareName, null, - options.getMetadata(), requestConditions.getLeaseId(), finalContext)); + Callable> operation = () -> this.azureFileStorageClient.getShares() + .setMetadataNoCustomHeadersWithResponse(shareName, null, options.getMetadata(), + requestConditions.getLeaseId(), finalContext); return ModelHelper.mapToShareInfoResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -1077,9 +1072,9 @@ public PagedIterable getAccessPolicy(ShareGetAccessPolicy ShareRequestConditions requestConditions = finalOptions.getRequestConditions() == null ? new ShareRequestConditions() : finalOptions.getRequestConditions(); - ResponseBase responseBase = - wrapServiceCallWithExceptionMapping(() -> this.azureFileStorageClient.getShares() - .getAccessPolicyWithResponse(shareName, null, requestConditions.getLeaseId(), Context.NONE)); + ResponseBase responseBase + = this.azureFileStorageClient.getShares().getAccessPolicyWithResponse(shareName, null, + requestConditions.getLeaseId(), Context.NONE); Supplier> response = () -> new PagedResponseBase<>( responseBase.getRequest(), @@ -1212,9 +1207,9 @@ public Response setAccessPolicyWithResponse(ShareSetAccessPolicyOptio ModelHelper.truncateAccessPolicyPermissionsToSeconds(options.getPermissions()); Context finalContext = context == null ? Context.NONE : context; - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureFileStorageClient.getShares().setAccessPolicyNoCustomHeadersWithResponse(shareName, null, - requestConditions.getLeaseId(), permissions, finalContext)); + Callable> operation = () -> this.azureFileStorageClient.getShares() + .setAccessPolicyNoCustomHeadersWithResponse(shareName, null, requestConditions.getLeaseId(), permissions, + finalContext); return ModelHelper.mapToShareInfoResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -1306,9 +1301,8 @@ public Response getStatisticsWithResponse(ShareGetStatisticsOpt ? new ShareRequestConditions() : options.getRequestConditions(); Context finalContext = context == null ? Context.NONE : context; - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureFileStorageClient.getShares().getStatisticsNoCustomHeadersWithResponse(shareName, null, - requestConditions.getLeaseId(), finalContext)); + Callable> operation = () -> this.azureFileStorageClient.getShares() + .getStatisticsNoCustomHeadersWithResponse(shareName, null, requestConditions.getLeaseId(), finalContext); return ModelHelper.mapGetStatisticsResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -1976,9 +1970,8 @@ public String createPermission(ShareFilePermission filePermission) { public Response createPermissionWithResponse(String filePermission, Context context) { Context finalContext = context == null ? Context.NONE : context; SharePermission sharePermission = new SharePermission().setPermission(filePermission); - ResponseBase response = wrapServiceCallWithExceptionMapping(() -> - this.azureFileStorageClient.getShares().createPermissionWithResponse(shareName, sharePermission, null, - finalContext)); + ResponseBase response = this.azureFileStorageClient.getShares() + .createPermissionWithResponse(shareName, sharePermission, null, finalContext); return new SimpleResponse<>(response, response.getDeserializedHeaders().getXMsFilePermissionKey()); } @@ -2007,9 +2000,8 @@ public Response createPermissionWithResponse(ShareFilePermission filePer Context finalContext = context == null ? Context.NONE : context; SharePermission sharePermission = new SharePermission().setPermission(filePermission.getPermission()) .setFormat(filePermission.getPermissionFormat()); - ResponseBase response = wrapServiceCallWithExceptionMapping(() -> - this.azureFileStorageClient.getShares().createPermissionWithResponse(shareName, sharePermission, null, - finalContext)); + ResponseBase response = this.azureFileStorageClient.getShares() + .createPermissionWithResponse(shareName, sharePermission, null, finalContext); return new SimpleResponse<>(response, response.getDeserializedHeaders().getXMsFilePermissionKey()); } @@ -2078,9 +2070,8 @@ public String getPermission(String filePermissionKey, FilePermissionFormat fileP @ServiceMethod(returns = ReturnType.SINGLE) public Response getPermissionWithResponse(String filePermissionKey, Context context) { Context finalContext = context == null ? Context.NONE : context; - ResponseBase response = wrapServiceCallWithExceptionMapping(() -> - this.azureFileStorageClient.getShares().getPermissionWithResponse(shareName, filePermissionKey, null, null, - finalContext)); + ResponseBase response = this.azureFileStorageClient.getShares() + .getPermissionWithResponse(shareName, filePermissionKey, null, null, finalContext); return new SimpleResponse<>(response, response.getValue().getPermission()); } @@ -2110,9 +2101,8 @@ public Response getPermissionWithResponse(String filePermissionKey, Cont @ServiceMethod(returns = ReturnType.SINGLE) public Response getPermissionWithResponse(String filePermissionKey, FilePermissionFormat filePermissionFormat, Context context) { Context finalContext = context == null ? Context.NONE : context; - ResponseBase response = wrapServiceCallWithExceptionMapping(() -> - this.azureFileStorageClient.getShares().getPermissionWithResponse(shareName, filePermissionKey, - filePermissionFormat, null, finalContext)); + ResponseBase response = this.azureFileStorageClient.getShares() + .getPermissionWithResponse(shareName, filePermissionKey, filePermissionFormat, null, finalContext); return new SimpleResponse<>(response, response.getValue().getPermission()); } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareDirectoryAsyncClient.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareDirectoryAsyncClient.java index e012dc83fe09..476467fa2f2a 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareDirectoryAsyncClient.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareDirectoryAsyncClient.java @@ -25,12 +25,12 @@ import com.azure.storage.file.share.implementation.AzureFileStorageImpl; import com.azure.storage.file.share.implementation.models.CopyFileSmbInfo; import com.azure.storage.file.share.implementation.models.DestinationLeaseAccessConditions; -import com.azure.storage.file.share.models.FilePermissionFormat; import com.azure.storage.file.share.implementation.models.ListFilesIncludeType; import com.azure.storage.file.share.implementation.models.SourceLeaseAccessConditions; import com.azure.storage.file.share.implementation.util.ModelHelper; import com.azure.storage.file.share.implementation.util.ShareSasImplUtil; import com.azure.storage.file.share.models.CloseHandlesInfo; +import com.azure.storage.file.share.models.FilePermissionFormat; import com.azure.storage.file.share.models.HandleItem; import com.azure.storage.file.share.models.NtfsFileAttributes; import com.azure.storage.file.share.models.ShareDirectoryInfo; @@ -378,7 +378,6 @@ Mono> createWithResponse(FileSmbProperties smbPrope return azureFileStorageClient.getDirectories() .createWithResponseAsync(shareName, directoryPath, fileAttributes, null, metadata, filePermission, filePermissionFormat, filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime, context) - .onErrorMap(ModelHelper::mapToShareStorageException) .map(ModelHelper::mapShareDirectoryInfo); } @@ -533,8 +532,7 @@ public Mono> deleteWithResponse() { Mono> deleteWithResponse(Context context) { context = context == null ? Context.NONE : context; return azureFileStorageClient.getDirectories() - .deleteNoCustomHeadersWithResponseAsync(shareName, directoryPath, null, context) - .onErrorMap(ModelHelper::mapToShareStorageException); + .deleteNoCustomHeadersWithResponseAsync(shareName, directoryPath, null, context); } /** @@ -673,7 +671,6 @@ Mono> getPropertiesWithResponse(Context conte context = context == null ? Context.NONE : context; return azureFileStorageClient.getDirectories() .getPropertiesWithResponseAsync(shareName, directoryPath, snapshot, null, context) - .onErrorMap(ModelHelper::mapToShareStorageException) .map(ModelHelper::mapShareDirectoryPropertiesResponse); } @@ -797,7 +794,6 @@ Mono> setPropertiesWithResponse(FileSmbProperties s return azureFileStorageClient.getDirectories() .setPropertiesWithResponseAsync(shareName, directoryPath, fileAttributes, null, filePermission, filePermissionFormat, filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime, context) - .onErrorMap(ModelHelper::mapToShareStorageException) .map(ModelHelper::mapSetPropertiesResponse); } @@ -888,7 +884,6 @@ Mono> setMetadataWithResponse(Map listFilesAndDirectoriesWithOptionalTimeout( modifiedOptions.getPrefix(), snapshot, marker, pageSize == null ? modifiedOptions.getMaxResultsPerPage() : pageSize, null, finalIncludeTypes, modifiedOptions.includeExtendedInfo(), context), timeout) - .onErrorMap(ModelHelper::mapToShareStorageException) .map(response -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), ModelHelper.convertResponseAndGetNumOfResults(response), response.getValue().getNextMarker(), null)); @@ -1065,7 +1059,6 @@ PagedFlux listHandlesWithOptionalTimeout(Integer maxResultPerPage, b marker -> StorageImplUtils.applyOptionalTimeout(this.azureFileStorageClient.getDirectories() .listHandlesWithResponseAsync(shareName, directoryPath, marker, maxResultPerPage, null, snapshot, recursive, context), timeout) - .onErrorMap(ModelHelper::mapToShareStorageException) .map(response -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), @@ -1138,7 +1131,6 @@ public Mono> forceCloseHandleWithResponse(String hand Mono> forceCloseHandleWithResponse(String handleId, Context context) { return this.azureFileStorageClient.getDirectories().forceCloseHandlesWithResponseAsync(shareName, directoryPath, handleId, null, null, snapshot, false, context) - .onErrorMap(ModelHelper::mapToShareStorageException) .map(response -> new SimpleResponse<>(response, new CloseHandlesInfo(response.getDeserializedHeaders().getXMsNumberOfHandlesClosed(), response.getDeserializedHeaders().getXMsNumberOfHandlesFailed()))); @@ -1183,7 +1175,6 @@ PagedFlux forceCloseAllHandlesWithTimeout(boolean recursive, D marker -> StorageImplUtils.applyOptionalTimeout(this.azureFileStorageClient.getDirectories() .forceCloseHandlesWithResponseAsync(shareName, directoryPath, "*", null, marker, snapshot, recursive, context), timeout) - .onErrorMap(ModelHelper::mapToShareStorageException) .map(response -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), @@ -1306,7 +1297,6 @@ Mono> renameWithResponse(ShareFileRenameOpti null /* timeout */, options.getReplaceIfExists(), options.isIgnoreReadOnly(), options.getFilePermission(), options.getFilePermissionFormat(), filePermissionKey, options.getMetadata(), sourceConditions, destinationConditions, smbInfo, context) - .onErrorMap(ModelHelper::mapToShareStorageException) .map(response -> new SimpleResponse<>(response, destinationDirectoryClient)); } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareDirectoryClient.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareDirectoryClient.java index 70dc18a709c6..fd97bb0f30f1 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareDirectoryClient.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareDirectoryClient.java @@ -67,7 +67,6 @@ import java.util.function.Function; import static com.azure.storage.common.implementation.StorageImplUtils.sendRequest; -import static com.azure.storage.file.share.implementation.util.ModelHelper.wrapTimeoutServiceCallWithExceptionMapping; /** * This class provides a client that contains all the operations for interacting with directory in Azure Storage File @@ -358,11 +357,10 @@ public Response createWithResponse(ShareDirectoryCreateOptio String fileLastWriteTime = properties.setFileLastWriteTime(FileConstants.FILE_TIME_NOW); String fileChangeTime = properties.getFileChangeTimeString(); - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> this.azureFileStorageClient.getDirectories() - .createWithResponse(shareName, directoryPath, fileAttributes, null, finalOptions.getMetadata(), - finalFilePermission, finalOptions.getFilePermissionFormat(), filePermissionKey, fileCreationTime, - fileLastWriteTime, fileChangeTime, finalContext)); + Callable> operation = () -> azureFileStorageClient.getDirectories() + .createWithResponse(shareName, directoryPath, fileAttributes, null, finalOptions.getMetadata(), + finalFilePermission, finalOptions.getFilePermissionFormat(), filePermissionKey, fileCreationTime, + fileLastWriteTime, fileChangeTime, finalContext); return ModelHelper.mapShareDirectoryInfo(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -497,9 +495,8 @@ public void delete() { @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> this.azureFileStorageClient.getDirectories().deleteNoCustomHeadersWithResponse(shareName, - directoryPath, null, finalContext)); + Callable> operation = () -> this.azureFileStorageClient.getDirectories() + .deleteNoCustomHeadersWithResponse(shareName, directoryPath, null, finalContext); return sendRequest(operation, timeout, ShareStorageException.class); } @@ -626,8 +623,8 @@ public ShareDirectoryProperties getProperties() { public Response getPropertiesWithResponse(Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; Callable> operation - = wrapTimeoutServiceCallWithExceptionMapping(() -> this.azureFileStorageClient.getDirectories() - .getPropertiesWithResponse(shareName, directoryPath, snapshot, null, finalContext)); + = () -> this.azureFileStorageClient.getDirectories().getPropertiesWithResponse(shareName, directoryPath, + snapshot, null, finalContext); return ModelHelper.mapShareDirectoryPropertiesResponse(sendRequest(operation, timeout, ShareStorageException.class)); @@ -706,9 +703,9 @@ public Response setPropertiesWithResponse(FileSmbProperties String fileLastWriteTime = smbProperties.setFileLastWriteTime(FileConstants.PRESERVE); String fileChangeTime = smbProperties.getFileChangeTimeString(); Callable> operation - = wrapTimeoutServiceCallWithExceptionMapping(() -> this.azureFileStorageClient.getDirectories() - .setPropertiesWithResponse(shareName, directoryPath, fileAttributes, null, finalFilePermission, null, - filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime, finalContext)); + = () -> this.azureFileStorageClient.getDirectories().setPropertiesWithResponse(shareName, directoryPath, + fileAttributes, null, finalFilePermission, null, filePermissionKey, fileCreationTime, fileLastWriteTime, + fileChangeTime, finalContext); return ModelHelper.mapSetPropertiesResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -760,10 +757,9 @@ public Response setPropertiesWithResponse(ShareDirectorySetP String fileLastWriteTime = smbProperties.setFileLastWriteTime(FileConstants.PRESERVE); String fileChangeTime = smbProperties.getFileChangeTimeString(); Callable> operation - = wrapTimeoutServiceCallWithExceptionMapping(() -> this.azureFileStorageClient.getDirectories() - .setPropertiesWithResponse(shareName, directoryPath, fileAttributes, null, finalFilePermission, - options.getFilePermissions().getPermissionFormat(), filePermissionKey, fileCreationTime, - fileLastWriteTime, fileChangeTime, finalContext)); + = () -> this.azureFileStorageClient.getDirectories().setPropertiesWithResponse(shareName, directoryPath, + fileAttributes, null, finalFilePermission, options.getFilePermissions().getPermissionFormat(), + filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime, finalContext); return ModelHelper.mapSetPropertiesResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -851,8 +847,8 @@ public Response setMetadataWithResponse(Map> operation - = wrapTimeoutServiceCallWithExceptionMapping(() -> this.azureFileStorageClient.getDirectories() - .setMetadataWithResponse(shareName, directoryPath, null, metadata, finalContext)); + = () -> this.azureFileStorageClient.getDirectories().setMetadataWithResponse(shareName, directoryPath, null, + metadata, finalContext); return ModelHelper.setShareDirectoryMetadataResponse(sendRequest(operation, timeout, ShareStorageException.class)); @@ -982,11 +978,11 @@ public PagedIterable listFilesAndDirectories(ShareListFilesAndDir BiFunction> retriever = (marker, pageSize) -> { Callable> operation - = wrapTimeoutServiceCallWithExceptionMapping(() -> this.azureFileStorageClient.getDirectories() + = () -> this.azureFileStorageClient.getDirectories() .listFilesAndDirectoriesSegmentNoCustomHeadersWithResponse(shareName, directoryPath, modifiedOptions.getPrefix(), snapshot, marker, pageSize == null ? modifiedOptions.getMaxResultsPerPage() : pageSize, null, finalIncludeTypes, - modifiedOptions.includeExtendedInfo(), finalContext)); + modifiedOptions.includeExtendedInfo(), finalContext); Response response = sendRequest(operation, timeout, ShareStorageException.class); @@ -1035,10 +1031,9 @@ PagedIterable listHandlesWithOptionalTimeout(Integer maxResultPerPag Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; Function> retriever = (marker) -> { - Callable> operation = - wrapTimeoutServiceCallWithExceptionMapping(() -> this.azureFileStorageClient.getDirectories() - .listHandlesWithResponse(shareName, directoryPath, marker, maxResultPerPage, null, snapshot, - recursive, finalContext)); + Callable> operation + = () -> this.azureFileStorageClient.getDirectories().listHandlesWithResponse(shareName, directoryPath, + marker, maxResultPerPage, null, snapshot, recursive, finalContext); ResponseBase response = sendRequest(operation, timeout, ShareStorageException.class); @@ -1112,9 +1107,8 @@ public Response forceCloseHandleWithResponse(String handleId, Context finalContext = context == null ? Context.NONE : context; Callable> operation - = wrapTimeoutServiceCallWithExceptionMapping(() -> this.azureFileStorageClient.getDirectories() - .forceCloseHandlesWithResponse(shareName, directoryPath, handleId, null, null, snapshot, false, - finalContext)); + = () -> this.azureFileStorageClient.getDirectories().forceCloseHandlesWithResponse(shareName, directoryPath, + handleId, null, null, snapshot, false, finalContext); ResponseBase response = sendRequest(operation, timeout, ShareStorageException.class); @@ -1156,9 +1150,8 @@ public CloseHandlesInfo forceCloseAllHandles(boolean recursive, Duration timeout Function> retriever = (marker) -> { Callable> operation = - wrapTimeoutServiceCallWithExceptionMapping(() -> this.azureFileStorageClient.getDirectories() - .forceCloseHandlesWithResponse(shareName, directoryPath, "*", null, marker, snapshot, - recursive, finalContext)); + () -> this.azureFileStorageClient.getDirectories().forceCloseHandlesWithResponse(shareName, + directoryPath, "*", null, marker, snapshot, recursive, finalContext); ResponseBase response = sendRequest(operation, timeout, ShareStorageException.class); @@ -1280,12 +1273,12 @@ public Response renameWithResponse(ShareFileRenameOptions String renameSource = this.sasToken != null ? this.getDirectoryUrl() + "?" + this.sasToken.getSignature() : this.getDirectoryUrl(); - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> destinationDirectoryClient.azureFileStorageClient.getDirectories().renameNoCustomHeadersWithResponse( - destinationDirectoryClient.getShareName(), destinationDirectoryClient.getDirectoryPath(), renameSource, - null /* timeout */, options.getReplaceIfExists(), options.isIgnoreReadOnly(), - options.getFilePermission(), options.getFilePermissionFormat(), filePermissionKey, - options.getMetadata(), sourceConditions, destinationConditions, smbInfo, finalContext)); + Callable> operation = () -> destinationDirectoryClient.azureFileStorageClient.getDirectories() + .renameNoCustomHeadersWithResponse(destinationDirectoryClient.getShareName(), + destinationDirectoryClient.getDirectoryPath(), renameSource, null /* timeout */, + options.getReplaceIfExists(), options.isIgnoreReadOnly(), options.getFilePermission(), + options.getFilePermissionFormat(), filePermissionKey, options.getMetadata(), sourceConditions, + destinationConditions, smbInfo, finalContext); return new SimpleResponse<>(sendRequest(operation, timeout, ShareStorageException.class), destinationDirectoryClient); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareFileAsyncClient.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareFileAsyncClient.java index 837170108041..dfbed517c091 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareFileAsyncClient.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareFileAsyncClient.java @@ -37,7 +37,6 @@ import com.azure.storage.file.share.implementation.AzureFileStorageImpl; import com.azure.storage.file.share.implementation.models.CopyFileSmbInfo; import com.azure.storage.file.share.implementation.models.DestinationLeaseAccessConditions; -import com.azure.storage.file.share.models.FilePermissionFormat; import com.azure.storage.file.share.implementation.models.FilesDownloadHeaders; import com.azure.storage.file.share.implementation.models.FilesStartCopyHeaders; import com.azure.storage.file.share.implementation.models.ShareFileRangeWriteType; @@ -48,6 +47,7 @@ import com.azure.storage.file.share.models.CopyStatusType; import com.azure.storage.file.share.models.CopyableFileSmbPropertiesList; import com.azure.storage.file.share.models.DownloadRetryOptions; +import com.azure.storage.file.share.models.FilePermissionFormat; import com.azure.storage.file.share.models.HandleItem; import com.azure.storage.file.share.models.NtfsFileAttributes; import com.azure.storage.file.share.models.PermissionCopyModeType; @@ -487,7 +487,6 @@ Mono> createWithResponse(long maxSize, ShareFileHttpHead .createWithResponseAsync(shareName, filePath, maxSize, fileAttributes, null, metadata, filePermission, filePermissionFormat, filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime, requestConditions.getLeaseId(), httpHeaders, context) - .onErrorMap(ModelHelper::mapToShareStorageException) .map(ModelHelper::createFileInfoResponse); } @@ -710,7 +709,6 @@ public PollerFlux beginCopy(String sourceUrl, ShareFile .startCopyWithResponseAsync(shareName, filePath, copySource, null, options.getMetadata(), options.getFilePermission(), tempSmbProperties.getFilePermissionKey(), finalRequestConditions.getLeaseId(), copyFileSmbInfo, context)) - .onErrorMap(ModelHelper::mapToShareStorageException) .map(response -> { final FilesStartCopyHeaders headers = response.getDeserializedHeaders(); copyId.set(headers.getXMsCopyId()); @@ -861,8 +859,7 @@ Mono> abortCopyWithResponse(String copyId, ShareRequestConditions Context context) { requestConditions = requestConditions == null ? new ShareRequestConditions() : requestConditions; return azureFileStorageClient.getFiles().abortCopyNoCustomHeadersWithResponseAsync(shareName, filePath, copyId, - null, requestConditions.getLeaseId(), context) - .onErrorMap(ModelHelper::mapToShareStorageException); + null, requestConditions.getLeaseId(), context); } /** @@ -1237,8 +1234,7 @@ private Mono>> downloadRange Boolean rangeGetContentMD5, ShareRequestConditions requestConditions, Context context) { String rangeString = range == null ? null : range.toHeaderValue(); return azureFileStorageClient.getFiles().downloadWithResponseAsync(shareName, filePath, null, - rangeString, rangeGetContentMD5, requestConditions.getLeaseId(), context) - .onErrorMap(ModelHelper::mapToShareStorageException); + rangeString, rangeGetContentMD5, requestConditions.getLeaseId(), context); } /** @@ -1332,8 +1328,7 @@ public Mono> deleteWithResponse(ShareRequestConditions requestCon Mono> deleteWithResponse(ShareRequestConditions requestConditions, Context context) { requestConditions = requestConditions == null ? new ShareRequestConditions() : requestConditions; return azureFileStorageClient.getFiles() - .deleteNoCustomHeadersWithResponseAsync(shareName, filePath, null, requestConditions.getLeaseId(), context) - .onErrorMap(ModelHelper::mapToShareStorageException); + .deleteNoCustomHeadersWithResponseAsync(shareName, filePath, null, requestConditions.getLeaseId(), context); } /** @@ -1512,8 +1507,8 @@ Mono> getPropertiesWithResponse(ShareRequestCondit requestConditions = requestConditions == null ? new ShareRequestConditions() : requestConditions; context = context == null ? Context.NONE : context; return azureFileStorageClient.getFiles() - .getPropertiesWithResponseAsync(shareName, filePath, snapshot, null, requestConditions.getLeaseId(), context) - .onErrorMap(ModelHelper::mapToShareStorageException) + .getPropertiesWithResponseAsync(shareName, filePath, snapshot, null, requestConditions.getLeaseId(), + context) .map(ModelHelper::getPropertiesResponse); } @@ -1779,7 +1774,6 @@ Mono> setPropertiesWithResponse(long newFileSize, ShareF .setHttpHeadersWithResponseAsync(shareName, filePath, fileAttributes, null, newFileSize, filePermission, filePermissionFormat, filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime, requestConditions.getLeaseId(), httpHeaders, context) - .onErrorMap(ModelHelper::mapToShareStorageException) .map(ModelHelper::setPropertiesResponse); } @@ -1913,9 +1907,8 @@ Mono> setMetadataWithResponse(Map> uploadRangeWithResponse(ShareFileUploadRange return azureFileStorageClient.getFiles() .uploadRangeWithResponseAsync(shareName, filePath, range.toString(), ShareFileRangeWriteType.UPDATE, - options.getLength(), null, null, requestConditions.getLeaseId(), options.getLastWrittenMode(), data, context) - .onErrorMap(ModelHelper::mapToShareStorageException) + options.getLength(), null, null, requestConditions.getLeaseId(), options.getLastWrittenMode(), data, + context) .map(ModelHelper::uploadRangeHeadersToShareFileInfo); } @@ -2463,7 +2456,6 @@ Mono> uploadRangeFromUrlWithResponse( .uploadRangeFromURLWithResponseAsync(shareName, filePath, destinationRange.toString(), copySource, 0, null, sourceRange.toString(), null, modifiedRequestConditions.getLeaseId(), sourceAuth, options.getLastWrittenMode(), null, context) - .onErrorMap(ModelHelper::mapToShareStorageException) .map(ModelHelper::mapUploadRangeFromUrlResponse); } @@ -2575,7 +2567,6 @@ Mono> clearRangeWithResponse(long length, long off return azureFileStorageClient.getFiles() .uploadRangeWithResponseAsync(shareName, filePath, range.toString(), ShareFileRangeWriteType.CLEAR, 0L, null, null, requestConditions.getLeaseId(), null, (Flux) null, context) - .onErrorMap(ModelHelper::mapToShareStorageException) .map(ModelHelper::transformUploadResponse); } @@ -2850,7 +2841,6 @@ Mono> listRangesWithResponse(ShareFileRange range, return this.azureFileStorageClient.getFiles().getRangeListWithResponseAsync(shareName, filePath, snapshot, previousSnapshot, null, rangeString, finalRequestConditions.getLeaseId(), supportRename, context) - .onErrorMap(ModelHelper::mapToShareStorageException) .map(response -> new SimpleResponse<>(response, response.getValue())); } @@ -2912,7 +2902,6 @@ PagedFlux listHandlesWithOptionalTimeout(Integer maxResultsPerPage, marker -> StorageImplUtils.applyOptionalTimeout(this.azureFileStorageClient.getFiles() .listHandlesWithResponseAsync(shareName, filePath, marker, maxResultsPerPage, null, snapshot, context), timeout) - .onErrorMap(ModelHelper::mapToShareStorageException) .map(response -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), @@ -2986,7 +2975,6 @@ Mono> forceCloseHandleWithResponse(String handleId, C context = context == null ? Context.NONE : context; return azureFileStorageClient.getFiles() .forceCloseHandlesWithResponseAsync(shareName, filePath, handleId, null, null, snapshot, context) - .onErrorMap(ModelHelper::mapToShareStorageException) .map(response -> new SimpleResponse<>(response, new CloseHandlesInfo(response.getDeserializedHeaders().getXMsNumberOfHandlesClosed(), response.getDeserializedHeaders().getXMsNumberOfHandlesFailed()))); @@ -3027,9 +3015,7 @@ public Mono forceCloseAllHandles() { PagedFlux forceCloseAllHandlesWithOptionalTimeout(Duration timeout, Context context) { Function>> retriever = marker -> StorageImplUtils.applyOptionalTimeout(this.azureFileStorageClient.getFiles() - .forceCloseHandlesWithResponseAsync(shareName, filePath, "*", null, marker, - snapshot, context), timeout) - .onErrorMap(ModelHelper::mapToShareStorageException) + .forceCloseHandlesWithResponseAsync(shareName, filePath, "*", null, marker, snapshot, context), timeout) .map(response -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), @@ -3158,7 +3144,6 @@ Mono> renameWithResponse(ShareFileRenameOptions o null /* timeout */, options.getReplaceIfExists(), options.isIgnoreReadOnly(), options.getFilePermission(), options.getFilePermissionFormat(), filePermissionKey, options.getMetadata(), sourceConditions, destinationConditions, smbInfo, headers, context) - .onErrorMap(ModelHelper::mapToShareStorageException) .map(response -> new SimpleResponse<>(response, destinationFileClient)); } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareFileClient.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareFileClient.java index d985c81cc937..2d6bb083e0a3 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareFileClient.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareFileClient.java @@ -8,7 +8,6 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.credential.AzureSasCredential; import com.azure.core.exception.HttpResponseException; -import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; @@ -28,6 +27,7 @@ import com.azure.storage.common.ParallelTransferOptions; import com.azure.storage.common.StorageSharedKeyCredential; import com.azure.storage.common.Utility; +import com.azure.storage.common.implementation.Constants; import com.azure.storage.common.implementation.SasImplUtils; import com.azure.storage.common.implementation.StorageImplUtils; import com.azure.storage.common.implementation.StorageSeekableByteChannel; @@ -101,8 +101,6 @@ import java.util.stream.Collectors; import static com.azure.storage.common.implementation.StorageImplUtils.sendRequest; -import static com.azure.storage.file.share.implementation.util.ModelHelper.wrapServiceCallWithExceptionMapping; -import static com.azure.storage.file.share.implementation.util.ModelHelper.wrapTimeoutServiceCallWithExceptionMapping; /** * This class provides a client that contains all the operations for interacting files under Azure Storage File Service. @@ -477,10 +475,10 @@ public Response createWithResponse(long maxSize, ShareFileHttpHea String fileCreationTime = smbProperties.setFileCreationTime(FileConstants.FILE_TIME_NOW); String fileLastWriteTime = smbProperties.setFileLastWriteTime(FileConstants.FILE_TIME_NOW); String fileChangeTime = smbProperties.getFileChangeTimeString(); - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureFileStorageClient.getFiles().createWithResponse(shareName, filePath, maxSize, fileAttributes, - null, metadata, finalFilePermission, null, filePermissionKey, fileCreationTime, - fileLastWriteTime, fileChangeTime, finalRequestConditions.getLeaseId(), httpHeaders, finalContext)); + Callable> operation = () -> this.azureFileStorageClient.getFiles() + .createWithResponse(shareName, filePath, maxSize, fileAttributes, null, metadata, finalFilePermission, null, + filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime, + finalRequestConditions.getLeaseId(), httpHeaders, finalContext); return ModelHelper.createFileInfoResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -551,12 +549,11 @@ public Response createWithResponse(ShareFileCreateOptions options String fileCreationTime = smbProperties.setFileCreationTime(FileConstants.FILE_TIME_NOW); String fileLastWriteTime = smbProperties.setFileLastWriteTime(FileConstants.FILE_TIME_NOW); String fileChangeTime = smbProperties.getFileChangeTimeString(); - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureFileStorageClient.getFiles().createWithResponse(shareName, filePath, options.getSize(), - fileAttributes, null, options.getMetadata(), finalFilePermission, - options.getFilePermissionFormat(), filePermissionKey, fileCreationTime, - fileLastWriteTime, fileChangeTime, finalRequestConditions.getLeaseId(), options.getShareFileHttpHeaders(), - finalContext)); + Callable> operation = () -> this.azureFileStorageClient.getFiles() + .createWithResponse(shareName, filePath, options.getSize(), fileAttributes, null, options.getMetadata(), + finalFilePermission, options.getFilePermissionFormat(), filePermissionKey, fileCreationTime, + fileLastWriteTime, fileChangeTime, finalRequestConditions.getLeaseId(), + options.getShareFileHttpHeaders(), finalContext); return ModelHelper.createFileInfoResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -768,10 +765,10 @@ public SyncPoller beginCopy(String sourceUrl, ShareFile Function, PollResponse> syncActivationOperation = (pollingContext) -> { - ResponseBase response = wrapServiceCallWithExceptionMapping( - () -> azureFileStorageClient.getFiles().startCopyWithResponse(shareName, filePath, copySource, null, - options.getMetadata(), options.getFilePermission(), tempSmbProperties.getFilePermissionKey(), - finalRequestConditions.getLeaseId(), copyFileSmbInfo, null)); + ResponseBase response = azureFileStorageClient.getFiles() + .startCopyWithResponse(shareName, filePath, copySource, null, options.getMetadata(), + options.getFilePermission(), tempSmbProperties.getFilePermissionKey(), + finalRequestConditions.getLeaseId(), copyFileSmbInfo, null); FilesStartCopyHeaders headers = response.getDeserializedHeaders(); copyId.set(headers.getXMsCopyId()); @@ -782,7 +779,7 @@ public SyncPoller beginCopy(String sourceUrl, ShareFile headers.getXMsCopyStatus(), headers.getETag(), headers.getLastModified(), - response.getHeaders().getValue(HttpHeaderName.fromString("x-ms-error-code")))); + response.getHeaders().getValue(Constants.HeaderConstants.ERROR_CODE_HEADER_NAME))); }; Function, PollResponse> pollOperation = (pollingContext) -> @@ -921,9 +918,9 @@ public Response abortCopyWithResponse(String copyId, ShareRequestCondition Context finalContext = context == null ? Context.NONE : context; ShareRequestConditions finalRequestConditions = requestConditions == null ? new ShareRequestConditions() : requestConditions; - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> this.azureFileStorageClient.getFiles().abortCopyNoCustomHeadersWithResponse(shareName, filePath, - copyId, null, finalRequestConditions.getLeaseId(), finalContext)); + Callable> operation = () -> this.azureFileStorageClient.getFiles() + .abortCopyNoCustomHeadersWithResponse(shareName, filePath, copyId, null, + finalRequestConditions.getLeaseId(), finalContext); return sendRequest(operation, timeout, ShareStorageException.class); } @@ -1293,9 +1290,9 @@ public Response deleteWithResponse(ShareRequestConditions requestCondition Context finalContext = context == null ? Context.NONE : context; ShareRequestConditions finalRequestConditions = requestConditions == null ? new ShareRequestConditions() : requestConditions; - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> this.azureFileStorageClient.getFiles().deleteNoCustomHeadersWithResponse(shareName, filePath, null, - finalRequestConditions.getLeaseId(), finalContext)); + Callable> operation = () -> this.azureFileStorageClient.getFiles() + .deleteNoCustomHeadersWithResponse(shareName, filePath, null, finalRequestConditions.getLeaseId(), + finalContext); return sendRequest(operation, timeout, ShareStorageException.class); } @@ -1459,9 +1456,9 @@ public Response getPropertiesWithResponse(ShareRequestCondi Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; ShareRequestConditions finalRequestConditions = requestConditions == null ? new ShareRequestConditions() : requestConditions; - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> this.azureFileStorageClient.getFiles().getPropertiesWithResponse(shareName, filePath, snapshot, - null, finalRequestConditions.getLeaseId(), finalContext)); + Callable> operation = () -> this.azureFileStorageClient.getFiles() + .getPropertiesWithResponse(shareName, filePath, snapshot, null, finalRequestConditions.getLeaseId(), + finalContext); return ModelHelper.getPropertiesResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -1658,10 +1655,10 @@ public Response setPropertiesWithResponse(long newFileSize, Share String fileCreationTime = smbProperties.setFileCreationTime(FileConstants.PRESERVE); String fileLastWriteTime = smbProperties.setFileLastWriteTime(FileConstants.PRESERVE); String fileChangeTime = smbProperties.getFileChangeTimeString(); - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> this.azureFileStorageClient.getFiles().setHttpHeadersWithResponse(shareName, filePath, fileAttributes, - null, newFileSize, finalFilePermission, null, filePermissionKey, fileCreationTime, fileLastWriteTime, - fileChangeTime, finalRequestConditions.getLeaseId(), httpHeaders, finalContext)); + Callable> operation = () -> azureFileStorageClient.getFiles() + .setHttpHeadersWithResponse(shareName, filePath, fileAttributes, null, newFileSize, finalFilePermission, + null, filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime, + finalRequestConditions.getLeaseId(), httpHeaders, finalContext); return ModelHelper.setPropertiesResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -1729,11 +1726,11 @@ public Response setPropertiesWithResponse(ShareFileSetPropertiesO String fileCreationTime = smbProperties.setFileCreationTime(FileConstants.PRESERVE); String fileLastWriteTime = smbProperties.setFileLastWriteTime(FileConstants.PRESERVE); String fileChangeTime = smbProperties.getFileChangeTimeString(); - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> this.azureFileStorageClient.getFiles().setHttpHeadersWithResponse(shareName, filePath, fileAttributes, - null, options.getSizeInBytes(), finalFilePermission, options.getFilePermissions().getPermissionFormat(), - filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime, finalRequestConditions.getLeaseId(), - options.getHttpHeaders(), finalContext)); + Callable> operation = () -> azureFileStorageClient.getFiles() + .setHttpHeadersWithResponse(shareName, filePath, fileAttributes, null, options.getSizeInBytes(), + finalFilePermission, options.getFilePermissions().getPermissionFormat(), filePermissionKey, + fileCreationTime, fileLastWriteTime, fileChangeTime, finalRequestConditions.getLeaseId(), + options.getHttpHeaders(), finalContext); return ModelHelper.setPropertiesResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -1866,9 +1863,9 @@ public Response setMetadataWithResponse(Map> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> this.azureFileStorageClient.getFiles().setMetadataWithResponse(shareName, filePath, null, metadata, - finalRequestConditions.getLeaseId(), finalContext)); + Callable> operation = () -> this.azureFileStorageClient.getFiles() + .setMetadataWithResponse(shareName, filePath, null, metadata, finalRequestConditions.getLeaseId(), + finalContext); return ModelHelper.setMetadataResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -2279,11 +2276,10 @@ public Response uploadRangeFromUrlWithResponse( ? null : options.getSourceAuthorization().toString(); String copySource = Utility.encodeUrlPath(options.getSourceUrl()); - Callable> operation - = wrapTimeoutServiceCallWithExceptionMapping(() -> this.azureFileStorageClient.getFiles() - .uploadRangeFromURLWithResponse(shareName, filePath, destinationRange.toString(), copySource, 0, - null, sourceRange.toString(), null, finalRequestConditions.getLeaseId(), sourceAuth, - options.getLastWrittenMode(), null, finalContext)); + Callable> operation = () -> azureFileStorageClient.getFiles() + .uploadRangeFromURLWithResponse(shareName, filePath, destinationRange.toString(), copySource, 0, null, + sourceRange.toString(), null, finalRequestConditions.getLeaseId(), sourceAuth, + options.getLastWrittenMode(), null, finalContext); return ModelHelper.mapUploadRangeFromUrlResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -2385,10 +2381,9 @@ public Response clearRangeWithResponse(long length, long of ? new ShareRequestConditions() : requestConditions; ShareFileRange range = new ShareFileRange(offset, offset + length - 1); Context finalContext = context == null ? Context.NONE : context; - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> this.azureFileStorageClient.getFiles().uploadRangeWithResponse(shareName, filePath, range.toString(), - ShareFileRangeWriteType.CLEAR, 0L, null, null, finalRequestConditions.getLeaseId(), null, null, - finalContext)); + Callable> operation = () -> this.azureFileStorageClient.getFiles() + .uploadRangeWithResponse(shareName, filePath, range.toString(), ShareFileRangeWriteType.CLEAR, 0L, null, + null, finalRequestConditions.getLeaseId(), null, null, finalContext); return ModelHelper.transformUploadResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -2538,10 +2533,9 @@ public PagedIterable listRanges(ShareFileRange range, ShareReque String rangeString = range == null ? null : range.toString(); try { - Callable> operation = - wrapTimeoutServiceCallWithExceptionMapping(() -> this.azureFileStorageClient.getFiles() - .getRangeListWithResponse(shareName, filePath, snapshot, null, null, rangeString, - finalRequestConditions.getLeaseId(), null, finalContext)); + Callable> operation + = () -> this.azureFileStorageClient.getFiles().getRangeListWithResponse(shareName, filePath, snapshot, + null, null, rangeString, finalRequestConditions.getLeaseId(), null, finalContext); ResponseBase response = sendRequest(operation, timeout, ShareStorageException.class); @@ -2630,10 +2624,9 @@ public Response listRangesDiffWithResponse(ShareFileListRang ShareRequestConditions requestConditions = options.getRequestConditions() == null ? new ShareRequestConditions() : options.getRequestConditions(); String rangeString = options.getRange() == null ? null : options.getRange().toString(); - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> this.azureFileStorageClient.getFiles().getRangeListNoCustomHeadersWithResponse(shareName, filePath, - snapshot, options.getPreviousSnapshot(), null, rangeString, requestConditions.getLeaseId(), - options.isRenameIncluded(), finalContext)); + Callable> operation = () -> this.azureFileStorageClient.getFiles() + .getRangeListNoCustomHeadersWithResponse(shareName, filePath, snapshot, options.getPreviousSnapshot(), null, + rangeString, requestConditions.getLeaseId(), options.isRenameIncluded(), finalContext); return sendRequest(operation, timeout, ShareStorageException.class); } @@ -2693,8 +2686,8 @@ public PagedIterable listHandles(Integer maxResultsPerPage, Duration Context finalContext = context == null ? Context.NONE : context; try { Callable> operation - = wrapTimeoutServiceCallWithExceptionMapping(() -> this.azureFileStorageClient.getFiles() - .listHandlesWithResponse(shareName, filePath, null, maxResultsPerPage, null, snapshot, finalContext)); + = () -> this.azureFileStorageClient.getFiles().listHandlesWithResponse(shareName, filePath, null, + maxResultsPerPage, null, snapshot, finalContext); ResponseBase response = sendRequest(operation, timeout, ShareStorageException.class); @@ -2770,9 +2763,8 @@ public CloseHandlesInfo forceCloseHandle(String handleId) { @ServiceMethod(returns = ReturnType.SINGLE) public Response forceCloseHandleWithResponse(String handleId, Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> this.azureFileStorageClient.getFiles().forceCloseHandlesWithResponse(shareName, filePath, handleId, - null, null, snapshot, finalContext)); + Callable> operation = () -> azureFileStorageClient.getFiles() + .forceCloseHandlesWithResponse(shareName, filePath, handleId, null, null, snapshot, finalContext); ResponseBase response = sendRequest(operation, timeout, ShareStorageException.class); @@ -2810,8 +2802,8 @@ public CloseHandlesInfo forceCloseAllHandles(Duration timeout, Context context) Context finalContext = context == null ? Context.NONE : context; try { Callable> operation - = wrapTimeoutServiceCallWithExceptionMapping(() -> this.azureFileStorageClient.getFiles() - .forceCloseHandlesWithResponse(shareName, filePath, "*", null, null, snapshot, finalContext)); + = () -> this.azureFileStorageClient.getFiles().forceCloseHandlesWithResponse(shareName, filePath, "*", + null, null, snapshot, finalContext); ResponseBase response = sendRequest(operation, timeout, ShareStorageException.class); @@ -2938,12 +2930,12 @@ public Response renameWithResponse(ShareFileRenameOptions optio String finalRenameSource = this.sasToken != null ? renameSource + "?" + this.sasToken.getSignature() : renameSource; - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> destinationFileClient.azureFileStorageClient.getFiles().renameNoCustomHeadersWithResponse( - destinationFileClient.getShareName(), destinationFileClient.getFilePath(), finalRenameSource, - null /* timeout */, options.getReplaceIfExists(), options.isIgnoreReadOnly(), - options.getFilePermission(), options.getFilePermissionFormat(), finalFilePermissionKey, - options.getMetadata(), sourceConditions, destinationConditions, finalSmbInfo, headers, finalContext)); + Callable> operation = () -> destinationFileClient.azureFileStorageClient.getFiles() + .renameNoCustomHeadersWithResponse(destinationFileClient.getShareName(), + destinationFileClient.getFilePath(), finalRenameSource, null, options.getReplaceIfExists(), + options.isIgnoreReadOnly(), options.getFilePermission(), options.getFilePermissionFormat(), + finalFilePermissionKey, options.getMetadata(), sourceConditions, destinationConditions, finalSmbInfo, + headers, finalContext); return new SimpleResponse<>(sendRequest(operation, timeout, ShareStorageException.class), destinationFileClient); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareServiceAsyncClient.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareServiceAsyncClient.java index 5958dfe4a8c8..758bffbab9d1 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareServiceAsyncClient.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareServiceAsyncClient.java @@ -252,9 +252,8 @@ PagedFlux listSharesWithOptionalTimeout(String marker, ListSharesOpti BiFunction>> retriever = (nextMarker, pageSize) -> StorageImplUtils.applyOptionalTimeout(this.azureFileStorageClient.getServices() - .listSharesSegmentSinglePageAsync( - prefix, nextMarker, pageSize == null ? maxResultsPerPage : pageSize, include, null, context) - .onErrorMap(ModelHelper::mapToShareStorageException) + .listSharesSegmentSinglePageAsync(prefix, nextMarker, + pageSize == null ? maxResultsPerPage : pageSize, include, null, context) .map(response -> { List value = response.getValue() == null ? Collections.emptyList() @@ -336,7 +335,6 @@ public Mono> getPropertiesWithResponse() { Mono> getPropertiesWithResponse(Context context) { context = context == null ? Context.NONE : context; return azureFileStorageClient.getServices().getPropertiesWithResponseAsync(null, context) - .onErrorMap(ModelHelper::mapToShareStorageException) .map(response -> new SimpleResponse<>(response, response.getValue())); } @@ -458,8 +456,7 @@ public Mono> setPropertiesWithResponse(ShareServiceProperties pro Mono> setPropertiesWithResponse(ShareServiceProperties properties, Context context) { context = context == null ? Context.NONE : context; return azureFileStorageClient.getServices() - .setPropertiesNoCustomHeadersWithResponseAsync(properties, null, context) - .onErrorMap(ModelHelper::mapToShareStorageException); + .setPropertiesNoCustomHeadersWithResponseAsync(properties, null, context); } /** @@ -660,8 +657,7 @@ Mono> deleteShareWithResponse(String shareName, String snapshot, } context = context == null ? Context.NONE : context; return azureFileStorageClient.getShares() - .deleteNoCustomHeadersWithResponseAsync(shareName, snapshot, null, deleteSnapshots, null, context) - .onErrorMap(ModelHelper::mapToShareStorageException); + .deleteNoCustomHeadersWithResponseAsync(shareName, snapshot, null, deleteSnapshots, null, context); } /** @@ -858,7 +854,6 @@ Mono> undeleteShareWithResponse( String deletedShareName, String deletedShareVersion, Context context) { return this.azureFileStorageClient.getShares().restoreWithResponseAsync( deletedShareName, null, null, deletedShareName, deletedShareVersion, context) - .onErrorMap(ModelHelper::mapToShareStorageException) .map(response -> new SimpleResponse<>(response, getShareAsyncClient(deletedShareName))); } } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareServiceClient.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareServiceClient.java index f09d0d5fcb88..52c19c25ca89 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareServiceClient.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareServiceClient.java @@ -43,7 +43,6 @@ import java.util.stream.Collectors; import static com.azure.storage.common.implementation.StorageImplUtils.sendRequest; -import static com.azure.storage.file.share.implementation.util.ModelHelper.wrapTimeoutServiceCallWithExceptionMapping; /** * This class provides a shareServiceAsyncClient that contains all the operations for interacting with a file account in @@ -219,9 +218,9 @@ public PagedIterable listShares(ListSharesOptions options, Duration t BiFunction> retriever = (nextMarker, pageSize) -> { - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> this.azureFileStorageClient.getServices().listSharesSegmentNoCustomHeadersSinglePage(prefix, - nextMarker, pageSize == null ? maxResultsPerPage : pageSize, include, null, finalContext)); + Callable> operation = () -> this.azureFileStorageClient.getServices() + .listSharesSegmentNoCustomHeadersSinglePage(prefix, nextMarker, + pageSize == null ? maxResultsPerPage : pageSize, include, null, finalContext); PagedResponse response = sendRequest(operation, timeout, ShareStorageException.class); @@ -295,9 +294,8 @@ public ShareServiceProperties getProperties() { @ServiceMethod(returns = ReturnType.SINGLE) public Response getPropertiesWithResponse(Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> this.azureFileStorageClient.getServices().getPropertiesNoCustomHeadersWithResponse(null, - finalContext)); + Callable> operation = () -> this.azureFileStorageClient.getServices() + .getPropertiesNoCustomHeadersWithResponse(null, finalContext); Response response = sendRequest(operation, timeout, ShareStorageException.class); return new SimpleResponse<>(response, response.getValue()); @@ -429,9 +427,8 @@ public void setProperties(ShareServiceProperties properties) { public Response setPropertiesWithResponse(ShareServiceProperties properties, Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> this.azureFileStorageClient.getServices().setPropertiesNoCustomHeadersWithResponse(properties, null, - finalContext)); + Callable> operation = () -> this.azureFileStorageClient.getServices() + .setPropertiesNoCustomHeadersWithResponse(properties, null, finalContext); return sendRequest(operation, timeout, ShareStorageException.class); } @@ -598,9 +595,8 @@ public Response deleteShareWithResponse(String shareName, String snapshot, Context finalContext = context == null ? Context.NONE : context; DeleteSnapshotsOptionType deleteSnapshots = CoreUtils.isNullOrEmpty(snapshot) ? DeleteSnapshotsOptionType.INCLUDE : null; - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> this.azureFileStorageClient.getShares().deleteNoCustomHeadersWithResponse(shareName, snapshot, null, - deleteSnapshots, null, finalContext)); + Callable> operation = () -> this.azureFileStorageClient.getShares() + .deleteNoCustomHeadersWithResponse(shareName, snapshot, null, deleteSnapshots, null, finalContext); return sendRequest(operation, timeout, ShareStorageException.class); } @@ -793,9 +789,9 @@ public ShareClient undeleteShare(String deletedShareName, String deletedShareVer public Response undeleteShareWithResponse(String deletedShareName, String deletedShareVersion, Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> this.azureFileStorageClient.getShares().restoreNoCustomHeadersWithResponse(deletedShareName, null, - null, deletedShareName, deletedShareVersion, finalContext)); + Callable> operation = () -> this.azureFileStorageClient.getShares() + .restoreNoCustomHeadersWithResponse(deletedShareName, null, null, deletedShareName, deletedShareVersion, + finalContext); return new SimpleResponse<>(sendRequest(operation, timeout, ShareStorageException.class), getShareClient(deletedShareName)); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/DirectoriesImpl.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/DirectoriesImpl.java index 419bb52ac882..c1a25b74d2e3 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/DirectoriesImpl.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/DirectoriesImpl.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.storage.file.share.implementation; import com.azure.core.annotation.Delete; @@ -45,11 +44,13 @@ import java.util.Objects; import java.util.stream.Collectors; import reactor.core.publisher.Mono; +import com.azure.storage.file.share.implementation.util.ModelHelper; /** * An instance of this class provides access to all the operations defined in Directories. */ public final class DirectoriesImpl { + /** * The proxy service used to perform REST calls. */ @@ -62,7 +63,7 @@ public final class DirectoriesImpl { /** * Initializes an instance of DirectoriesImpl. - * + * * @param client the instance of the service client containing this operation class. */ DirectoriesImpl(AzureFileStorageImpl client) { @@ -78,6 +79,7 @@ public final class DirectoriesImpl { @Host("{url}") @ServiceInterface(name = "AzureFileStorageDire") public interface DirectoriesService { + @Put("/{shareName}/{directory}") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) @@ -616,7 +618,7 @@ Response renameNoCustomHeadersSync(@HostParam("url") String url, @PathPara /** * Creates a new directory under the specified share or parent directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file @@ -651,15 +653,17 @@ public Mono> createWithResponseAsyn String fileLastWriteTime, String fileChangeTime) { final String restype = "directory"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.create(this.client.getUrl(), shareName, directory, restype, - this.client.isAllowTrailingDot(), timeout, metadata, this.client.getVersion(), filePermission, - filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, - fileChangeTime, this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.create(this.client.getUrl(), shareName, directory, restype, + this.client.isAllowTrailingDot(), timeout, metadata, this.client.getVersion(), filePermission, + filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, + fileChangeTime, this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Creates a new directory under the specified share or parent directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file @@ -695,15 +699,17 @@ public Mono> createWithResponseAsyn String fileLastWriteTime, String fileChangeTime, Context context) { final String restype = "directory"; final String accept = "application/xml"; - return service.create(this.client.getUrl(), shareName, directory, restype, this.client.isAllowTrailingDot(), - timeout, metadata, this.client.getVersion(), filePermission, filePermissionFormat, filePermissionKey, - fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, this.client.getFileRequestIntent(), - accept, context); + return service + .create(this.client.getUrl(), shareName, directory, restype, this.client.isAllowTrailingDot(), timeout, + metadata, this.client.getVersion(), filePermission, filePermissionFormat, filePermissionKey, + fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, this.client.getFileRequestIntent(), + accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Creates a new directory under the specified share or parent directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file @@ -737,12 +743,13 @@ public Mono createAsync(String shareName, String directory, String fileAtt String filePermissionKey, String fileCreationTime, String fileLastWriteTime, String fileChangeTime) { return createWithResponseAsync(shareName, directory, fileAttributes, timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * Creates a new directory under the specified share or parent directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file @@ -778,12 +785,13 @@ public Mono createAsync(String shareName, String directory, String fileAtt Context context) { return createWithResponseAsync(shareName, directory, fileAttributes, timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * Creates a new directory under the specified share or parent directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file @@ -818,15 +826,17 @@ public Mono> createNoCustomHeadersWithResponseAsync(String shareN String fileLastWriteTime, String fileChangeTime) { final String restype = "directory"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.createNoCustomHeaders(this.client.getUrl(), shareName, directory, - restype, this.client.isAllowTrailingDot(), timeout, metadata, this.client.getVersion(), filePermission, - filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, - fileChangeTime, this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.createNoCustomHeaders(this.client.getUrl(), shareName, directory, restype, + this.client.isAllowTrailingDot(), timeout, metadata, this.client.getVersion(), filePermission, + filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, + fileChangeTime, this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Creates a new directory under the specified share or parent directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file @@ -862,15 +872,17 @@ public Mono> createNoCustomHeadersWithResponseAsync(String shareN String fileLastWriteTime, String fileChangeTime, Context context) { final String restype = "directory"; final String accept = "application/xml"; - return service.createNoCustomHeaders(this.client.getUrl(), shareName, directory, restype, - this.client.isAllowTrailingDot(), timeout, metadata, this.client.getVersion(), filePermission, - filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, - fileChangeTime, this.client.getFileRequestIntent(), accept, context); + return service + .createNoCustomHeaders(this.client.getUrl(), shareName, directory, restype, + this.client.isAllowTrailingDot(), timeout, metadata, this.client.getVersion(), filePermission, + filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, + fileChangeTime, this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Creates a new directory under the specified share or parent directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file @@ -906,15 +918,19 @@ public ResponseBase createWithResponse(String sh String fileLastWriteTime, String fileChangeTime, Context context) { final String restype = "directory"; final String accept = "application/xml"; - return service.createSync(this.client.getUrl(), shareName, directory, restype, this.client.isAllowTrailingDot(), - timeout, metadata, this.client.getVersion(), filePermission, filePermissionFormat, filePermissionKey, - fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, this.client.getFileRequestIntent(), - accept, context); + try { + return service.createSync(this.client.getUrl(), shareName, directory, restype, + this.client.isAllowTrailingDot(), timeout, metadata, this.client.getVersion(), filePermission, + filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, + fileChangeTime, this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Creates a new directory under the specified share or parent directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file @@ -951,7 +967,7 @@ public void create(String shareName, String directory, String fileAttributes, In /** * Creates a new directory under the specified share or parent directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file @@ -987,16 +1003,20 @@ public Response createNoCustomHeadersWithResponse(String shareName, String Context context) { final String restype = "directory"; final String accept = "application/xml"; - return service.createNoCustomHeadersSync(this.client.getUrl(), shareName, directory, restype, - this.client.isAllowTrailingDot(), timeout, metadata, this.client.getVersion(), filePermission, - filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, - fileChangeTime, this.client.getFileRequestIntent(), accept, context); + try { + return service.createNoCustomHeadersSync(this.client.getUrl(), shareName, directory, restype, + this.client.isAllowTrailingDot(), timeout, metadata, this.client.getVersion(), filePermission, + filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, + fileChangeTime, this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Returns all system properties for the specified directory, and can also be used to check the existence of a * directory. The data returned does not include the files in the directory or any subdirectories. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share @@ -1014,15 +1034,17 @@ public Mono> getPropertiesWi String directory, String sharesnapshot, Integer timeout) { final String restype = "directory"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getProperties(this.client.getUrl(), shareName, directory, - restype, this.client.isAllowTrailingDot(), sharesnapshot, timeout, this.client.getVersion(), - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.getProperties(this.client.getUrl(), shareName, directory, restype, + this.client.isAllowTrailingDot(), sharesnapshot, timeout, this.client.getVersion(), + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Returns all system properties for the specified directory, and can also be used to check the existence of a * directory. The data returned does not include the files in the directory or any subdirectories. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share @@ -1041,15 +1063,16 @@ public Mono> getPropertiesWi String directory, String sharesnapshot, Integer timeout, Context context) { final String restype = "directory"; final String accept = "application/xml"; - return service.getProperties(this.client.getUrl(), shareName, directory, restype, - this.client.isAllowTrailingDot(), sharesnapshot, timeout, this.client.getVersion(), - this.client.getFileRequestIntent(), accept, context); + return service + .getProperties(this.client.getUrl(), shareName, directory, restype, this.client.isAllowTrailingDot(), + sharesnapshot, timeout, this.client.getVersion(), this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Returns all system properties for the specified directory, and can also be used to check the existence of a * directory. The data returned does not include the files in the directory or any subdirectories. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share @@ -1065,13 +1088,14 @@ public Mono> getPropertiesWi @ServiceMethod(returns = ReturnType.SINGLE) public Mono getPropertiesAsync(String shareName, String directory, String sharesnapshot, Integer timeout) { return getPropertiesWithResponseAsync(shareName, directory, sharesnapshot, timeout) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * Returns all system properties for the specified directory, and can also be used to check the existence of a * directory. The data returned does not include the files in the directory or any subdirectories. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share @@ -1089,13 +1113,14 @@ public Mono getPropertiesAsync(String shareName, String directory, String public Mono getPropertiesAsync(String shareName, String directory, String sharesnapshot, Integer timeout, Context context) { return getPropertiesWithResponseAsync(shareName, directory, sharesnapshot, timeout, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * Returns all system properties for the specified directory, and can also be used to check the existence of a * directory. The data returned does not include the files in the directory or any subdirectories. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share @@ -1113,15 +1138,17 @@ public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String String sharesnapshot, Integer timeout) { final String restype = "directory"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getPropertiesNoCustomHeaders(this.client.getUrl(), shareName, - directory, restype, this.client.isAllowTrailingDot(), sharesnapshot, timeout, this.client.getVersion(), - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.getPropertiesNoCustomHeaders(this.client.getUrl(), shareName, directory, + restype, this.client.isAllowTrailingDot(), sharesnapshot, timeout, this.client.getVersion(), + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Returns all system properties for the specified directory, and can also be used to check the existence of a * directory. The data returned does not include the files in the directory or any subdirectories. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share @@ -1140,15 +1167,17 @@ public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String String sharesnapshot, Integer timeout, Context context) { final String restype = "directory"; final String accept = "application/xml"; - return service.getPropertiesNoCustomHeaders(this.client.getUrl(), shareName, directory, restype, - this.client.isAllowTrailingDot(), sharesnapshot, timeout, this.client.getVersion(), - this.client.getFileRequestIntent(), accept, context); + return service + .getPropertiesNoCustomHeaders(this.client.getUrl(), shareName, directory, restype, + this.client.isAllowTrailingDot(), sharesnapshot, timeout, this.client.getVersion(), + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Returns all system properties for the specified directory, and can also be used to check the existence of a * directory. The data returned does not include the files in the directory or any subdirectories. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share @@ -1167,15 +1196,19 @@ public ResponseBase getPropertiesWithResp String directory, String sharesnapshot, Integer timeout, Context context) { final String restype = "directory"; final String accept = "application/xml"; - return service.getPropertiesSync(this.client.getUrl(), shareName, directory, restype, - this.client.isAllowTrailingDot(), sharesnapshot, timeout, this.client.getVersion(), - this.client.getFileRequestIntent(), accept, context); + try { + return service.getPropertiesSync(this.client.getUrl(), shareName, directory, restype, + this.client.isAllowTrailingDot(), sharesnapshot, timeout, this.client.getVersion(), + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Returns all system properties for the specified directory, and can also be used to check the existence of a * directory. The data returned does not include the files in the directory or any subdirectories. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share @@ -1195,7 +1228,7 @@ public void getProperties(String shareName, String directory, String sharesnapsh /** * Returns all system properties for the specified directory, and can also be used to check the existence of a * directory. The data returned does not include the files in the directory or any subdirectories. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share @@ -1214,14 +1247,18 @@ public Response getPropertiesNoCustomHeadersWithResponse(String shareName, String sharesnapshot, Integer timeout, Context context) { final String restype = "directory"; final String accept = "application/xml"; - return service.getPropertiesNoCustomHeadersSync(this.client.getUrl(), shareName, directory, restype, - this.client.isAllowTrailingDot(), sharesnapshot, timeout, this.client.getVersion(), - this.client.getFileRequestIntent(), accept, context); + try { + return service.getPropertiesNoCustomHeadersSync(this.client.getUrl(), shareName, directory, restype, + this.client.isAllowTrailingDot(), sharesnapshot, timeout, this.client.getVersion(), + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Removes the specified empty directory. Note that the directory must be empty before it can be deleted. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1237,14 +1274,16 @@ public Mono> deleteWithResponseAsyn String directory, Integer timeout) { final String restype = "directory"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.delete(this.client.getUrl(), shareName, directory, restype, - this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), this.client.getFileRequestIntent(), - accept, context)); + return FluxUtil + .withContext(context -> service.delete(this.client.getUrl(), shareName, directory, restype, + this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), this.client.getFileRequestIntent(), + accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Removes the specified empty directory. Note that the directory must be empty before it can be deleted. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1261,13 +1300,15 @@ public Mono> deleteWithResponseAsyn String directory, Integer timeout, Context context) { final String restype = "directory"; final String accept = "application/xml"; - return service.delete(this.client.getUrl(), shareName, directory, restype, this.client.isAllowTrailingDot(), - timeout, this.client.getVersion(), this.client.getFileRequestIntent(), accept, context); + return service + .delete(this.client.getUrl(), shareName, directory, restype, this.client.isAllowTrailingDot(), timeout, + this.client.getVersion(), this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Removes the specified empty directory. Note that the directory must be empty before it can be deleted. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1280,12 +1321,14 @@ public Mono> deleteWithResponseAsyn */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String shareName, String directory, Integer timeout) { - return deleteWithResponseAsync(shareName, directory, timeout).flatMap(ignored -> Mono.empty()); + return deleteWithResponseAsync(shareName, directory, timeout) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Removes the specified empty directory. Note that the directory must be empty before it can be deleted. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1299,12 +1342,14 @@ public Mono deleteAsync(String shareName, String directory, Integer timeou */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String shareName, String directory, Integer timeout, Context context) { - return deleteWithResponseAsync(shareName, directory, timeout, context).flatMap(ignored -> Mono.empty()); + return deleteWithResponseAsync(shareName, directory, timeout, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Removes the specified empty directory. Note that the directory must be empty before it can be deleted. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1320,14 +1365,16 @@ public Mono> deleteNoCustomHeadersWithResponseAsync(String shareN Integer timeout) { final String restype = "directory"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.deleteNoCustomHeaders(this.client.getUrl(), shareName, directory, - restype, this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.deleteNoCustomHeaders(this.client.getUrl(), shareName, directory, restype, + this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), this.client.getFileRequestIntent(), + accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Removes the specified empty directory. Note that the directory must be empty before it can be deleted. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1344,14 +1391,16 @@ public Mono> deleteNoCustomHeadersWithResponseAsync(String shareN Integer timeout, Context context) { final String restype = "directory"; final String accept = "application/xml"; - return service.deleteNoCustomHeaders(this.client.getUrl(), shareName, directory, restype, - this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), this.client.getFileRequestIntent(), - accept, context); + return service + .deleteNoCustomHeaders(this.client.getUrl(), shareName, directory, restype, + this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), this.client.getFileRequestIntent(), + accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Removes the specified empty directory. Note that the directory must be empty before it can be deleted. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1368,13 +1417,18 @@ public ResponseBase deleteWithResponse(String sh Integer timeout, Context context) { final String restype = "directory"; final String accept = "application/xml"; - return service.deleteSync(this.client.getUrl(), shareName, directory, restype, this.client.isAllowTrailingDot(), - timeout, this.client.getVersion(), this.client.getFileRequestIntent(), accept, context); + try { + return service.deleteSync(this.client.getUrl(), shareName, directory, restype, + this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), this.client.getFileRequestIntent(), + accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Removes the specified empty directory. Note that the directory must be empty before it can be deleted. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1391,7 +1445,7 @@ public void delete(String shareName, String directory, Integer timeout) { /** * Removes the specified empty directory. Note that the directory must be empty before it can be deleted. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1408,14 +1462,18 @@ public Response deleteNoCustomHeadersWithResponse(String shareName, String Context context) { final String restype = "directory"; final String accept = "application/xml"; - return service.deleteNoCustomHeadersSync(this.client.getUrl(), shareName, directory, restype, - this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), this.client.getFileRequestIntent(), - accept, context); + try { + return service.deleteNoCustomHeadersSync(this.client.getUrl(), shareName, directory, restype, + this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), this.client.getFileRequestIntent(), + accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Sets properties on the directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file @@ -1450,15 +1508,17 @@ public Mono> setPropertiesWi final String restype = "directory"; final String comp = "properties"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.setProperties(this.client.getUrl(), shareName, directory, - restype, comp, timeout, this.client.getVersion(), filePermission, filePermissionFormat, filePermissionKey, - fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.setProperties(this.client.getUrl(), shareName, directory, restype, comp, + timeout, this.client.getVersion(), filePermission, filePermissionFormat, filePermissionKey, + fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Sets properties on the directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file @@ -1494,15 +1554,17 @@ public Mono> setPropertiesWi final String restype = "directory"; final String comp = "properties"; final String accept = "application/xml"; - return service.setProperties(this.client.getUrl(), shareName, directory, restype, comp, timeout, - this.client.getVersion(), filePermission, filePermissionFormat, filePermissionKey, fileAttributes, - fileCreationTime, fileLastWriteTime, fileChangeTime, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + return service + .setProperties(this.client.getUrl(), shareName, directory, restype, comp, timeout, this.client.getVersion(), + filePermission, filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, + fileLastWriteTime, fileChangeTime, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), + accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Sets properties on the directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file @@ -1535,12 +1597,13 @@ public Mono setPropertiesAsync(String shareName, String directory, String String fileCreationTime, String fileLastWriteTime, String fileChangeTime) { return setPropertiesWithResponseAsync(shareName, directory, fileAttributes, timeout, filePermission, filePermissionFormat, filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * Sets properties on the directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file @@ -1574,12 +1637,13 @@ public Mono setPropertiesAsync(String shareName, String directory, String String fileCreationTime, String fileLastWriteTime, String fileChangeTime, Context context) { return setPropertiesWithResponseAsync(shareName, directory, fileAttributes, timeout, filePermission, filePermissionFormat, filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * Sets properties on the directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file @@ -1613,15 +1677,17 @@ public Mono> setPropertiesNoCustomHeadersWithResponseAsync(String final String restype = "directory"; final String comp = "properties"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.setPropertiesNoCustomHeaders(this.client.getUrl(), shareName, - directory, restype, comp, timeout, this.client.getVersion(), filePermission, filePermissionFormat, - filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.setPropertiesNoCustomHeaders(this.client.getUrl(), shareName, directory, + restype, comp, timeout, this.client.getVersion(), filePermission, filePermissionFormat, + filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Sets properties on the directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file @@ -1657,15 +1723,17 @@ public Mono> setPropertiesNoCustomHeadersWithResponseAsync(String final String restype = "directory"; final String comp = "properties"; final String accept = "application/xml"; - return service.setPropertiesNoCustomHeaders(this.client.getUrl(), shareName, directory, restype, comp, timeout, - this.client.getVersion(), filePermission, filePermissionFormat, filePermissionKey, fileAttributes, - fileCreationTime, fileLastWriteTime, fileChangeTime, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + return service + .setPropertiesNoCustomHeaders(this.client.getUrl(), shareName, directory, restype, comp, timeout, + this.client.getVersion(), filePermission, filePermissionFormat, filePermissionKey, fileAttributes, + fileCreationTime, fileLastWriteTime, fileChangeTime, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Sets properties on the directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file @@ -1701,15 +1769,19 @@ public ResponseBase setPropertiesWithResp final String restype = "directory"; final String comp = "properties"; final String accept = "application/xml"; - return service.setPropertiesSync(this.client.getUrl(), shareName, directory, restype, comp, timeout, - this.client.getVersion(), filePermission, filePermissionFormat, filePermissionKey, fileAttributes, - fileCreationTime, fileLastWriteTime, fileChangeTime, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + try { + return service.setPropertiesSync(this.client.getUrl(), shareName, directory, restype, comp, timeout, + this.client.getVersion(), filePermission, filePermissionFormat, filePermissionKey, fileAttributes, + fileCreationTime, fileLastWriteTime, fileChangeTime, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Sets properties on the directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file @@ -1745,7 +1817,7 @@ public void setProperties(String shareName, String directory, String fileAttribu /** * Sets properties on the directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file @@ -1781,15 +1853,19 @@ public Response setPropertiesNoCustomHeadersWithResponse(String shareName, final String restype = "directory"; final String comp = "properties"; final String accept = "application/xml"; - return service.setPropertiesNoCustomHeadersSync(this.client.getUrl(), shareName, directory, restype, comp, - timeout, this.client.getVersion(), filePermission, filePermissionFormat, filePermissionKey, fileAttributes, - fileCreationTime, fileLastWriteTime, fileChangeTime, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + try { + return service.setPropertiesNoCustomHeadersSync(this.client.getUrl(), shareName, directory, restype, comp, + timeout, this.client.getVersion(), filePermission, filePermissionFormat, filePermissionKey, + fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Updates user defined metadata for the specified directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1807,14 +1883,16 @@ public Mono> setMetadataWithRe final String restype = "directory"; final String comp = "metadata"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.setMetadata(this.client.getUrl(), shareName, directory, restype, - comp, timeout, metadata, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.setMetadata(this.client.getUrl(), shareName, directory, restype, comp, + timeout, metadata, this.client.getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Updates user defined metadata for the specified directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1833,14 +1911,16 @@ public Mono> setMetadataWithRe final String restype = "directory"; final String comp = "metadata"; final String accept = "application/xml"; - return service.setMetadata(this.client.getUrl(), shareName, directory, restype, comp, timeout, metadata, - this.client.getVersion(), this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, - context); + return service + .setMetadata(this.client.getUrl(), shareName, directory, restype, comp, timeout, metadata, + this.client.getVersion(), this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, + context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Updates user defined metadata for the specified directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1855,12 +1935,14 @@ public Mono> setMetadataWithRe @ServiceMethod(returns = ReturnType.SINGLE) public Mono setMetadataAsync(String shareName, String directory, Integer timeout, Map metadata) { - return setMetadataWithResponseAsync(shareName, directory, timeout, metadata).flatMap(ignored -> Mono.empty()); + return setMetadataWithResponseAsync(shareName, directory, timeout, metadata) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Updates user defined metadata for the specified directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1877,12 +1959,13 @@ public Mono setMetadataAsync(String shareName, String directory, Integer t public Mono setMetadataAsync(String shareName, String directory, Integer timeout, Map metadata, Context context) { return setMetadataWithResponseAsync(shareName, directory, timeout, metadata, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * Updates user defined metadata for the specified directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1900,14 +1983,16 @@ public Mono> setMetadataNoCustomHeadersWithResponseAsync(String s final String restype = "directory"; final String comp = "metadata"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.setMetadataNoCustomHeaders(this.client.getUrl(), shareName, - directory, restype, comp, timeout, metadata, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.setMetadataNoCustomHeaders(this.client.getUrl(), shareName, directory, + restype, comp, timeout, metadata, this.client.getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Updates user defined metadata for the specified directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1926,14 +2011,16 @@ public Mono> setMetadataNoCustomHeadersWithResponseAsync(String s final String restype = "directory"; final String comp = "metadata"; final String accept = "application/xml"; - return service.setMetadataNoCustomHeaders(this.client.getUrl(), shareName, directory, restype, comp, timeout, - metadata, this.client.getVersion(), this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), - accept, context); + return service + .setMetadataNoCustomHeaders(this.client.getUrl(), shareName, directory, restype, comp, timeout, metadata, + this.client.getVersion(), this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, + context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Updates user defined metadata for the specified directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1952,14 +2039,18 @@ public ResponseBase setMetadataWithResponse final String restype = "directory"; final String comp = "metadata"; final String accept = "application/xml"; - return service.setMetadataSync(this.client.getUrl(), shareName, directory, restype, comp, timeout, metadata, - this.client.getVersion(), this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, - context); + try { + return service.setMetadataSync(this.client.getUrl(), shareName, directory, restype, comp, timeout, metadata, + this.client.getVersion(), this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, + context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Updates user defined metadata for the specified directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1977,7 +2068,7 @@ public void setMetadata(String shareName, String directory, Integer timeout, Map /** * Updates user defined metadata for the specified directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1996,15 +2087,19 @@ public Response setMetadataNoCustomHeadersWithResponse(String shareName, S final String restype = "directory"; final String comp = "metadata"; final String accept = "application/xml"; - return service.setMetadataNoCustomHeadersSync(this.client.getUrl(), shareName, directory, restype, comp, - timeout, metadata, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + try { + return service.setMetadataNoCustomHeadersSync(this.client.getUrl(), shareName, directory, restype, comp, + timeout, metadata, this.client.getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Returns a list of files or directories under the specified share or directory. It lists the contents only for a * single level of the directory hierarchy. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param prefix Filters the results to return only entries whose name begins with the specified prefix. @@ -2040,16 +2135,18 @@ public Response setMetadataNoCustomHeadersWithResponse(String shareName, S : include.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return FluxUtil.withContext(context -> service.listFilesAndDirectoriesSegment(this.client.getUrl(), shareName, - directory, restype, comp, prefix, sharesnapshot, marker, maxresults, timeout, this.client.getVersion(), - includeConverted, includeExtendedInfo, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), - accept, context)); + return FluxUtil + .withContext(context -> service.listFilesAndDirectoriesSegment(this.client.getUrl(), shareName, directory, + restype, comp, prefix, sharesnapshot, marker, maxresults, timeout, this.client.getVersion(), + includeConverted, includeExtendedInfo, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Returns a list of files or directories under the specified share or directory. It lists the contents only for a * single level of the directory hierarchy. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param prefix Filters the results to return only entries whose name begins with the specified prefix. @@ -2088,13 +2185,14 @@ public Response setMetadataNoCustomHeadersWithResponse(String shareName, S .collect(Collectors.joining(",")); return service.listFilesAndDirectoriesSegment(this.client.getUrl(), shareName, directory, restype, comp, prefix, sharesnapshot, marker, maxresults, timeout, this.client.getVersion(), includeConverted, includeExtendedInfo, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context); + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Returns a list of files or directories under the specified share or directory. It lists the contents only for a * single level of the directory hierarchy. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param prefix Filters the results to return only entries whose name begins with the specified prefix. @@ -2121,13 +2219,15 @@ public Mono listFilesAndDirectoriesSegme String directory, String prefix, String sharesnapshot, String marker, Integer maxresults, Integer timeout, List include, Boolean includeExtendedInfo) { return listFilesAndDirectoriesSegmentWithResponseAsync(shareName, directory, prefix, sharesnapshot, marker, - maxresults, timeout, include, includeExtendedInfo).flatMap(res -> Mono.justOrEmpty(res.getValue())); + maxresults, timeout, include, includeExtendedInfo) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Returns a list of files or directories under the specified share or directory. It lists the contents only for a * single level of the directory hierarchy. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param prefix Filters the results to return only entries whose name begins with the specified prefix. @@ -2156,13 +2256,14 @@ public Mono listFilesAndDirectoriesSegme List include, Boolean includeExtendedInfo, Context context) { return listFilesAndDirectoriesSegmentWithResponseAsync(shareName, directory, prefix, sharesnapshot, marker, maxresults, timeout, include, includeExtendedInfo, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Returns a list of files or directories under the specified share or directory. It lists the contents only for a * single level of the directory hierarchy. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param prefix Filters the results to return only entries whose name begins with the specified prefix. @@ -2202,13 +2303,14 @@ public Mono listFilesAndDirectoriesSegme .withContext(context -> service.listFilesAndDirectoriesSegmentNoCustomHeaders(this.client.getUrl(), shareName, directory, restype, comp, prefix, sharesnapshot, marker, maxresults, timeout, this.client.getVersion(), includeConverted, includeExtendedInfo, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context)); + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Returns a list of files or directories under the specified share or directory. It lists the contents only for a * single level of the directory hierarchy. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param prefix Filters the results to return only entries whose name begins with the specified prefix. @@ -2245,16 +2347,18 @@ public Mono listFilesAndDirectoriesSegme : include.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return service.listFilesAndDirectoriesSegmentNoCustomHeaders(this.client.getUrl(), shareName, directory, - restype, comp, prefix, sharesnapshot, marker, maxresults, timeout, this.client.getVersion(), - includeConverted, includeExtendedInfo, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), - accept, context); + return service + .listFilesAndDirectoriesSegmentNoCustomHeaders(this.client.getUrl(), shareName, directory, restype, comp, + prefix, sharesnapshot, marker, maxresults, timeout, this.client.getVersion(), includeConverted, + includeExtendedInfo, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, + context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Returns a list of files or directories under the specified share or directory. It lists the contents only for a * single level of the directory hierarchy. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param prefix Filters the results to return only entries whose name begins with the specified prefix. @@ -2290,15 +2394,20 @@ public Mono listFilesAndDirectoriesSegme : include.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return service.listFilesAndDirectoriesSegmentSync(this.client.getUrl(), shareName, directory, restype, comp, - prefix, sharesnapshot, marker, maxresults, timeout, this.client.getVersion(), includeConverted, - includeExtendedInfo, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context); + try { + return service.listFilesAndDirectoriesSegmentSync(this.client.getUrl(), shareName, directory, restype, comp, + prefix, sharesnapshot, marker, maxresults, timeout, this.client.getVersion(), includeConverted, + includeExtendedInfo, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, + context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Returns a list of files or directories under the specified share or directory. It lists the contents only for a * single level of the directory hierarchy. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param prefix Filters the results to return only entries whose name begins with the specified prefix. @@ -2324,14 +2433,18 @@ public Mono listFilesAndDirectoriesSegme public ListFilesAndDirectoriesSegmentResponse listFilesAndDirectoriesSegment(String shareName, String directory, String prefix, String sharesnapshot, String marker, Integer maxresults, Integer timeout, List include, Boolean includeExtendedInfo) { - return listFilesAndDirectoriesSegmentWithResponse(shareName, directory, prefix, sharesnapshot, marker, - maxresults, timeout, include, includeExtendedInfo, Context.NONE).getValue(); + try { + return listFilesAndDirectoriesSegmentWithResponse(shareName, directory, prefix, sharesnapshot, marker, + maxresults, timeout, include, includeExtendedInfo, Context.NONE).getValue(); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Returns a list of files or directories under the specified share or directory. It lists the contents only for a * single level of the directory hierarchy. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param prefix Filters the results to return only entries whose name begins with the specified prefix. @@ -2366,15 +2479,19 @@ public Response listFilesAndDirectoriesS : include.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return service.listFilesAndDirectoriesSegmentNoCustomHeadersSync(this.client.getUrl(), shareName, directory, - restype, comp, prefix, sharesnapshot, marker, maxresults, timeout, this.client.getVersion(), - includeConverted, includeExtendedInfo, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), - accept, context); + try { + return service.listFilesAndDirectoriesSegmentNoCustomHeadersSync(this.client.getUrl(), shareName, directory, + restype, comp, prefix, sharesnapshot, marker, maxresults, timeout, this.client.getVersion(), + includeConverted, includeExtendedInfo, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Lists handles for directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. @@ -2401,14 +2518,16 @@ public Mono> li Boolean recursive) { final String comp = "listhandles"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.listHandles(this.client.getUrl(), shareName, directory, comp, - marker, maxresults, timeout, sharesnapshot, recursive, this.client.getVersion(), - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.listHandles(this.client.getUrl(), shareName, directory, comp, marker, + maxresults, timeout, sharesnapshot, recursive, this.client.getVersion(), + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Lists handles for directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. @@ -2436,14 +2555,16 @@ public Mono> li Boolean recursive, Context context) { final String comp = "listhandles"; final String accept = "application/xml"; - return service.listHandles(this.client.getUrl(), shareName, directory, comp, marker, maxresults, timeout, - sharesnapshot, recursive, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + return service + .listHandles(this.client.getUrl(), shareName, directory, comp, marker, maxresults, timeout, sharesnapshot, + recursive, this.client.getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Lists handles for directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. @@ -2468,12 +2589,13 @@ public Mono> li public Mono listHandlesAsync(String shareName, String directory, String marker, Integer maxresults, Integer timeout, String sharesnapshot, Boolean recursive) { return listHandlesWithResponseAsync(shareName, directory, marker, maxresults, timeout, sharesnapshot, recursive) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Lists handles for directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. @@ -2499,12 +2621,13 @@ public Mono listHandlesAsync(String shareName, String direc public Mono listHandlesAsync(String shareName, String directory, String marker, Integer maxresults, Integer timeout, String sharesnapshot, Boolean recursive, Context context) { return listHandlesWithResponseAsync(shareName, directory, marker, maxresults, timeout, sharesnapshot, recursive, - context).flatMap(res -> Mono.justOrEmpty(res.getValue())); + context).onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Lists handles for directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. @@ -2530,14 +2653,16 @@ public Mono> listHandlesNoCustomHeadersWithRespons String directory, String marker, Integer maxresults, Integer timeout, String sharesnapshot, Boolean recursive) { final String comp = "listhandles"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.listHandlesNoCustomHeaders(this.client.getUrl(), shareName, - directory, comp, marker, maxresults, timeout, sharesnapshot, recursive, this.client.getVersion(), - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.listHandlesNoCustomHeaders(this.client.getUrl(), shareName, directory, comp, + marker, maxresults, timeout, sharesnapshot, recursive, this.client.getVersion(), + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Lists handles for directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. @@ -2565,14 +2690,16 @@ public Mono> listHandlesNoCustomHeadersWithRespons Context context) { final String comp = "listhandles"; final String accept = "application/xml"; - return service.listHandlesNoCustomHeaders(this.client.getUrl(), shareName, directory, comp, marker, maxresults, - timeout, sharesnapshot, recursive, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + return service + .listHandlesNoCustomHeaders(this.client.getUrl(), shareName, directory, comp, marker, maxresults, timeout, + sharesnapshot, recursive, this.client.getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Lists handles for directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. @@ -2600,14 +2727,18 @@ public ResponseBase listHand Context context) { final String comp = "listhandles"; final String accept = "application/xml"; - return service.listHandlesSync(this.client.getUrl(), shareName, directory, comp, marker, maxresults, timeout, - sharesnapshot, recursive, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + try { + return service.listHandlesSync(this.client.getUrl(), shareName, directory, comp, marker, maxresults, + timeout, sharesnapshot, recursive, this.client.getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Lists handles for directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. @@ -2631,13 +2762,17 @@ public ResponseBase listHand @ServiceMethod(returns = ReturnType.SINGLE) public ListHandlesResponse listHandles(String shareName, String directory, String marker, Integer maxresults, Integer timeout, String sharesnapshot, Boolean recursive) { - return listHandlesWithResponse(shareName, directory, marker, maxresults, timeout, sharesnapshot, recursive, - Context.NONE).getValue(); + try { + return listHandlesWithResponse(shareName, directory, marker, maxresults, timeout, sharesnapshot, recursive, + Context.NONE).getValue(); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Lists handles for directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. @@ -2664,14 +2799,18 @@ public Response listHandlesNoCustomHeadersWithResponse(Stri String marker, Integer maxresults, Integer timeout, String sharesnapshot, Boolean recursive, Context context) { final String comp = "listhandles"; final String accept = "application/xml"; - return service.listHandlesNoCustomHeadersSync(this.client.getUrl(), shareName, directory, comp, marker, - maxresults, timeout, sharesnapshot, recursive, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + try { + return service.listHandlesNoCustomHeadersSync(this.client.getUrl(), shareName, directory, comp, marker, + maxresults, timeout, sharesnapshot, recursive, this.client.getVersion(), + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Closes all handles open for given directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard @@ -2698,14 +2837,16 @@ public Mono> forceCloseH Boolean recursive) { final String comp = "forceclosehandles"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.forceCloseHandles(this.client.getUrl(), shareName, directory, - comp, timeout, marker, sharesnapshot, handleId, recursive, this.client.getVersion(), - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.forceCloseHandles(this.client.getUrl(), shareName, directory, comp, timeout, + marker, sharesnapshot, handleId, recursive, this.client.getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Closes all handles open for given directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard @@ -2733,14 +2874,16 @@ public Mono> forceCloseH Boolean recursive, Context context) { final String comp = "forceclosehandles"; final String accept = "application/xml"; - return service.forceCloseHandles(this.client.getUrl(), shareName, directory, comp, timeout, marker, - sharesnapshot, handleId, recursive, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + return service + .forceCloseHandles(this.client.getUrl(), shareName, directory, comp, timeout, marker, sharesnapshot, + handleId, recursive, this.client.getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Closes all handles open for given directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard @@ -2765,12 +2908,13 @@ public Mono> forceCloseH public Mono forceCloseHandlesAsync(String shareName, String directory, String handleId, Integer timeout, String marker, String sharesnapshot, Boolean recursive) { return forceCloseHandlesWithResponseAsync(shareName, directory, handleId, timeout, marker, sharesnapshot, - recursive).flatMap(ignored -> Mono.empty()); + recursive).onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Closes all handles open for given directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard @@ -2796,12 +2940,13 @@ public Mono forceCloseHandlesAsync(String shareName, String directory, Str public Mono forceCloseHandlesAsync(String shareName, String directory, String handleId, Integer timeout, String marker, String sharesnapshot, Boolean recursive, Context context) { return forceCloseHandlesWithResponseAsync(shareName, directory, handleId, timeout, marker, sharesnapshot, - recursive, context).flatMap(ignored -> Mono.empty()); + recursive, context).onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Closes all handles open for given directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard @@ -2827,14 +2972,16 @@ public Mono> forceCloseHandlesNoCustomHeadersWithResponseAsync(St String handleId, Integer timeout, String marker, String sharesnapshot, Boolean recursive) { final String comp = "forceclosehandles"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.forceCloseHandlesNoCustomHeaders(this.client.getUrl(), shareName, - directory, comp, timeout, marker, sharesnapshot, handleId, recursive, this.client.getVersion(), - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.forceCloseHandlesNoCustomHeaders(this.client.getUrl(), shareName, directory, + comp, timeout, marker, sharesnapshot, handleId, recursive, this.client.getVersion(), + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Closes all handles open for given directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard @@ -2861,14 +3008,16 @@ public Mono> forceCloseHandlesNoCustomHeadersWithResponseAsync(St String handleId, Integer timeout, String marker, String sharesnapshot, Boolean recursive, Context context) { final String comp = "forceclosehandles"; final String accept = "application/xml"; - return service.forceCloseHandlesNoCustomHeaders(this.client.getUrl(), shareName, directory, comp, timeout, - marker, sharesnapshot, handleId, recursive, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + return service + .forceCloseHandlesNoCustomHeaders(this.client.getUrl(), shareName, directory, comp, timeout, marker, + sharesnapshot, handleId, recursive, this.client.getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Closes all handles open for given directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard @@ -2896,14 +3045,18 @@ public ResponseBase forceCloseHandles Context context) { final String comp = "forceclosehandles"; final String accept = "application/xml"; - return service.forceCloseHandlesSync(this.client.getUrl(), shareName, directory, comp, timeout, marker, - sharesnapshot, handleId, recursive, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + try { + return service.forceCloseHandlesSync(this.client.getUrl(), shareName, directory, comp, timeout, marker, + sharesnapshot, handleId, recursive, this.client.getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Closes all handles open for given directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard @@ -2932,7 +3085,7 @@ public void forceCloseHandles(String shareName, String directory, String handleI /** * Closes all handles open for given directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard @@ -2959,14 +3112,18 @@ public Response forceCloseHandlesNoCustomHeadersWithResponse(String shareN String handleId, Integer timeout, String marker, String sharesnapshot, Boolean recursive, Context context) { final String comp = "forceclosehandles"; final String accept = "application/xml"; - return service.forceCloseHandlesNoCustomHeadersSync(this.client.getUrl(), shareName, directory, comp, timeout, - marker, sharesnapshot, handleId, recursive, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + try { + return service.forceCloseHandlesNoCustomHeadersSync(this.client.getUrl(), shareName, directory, comp, + timeout, marker, sharesnapshot, handleId, recursive, this.client.getVersion(), + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Renames a directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. @@ -3040,16 +3197,18 @@ public Mono> renameWithResponseAsyn fileChangeTimeInternal = copyFileSmbInfo.getFileChangeTime(); } String fileChangeTime = fileChangeTimeInternal; - return FluxUtil.withContext(context -> service.rename(this.client.getUrl(), shareName, directory, restype, comp, - timeout, this.client.getVersion(), renameSource, replaceIfExists, ignoreReadOnly, sourceLeaseId, - destinationLeaseId, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, filePermission, - filePermissionFormat, filePermissionKey, metadata, this.client.isAllowTrailingDot(), - this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.rename(this.client.getUrl(), shareName, directory, restype, comp, timeout, + this.client.getVersion(), renameSource, replaceIfExists, ignoreReadOnly, sourceLeaseId, + destinationLeaseId, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, filePermission, + filePermissionFormat, filePermissionKey, metadata, this.client.isAllowTrailingDot(), + this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Renames a directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. @@ -3125,16 +3284,18 @@ public Mono> renameWithResponseAsyn fileChangeTimeInternal = copyFileSmbInfo.getFileChangeTime(); } String fileChangeTime = fileChangeTimeInternal; - return service.rename(this.client.getUrl(), shareName, directory, restype, comp, timeout, - this.client.getVersion(), renameSource, replaceIfExists, ignoreReadOnly, sourceLeaseId, destinationLeaseId, - fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, filePermission, filePermissionFormat, - filePermissionKey, metadata, this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + return service + .rename(this.client.getUrl(), shareName, directory, restype, comp, timeout, this.client.getVersion(), + renameSource, replaceIfExists, ignoreReadOnly, sourceLeaseId, destinationLeaseId, fileAttributes, + fileCreationTime, fileLastWriteTime, fileChangeTime, filePermission, filePermissionFormat, + filePermissionKey, metadata, this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Renames a directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. @@ -3177,12 +3338,14 @@ public Mono renameAsync(String shareName, String directory, String renameS DestinationLeaseAccessConditions destinationLeaseAccessConditions, CopyFileSmbInfo copyFileSmbInfo) { return renameWithResponseAsync(shareName, directory, renameSource, timeout, replaceIfExists, ignoreReadOnly, filePermission, filePermissionFormat, filePermissionKey, metadata, sourceLeaseAccessConditions, - destinationLeaseAccessConditions, copyFileSmbInfo).flatMap(ignored -> Mono.empty()); + destinationLeaseAccessConditions, copyFileSmbInfo) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Renames a directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. @@ -3227,12 +3390,14 @@ public Mono renameAsync(String shareName, String directory, String renameS Context context) { return renameWithResponseAsync(shareName, directory, renameSource, timeout, replaceIfExists, ignoreReadOnly, filePermission, filePermissionFormat, filePermissionKey, metadata, sourceLeaseAccessConditions, - destinationLeaseAccessConditions, copyFileSmbInfo, context).flatMap(ignored -> Mono.empty()); + destinationLeaseAccessConditions, copyFileSmbInfo, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Renames a directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. @@ -3306,16 +3471,18 @@ public Mono> renameNoCustomHeadersWithResponseAsync(String shareN fileChangeTimeInternal = copyFileSmbInfo.getFileChangeTime(); } String fileChangeTime = fileChangeTimeInternal; - return FluxUtil.withContext(context -> service.renameNoCustomHeaders(this.client.getUrl(), shareName, directory, - restype, comp, timeout, this.client.getVersion(), renameSource, replaceIfExists, ignoreReadOnly, - sourceLeaseId, destinationLeaseId, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, - filePermission, filePermissionFormat, filePermissionKey, metadata, this.client.isAllowTrailingDot(), - this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.renameNoCustomHeaders(this.client.getUrl(), shareName, directory, restype, + comp, timeout, this.client.getVersion(), renameSource, replaceIfExists, ignoreReadOnly, sourceLeaseId, + destinationLeaseId, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, filePermission, + filePermissionFormat, filePermissionKey, metadata, this.client.isAllowTrailingDot(), + this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Renames a directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. @@ -3391,16 +3558,18 @@ public Mono> renameNoCustomHeadersWithResponseAsync(String shareN fileChangeTimeInternal = copyFileSmbInfo.getFileChangeTime(); } String fileChangeTime = fileChangeTimeInternal; - return service.renameNoCustomHeaders(this.client.getUrl(), shareName, directory, restype, comp, timeout, - this.client.getVersion(), renameSource, replaceIfExists, ignoreReadOnly, sourceLeaseId, destinationLeaseId, - fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, filePermission, filePermissionFormat, - filePermissionKey, metadata, this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + return service + .renameNoCustomHeaders(this.client.getUrl(), shareName, directory, restype, comp, timeout, + this.client.getVersion(), renameSource, replaceIfExists, ignoreReadOnly, sourceLeaseId, + destinationLeaseId, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, filePermission, + filePermissionFormat, filePermissionKey, metadata, this.client.isAllowTrailingDot(), + this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Renames a directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. @@ -3476,16 +3645,20 @@ public ResponseBase renameWithResponse(String sh fileChangeTimeInternal = copyFileSmbInfo.getFileChangeTime(); } String fileChangeTime = fileChangeTimeInternal; - return service.renameSync(this.client.getUrl(), shareName, directory, restype, comp, timeout, - this.client.getVersion(), renameSource, replaceIfExists, ignoreReadOnly, sourceLeaseId, destinationLeaseId, - fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, filePermission, filePermissionFormat, - filePermissionKey, metadata, this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + try { + return service.renameSync(this.client.getUrl(), shareName, directory, restype, comp, timeout, + this.client.getVersion(), renameSource, replaceIfExists, ignoreReadOnly, sourceLeaseId, + destinationLeaseId, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, filePermission, + filePermissionFormat, filePermissionKey, metadata, this.client.isAllowTrailingDot(), + this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Renames a directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. @@ -3532,7 +3705,7 @@ public void rename(String shareName, String directory, String renameSource, Inte /** * Renames a directory. - * + * * @param shareName The name of the target share. * @param directory The path of the target directory. * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. @@ -3608,10 +3781,14 @@ public Response renameNoCustomHeadersWithResponse(String shareName, String fileChangeTimeInternal = copyFileSmbInfo.getFileChangeTime(); } String fileChangeTime = fileChangeTimeInternal; - return service.renameNoCustomHeadersSync(this.client.getUrl(), shareName, directory, restype, comp, timeout, - this.client.getVersion(), renameSource, replaceIfExists, ignoreReadOnly, sourceLeaseId, destinationLeaseId, - fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, filePermission, filePermissionFormat, - filePermissionKey, metadata, this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + try { + return service.renameNoCustomHeadersSync(this.client.getUrl(), shareName, directory, restype, comp, timeout, + this.client.getVersion(), renameSource, replaceIfExists, ignoreReadOnly, sourceLeaseId, + destinationLeaseId, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, filePermission, + filePermissionFormat, filePermissionKey, metadata, this.client.isAllowTrailingDot(), + this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/FilesImpl.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/FilesImpl.java index 28a5606f1834..3038b587104b 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/FilesImpl.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/FilesImpl.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.storage.file.share.implementation; import com.azure.core.annotation.BodyParam; @@ -63,11 +62,13 @@ import java.util.Map; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import com.azure.storage.file.share.implementation.util.ModelHelper; /** * An instance of this class provides access to all the operations defined in Files. */ public final class FilesImpl { + /** * The proxy service used to perform REST calls. */ @@ -80,7 +81,7 @@ public final class FilesImpl { /** * Initializes an instance of FilesImpl. - * + * * @param client the instance of the service client containing this operation class. */ FilesImpl(AzureFileStorageImpl client) { @@ -95,6 +96,7 @@ public final class FilesImpl { @Host("{url}") @ServiceInterface(name = "AzureFileStorageFile") public interface FilesService { + @Put("/{shareName}/{fileName}") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) @@ -1220,7 +1222,7 @@ Response renameNoCustomHeadersSync(@HostParam("url") String url, @PathPara /** * Creates a new file or replaces a file. Note it only initializes the file with no content. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param fileContentLength Specifies the maximum size for the file, up to 4 TB. @@ -1290,16 +1292,19 @@ public Mono> createWithResponseAsync(Stri } String contentDisposition = contentDispositionInternal; String contentMd5Converted = Base64Util.encodeToString(contentMd5); - return FluxUtil.withContext(context -> service.create(this.client.getUrl(), shareName, fileName, - this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), fileContentLength, fileTypeConstant, - contentType, contentEncoding, contentLanguage, cacheControl, contentMd5Converted, contentDisposition, - metadata, filePermission, filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, - fileLastWriteTime, fileChangeTime, leaseId, this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext( + context -> service.create(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), + timeout, this.client.getVersion(), fileContentLength, fileTypeConstant, contentType, + contentEncoding, contentLanguage, cacheControl, contentMd5Converted, contentDisposition, metadata, + filePermission, filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, + fileLastWriteTime, fileChangeTime, leaseId, this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Creates a new file or replaces a file. Note it only initializes the file with no content. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param fileContentLength Specifies the maximum size for the file, up to 4 TB. @@ -1370,16 +1375,18 @@ public Mono> createWithResponseAsync(Stri } String contentDisposition = contentDispositionInternal; String contentMd5Converted = Base64Util.encodeToString(contentMd5); - return service.create(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), timeout, - this.client.getVersion(), fileContentLength, fileTypeConstant, contentType, contentEncoding, - contentLanguage, cacheControl, contentMd5Converted, contentDisposition, metadata, filePermission, - filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, - fileChangeTime, leaseId, this.client.getFileRequestIntent(), accept, context); + return service + .create(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), timeout, + this.client.getVersion(), fileContentLength, fileTypeConstant, contentType, contentEncoding, + contentLanguage, cacheControl, contentMd5Converted, contentDisposition, metadata, filePermission, + filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, + fileChangeTime, leaseId, this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Creates a new file or replaces a file. Note it only initializes the file with no content. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param fileContentLength Specifies the maximum size for the file, up to 4 TB. @@ -1417,12 +1424,14 @@ public Mono createAsync(String shareName, String fileName, long fileConten String leaseId, ShareFileHttpHeaders shareFileHttpHeaders) { return createWithResponseAsync(shareName, fileName, fileContentLength, fileAttributes, timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, fileCreationTime, fileLastWriteTime, - fileChangeTime, leaseId, shareFileHttpHeaders).flatMap(ignored -> Mono.empty()); + fileChangeTime, leaseId, shareFileHttpHeaders) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Creates a new file or replaces a file. Note it only initializes the file with no content. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param fileContentLength Specifies the maximum size for the file, up to 4 TB. @@ -1461,12 +1470,14 @@ public Mono createAsync(String shareName, String fileName, long fileConten String leaseId, ShareFileHttpHeaders shareFileHttpHeaders, Context context) { return createWithResponseAsync(shareName, fileName, fileContentLength, fileAttributes, timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, fileCreationTime, fileLastWriteTime, - fileChangeTime, leaseId, shareFileHttpHeaders, context).flatMap(ignored -> Mono.empty()); + fileChangeTime, leaseId, shareFileHttpHeaders, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Creates a new file or replaces a file. Note it only initializes the file with no content. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param fileContentLength Specifies the maximum size for the file, up to 4 TB. @@ -1540,12 +1551,13 @@ public Mono> createNoCustomHeadersWithResponseAsync(String shareN this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), fileContentLength, fileTypeConstant, contentType, contentEncoding, contentLanguage, cacheControl, contentMd5Converted, contentDisposition, metadata, filePermission, filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, - fileLastWriteTime, fileChangeTime, leaseId, this.client.getFileRequestIntent(), accept, context)); + fileLastWriteTime, fileChangeTime, leaseId, this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Creates a new file or replaces a file. Note it only initializes the file with no content. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param fileContentLength Specifies the maximum size for the file, up to 4 TB. @@ -1616,16 +1628,18 @@ public Mono> createNoCustomHeadersWithResponseAsync(String shareN } String contentDisposition = contentDispositionInternal; String contentMd5Converted = Base64Util.encodeToString(contentMd5); - return service.createNoCustomHeaders(this.client.getUrl(), shareName, fileName, - this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), fileContentLength, fileTypeConstant, - contentType, contentEncoding, contentLanguage, cacheControl, contentMd5Converted, contentDisposition, - metadata, filePermission, filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, - fileLastWriteTime, fileChangeTime, leaseId, this.client.getFileRequestIntent(), accept, context); + return service + .createNoCustomHeaders(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), timeout, + this.client.getVersion(), fileContentLength, fileTypeConstant, contentType, contentEncoding, + contentLanguage, cacheControl, contentMd5Converted, contentDisposition, metadata, filePermission, + filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, + fileChangeTime, leaseId, this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Creates a new file or replaces a file. Note it only initializes the file with no content. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param fileContentLength Specifies the maximum size for the file, up to 4 TB. @@ -1696,16 +1710,20 @@ public ResponseBase createWithResponse(String shareNam } String contentDisposition = contentDispositionInternal; String contentMd5Converted = Base64Util.encodeToString(contentMd5); - return service.createSync(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), timeout, - this.client.getVersion(), fileContentLength, fileTypeConstant, contentType, contentEncoding, - contentLanguage, cacheControl, contentMd5Converted, contentDisposition, metadata, filePermission, - filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, - fileChangeTime, leaseId, this.client.getFileRequestIntent(), accept, context); + try { + return service.createSync(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), + timeout, this.client.getVersion(), fileContentLength, fileTypeConstant, contentType, contentEncoding, + contentLanguage, cacheControl, contentMd5Converted, contentDisposition, metadata, filePermission, + filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, + fileChangeTime, leaseId, this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Creates a new file or replaces a file. Note it only initializes the file with no content. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param fileContentLength Specifies the maximum size for the file, up to 4 TB. @@ -1747,7 +1765,7 @@ public void create(String shareName, String fileName, long fileContentLength, St /** * Creates a new file or replaces a file. Note it only initializes the file with no content. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param fileContentLength Specifies the maximum size for the file, up to 4 TB. @@ -1818,16 +1836,21 @@ public Response createNoCustomHeadersWithResponse(String shareName, String } String contentDisposition = contentDispositionInternal; String contentMd5Converted = Base64Util.encodeToString(contentMd5); - return service.createNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, - this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), fileContentLength, fileTypeConstant, - contentType, contentEncoding, contentLanguage, cacheControl, contentMd5Converted, contentDisposition, - metadata, filePermission, filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, - fileLastWriteTime, fileChangeTime, leaseId, this.client.getFileRequestIntent(), accept, context); + try { + return service.createNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, + this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), fileContentLength, + fileTypeConstant, contentType, contentEncoding, contentLanguage, cacheControl, contentMd5Converted, + contentDisposition, metadata, filePermission, filePermissionFormat, filePermissionKey, fileAttributes, + fileCreationTime, fileLastWriteTime, fileChangeTime, leaseId, this.client.getFileRequestIntent(), + accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Reads or downloads a file from the system, including its metadata and properties. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1846,14 +1869,16 @@ public Response createNoCustomHeadersWithResponse(String shareName, String public Mono>> downloadWithResponseAsync(String shareName, String fileName, Integer timeout, String range, Boolean rangeGetContentMD5, String leaseId) { final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.download(this.client.getUrl(), shareName, fileName, - this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), range, rangeGetContentMD5, leaseId, - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.download(this.client.getUrl(), shareName, fileName, + this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), range, rangeGetContentMD5, leaseId, + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Reads or downloads a file from the system, including its metadata and properties. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1873,14 +1898,16 @@ public Mono>> downloadWithRe public Mono>> downloadWithResponseAsync(String shareName, String fileName, Integer timeout, String range, Boolean rangeGetContentMD5, String leaseId, Context context) { final String accept = "application/xml"; - return service.download(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), timeout, - this.client.getVersion(), range, rangeGetContentMD5, leaseId, this.client.getFileRequestIntent(), accept, - context); + return service + .download(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), timeout, + this.client.getVersion(), range, rangeGetContentMD5, leaseId, this.client.getFileRequestIntent(), + accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Reads or downloads a file from the system, including its metadata and properties. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1899,12 +1926,13 @@ public Mono>> downloadWithRe public Flux downloadAsync(String shareName, String fileName, Integer timeout, String range, Boolean rangeGetContentMD5, String leaseId) { return downloadWithResponseAsync(shareName, fileName, timeout, range, rangeGetContentMD5, leaseId) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMapMany(fluxByteBufferResponse -> fluxByteBufferResponse.getValue()); } /** * Reads or downloads a file from the system, including its metadata and properties. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1924,12 +1952,13 @@ public Flux downloadAsync(String shareName, String fileName, Integer public Flux downloadAsync(String shareName, String fileName, Integer timeout, String range, Boolean rangeGetContentMD5, String leaseId, Context context) { return downloadWithResponseAsync(shareName, fileName, timeout, range, rangeGetContentMD5, leaseId, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMapMany(fluxByteBufferResponse -> fluxByteBufferResponse.getValue()); } /** * Reads or downloads a file from the system, including its metadata and properties. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1948,14 +1977,16 @@ public Flux downloadAsync(String shareName, String fileName, Integer public Mono downloadNoCustomHeadersWithResponseAsync(String shareName, String fileName, Integer timeout, String range, Boolean rangeGetContentMD5, String leaseId) { final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.downloadNoCustomHeaders(this.client.getUrl(), shareName, - fileName, this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), range, rangeGetContentMD5, - leaseId, this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.downloadNoCustomHeaders(this.client.getUrl(), shareName, fileName, + this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), range, rangeGetContentMD5, leaseId, + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Reads or downloads a file from the system, including its metadata and properties. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -1975,14 +2006,16 @@ public Mono downloadNoCustomHeadersWithResponseAsync(String shar public Mono downloadNoCustomHeadersWithResponseAsync(String shareName, String fileName, Integer timeout, String range, Boolean rangeGetContentMD5, String leaseId, Context context) { final String accept = "application/xml"; - return service.downloadNoCustomHeaders(this.client.getUrl(), shareName, fileName, - this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), range, rangeGetContentMD5, leaseId, - this.client.getFileRequestIntent(), accept, context); + return service + .downloadNoCustomHeaders(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), + timeout, this.client.getVersion(), range, rangeGetContentMD5, leaseId, + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Reads or downloads a file from the system, including its metadata and properties. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2002,14 +2035,18 @@ public Mono downloadNoCustomHeadersWithResponseAsync(String shar public ResponseBase downloadWithResponse(String shareName, String fileName, Integer timeout, String range, Boolean rangeGetContentMD5, String leaseId, Context context) { final String accept = "application/xml"; - return service.downloadSync(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), - timeout, this.client.getVersion(), range, rangeGetContentMD5, leaseId, this.client.getFileRequestIntent(), - accept, context); + try { + return service.downloadSync(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), + timeout, this.client.getVersion(), range, rangeGetContentMD5, leaseId, + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Reads or downloads a file from the system, including its metadata and properties. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2027,13 +2064,17 @@ public ResponseBase downloadWithResponse(Stri @ServiceMethod(returns = ReturnType.SINGLE) public InputStream download(String shareName, String fileName, Integer timeout, String range, Boolean rangeGetContentMD5, String leaseId) { - return downloadWithResponse(shareName, fileName, timeout, range, rangeGetContentMD5, leaseId, Context.NONE) - .getValue(); + try { + return downloadWithResponse(shareName, fileName, timeout, range, rangeGetContentMD5, leaseId, Context.NONE) + .getValue(); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Reads or downloads a file from the system, including its metadata and properties. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2053,15 +2094,19 @@ public InputStream download(String shareName, String fileName, Integer timeout, public Response downloadNoCustomHeadersWithResponse(String shareName, String fileName, Integer timeout, String range, Boolean rangeGetContentMD5, String leaseId, Context context) { final String accept = "application/xml"; - return service.downloadNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, - this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), range, rangeGetContentMD5, leaseId, - this.client.getFileRequestIntent(), accept, context); + try { + return service.downloadNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, + this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), range, rangeGetContentMD5, leaseId, + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Returns all user-defined metadata, standard HTTP properties, and system properties for the file. It does not * return the content of the file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share @@ -2079,15 +2124,17 @@ public Response downloadNoCustomHeadersWithResponse(String shareNam public Mono> getPropertiesWithResponseAsync(String shareName, String fileName, String sharesnapshot, Integer timeout, String leaseId) { final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getProperties(this.client.getUrl(), shareName, fileName, - this.client.isAllowTrailingDot(), sharesnapshot, timeout, this.client.getVersion(), leaseId, - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.getProperties(this.client.getUrl(), shareName, fileName, + this.client.isAllowTrailingDot(), sharesnapshot, timeout, this.client.getVersion(), leaseId, + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Returns all user-defined metadata, standard HTTP properties, and system properties for the file. It does not * return the content of the file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share @@ -2106,15 +2153,16 @@ public Mono> getPropertiesWithResp public Mono> getPropertiesWithResponseAsync(String shareName, String fileName, String sharesnapshot, Integer timeout, String leaseId, Context context) { final String accept = "application/xml"; - return service.getProperties(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), - sharesnapshot, timeout, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, - context); + return service + .getProperties(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), sharesnapshot, + timeout, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Returns all user-defined metadata, standard HTTP properties, and system properties for the file. It does not * return the content of the file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share @@ -2132,13 +2180,14 @@ public Mono> getPropertiesWithResp public Mono getPropertiesAsync(String shareName, String fileName, String sharesnapshot, Integer timeout, String leaseId) { return getPropertiesWithResponseAsync(shareName, fileName, sharesnapshot, timeout, leaseId) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * Returns all user-defined metadata, standard HTTP properties, and system properties for the file. It does not * return the content of the file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share @@ -2157,13 +2206,14 @@ public Mono getPropertiesAsync(String shareName, String fileName, String s public Mono getPropertiesAsync(String shareName, String fileName, String sharesnapshot, Integer timeout, String leaseId, Context context) { return getPropertiesWithResponseAsync(shareName, fileName, sharesnapshot, timeout, leaseId, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * Returns all user-defined metadata, standard HTTP properties, and system properties for the file. It does not * return the content of the file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share @@ -2181,15 +2231,17 @@ public Mono getPropertiesAsync(String shareName, String fileName, String s public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String shareName, String fileName, String sharesnapshot, Integer timeout, String leaseId) { final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getPropertiesNoCustomHeaders(this.client.getUrl(), shareName, - fileName, this.client.isAllowTrailingDot(), sharesnapshot, timeout, this.client.getVersion(), leaseId, - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.getPropertiesNoCustomHeaders(this.client.getUrl(), shareName, fileName, + this.client.isAllowTrailingDot(), sharesnapshot, timeout, this.client.getVersion(), leaseId, + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Returns all user-defined metadata, standard HTTP properties, and system properties for the file. It does not * return the content of the file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share @@ -2208,15 +2260,17 @@ public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String shareName, String fileName, String sharesnapshot, Integer timeout, String leaseId, Context context) { final String accept = "application/xml"; - return service.getPropertiesNoCustomHeaders(this.client.getUrl(), shareName, fileName, - this.client.isAllowTrailingDot(), sharesnapshot, timeout, this.client.getVersion(), leaseId, - this.client.getFileRequestIntent(), accept, context); + return service + .getPropertiesNoCustomHeaders(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), + sharesnapshot, timeout, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, + context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Returns all user-defined metadata, standard HTTP properties, and system properties for the file. It does not * return the content of the file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share @@ -2235,15 +2289,19 @@ public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String public ResponseBase getPropertiesWithResponse(String shareName, String fileName, String sharesnapshot, Integer timeout, String leaseId, Context context) { final String accept = "application/xml"; - return service.getPropertiesSync(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), - sharesnapshot, timeout, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, - context); + try { + return service.getPropertiesSync(this.client.getUrl(), shareName, fileName, + this.client.isAllowTrailingDot(), sharesnapshot, timeout, this.client.getVersion(), leaseId, + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Returns all user-defined metadata, standard HTTP properties, and system properties for the file. It does not * return the content of the file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share @@ -2265,7 +2323,7 @@ public void getProperties(String shareName, String fileName, String sharesnapsho /** * Returns all user-defined metadata, standard HTTP properties, and system properties for the file. It does not * return the content of the file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share @@ -2284,14 +2342,18 @@ public void getProperties(String shareName, String fileName, String sharesnapsho public Response getPropertiesNoCustomHeadersWithResponse(String shareName, String fileName, String sharesnapshot, Integer timeout, String leaseId, Context context) { final String accept = "application/xml"; - return service.getPropertiesNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, - this.client.isAllowTrailingDot(), sharesnapshot, timeout, this.client.getVersion(), leaseId, - this.client.getFileRequestIntent(), accept, context); + try { + return service.getPropertiesNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, + this.client.isAllowTrailingDot(), sharesnapshot, timeout, this.client.getVersion(), leaseId, + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * removes the file from the storage account. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2307,14 +2369,16 @@ public Response getPropertiesNoCustomHeadersWithResponse(String shareName, public Mono> deleteWithResponseAsync(String shareName, String fileName, Integer timeout, String leaseId) { final String accept = "application/xml"; - return FluxUtil.withContext( - context -> service.delete(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), - timeout, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext( + context -> service.delete(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), + timeout, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * removes the file from the storage account. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2331,13 +2395,15 @@ public Mono> deleteWithResponseAsync(Stri public Mono> deleteWithResponseAsync(String shareName, String fileName, Integer timeout, String leaseId, Context context) { final String accept = "application/xml"; - return service.delete(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), timeout, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + return service + .delete(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), timeout, + this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * removes the file from the storage account. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2351,12 +2417,14 @@ public Mono> deleteWithResponseAsync(Stri */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String shareName, String fileName, Integer timeout, String leaseId) { - return deleteWithResponseAsync(shareName, fileName, timeout, leaseId).flatMap(ignored -> Mono.empty()); + return deleteWithResponseAsync(shareName, fileName, timeout, leaseId) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * removes the file from the storage account. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2371,12 +2439,14 @@ public Mono deleteAsync(String shareName, String fileName, Integer timeout */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String shareName, String fileName, Integer timeout, String leaseId, Context context) { - return deleteWithResponseAsync(shareName, fileName, timeout, leaseId, context).flatMap(ignored -> Mono.empty()); + return deleteWithResponseAsync(shareName, fileName, timeout, leaseId, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * removes the file from the storage account. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2392,14 +2462,16 @@ public Mono deleteAsync(String shareName, String fileName, Integer timeout public Mono> deleteNoCustomHeadersWithResponseAsync(String shareName, String fileName, Integer timeout, String leaseId) { final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.deleteNoCustomHeaders(this.client.getUrl(), shareName, fileName, - this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), leaseId, - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.deleteNoCustomHeaders(this.client.getUrl(), shareName, fileName, + this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), leaseId, + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * removes the file from the storage account. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2416,14 +2488,15 @@ public Mono> deleteNoCustomHeadersWithResponseAsync(String shareN public Mono> deleteNoCustomHeadersWithResponseAsync(String shareName, String fileName, Integer timeout, String leaseId, Context context) { final String accept = "application/xml"; - return service.deleteNoCustomHeaders(this.client.getUrl(), shareName, fileName, - this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), leaseId, - this.client.getFileRequestIntent(), accept, context); + return service + .deleteNoCustomHeaders(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), timeout, + this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * removes the file from the storage account. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2440,13 +2513,17 @@ public Mono> deleteNoCustomHeadersWithResponseAsync(String shareN public ResponseBase deleteWithResponse(String shareName, String fileName, Integer timeout, String leaseId, Context context) { final String accept = "application/xml"; - return service.deleteSync(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), timeout, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + try { + return service.deleteSync(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), + timeout, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * removes the file from the storage account. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2464,7 +2541,7 @@ public void delete(String shareName, String fileName, Integer timeout, String le /** * removes the file from the storage account. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2481,14 +2558,18 @@ public void delete(String shareName, String fileName, Integer timeout, String le public Response deleteNoCustomHeadersWithResponse(String shareName, String fileName, Integer timeout, String leaseId, Context context) { final String accept = "application/xml"; - return service.deleteNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, - this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), leaseId, - this.client.getFileRequestIntent(), accept, context); + try { + return service.deleteNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, + this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), leaseId, + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Sets HTTP headers on the file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file @@ -2557,16 +2638,18 @@ public Mono> setHttpHeadersWithRe } String contentDisposition = contentDispositionInternal; String contentMd5Converted = Base64Util.encodeToString(contentMd5); - return FluxUtil.withContext(context -> service.setHttpHeaders(this.client.getUrl(), shareName, fileName, comp, - timeout, this.client.getVersion(), fileContentLength, contentType, contentEncoding, contentLanguage, - cacheControl, contentMd5Converted, contentDisposition, filePermission, filePermissionFormat, - filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, leaseId, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.setHttpHeaders(this.client.getUrl(), shareName, fileName, comp, timeout, + this.client.getVersion(), fileContentLength, contentType, contentEncoding, contentLanguage, + cacheControl, contentMd5Converted, contentDisposition, filePermission, filePermissionFormat, + filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, leaseId, + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Sets HTTP headers on the file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file @@ -2637,16 +2720,18 @@ public Mono> setHttpHeadersWithRe } String contentDisposition = contentDispositionInternal; String contentMd5Converted = Base64Util.encodeToString(contentMd5); - return service.setHttpHeaders(this.client.getUrl(), shareName, fileName, comp, timeout, - this.client.getVersion(), fileContentLength, contentType, contentEncoding, contentLanguage, cacheControl, - contentMd5Converted, contentDisposition, filePermission, filePermissionFormat, filePermissionKey, - fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, leaseId, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context); + return service + .setHttpHeaders(this.client.getUrl(), shareName, fileName, comp, timeout, this.client.getVersion(), + fileContentLength, contentType, contentEncoding, contentLanguage, cacheControl, contentMd5Converted, + contentDisposition, filePermission, filePermissionFormat, filePermissionKey, fileAttributes, + fileCreationTime, fileLastWriteTime, fileChangeTime, leaseId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Sets HTTP headers on the file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file @@ -2684,12 +2769,14 @@ public Mono setHttpHeadersAsync(String shareName, String fileName, String String leaseId, ShareFileHttpHeaders shareFileHttpHeaders) { return setHttpHeadersWithResponseAsync(shareName, fileName, fileAttributes, timeout, fileContentLength, filePermission, filePermissionFormat, filePermissionKey, fileCreationTime, fileLastWriteTime, - fileChangeTime, leaseId, shareFileHttpHeaders).flatMap(ignored -> Mono.empty()); + fileChangeTime, leaseId, shareFileHttpHeaders) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Sets HTTP headers on the file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file @@ -2728,12 +2815,14 @@ public Mono setHttpHeadersAsync(String shareName, String fileName, String String leaseId, ShareFileHttpHeaders shareFileHttpHeaders, Context context) { return setHttpHeadersWithResponseAsync(shareName, fileName, fileAttributes, timeout, fileContentLength, filePermission, filePermissionFormat, filePermissionKey, fileCreationTime, fileLastWriteTime, - fileChangeTime, leaseId, shareFileHttpHeaders, context).flatMap(ignored -> Mono.empty()); + fileChangeTime, leaseId, shareFileHttpHeaders, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Sets HTTP headers on the file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file @@ -2802,17 +2891,19 @@ public Mono> setHttpHeadersNoCustomHeadersWithResponseAsync(Strin } String contentDisposition = contentDispositionInternal; String contentMd5Converted = Base64Util.encodeToString(contentMd5); - return FluxUtil.withContext( - context -> service.setHttpHeadersNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, timeout, - this.client.getVersion(), fileContentLength, contentType, contentEncoding, contentLanguage, - cacheControl, contentMd5Converted, contentDisposition, filePermission, filePermissionFormat, - filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, leaseId, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext( + context -> service.setHttpHeadersNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, + timeout, this.client.getVersion(), fileContentLength, contentType, contentEncoding, contentLanguage, + cacheControl, contentMd5Converted, contentDisposition, filePermission, filePermissionFormat, + filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, leaseId, + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Sets HTTP headers on the file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file @@ -2883,16 +2974,18 @@ public Mono> setHttpHeadersNoCustomHeadersWithResponseAsync(Strin } String contentDisposition = contentDispositionInternal; String contentMd5Converted = Base64Util.encodeToString(contentMd5); - return service.setHttpHeadersNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, timeout, - this.client.getVersion(), fileContentLength, contentType, contentEncoding, contentLanguage, cacheControl, - contentMd5Converted, contentDisposition, filePermission, filePermissionFormat, filePermissionKey, - fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, leaseId, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context); + return service + .setHttpHeadersNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, timeout, + this.client.getVersion(), fileContentLength, contentType, contentEncoding, contentLanguage, + cacheControl, contentMd5Converted, contentDisposition, filePermission, filePermissionFormat, + filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, leaseId, + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Sets HTTP headers on the file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file @@ -2963,16 +3056,20 @@ public ResponseBase setHttpHeadersWithResponse } String contentDisposition = contentDispositionInternal; String contentMd5Converted = Base64Util.encodeToString(contentMd5); - return service.setHttpHeadersSync(this.client.getUrl(), shareName, fileName, comp, timeout, - this.client.getVersion(), fileContentLength, contentType, contentEncoding, contentLanguage, cacheControl, - contentMd5Converted, contentDisposition, filePermission, filePermissionFormat, filePermissionKey, - fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, leaseId, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context); + try { + return service.setHttpHeadersSync(this.client.getUrl(), shareName, fileName, comp, timeout, + this.client.getVersion(), fileContentLength, contentType, contentEncoding, contentLanguage, + cacheControl, contentMd5Converted, contentDisposition, filePermission, filePermissionFormat, + filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, leaseId, + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Sets HTTP headers on the file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file @@ -3014,7 +3111,7 @@ public void setHttpHeaders(String shareName, String fileName, String fileAttribu /** * Sets HTTP headers on the file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file @@ -3085,16 +3182,20 @@ public Response setHttpHeadersNoCustomHeadersWithResponse(String shareName } String contentDisposition = contentDispositionInternal; String contentMd5Converted = Base64Util.encodeToString(contentMd5); - return service.setHttpHeadersNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, timeout, - this.client.getVersion(), fileContentLength, contentType, contentEncoding, contentLanguage, cacheControl, - contentMd5Converted, contentDisposition, filePermission, filePermissionFormat, filePermissionKey, - fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, leaseId, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context); + try { + return service.setHttpHeadersNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, timeout, + this.client.getVersion(), fileContentLength, contentType, contentEncoding, contentLanguage, + cacheControl, contentMd5Converted, contentDisposition, filePermission, filePermissionFormat, + filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, leaseId, + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Upload a range of bytes to a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. @@ -3130,15 +3231,17 @@ public Mono> uploadRangeWithResponse final String comp = "range"; final String accept = "application/xml"; String contentMD5Converted = Base64Util.encodeToString(contentMD5); - return FluxUtil.withContext(context -> service.uploadRange(this.client.getUrl(), shareName, fileName, comp, - timeout, range, fileRangeWrite, contentLength, contentMD5Converted, this.client.getVersion(), leaseId, - fileLastWrittenMode, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), optionalbody, - accept, context)); + return FluxUtil + .withContext(context -> service.uploadRange(this.client.getUrl(), shareName, fileName, comp, timeout, range, + fileRangeWrite, contentLength, contentMD5Converted, this.client.getVersion(), leaseId, + fileLastWrittenMode, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), optionalbody, + accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Upload a range of bytes to a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. @@ -3176,14 +3279,16 @@ public Mono> uploadRangeWithResponse final String comp = "range"; final String accept = "application/xml"; String contentMD5Converted = Base64Util.encodeToString(contentMD5); - return service.uploadRange(this.client.getUrl(), shareName, fileName, comp, timeout, range, fileRangeWrite, - contentLength, contentMD5Converted, this.client.getVersion(), leaseId, fileLastWrittenMode, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), optionalbody, accept, context); + return service + .uploadRange(this.client.getUrl(), shareName, fileName, comp, timeout, range, fileRangeWrite, contentLength, + contentMD5Converted, this.client.getVersion(), leaseId, fileLastWrittenMode, + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), optionalbody, accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Upload a range of bytes to a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. @@ -3217,12 +3322,14 @@ public Mono uploadRangeAsync(String shareName, String fileName, String ran ShareFileRangeWriteType fileRangeWrite, long contentLength, Integer timeout, byte[] contentMD5, String leaseId, FileLastWrittenMode fileLastWrittenMode, Flux optionalbody) { return uploadRangeWithResponseAsync(shareName, fileName, range, fileRangeWrite, contentLength, timeout, - contentMD5, leaseId, fileLastWrittenMode, optionalbody).flatMap(ignored -> Mono.empty()); + contentMD5, leaseId, fileLastWrittenMode, optionalbody) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Upload a range of bytes to a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. @@ -3257,12 +3364,14 @@ public Mono uploadRangeAsync(String shareName, String fileName, String ran ShareFileRangeWriteType fileRangeWrite, long contentLength, Integer timeout, byte[] contentMD5, String leaseId, FileLastWrittenMode fileLastWrittenMode, Flux optionalbody, Context context) { return uploadRangeWithResponseAsync(shareName, fileName, range, fileRangeWrite, contentLength, timeout, - contentMD5, leaseId, fileLastWrittenMode, optionalbody, context).flatMap(ignored -> Mono.empty()); + contentMD5, leaseId, fileLastWrittenMode, optionalbody, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Upload a range of bytes to a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. @@ -3298,15 +3407,17 @@ public Mono> uploadRangeNoCustomHeadersWithResponseAsync(String s final String comp = "range"; final String accept = "application/xml"; String contentMD5Converted = Base64Util.encodeToString(contentMD5); - return FluxUtil.withContext(context -> service.uploadRangeNoCustomHeaders(this.client.getUrl(), shareName, - fileName, comp, timeout, range, fileRangeWrite, contentLength, contentMD5Converted, - this.client.getVersion(), leaseId, fileLastWrittenMode, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), optionalbody, accept, context)); + return FluxUtil + .withContext(context -> service.uploadRangeNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, + timeout, range, fileRangeWrite, contentLength, contentMD5Converted, this.client.getVersion(), leaseId, + fileLastWrittenMode, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), optionalbody, + accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Upload a range of bytes to a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. @@ -3343,14 +3454,16 @@ public Mono> uploadRangeNoCustomHeadersWithResponseAsync(String s final String comp = "range"; final String accept = "application/xml"; String contentMD5Converted = Base64Util.encodeToString(contentMD5); - return service.uploadRangeNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, timeout, range, - fileRangeWrite, contentLength, contentMD5Converted, this.client.getVersion(), leaseId, fileLastWrittenMode, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), optionalbody, accept, context); + return service + .uploadRangeNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, timeout, range, fileRangeWrite, + contentLength, contentMD5Converted, this.client.getVersion(), leaseId, fileLastWrittenMode, + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), optionalbody, accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Upload a range of bytes to a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. @@ -3386,15 +3499,17 @@ public Mono> uploadRangeWithResponse final String comp = "range"; final String accept = "application/xml"; String contentMD5Converted = Base64Util.encodeToString(contentMD5); - return FluxUtil.withContext(context -> service.uploadRange(this.client.getUrl(), shareName, fileName, comp, - timeout, range, fileRangeWrite, contentLength, contentMD5Converted, this.client.getVersion(), leaseId, - fileLastWrittenMode, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), optionalbody, - accept, context)); + return FluxUtil + .withContext(context -> service.uploadRange(this.client.getUrl(), shareName, fileName, comp, timeout, range, + fileRangeWrite, contentLength, contentMD5Converted, this.client.getVersion(), leaseId, + fileLastWrittenMode, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), optionalbody, + accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Upload a range of bytes to a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. @@ -3432,14 +3547,16 @@ public Mono> uploadRangeWithResponse final String comp = "range"; final String accept = "application/xml"; String contentMD5Converted = Base64Util.encodeToString(contentMD5); - return service.uploadRange(this.client.getUrl(), shareName, fileName, comp, timeout, range, fileRangeWrite, - contentLength, contentMD5Converted, this.client.getVersion(), leaseId, fileLastWrittenMode, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), optionalbody, accept, context); + return service + .uploadRange(this.client.getUrl(), shareName, fileName, comp, timeout, range, fileRangeWrite, contentLength, + contentMD5Converted, this.client.getVersion(), leaseId, fileLastWrittenMode, + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), optionalbody, accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Upload a range of bytes to a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. @@ -3473,12 +3590,14 @@ public Mono uploadRangeAsync(String shareName, String fileName, String ran ShareFileRangeWriteType fileRangeWrite, long contentLength, Integer timeout, byte[] contentMD5, String leaseId, FileLastWrittenMode fileLastWrittenMode, BinaryData optionalbody) { return uploadRangeWithResponseAsync(shareName, fileName, range, fileRangeWrite, contentLength, timeout, - contentMD5, leaseId, fileLastWrittenMode, optionalbody).flatMap(ignored -> Mono.empty()); + contentMD5, leaseId, fileLastWrittenMode, optionalbody) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Upload a range of bytes to a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. @@ -3513,12 +3632,14 @@ public Mono uploadRangeAsync(String shareName, String fileName, String ran ShareFileRangeWriteType fileRangeWrite, long contentLength, Integer timeout, byte[] contentMD5, String leaseId, FileLastWrittenMode fileLastWrittenMode, BinaryData optionalbody, Context context) { return uploadRangeWithResponseAsync(shareName, fileName, range, fileRangeWrite, contentLength, timeout, - contentMD5, leaseId, fileLastWrittenMode, optionalbody, context).flatMap(ignored -> Mono.empty()); + contentMD5, leaseId, fileLastWrittenMode, optionalbody, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Upload a range of bytes to a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. @@ -3554,15 +3675,17 @@ public Mono> uploadRangeNoCustomHeadersWithResponseAsync(String s final String comp = "range"; final String accept = "application/xml"; String contentMD5Converted = Base64Util.encodeToString(contentMD5); - return FluxUtil.withContext(context -> service.uploadRangeNoCustomHeaders(this.client.getUrl(), shareName, - fileName, comp, timeout, range, fileRangeWrite, contentLength, contentMD5Converted, - this.client.getVersion(), leaseId, fileLastWrittenMode, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), optionalbody, accept, context)); + return FluxUtil + .withContext(context -> service.uploadRangeNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, + timeout, range, fileRangeWrite, contentLength, contentMD5Converted, this.client.getVersion(), leaseId, + fileLastWrittenMode, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), optionalbody, + accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Upload a range of bytes to a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. @@ -3599,14 +3722,16 @@ public Mono> uploadRangeNoCustomHeadersWithResponseAsync(String s final String comp = "range"; final String accept = "application/xml"; String contentMD5Converted = Base64Util.encodeToString(contentMD5); - return service.uploadRangeNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, timeout, range, - fileRangeWrite, contentLength, contentMD5Converted, this.client.getVersion(), leaseId, fileLastWrittenMode, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), optionalbody, accept, context); + return service + .uploadRangeNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, timeout, range, fileRangeWrite, + contentLength, contentMD5Converted, this.client.getVersion(), leaseId, fileLastWrittenMode, + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), optionalbody, accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Upload a range of bytes to a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. @@ -3643,14 +3768,19 @@ public ResponseBase uploadRangeWithResponse(Strin final String comp = "range"; final String accept = "application/xml"; String contentMD5Converted = Base64Util.encodeToString(contentMD5); - return service.uploadRangeSync(this.client.getUrl(), shareName, fileName, comp, timeout, range, fileRangeWrite, - contentLength, contentMD5Converted, this.client.getVersion(), leaseId, fileLastWrittenMode, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), optionalbody, accept, context); + try { + return service.uploadRangeSync(this.client.getUrl(), shareName, fileName, comp, timeout, range, + fileRangeWrite, contentLength, contentMD5Converted, this.client.getVersion(), leaseId, + fileLastWrittenMode, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), optionalbody, + accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Upload a range of bytes to a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. @@ -3688,7 +3818,7 @@ public void uploadRange(String shareName, String fileName, String range, ShareFi /** * Upload a range of bytes to a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. @@ -3725,14 +3855,19 @@ public Response uploadRangeNoCustomHeadersWithResponse(String shareName, S final String comp = "range"; final String accept = "application/xml"; String contentMD5Converted = Base64Util.encodeToString(contentMD5); - return service.uploadRangeNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, timeout, range, - fileRangeWrite, contentLength, contentMD5Converted, this.client.getVersion(), leaseId, fileLastWrittenMode, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), optionalbody, accept, context); + try { + return service.uploadRangeNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, timeout, + range, fileRangeWrite, contentLength, contentMD5Converted, this.client.getVersion(), leaseId, + fileLastWrittenMode, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), optionalbody, + accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Updates user-defined metadata for the specified file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3750,14 +3885,16 @@ public Mono> setMetadataWithResponse String fileName, Integer timeout, Map metadata, String leaseId) { final String comp = "metadata"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.setMetadata(this.client.getUrl(), shareName, fileName, comp, - timeout, metadata, this.client.getVersion(), leaseId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.setMetadata(this.client.getUrl(), shareName, fileName, comp, timeout, + metadata, this.client.getVersion(), leaseId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Updates user-defined metadata for the specified file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3776,14 +3913,15 @@ public Mono> setMetadataWithResponse String fileName, Integer timeout, Map metadata, String leaseId, Context context) { final String comp = "metadata"; final String accept = "application/xml"; - return service.setMetadata(this.client.getUrl(), shareName, fileName, comp, timeout, metadata, - this.client.getVersion(), leaseId, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), - accept, context); + return service + .setMetadata(this.client.getUrl(), shareName, fileName, comp, timeout, metadata, this.client.getVersion(), + leaseId, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Updates user-defined metadata for the specified file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3800,12 +3938,13 @@ public Mono> setMetadataWithResponse public Mono setMetadataAsync(String shareName, String fileName, Integer timeout, Map metadata, String leaseId) { return setMetadataWithResponseAsync(shareName, fileName, timeout, metadata, leaseId) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * Updates user-defined metadata for the specified file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3823,12 +3962,13 @@ public Mono setMetadataAsync(String shareName, String fileName, Integer ti public Mono setMetadataAsync(String shareName, String fileName, Integer timeout, Map metadata, String leaseId, Context context) { return setMetadataWithResponseAsync(shareName, fileName, timeout, metadata, leaseId, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * Updates user-defined metadata for the specified file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3846,14 +3986,16 @@ public Mono> setMetadataNoCustomHeadersWithResponseAsync(String s Integer timeout, Map metadata, String leaseId) { final String comp = "metadata"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.setMetadataNoCustomHeaders(this.client.getUrl(), shareName, - fileName, comp, timeout, metadata, this.client.getVersion(), leaseId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.setMetadataNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, + timeout, metadata, this.client.getVersion(), leaseId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Updates user-defined metadata for the specified file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3872,14 +4014,16 @@ public Mono> setMetadataNoCustomHeadersWithResponseAsync(String s Integer timeout, Map metadata, String leaseId, Context context) { final String comp = "metadata"; final String accept = "application/xml"; - return service.setMetadataNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, timeout, metadata, - this.client.getVersion(), leaseId, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), - accept, context); + return service + .setMetadataNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, timeout, metadata, + this.client.getVersion(), leaseId, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), + accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Updates user-defined metadata for the specified file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3898,14 +4042,18 @@ public ResponseBase setMetadataWithResponse(Strin Integer timeout, Map metadata, String leaseId, Context context) { final String comp = "metadata"; final String accept = "application/xml"; - return service.setMetadataSync(this.client.getUrl(), shareName, fileName, comp, timeout, metadata, - this.client.getVersion(), leaseId, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), - accept, context); + try { + return service.setMetadataSync(this.client.getUrl(), shareName, fileName, comp, timeout, metadata, + this.client.getVersion(), leaseId, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), + accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Updates user-defined metadata for the specified file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3925,7 +4073,7 @@ public void setMetadata(String shareName, String fileName, Integer timeout, Map< /** * Updates user-defined metadata for the specified file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3944,14 +4092,18 @@ public Response setMetadataNoCustomHeadersWithResponse(String shareName, S Map metadata, String leaseId, Context context) { final String comp = "metadata"; final String accept = "application/xml"; - return service.setMetadataNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, timeout, - metadata, this.client.getVersion(), leaseId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + try { + return service.setMetadataNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, timeout, + metadata, this.client.getVersion(), leaseId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3976,14 +4128,16 @@ public Mono> acquireLeaseWithRespon final String comp = "lease"; final String action = "acquire"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.acquireLease(this.client.getUrl(), shareName, fileName, comp, - action, timeout, duration, proposedLeaseId, this.client.getVersion(), requestId, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.acquireLease(this.client.getUrl(), shareName, fileName, comp, action, + timeout, duration, proposedLeaseId, this.client.getVersion(), requestId, + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -4009,14 +4163,16 @@ public Mono> acquireLeaseWithRespon final String comp = "lease"; final String action = "acquire"; final String accept = "application/xml"; - return service.acquireLease(this.client.getUrl(), shareName, fileName, comp, action, timeout, duration, - proposedLeaseId, this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + return service + .acquireLease(this.client.getUrl(), shareName, fileName, comp, action, timeout, duration, proposedLeaseId, + this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -4039,12 +4195,13 @@ public Mono> acquireLeaseWithRespon public Mono acquireLeaseAsync(String shareName, String fileName, Integer timeout, Integer duration, String proposedLeaseId, String requestId) { return acquireLeaseWithResponseAsync(shareName, fileName, timeout, duration, proposedLeaseId, requestId) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -4068,12 +4225,13 @@ public Mono acquireLeaseAsync(String shareName, String fileName, Integer t public Mono acquireLeaseAsync(String shareName, String fileName, Integer timeout, Integer duration, String proposedLeaseId, String requestId, Context context) { return acquireLeaseWithResponseAsync(shareName, fileName, timeout, duration, proposedLeaseId, requestId, - context).flatMap(ignored -> Mono.empty()); + context).onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -4098,14 +4256,16 @@ public Mono> acquireLeaseNoCustomHeadersWithResponseAsync(String final String comp = "lease"; final String action = "acquire"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.acquireLeaseNoCustomHeaders(this.client.getUrl(), shareName, - fileName, comp, action, timeout, duration, proposedLeaseId, this.client.getVersion(), requestId, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.acquireLeaseNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, + action, timeout, duration, proposedLeaseId, this.client.getVersion(), requestId, + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -4131,14 +4291,16 @@ public Mono> acquireLeaseNoCustomHeadersWithResponseAsync(String final String comp = "lease"; final String action = "acquire"; final String accept = "application/xml"; - return service.acquireLeaseNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, action, timeout, - duration, proposedLeaseId, this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + return service + .acquireLeaseNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, action, timeout, duration, + proposedLeaseId, this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -4164,14 +4326,18 @@ public ResponseBase acquireLeaseWithResponse(Str final String comp = "lease"; final String action = "acquire"; final String accept = "application/xml"; - return service.acquireLeaseSync(this.client.getUrl(), shareName, fileName, comp, action, timeout, duration, - proposedLeaseId, this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + try { + return service.acquireLeaseSync(this.client.getUrl(), shareName, fileName, comp, action, timeout, duration, + proposedLeaseId, this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -4197,7 +4363,7 @@ public void acquireLease(String shareName, String fileName, Integer timeout, Int /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -4223,14 +4389,18 @@ public Response acquireLeaseNoCustomHeadersWithResponse(String shareName, final String comp = "lease"; final String action = "acquire"; final String accept = "application/xml"; - return service.acquireLeaseNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, action, timeout, - duration, proposedLeaseId, this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + try { + return service.acquireLeaseNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, action, + timeout, duration, proposedLeaseId, this.client.getVersion(), requestId, + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param leaseId Specifies the current lease ID on the resource. @@ -4250,14 +4420,16 @@ public Mono> releaseLeaseWithRespon final String comp = "lease"; final String action = "release"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.releaseLease(this.client.getUrl(), shareName, fileName, comp, - action, timeout, leaseId, this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.releaseLease(this.client.getUrl(), shareName, fileName, comp, action, + timeout, leaseId, this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param leaseId Specifies the current lease ID on the resource. @@ -4278,14 +4450,16 @@ public Mono> releaseLeaseWithRespon final String comp = "lease"; final String action = "release"; final String accept = "application/xml"; - return service.releaseLease(this.client.getUrl(), shareName, fileName, comp, action, timeout, leaseId, - this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), - accept, context); + return service + .releaseLease(this.client.getUrl(), shareName, fileName, comp, action, timeout, leaseId, + this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param leaseId Specifies the current lease ID on the resource. @@ -4303,12 +4477,13 @@ public Mono> releaseLeaseWithRespon public Mono releaseLeaseAsync(String shareName, String fileName, String leaseId, Integer timeout, String requestId) { return releaseLeaseWithResponseAsync(shareName, fileName, leaseId, timeout, requestId) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param leaseId Specifies the current lease ID on the resource. @@ -4327,12 +4502,13 @@ public Mono releaseLeaseAsync(String shareName, String fileName, String le public Mono releaseLeaseAsync(String shareName, String fileName, String leaseId, Integer timeout, String requestId, Context context) { return releaseLeaseWithResponseAsync(shareName, fileName, leaseId, timeout, requestId, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param leaseId Specifies the current lease ID on the resource. @@ -4352,14 +4528,16 @@ public Mono> releaseLeaseNoCustomHeadersWithResponseAsync(String final String comp = "lease"; final String action = "release"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.releaseLeaseNoCustomHeaders(this.client.getUrl(), shareName, - fileName, comp, action, timeout, leaseId, this.client.getVersion(), requestId, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.releaseLeaseNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, + action, timeout, leaseId, this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param leaseId Specifies the current lease ID on the resource. @@ -4380,14 +4558,16 @@ public Mono> releaseLeaseNoCustomHeadersWithResponseAsync(String final String comp = "lease"; final String action = "release"; final String accept = "application/xml"; - return service.releaseLeaseNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, action, timeout, - leaseId, this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + return service + .releaseLeaseNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, action, timeout, leaseId, + this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param leaseId Specifies the current lease ID on the resource. @@ -4408,14 +4588,18 @@ public ResponseBase releaseLeaseWithResponse(Str final String comp = "lease"; final String action = "release"; final String accept = "application/xml"; - return service.releaseLeaseSync(this.client.getUrl(), shareName, fileName, comp, action, timeout, leaseId, - this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), - accept, context); + try { + return service.releaseLeaseSync(this.client.getUrl(), shareName, fileName, comp, action, timeout, leaseId, + this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param leaseId Specifies the current lease ID on the resource. @@ -4435,7 +4619,7 @@ public void releaseLease(String shareName, String fileName, String leaseId, Inte /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param leaseId Specifies the current lease ID on the resource. @@ -4456,14 +4640,18 @@ public Response releaseLeaseNoCustomHeadersWithResponse(String shareName, final String comp = "lease"; final String action = "release"; final String accept = "application/xml"; - return service.releaseLeaseNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, action, timeout, - leaseId, this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + try { + return service.releaseLeaseNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, action, + timeout, leaseId, this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param leaseId Specifies the current lease ID on the resource. @@ -4486,14 +4674,16 @@ public Mono> changeLeaseWithResponse final String comp = "lease"; final String action = "change"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.changeLease(this.client.getUrl(), shareName, fileName, comp, - action, timeout, leaseId, proposedLeaseId, this.client.getVersion(), requestId, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.changeLease(this.client.getUrl(), shareName, fileName, comp, action, + timeout, leaseId, proposedLeaseId, this.client.getVersion(), requestId, + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param leaseId Specifies the current lease ID on the resource. @@ -4517,14 +4707,16 @@ public Mono> changeLeaseWithResponse final String comp = "lease"; final String action = "change"; final String accept = "application/xml"; - return service.changeLease(this.client.getUrl(), shareName, fileName, comp, action, timeout, leaseId, - proposedLeaseId, this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + return service + .changeLease(this.client.getUrl(), shareName, fileName, comp, action, timeout, leaseId, proposedLeaseId, + this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param leaseId Specifies the current lease ID on the resource. @@ -4545,12 +4737,13 @@ public Mono> changeLeaseWithResponse public Mono changeLeaseAsync(String shareName, String fileName, String leaseId, Integer timeout, String proposedLeaseId, String requestId) { return changeLeaseWithResponseAsync(shareName, fileName, leaseId, timeout, proposedLeaseId, requestId) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param leaseId Specifies the current lease ID on the resource. @@ -4572,12 +4765,13 @@ public Mono changeLeaseAsync(String shareName, String fileName, String lea public Mono changeLeaseAsync(String shareName, String fileName, String leaseId, Integer timeout, String proposedLeaseId, String requestId, Context context) { return changeLeaseWithResponseAsync(shareName, fileName, leaseId, timeout, proposedLeaseId, requestId, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param leaseId Specifies the current lease ID on the resource. @@ -4600,14 +4794,16 @@ public Mono> changeLeaseNoCustomHeadersWithResponseAsync(String s final String comp = "lease"; final String action = "change"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.changeLeaseNoCustomHeaders(this.client.getUrl(), shareName, - fileName, comp, action, timeout, leaseId, proposedLeaseId, this.client.getVersion(), requestId, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.changeLeaseNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, + action, timeout, leaseId, proposedLeaseId, this.client.getVersion(), requestId, + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param leaseId Specifies the current lease ID on the resource. @@ -4631,14 +4827,16 @@ public Mono> changeLeaseNoCustomHeadersWithResponseAsync(String s final String comp = "lease"; final String action = "change"; final String accept = "application/xml"; - return service.changeLeaseNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, action, timeout, - leaseId, proposedLeaseId, this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + return service + .changeLeaseNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, action, timeout, leaseId, + proposedLeaseId, this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param leaseId Specifies the current lease ID on the resource. @@ -4662,14 +4860,18 @@ public ResponseBase changeLeaseWithResponse(Strin final String comp = "lease"; final String action = "change"; final String accept = "application/xml"; - return service.changeLeaseSync(this.client.getUrl(), shareName, fileName, comp, action, timeout, leaseId, - proposedLeaseId, this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + try { + return service.changeLeaseSync(this.client.getUrl(), shareName, fileName, comp, action, timeout, leaseId, + proposedLeaseId, this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param leaseId Specifies the current lease ID on the resource. @@ -4693,7 +4895,7 @@ public void changeLease(String shareName, String fileName, String leaseId, Integ /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param leaseId Specifies the current lease ID on the resource. @@ -4717,14 +4919,18 @@ public Response changeLeaseNoCustomHeadersWithResponse(String shareName, S final String comp = "lease"; final String action = "change"; final String accept = "application/xml"; - return service.changeLeaseNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, action, timeout, - leaseId, proposedLeaseId, this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + try { + return service.changeLeaseNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, action, + timeout, leaseId, proposedLeaseId, this.client.getVersion(), requestId, + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -4744,14 +4950,16 @@ public Mono> breakLeaseWithResponseAs final String comp = "lease"; final String action = "break"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.breakLease(this.client.getUrl(), shareName, fileName, comp, - action, timeout, leaseId, this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.breakLease(this.client.getUrl(), shareName, fileName, comp, action, timeout, + leaseId, this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -4772,14 +4980,16 @@ public Mono> breakLeaseWithResponseAs final String comp = "lease"; final String action = "break"; final String accept = "application/xml"; - return service.breakLease(this.client.getUrl(), shareName, fileName, comp, action, timeout, leaseId, - this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), - accept, context); + return service + .breakLease(this.client.getUrl(), shareName, fileName, comp, action, timeout, leaseId, + this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -4797,12 +5007,13 @@ public Mono> breakLeaseWithResponseAs public Mono breakLeaseAsync(String shareName, String fileName, Integer timeout, String leaseId, String requestId) { return breakLeaseWithResponseAsync(shareName, fileName, timeout, leaseId, requestId) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -4821,12 +5032,13 @@ public Mono breakLeaseAsync(String shareName, String fileName, Integer tim public Mono breakLeaseAsync(String shareName, String fileName, Integer timeout, String leaseId, String requestId, Context context) { return breakLeaseWithResponseAsync(shareName, fileName, timeout, leaseId, requestId, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -4846,14 +5058,16 @@ public Mono> breakLeaseNoCustomHeadersWithResponseAsync(String sh final String comp = "lease"; final String action = "break"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.breakLeaseNoCustomHeaders(this.client.getUrl(), shareName, - fileName, comp, action, timeout, leaseId, this.client.getVersion(), requestId, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.breakLeaseNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, + action, timeout, leaseId, this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -4874,14 +5088,16 @@ public Mono> breakLeaseNoCustomHeadersWithResponseAsync(String sh final String comp = "lease"; final String action = "break"; final String accept = "application/xml"; - return service.breakLeaseNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, action, timeout, - leaseId, this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + return service + .breakLeaseNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, action, timeout, leaseId, + this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -4902,14 +5118,18 @@ public ResponseBase breakLeaseWithResponse(String final String comp = "lease"; final String action = "break"; final String accept = "application/xml"; - return service.breakLeaseSync(this.client.getUrl(), shareName, fileName, comp, action, timeout, leaseId, - this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), - accept, context); + try { + return service.breakLeaseSync(this.client.getUrl(), shareName, fileName, comp, action, timeout, leaseId, + this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -4929,7 +5149,7 @@ public void breakLease(String shareName, String fileName, Integer timeout, Strin /** * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -4950,14 +5170,18 @@ public Response breakLeaseNoCustomHeadersWithResponse(String shareName, St final String comp = "lease"; final String action = "break"; final String accept = "application/xml"; - return service.breakLeaseNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, action, timeout, - leaseId, this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + try { + return service.breakLeaseNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, action, + timeout, leaseId, this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Upload a range of bytes to a file where the contents are read from a URL. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param range Writes data to the specified byte range in the file. @@ -5011,12 +5235,13 @@ public Mono> uploadRangeFromU range, copySource, sourceRange, fileRangeWriteFromUrl, contentLength, sourceContentCrc64Converted, sourceIfMatchCrc64Converted, sourceIfNoneMatchCrc64Converted, this.client.getVersion(), leaseId, copySourceAuthorization, fileLastWrittenMode, this.client.isAllowTrailingDot(), - this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context)); + this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Upload a range of bytes to a file where the contents are read from a URL. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param range Writes data to the specified byte range in the file. @@ -5067,16 +5292,18 @@ public Mono> uploadRangeFromU String sourceContentCrc64Converted = Base64Util.encodeToString(sourceContentCrc64); String sourceIfMatchCrc64Converted = Base64Util.encodeToString(sourceIfMatchCrc64); String sourceIfNoneMatchCrc64Converted = Base64Util.encodeToString(sourceIfNoneMatchCrc64); - return service.uploadRangeFromURL(this.client.getUrl(), shareName, fileName, comp, timeout, range, copySource, - sourceRange, fileRangeWriteFromUrl, contentLength, sourceContentCrc64Converted, sourceIfMatchCrc64Converted, - sourceIfNoneMatchCrc64Converted, this.client.getVersion(), leaseId, copySourceAuthorization, - fileLastWrittenMode, this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + return service + .uploadRangeFromURL(this.client.getUrl(), shareName, fileName, comp, timeout, range, copySource, + sourceRange, fileRangeWriteFromUrl, contentLength, sourceContentCrc64Converted, + sourceIfMatchCrc64Converted, sourceIfNoneMatchCrc64Converted, this.client.getVersion(), leaseId, + copySourceAuthorization, fileLastWrittenMode, this.client.isAllowTrailingDot(), + this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Upload a range of bytes to a file where the contents are read from a URL. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param range Writes data to the specified byte range in the file. @@ -5111,12 +5338,14 @@ public Mono uploadRangeFromURLAsync(String shareName, String fileName, Str SourceModifiedAccessConditions sourceModifiedAccessConditions) { return uploadRangeFromURLWithResponseAsync(shareName, fileName, range, copySource, contentLength, timeout, sourceRange, sourceContentCrc64, leaseId, copySourceAuthorization, fileLastWrittenMode, - sourceModifiedAccessConditions).flatMap(ignored -> Mono.empty()); + sourceModifiedAccessConditions) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Upload a range of bytes to a file where the contents are read from a URL. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param range Writes data to the specified byte range in the file. @@ -5152,12 +5381,14 @@ public Mono uploadRangeFromURLAsync(String shareName, String fileName, Str SourceModifiedAccessConditions sourceModifiedAccessConditions, Context context) { return uploadRangeFromURLWithResponseAsync(shareName, fileName, range, copySource, contentLength, timeout, sourceRange, sourceContentCrc64, leaseId, copySourceAuthorization, fileLastWrittenMode, - sourceModifiedAccessConditions, context).flatMap(ignored -> Mono.empty()); + sourceModifiedAccessConditions, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Upload a range of bytes to a file where the contents are read from a URL. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param range Writes data to the specified byte range in the file. @@ -5206,17 +5437,19 @@ public Mono> uploadRangeFromURLNoCustomHeadersWithResponseAsync(S String sourceContentCrc64Converted = Base64Util.encodeToString(sourceContentCrc64); String sourceIfMatchCrc64Converted = Base64Util.encodeToString(sourceIfMatchCrc64); String sourceIfNoneMatchCrc64Converted = Base64Util.encodeToString(sourceIfNoneMatchCrc64); - return FluxUtil.withContext(context -> service.uploadRangeFromURLNoCustomHeaders(this.client.getUrl(), - shareName, fileName, comp, timeout, range, copySource, sourceRange, fileRangeWriteFromUrl, contentLength, - sourceContentCrc64Converted, sourceIfMatchCrc64Converted, sourceIfNoneMatchCrc64Converted, - this.client.getVersion(), leaseId, copySourceAuthorization, fileLastWrittenMode, - this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.uploadRangeFromURLNoCustomHeaders(this.client.getUrl(), shareName, fileName, + comp, timeout, range, copySource, sourceRange, fileRangeWriteFromUrl, contentLength, + sourceContentCrc64Converted, sourceIfMatchCrc64Converted, sourceIfNoneMatchCrc64Converted, + this.client.getVersion(), leaseId, copySourceAuthorization, fileLastWrittenMode, + this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Upload a range of bytes to a file where the contents are read from a URL. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param range Writes data to the specified byte range in the file. @@ -5267,16 +5500,18 @@ public Mono> uploadRangeFromURLNoCustomHeadersWithResponseAsync(S String sourceContentCrc64Converted = Base64Util.encodeToString(sourceContentCrc64); String sourceIfMatchCrc64Converted = Base64Util.encodeToString(sourceIfMatchCrc64); String sourceIfNoneMatchCrc64Converted = Base64Util.encodeToString(sourceIfNoneMatchCrc64); - return service.uploadRangeFromURLNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, timeout, - range, copySource, sourceRange, fileRangeWriteFromUrl, contentLength, sourceContentCrc64Converted, - sourceIfMatchCrc64Converted, sourceIfNoneMatchCrc64Converted, this.client.getVersion(), leaseId, - copySourceAuthorization, fileLastWrittenMode, this.client.isAllowTrailingDot(), - this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context); + return service + .uploadRangeFromURLNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, timeout, range, + copySource, sourceRange, fileRangeWriteFromUrl, contentLength, sourceContentCrc64Converted, + sourceIfMatchCrc64Converted, sourceIfNoneMatchCrc64Converted, this.client.getVersion(), leaseId, + copySourceAuthorization, fileLastWrittenMode, this.client.isAllowTrailingDot(), + this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Upload a range of bytes to a file where the contents are read from a URL. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param range Writes data to the specified byte range in the file. @@ -5327,16 +5562,20 @@ public ResponseBase uploadRangeFromURLWith String sourceContentCrc64Converted = Base64Util.encodeToString(sourceContentCrc64); String sourceIfMatchCrc64Converted = Base64Util.encodeToString(sourceIfMatchCrc64); String sourceIfNoneMatchCrc64Converted = Base64Util.encodeToString(sourceIfNoneMatchCrc64); - return service.uploadRangeFromURLSync(this.client.getUrl(), shareName, fileName, comp, timeout, range, - copySource, sourceRange, fileRangeWriteFromUrl, contentLength, sourceContentCrc64Converted, - sourceIfMatchCrc64Converted, sourceIfNoneMatchCrc64Converted, this.client.getVersion(), leaseId, - copySourceAuthorization, fileLastWrittenMode, this.client.isAllowTrailingDot(), - this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context); + try { + return service.uploadRangeFromURLSync(this.client.getUrl(), shareName, fileName, comp, timeout, range, + copySource, sourceRange, fileRangeWriteFromUrl, contentLength, sourceContentCrc64Converted, + sourceIfMatchCrc64Converted, sourceIfNoneMatchCrc64Converted, this.client.getVersion(), leaseId, + copySourceAuthorization, fileLastWrittenMode, this.client.isAllowTrailingDot(), + this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Upload a range of bytes to a file where the contents are read from a URL. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param range Writes data to the specified byte range in the file. @@ -5375,7 +5614,7 @@ public void uploadRangeFromURL(String shareName, String fileName, String range, /** * Upload a range of bytes to a file where the contents are read from a URL. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param range Writes data to the specified byte range in the file. @@ -5425,16 +5664,21 @@ public Response uploadRangeFromURLNoCustomHeadersWithResponse(String share String sourceContentCrc64Converted = Base64Util.encodeToString(sourceContentCrc64); String sourceIfMatchCrc64Converted = Base64Util.encodeToString(sourceIfMatchCrc64); String sourceIfNoneMatchCrc64Converted = Base64Util.encodeToString(sourceIfNoneMatchCrc64); - return service.uploadRangeFromURLNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, timeout, - range, copySource, sourceRange, fileRangeWriteFromUrl, contentLength, sourceContentCrc64Converted, - sourceIfMatchCrc64Converted, sourceIfNoneMatchCrc64Converted, this.client.getVersion(), leaseId, - copySourceAuthorization, fileLastWrittenMode, this.client.isAllowTrailingDot(), - this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context); + try { + return service.uploadRangeFromURLNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, + timeout, range, copySource, sourceRange, fileRangeWriteFromUrl, contentLength, + sourceContentCrc64Converted, sourceIfMatchCrc64Converted, sourceIfNoneMatchCrc64Converted, + this.client.getVersion(), leaseId, copySourceAuthorization, fileLastWrittenMode, + this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Returns the list of valid ranges for a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share @@ -5462,14 +5706,16 @@ public Mono> getRange String range, String leaseId, Boolean supportRename) { final String comp = "rangelist"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getRangeList(this.client.getUrl(), shareName, fileName, comp, - sharesnapshot, prevsharesnapshot, timeout, this.client.getVersion(), range, leaseId, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), supportRename, accept, context)); + return FluxUtil + .withContext(context -> service.getRangeList(this.client.getUrl(), shareName, fileName, comp, sharesnapshot, + prevsharesnapshot, timeout, this.client.getVersion(), range, leaseId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), supportRename, accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Returns the list of valid ranges for a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share @@ -5498,14 +5744,16 @@ public Mono> getRange String range, String leaseId, Boolean supportRename, Context context) { final String comp = "rangelist"; final String accept = "application/xml"; - return service.getRangeList(this.client.getUrl(), shareName, fileName, comp, sharesnapshot, prevsharesnapshot, - timeout, this.client.getVersion(), range, leaseId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), supportRename, accept, context); + return service + .getRangeList(this.client.getUrl(), shareName, fileName, comp, sharesnapshot, prevsharesnapshot, timeout, + this.client.getVersion(), range, leaseId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), supportRename, accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Returns the list of valid ranges for a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share @@ -5531,12 +5779,14 @@ public Mono> getRange public Mono getRangeListAsync(String shareName, String fileName, String sharesnapshot, String prevsharesnapshot, Integer timeout, String range, String leaseId, Boolean supportRename) { return getRangeListWithResponseAsync(shareName, fileName, sharesnapshot, prevsharesnapshot, timeout, range, - leaseId, supportRename).flatMap(res -> Mono.justOrEmpty(res.getValue())); + leaseId, supportRename) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Returns the list of valid ranges for a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share @@ -5564,12 +5814,14 @@ public Mono getRangeListAsync(String shareName, String fileN String prevsharesnapshot, Integer timeout, String range, String leaseId, Boolean supportRename, Context context) { return getRangeListWithResponseAsync(shareName, fileName, sharesnapshot, prevsharesnapshot, timeout, range, - leaseId, supportRename, context).flatMap(res -> Mono.justOrEmpty(res.getValue())); + leaseId, supportRename, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Returns the list of valid ranges for a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share @@ -5597,14 +5849,16 @@ public Mono> getRangeListNoCustomHeadersWithRespons Boolean supportRename) { final String comp = "rangelist"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getRangeListNoCustomHeaders(this.client.getUrl(), shareName, - fileName, comp, sharesnapshot, prevsharesnapshot, timeout, this.client.getVersion(), range, leaseId, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), supportRename, accept, context)); + return FluxUtil + .withContext(context -> service.getRangeListNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, + sharesnapshot, prevsharesnapshot, timeout, this.client.getVersion(), range, leaseId, + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), supportRename, accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Returns the list of valid ranges for a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share @@ -5633,14 +5887,16 @@ public Mono> getRangeListNoCustomHeadersWithRespons Boolean supportRename, Context context) { final String comp = "rangelist"; final String accept = "application/xml"; - return service.getRangeListNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, sharesnapshot, - prevsharesnapshot, timeout, this.client.getVersion(), range, leaseId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), supportRename, accept, context); + return service + .getRangeListNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, sharesnapshot, + prevsharesnapshot, timeout, this.client.getVersion(), range, leaseId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), supportRename, accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Returns the list of valid ranges for a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share @@ -5669,14 +5925,18 @@ public ResponseBase getRangeListWi Boolean supportRename, Context context) { final String comp = "rangelist"; final String accept = "application/xml"; - return service.getRangeListSync(this.client.getUrl(), shareName, fileName, comp, sharesnapshot, - prevsharesnapshot, timeout, this.client.getVersion(), range, leaseId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), supportRename, accept, context); + try { + return service.getRangeListSync(this.client.getUrl(), shareName, fileName, comp, sharesnapshot, + prevsharesnapshot, timeout, this.client.getVersion(), range, leaseId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), supportRename, accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Returns the list of valid ranges for a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share @@ -5701,13 +5961,17 @@ public ResponseBase getRangeListWi @ServiceMethod(returns = ReturnType.SINGLE) public ShareFileRangeList getRangeList(String shareName, String fileName, String sharesnapshot, String prevsharesnapshot, Integer timeout, String range, String leaseId, Boolean supportRename) { - return getRangeListWithResponse(shareName, fileName, sharesnapshot, prevsharesnapshot, timeout, range, leaseId, - supportRename, Context.NONE).getValue(); + try { + return getRangeListWithResponse(shareName, fileName, sharesnapshot, prevsharesnapshot, timeout, range, + leaseId, supportRename, Context.NONE).getValue(); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Returns the list of valid ranges for a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share @@ -5736,14 +6000,18 @@ public Response getRangeListNoCustomHeadersWithResponse(Stri Boolean supportRename, Context context) { final String comp = "rangelist"; final String accept = "application/xml"; - return service.getRangeListNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, sharesnapshot, - prevsharesnapshot, timeout, this.client.getVersion(), range, leaseId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), supportRename, accept, context); + try { + return service.getRangeListNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, + sharesnapshot, prevsharesnapshot, timeout, this.client.getVersion(), range, leaseId, + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), supportRename, accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Copies a blob or file to a destination file within the storage account. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param copySource Specifies the URL of the source file or blob, up to 2 KB in length. To copy a file to another @@ -5809,16 +6077,18 @@ public Mono> startCopyWithResponseAsyn setArchiveAttributeInternal = copyFileSmbInfo.isSetArchiveAttribute(); } Boolean setArchiveAttribute = setArchiveAttributeInternal; - return FluxUtil.withContext(context -> service.startCopy(this.client.getUrl(), shareName, fileName, timeout, - this.client.getVersion(), metadata, copySource, filePermission, filePermissionKey, filePermissionCopyMode, - ignoreReadOnly, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, setArchiveAttribute, - leaseId, this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.startCopy(this.client.getUrl(), shareName, fileName, timeout, + this.client.getVersion(), metadata, copySource, filePermission, filePermissionKey, + filePermissionCopyMode, ignoreReadOnly, fileAttributes, fileCreationTime, fileLastWriteTime, + fileChangeTime, setArchiveAttribute, leaseId, this.client.isAllowTrailingDot(), + this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Copies a blob or file to a destination file within the storage account. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param copySource Specifies the URL of the source file or blob, up to 2 KB in length. To copy a file to another @@ -5885,16 +6155,18 @@ public Mono> startCopyWithResponseAsyn setArchiveAttributeInternal = copyFileSmbInfo.isSetArchiveAttribute(); } Boolean setArchiveAttribute = setArchiveAttributeInternal; - return service.startCopy(this.client.getUrl(), shareName, fileName, timeout, this.client.getVersion(), metadata, - copySource, filePermission, filePermissionKey, filePermissionCopyMode, ignoreReadOnly, fileAttributes, - fileCreationTime, fileLastWriteTime, fileChangeTime, setArchiveAttribute, leaseId, - this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + return service + .startCopy(this.client.getUrl(), shareName, fileName, timeout, this.client.getVersion(), metadata, + copySource, filePermission, filePermissionKey, filePermissionCopyMode, ignoreReadOnly, fileAttributes, + fileCreationTime, fileLastWriteTime, fileChangeTime, setArchiveAttribute, leaseId, + this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Copies a blob or file to a destination file within the storage account. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param copySource Specifies the URL of the source file or blob, up to 2 KB in length. To copy a file to another @@ -5925,12 +6197,14 @@ public Mono startCopyAsync(String shareName, String fileName, String copyS Map metadata, String filePermission, String filePermissionKey, String leaseId, CopyFileSmbInfo copyFileSmbInfo) { return startCopyWithResponseAsync(shareName, fileName, copySource, timeout, metadata, filePermission, - filePermissionKey, leaseId, copyFileSmbInfo).flatMap(ignored -> Mono.empty()); + filePermissionKey, leaseId, copyFileSmbInfo) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Copies a blob or file to a destination file within the storage account. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param copySource Specifies the URL of the source file or blob, up to 2 KB in length. To copy a file to another @@ -5962,12 +6236,14 @@ public Mono startCopyAsync(String shareName, String fileName, String copyS Map metadata, String filePermission, String filePermissionKey, String leaseId, CopyFileSmbInfo copyFileSmbInfo, Context context) { return startCopyWithResponseAsync(shareName, fileName, copySource, timeout, metadata, filePermission, - filePermissionKey, leaseId, copyFileSmbInfo, context).flatMap(ignored -> Mono.empty()); + filePermissionKey, leaseId, copyFileSmbInfo, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Copies a blob or file to a destination file within the storage account. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param copySource Specifies the URL of the source file or blob, up to 2 KB in length. To copy a file to another @@ -6033,16 +6309,18 @@ public Mono> startCopyNoCustomHeadersWithResponseAsync(String sha setArchiveAttributeInternal = copyFileSmbInfo.isSetArchiveAttribute(); } Boolean setArchiveAttribute = setArchiveAttributeInternal; - return FluxUtil.withContext(context -> service.startCopyNoCustomHeaders(this.client.getUrl(), shareName, - fileName, timeout, this.client.getVersion(), metadata, copySource, filePermission, filePermissionKey, - filePermissionCopyMode, ignoreReadOnly, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, - setArchiveAttribute, leaseId, this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.startCopyNoCustomHeaders(this.client.getUrl(), shareName, fileName, timeout, + this.client.getVersion(), metadata, copySource, filePermission, filePermissionKey, + filePermissionCopyMode, ignoreReadOnly, fileAttributes, fileCreationTime, fileLastWriteTime, + fileChangeTime, setArchiveAttribute, leaseId, this.client.isAllowTrailingDot(), + this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Copies a blob or file to a destination file within the storage account. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param copySource Specifies the URL of the source file or blob, up to 2 KB in length. To copy a file to another @@ -6109,16 +6387,18 @@ public Mono> startCopyNoCustomHeadersWithResponseAsync(String sha setArchiveAttributeInternal = copyFileSmbInfo.isSetArchiveAttribute(); } Boolean setArchiveAttribute = setArchiveAttributeInternal; - return service.startCopyNoCustomHeaders(this.client.getUrl(), shareName, fileName, timeout, - this.client.getVersion(), metadata, copySource, filePermission, filePermissionKey, filePermissionCopyMode, - ignoreReadOnly, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, setArchiveAttribute, - leaseId, this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + return service + .startCopyNoCustomHeaders(this.client.getUrl(), shareName, fileName, timeout, this.client.getVersion(), + metadata, copySource, filePermission, filePermissionKey, filePermissionCopyMode, ignoreReadOnly, + fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, setArchiveAttribute, leaseId, + this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Copies a blob or file to a destination file within the storage account. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param copySource Specifies the URL of the source file or blob, up to 2 KB in length. To copy a file to another @@ -6185,16 +6465,20 @@ public ResponseBase startCopyWithResponse(String sh setArchiveAttributeInternal = copyFileSmbInfo.isSetArchiveAttribute(); } Boolean setArchiveAttribute = setArchiveAttributeInternal; - return service.startCopySync(this.client.getUrl(), shareName, fileName, timeout, this.client.getVersion(), - metadata, copySource, filePermission, filePermissionKey, filePermissionCopyMode, ignoreReadOnly, - fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, setArchiveAttribute, leaseId, - this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + try { + return service.startCopySync(this.client.getUrl(), shareName, fileName, timeout, this.client.getVersion(), + metadata, copySource, filePermission, filePermissionKey, filePermissionCopyMode, ignoreReadOnly, + fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, setArchiveAttribute, leaseId, + this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Copies a blob or file to a destination file within the storage account. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param copySource Specifies the URL of the source file or blob, up to 2 KB in length. To copy a file to another @@ -6229,7 +6513,7 @@ public void startCopy(String shareName, String fileName, String copySource, Inte /** * Copies a blob or file to a destination file within the storage account. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param copySource Specifies the URL of the source file or blob, up to 2 KB in length. To copy a file to another @@ -6296,16 +6580,20 @@ public Response startCopyNoCustomHeadersWithResponse(String shareName, Str setArchiveAttributeInternal = copyFileSmbInfo.isSetArchiveAttribute(); } Boolean setArchiveAttribute = setArchiveAttributeInternal; - return service.startCopyNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, timeout, - this.client.getVersion(), metadata, copySource, filePermission, filePermissionKey, filePermissionCopyMode, - ignoreReadOnly, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, setArchiveAttribute, - leaseId, this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + try { + return service.startCopyNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, timeout, + this.client.getVersion(), metadata, copySource, filePermission, filePermissionKey, + filePermissionCopyMode, ignoreReadOnly, fileAttributes, fileCreationTime, fileLastWriteTime, + fileChangeTime, setArchiveAttribute, leaseId, this.client.isAllowTrailingDot(), + this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Aborts a pending Copy File operation, and leaves a destination file with zero length and full metadata. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy File operation. @@ -6324,14 +6612,16 @@ public Mono> abortCopyWithResponseAsyn final String comp = "copy"; final String copyActionAbortConstant = "abort"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.abortCopy(this.client.getUrl(), shareName, fileName, comp, - copyId, timeout, copyActionAbortConstant, this.client.getVersion(), leaseId, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.abortCopy(this.client.getUrl(), shareName, fileName, comp, copyId, timeout, + copyActionAbortConstant, this.client.getVersion(), leaseId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Aborts a pending Copy File operation, and leaves a destination file with zero length and full metadata. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy File operation. @@ -6351,14 +6641,16 @@ public Mono> abortCopyWithResponseAsyn final String comp = "copy"; final String copyActionAbortConstant = "abort"; final String accept = "application/xml"; - return service.abortCopy(this.client.getUrl(), shareName, fileName, comp, copyId, timeout, - copyActionAbortConstant, this.client.getVersion(), leaseId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + return service + .abortCopy(this.client.getUrl(), shareName, fileName, comp, copyId, timeout, copyActionAbortConstant, + this.client.getVersion(), leaseId, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), + accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Aborts a pending Copy File operation, and leaves a destination file with zero length and full metadata. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy File operation. @@ -6375,12 +6667,13 @@ public Mono> abortCopyWithResponseAsyn public Mono abortCopyAsync(String shareName, String fileName, String copyId, Integer timeout, String leaseId) { return abortCopyWithResponseAsync(shareName, fileName, copyId, timeout, leaseId) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * Aborts a pending Copy File operation, and leaves a destination file with zero length and full metadata. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy File operation. @@ -6398,12 +6691,13 @@ public Mono abortCopyAsync(String shareName, String fileName, String copyI public Mono abortCopyAsync(String shareName, String fileName, String copyId, Integer timeout, String leaseId, Context context) { return abortCopyWithResponseAsync(shareName, fileName, copyId, timeout, leaseId, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * Aborts a pending Copy File operation, and leaves a destination file with zero length and full metadata. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy File operation. @@ -6422,14 +6716,16 @@ public Mono> abortCopyNoCustomHeadersWithResponseAsync(String sha final String comp = "copy"; final String copyActionAbortConstant = "abort"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.abortCopyNoCustomHeaders(this.client.getUrl(), shareName, - fileName, comp, copyId, timeout, copyActionAbortConstant, this.client.getVersion(), leaseId, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.abortCopyNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, + copyId, timeout, copyActionAbortConstant, this.client.getVersion(), leaseId, + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Aborts a pending Copy File operation, and leaves a destination file with zero length and full metadata. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy File operation. @@ -6449,14 +6745,16 @@ public Mono> abortCopyNoCustomHeadersWithResponseAsync(String sha final String comp = "copy"; final String copyActionAbortConstant = "abort"; final String accept = "application/xml"; - return service.abortCopyNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, copyId, timeout, - copyActionAbortConstant, this.client.getVersion(), leaseId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + return service + .abortCopyNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, copyId, timeout, + copyActionAbortConstant, this.client.getVersion(), leaseId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Aborts a pending Copy File operation, and leaves a destination file with zero length and full metadata. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy File operation. @@ -6476,14 +6774,18 @@ public ResponseBase abortCopyWithResponse(String sh final String comp = "copy"; final String copyActionAbortConstant = "abort"; final String accept = "application/xml"; - return service.abortCopySync(this.client.getUrl(), shareName, fileName, comp, copyId, timeout, - copyActionAbortConstant, this.client.getVersion(), leaseId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + try { + return service.abortCopySync(this.client.getUrl(), shareName, fileName, comp, copyId, timeout, + copyActionAbortConstant, this.client.getVersion(), leaseId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Aborts a pending Copy File operation, and leaves a destination file with zero length and full metadata. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy File operation. @@ -6502,7 +6804,7 @@ public void abortCopy(String shareName, String fileName, String copyId, Integer /** * Aborts a pending Copy File operation, and leaves a destination file with zero length and full metadata. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy File operation. @@ -6522,14 +6824,18 @@ public Response abortCopyNoCustomHeadersWithResponse(String shareName, Str final String comp = "copy"; final String copyActionAbortConstant = "abort"; final String accept = "application/xml"; - return service.abortCopyNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, copyId, timeout, - copyActionAbortConstant, this.client.getVersion(), leaseId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + try { + return service.abortCopyNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, copyId, + timeout, copyActionAbortConstant, this.client.getVersion(), leaseId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Lists handles for file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. @@ -6553,14 +6859,16 @@ public Mono> listHand String shareName, String fileName, String marker, Integer maxresults, Integer timeout, String sharesnapshot) { final String comp = "listhandles"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.listHandles(this.client.getUrl(), shareName, fileName, comp, - marker, maxresults, timeout, sharesnapshot, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.listHandles(this.client.getUrl(), shareName, fileName, comp, marker, + maxresults, timeout, sharesnapshot, this.client.getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Lists handles for file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. @@ -6586,14 +6894,16 @@ public Mono> listHand Context context) { final String comp = "listhandles"; final String accept = "application/xml"; - return service.listHandles(this.client.getUrl(), shareName, fileName, comp, marker, maxresults, timeout, - sharesnapshot, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + return service + .listHandles(this.client.getUrl(), shareName, fileName, comp, marker, maxresults, timeout, sharesnapshot, + this.client.getVersion(), this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, + context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Lists handles for file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. @@ -6616,12 +6926,13 @@ public Mono> listHand public Mono listHandlesAsync(String shareName, String fileName, String marker, Integer maxresults, Integer timeout, String sharesnapshot) { return listHandlesWithResponseAsync(shareName, fileName, marker, maxresults, timeout, sharesnapshot) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Lists handles for file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. @@ -6645,12 +6956,13 @@ public Mono listHandlesAsync(String shareName, String fileN public Mono listHandlesAsync(String shareName, String fileName, String marker, Integer maxresults, Integer timeout, String sharesnapshot, Context context) { return listHandlesWithResponseAsync(shareName, fileName, marker, maxresults, timeout, sharesnapshot, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Lists handles for file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. @@ -6674,14 +6986,16 @@ public Mono> listHandlesNoCustomHeadersWithRespons String fileName, String marker, Integer maxresults, Integer timeout, String sharesnapshot) { final String comp = "listhandles"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.listHandlesNoCustomHeaders(this.client.getUrl(), shareName, - fileName, comp, marker, maxresults, timeout, sharesnapshot, this.client.getVersion(), - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.listHandlesNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, + marker, maxresults, timeout, sharesnapshot, this.client.getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Lists handles for file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. @@ -6706,14 +7020,16 @@ public Mono> listHandlesNoCustomHeadersWithRespons String fileName, String marker, Integer maxresults, Integer timeout, String sharesnapshot, Context context) { final String comp = "listhandles"; final String accept = "application/xml"; - return service.listHandlesNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, marker, maxresults, - timeout, sharesnapshot, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + return service + .listHandlesNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, marker, maxresults, timeout, + sharesnapshot, this.client.getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Lists handles for file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. @@ -6738,14 +7054,18 @@ public ResponseBase listHandlesWit String fileName, String marker, Integer maxresults, Integer timeout, String sharesnapshot, Context context) { final String comp = "listhandles"; final String accept = "application/xml"; - return service.listHandlesSync(this.client.getUrl(), shareName, fileName, comp, marker, maxresults, timeout, - sharesnapshot, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + try { + return service.listHandlesSync(this.client.getUrl(), shareName, fileName, comp, marker, maxresults, timeout, + sharesnapshot, this.client.getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Lists handles for file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. @@ -6767,13 +7087,17 @@ public ResponseBase listHandlesWit @ServiceMethod(returns = ReturnType.SINGLE) public ListHandlesResponse listHandles(String shareName, String fileName, String marker, Integer maxresults, Integer timeout, String sharesnapshot) { - return listHandlesWithResponse(shareName, fileName, marker, maxresults, timeout, sharesnapshot, Context.NONE) - .getValue(); + try { + return listHandlesWithResponse(shareName, fileName, marker, maxresults, timeout, sharesnapshot, + Context.NONE).getValue(); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Lists handles for file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. @@ -6798,14 +7122,18 @@ public Response listHandlesNoCustomHeadersWithResponse(Stri String marker, Integer maxresults, Integer timeout, String sharesnapshot, Context context) { final String comp = "listhandles"; final String accept = "application/xml"; - return service.listHandlesNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, marker, - maxresults, timeout, sharesnapshot, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + try { + return service.listHandlesNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, marker, + maxresults, timeout, sharesnapshot, this.client.getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Closes all handles open for given file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard @@ -6829,14 +7157,16 @@ public Mono> forceCloseHandles String fileName, String handleId, Integer timeout, String marker, String sharesnapshot) { final String comp = "forceclosehandles"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.forceCloseHandles(this.client.getUrl(), shareName, fileName, - comp, timeout, marker, sharesnapshot, handleId, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.forceCloseHandles(this.client.getUrl(), shareName, fileName, comp, timeout, + marker, sharesnapshot, handleId, this.client.getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Closes all handles open for given file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard @@ -6861,14 +7191,16 @@ public Mono> forceCloseHandles String fileName, String handleId, Integer timeout, String marker, String sharesnapshot, Context context) { final String comp = "forceclosehandles"; final String accept = "application/xml"; - return service.forceCloseHandles(this.client.getUrl(), shareName, fileName, comp, timeout, marker, - sharesnapshot, handleId, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + return service + .forceCloseHandles(this.client.getUrl(), shareName, fileName, comp, timeout, marker, sharesnapshot, + handleId, this.client.getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Closes all handles open for given file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard @@ -6891,12 +7223,13 @@ public Mono> forceCloseHandles public Mono forceCloseHandlesAsync(String shareName, String fileName, String handleId, Integer timeout, String marker, String sharesnapshot) { return forceCloseHandlesWithResponseAsync(shareName, fileName, handleId, timeout, marker, sharesnapshot) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * Closes all handles open for given file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard @@ -6920,12 +7253,13 @@ public Mono forceCloseHandlesAsync(String shareName, String fileName, Stri public Mono forceCloseHandlesAsync(String shareName, String fileName, String handleId, Integer timeout, String marker, String sharesnapshot, Context context) { return forceCloseHandlesWithResponseAsync(shareName, fileName, handleId, timeout, marker, sharesnapshot, - context).flatMap(ignored -> Mono.empty()); + context).onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Closes all handles open for given file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard @@ -6949,14 +7283,16 @@ public Mono> forceCloseHandlesNoCustomHeadersWithResponseAsync(St String handleId, Integer timeout, String marker, String sharesnapshot) { final String comp = "forceclosehandles"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.forceCloseHandlesNoCustomHeaders(this.client.getUrl(), shareName, - fileName, comp, timeout, marker, sharesnapshot, handleId, this.client.getVersion(), - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.forceCloseHandlesNoCustomHeaders(this.client.getUrl(), shareName, fileName, + comp, timeout, marker, sharesnapshot, handleId, this.client.getVersion(), + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Closes all handles open for given file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard @@ -6981,14 +7317,16 @@ public Mono> forceCloseHandlesNoCustomHeadersWithResponseAsync(St String handleId, Integer timeout, String marker, String sharesnapshot, Context context) { final String comp = "forceclosehandles"; final String accept = "application/xml"; - return service.forceCloseHandlesNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, timeout, - marker, sharesnapshot, handleId, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + return service + .forceCloseHandlesNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, timeout, marker, + sharesnapshot, handleId, this.client.getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Closes all handles open for given file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard @@ -7013,14 +7351,18 @@ public ResponseBase forceCloseHandlesWithRe String fileName, String handleId, Integer timeout, String marker, String sharesnapshot, Context context) { final String comp = "forceclosehandles"; final String accept = "application/xml"; - return service.forceCloseHandlesSync(this.client.getUrl(), shareName, fileName, comp, timeout, marker, - sharesnapshot, handleId, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + try { + return service.forceCloseHandlesSync(this.client.getUrl(), shareName, fileName, comp, timeout, marker, + sharesnapshot, handleId, this.client.getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Closes all handles open for given file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard @@ -7046,7 +7388,7 @@ public void forceCloseHandles(String shareName, String fileName, String handleId /** * Closes all handles open for given file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard @@ -7071,14 +7413,18 @@ public Response forceCloseHandlesNoCustomHeadersWithResponse(String shareN String handleId, Integer timeout, String marker, String sharesnapshot, Context context) { final String comp = "forceclosehandles"; final String accept = "application/xml"; - return service.forceCloseHandlesNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, timeout, - marker, sharesnapshot, handleId, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + try { + return service.forceCloseHandlesNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, + timeout, marker, sharesnapshot, handleId, this.client.getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Renames a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. @@ -7158,16 +7504,18 @@ public Mono> renameWithResponseAsync(Stri contentTypeInternal = shareFileHttpHeaders.getContentType(); } String contentType = contentTypeInternal; - return FluxUtil.withContext(context -> service.rename(this.client.getUrl(), shareName, fileName, comp, timeout, - this.client.getVersion(), renameSource, replaceIfExists, ignoreReadOnly, sourceLeaseId, destinationLeaseId, - fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, filePermission, filePermissionFormat, - filePermissionKey, metadata, contentType, this.client.isAllowTrailingDot(), - this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.rename(this.client.getUrl(), shareName, fileName, comp, timeout, + this.client.getVersion(), renameSource, replaceIfExists, ignoreReadOnly, sourceLeaseId, + destinationLeaseId, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, filePermission, + filePermissionFormat, filePermissionKey, metadata, contentType, this.client.isAllowTrailingDot(), + this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Renames a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. @@ -7248,16 +7596,18 @@ public Mono> renameWithResponseAsync(Stri contentTypeInternal = shareFileHttpHeaders.getContentType(); } String contentType = contentTypeInternal; - return service.rename(this.client.getUrl(), shareName, fileName, comp, timeout, this.client.getVersion(), - renameSource, replaceIfExists, ignoreReadOnly, sourceLeaseId, destinationLeaseId, fileAttributes, - fileCreationTime, fileLastWriteTime, fileChangeTime, filePermission, filePermissionFormat, - filePermissionKey, metadata, contentType, this.client.isAllowTrailingDot(), - this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context); + return service + .rename(this.client.getUrl(), shareName, fileName, comp, timeout, this.client.getVersion(), renameSource, + replaceIfExists, ignoreReadOnly, sourceLeaseId, destinationLeaseId, fileAttributes, fileCreationTime, + fileLastWriteTime, fileChangeTime, filePermission, filePermissionFormat, filePermissionKey, metadata, + contentType, this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Renames a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. @@ -7302,12 +7652,14 @@ public Mono renameAsync(String shareName, String fileName, String renameSo ShareFileHttpHeaders shareFileHttpHeaders) { return renameWithResponseAsync(shareName, fileName, renameSource, timeout, replaceIfExists, ignoreReadOnly, filePermission, filePermissionFormat, filePermissionKey, metadata, sourceLeaseAccessConditions, - destinationLeaseAccessConditions, copyFileSmbInfo, shareFileHttpHeaders).flatMap(ignored -> Mono.empty()); + destinationLeaseAccessConditions, copyFileSmbInfo, shareFileHttpHeaders) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Renames a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. @@ -7354,12 +7706,13 @@ public Mono renameAsync(String shareName, String fileName, String renameSo return renameWithResponseAsync(shareName, fileName, renameSource, timeout, replaceIfExists, ignoreReadOnly, filePermission, filePermissionFormat, filePermissionKey, metadata, sourceLeaseAccessConditions, destinationLeaseAccessConditions, copyFileSmbInfo, shareFileHttpHeaders, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * Renames a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. @@ -7439,16 +7792,18 @@ public Mono> renameNoCustomHeadersWithResponseAsync(String shareN contentTypeInternal = shareFileHttpHeaders.getContentType(); } String contentType = contentTypeInternal; - return FluxUtil.withContext(context -> service.renameNoCustomHeaders(this.client.getUrl(), shareName, fileName, - comp, timeout, this.client.getVersion(), renameSource, replaceIfExists, ignoreReadOnly, sourceLeaseId, - destinationLeaseId, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, filePermission, - filePermissionFormat, filePermissionKey, metadata, contentType, this.client.isAllowTrailingDot(), - this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.renameNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, + timeout, this.client.getVersion(), renameSource, replaceIfExists, ignoreReadOnly, sourceLeaseId, + destinationLeaseId, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, filePermission, + filePermissionFormat, filePermissionKey, metadata, contentType, this.client.isAllowTrailingDot(), + this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Renames a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. @@ -7529,16 +7884,18 @@ public Mono> renameNoCustomHeadersWithResponseAsync(String shareN contentTypeInternal = shareFileHttpHeaders.getContentType(); } String contentType = contentTypeInternal; - return service.renameNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, timeout, - this.client.getVersion(), renameSource, replaceIfExists, ignoreReadOnly, sourceLeaseId, destinationLeaseId, - fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, filePermission, filePermissionFormat, - filePermissionKey, metadata, contentType, this.client.isAllowTrailingDot(), - this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context); + return service + .renameNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, timeout, this.client.getVersion(), + renameSource, replaceIfExists, ignoreReadOnly, sourceLeaseId, destinationLeaseId, fileAttributes, + fileCreationTime, fileLastWriteTime, fileChangeTime, filePermission, filePermissionFormat, + filePermissionKey, metadata, contentType, this.client.isAllowTrailingDot(), + this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Renames a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. @@ -7619,16 +7976,20 @@ public ResponseBase renameWithResponse(String shareNam contentTypeInternal = shareFileHttpHeaders.getContentType(); } String contentType = contentTypeInternal; - return service.renameSync(this.client.getUrl(), shareName, fileName, comp, timeout, this.client.getVersion(), - renameSource, replaceIfExists, ignoreReadOnly, sourceLeaseId, destinationLeaseId, fileAttributes, - fileCreationTime, fileLastWriteTime, fileChangeTime, filePermission, filePermissionFormat, - filePermissionKey, metadata, contentType, this.client.isAllowTrailingDot(), - this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context); + try { + return service.renameSync(this.client.getUrl(), shareName, fileName, comp, timeout, + this.client.getVersion(), renameSource, replaceIfExists, ignoreReadOnly, sourceLeaseId, + destinationLeaseId, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, filePermission, + filePermissionFormat, filePermissionKey, metadata, contentType, this.client.isAllowTrailingDot(), + this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Renames a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. @@ -7676,7 +8037,7 @@ public void rename(String shareName, String fileName, String renameSource, Integ /** * Renames a file. - * + * * @param shareName The name of the target share. * @param fileName The path of the target file. * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. @@ -7757,10 +8118,14 @@ public Response renameNoCustomHeadersWithResponse(String shareName, String contentTypeInternal = shareFileHttpHeaders.getContentType(); } String contentType = contentTypeInternal; - return service.renameNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, timeout, - this.client.getVersion(), renameSource, replaceIfExists, ignoreReadOnly, sourceLeaseId, destinationLeaseId, - fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, filePermission, filePermissionFormat, - filePermissionKey, metadata, contentType, this.client.isAllowTrailingDot(), - this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context); + try { + return service.renameNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, timeout, + this.client.getVersion(), renameSource, replaceIfExists, ignoreReadOnly, sourceLeaseId, + destinationLeaseId, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, filePermission, + filePermissionFormat, filePermissionKey, metadata, contentType, this.client.isAllowTrailingDot(), + this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/ServicesImpl.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/ServicesImpl.java index ee0672054ca1..9f331cdc0b3a 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/ServicesImpl.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/ServicesImpl.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.storage.file.share.implementation; import com.azure.core.annotation.BodyParam; @@ -40,11 +39,13 @@ import java.util.Objects; import java.util.stream.Collectors; import reactor.core.publisher.Mono; +import com.azure.storage.file.share.implementation.util.ModelHelper; /** * An instance of this class provides access to all the operations defined in Services. */ public final class ServicesImpl { + /** * The proxy service used to perform REST calls. */ @@ -57,7 +58,7 @@ public final class ServicesImpl { /** * Initializes an instance of ServicesImpl. - * + * * @param client the instance of the service client containing this operation class. */ ServicesImpl(AzureFileStorageImpl client) { @@ -72,6 +73,7 @@ public final class ServicesImpl { @Host("{url}") @ServiceInterface(name = "AzureFileStorageServ") public interface ServicesService { + @Put("/") @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) @@ -230,7 +232,7 @@ Response listSharesSegmentNextNoCustomHeadersSync( /** * Sets properties for a storage account's File service endpoint, including properties for Storage Analytics metrics * and CORS (Cross-Origin Resource Sharing) rules. - * + * * @param shareServiceProperties The StorageService properties. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -246,14 +248,16 @@ Response listSharesSegmentNextNoCustomHeadersSync( final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.setProperties(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), this.client.getFileRequestIntent(), shareServiceProperties, accept, context)); + return FluxUtil + .withContext(context -> service.setProperties(this.client.getUrl(), restype, comp, timeout, + this.client.getVersion(), this.client.getFileRequestIntent(), shareServiceProperties, accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Sets properties for a storage account's File service endpoint, including properties for Storage Analytics metrics * and CORS (Cross-Origin Resource Sharing) rules. - * + * * @param shareServiceProperties The StorageService properties. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -270,14 +274,16 @@ public Mono> setPropertiesWithR final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return service.setProperties(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), - this.client.getFileRequestIntent(), shareServiceProperties, accept, context); + return service + .setProperties(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), + this.client.getFileRequestIntent(), shareServiceProperties, accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Sets properties for a storage account's File service endpoint, including properties for Storage Analytics metrics * and CORS (Cross-Origin Resource Sharing) rules. - * + * * @param shareServiceProperties The StorageService properties. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -289,13 +295,15 @@ public Mono> setPropertiesWithR */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono setPropertiesAsync(ShareServiceProperties shareServiceProperties, Integer timeout) { - return setPropertiesWithResponseAsync(shareServiceProperties, timeout).flatMap(ignored -> Mono.empty()); + return setPropertiesWithResponseAsync(shareServiceProperties, timeout) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Sets properties for a storage account's File service endpoint, including properties for Storage Analytics metrics * and CORS (Cross-Origin Resource Sharing) rules. - * + * * @param shareServiceProperties The StorageService properties. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -310,13 +318,14 @@ public Mono setPropertiesAsync(ShareServiceProperties shareServiceProperti public Mono setPropertiesAsync(ShareServiceProperties shareServiceProperties, Integer timeout, Context context) { return setPropertiesWithResponseAsync(shareServiceProperties, timeout, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * Sets properties for a storage account's File service endpoint, including properties for Storage Analytics metrics * and CORS (Cross-Origin Resource Sharing) rules. - * + * * @param shareServiceProperties The StorageService properties. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -334,13 +343,14 @@ public Mono setPropertiesAsync(ShareServiceProperties shareServiceProperti final String accept = "application/xml"; return FluxUtil .withContext(context -> service.setPropertiesNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), this.client.getFileRequestIntent(), shareServiceProperties, accept, context)); + this.client.getVersion(), this.client.getFileRequestIntent(), shareServiceProperties, accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Sets properties for a storage account's File service endpoint, including properties for Storage Analytics metrics * and CORS (Cross-Origin Resource Sharing) rules. - * + * * @param shareServiceProperties The StorageService properties. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -357,14 +367,16 @@ public Mono> setPropertiesNoCustomHeadersWithResponseAsync( final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return service.setPropertiesNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), this.client.getFileRequestIntent(), shareServiceProperties, accept, context); + return service + .setPropertiesNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), + this.client.getFileRequestIntent(), shareServiceProperties, accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Sets properties for a storage account's File service endpoint, including properties for Storage Analytics metrics * and CORS (Cross-Origin Resource Sharing) rules. - * + * * @param shareServiceProperties The StorageService properties. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -381,14 +393,18 @@ public Mono> setPropertiesNoCustomHeadersWithResponseAsync( final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return service.setPropertiesSync(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), - this.client.getFileRequestIntent(), shareServiceProperties, accept, context); + try { + return service.setPropertiesSync(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), + this.client.getFileRequestIntent(), shareServiceProperties, accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Sets properties for a storage account's File service endpoint, including properties for Storage Analytics metrics * and CORS (Cross-Origin Resource Sharing) rules. - * + * * @param shareServiceProperties The StorageService properties. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -405,7 +421,7 @@ public void setProperties(ShareServiceProperties shareServiceProperties, Integer /** * Sets properties for a storage account's File service endpoint, including properties for Storage Analytics metrics * and CORS (Cross-Origin Resource Sharing) rules. - * + * * @param shareServiceProperties The StorageService properties. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -422,14 +438,18 @@ public Response setPropertiesNoCustomHeadersWithResponse(ShareServicePrope final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return service.setPropertiesNoCustomHeadersSync(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), this.client.getFileRequestIntent(), shareServiceProperties, accept, context); + try { + return service.setPropertiesNoCustomHeadersSync(this.client.getUrl(), restype, comp, timeout, + this.client.getVersion(), this.client.getFileRequestIntent(), shareServiceProperties, accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Gets the properties of a storage account's File service, including properties for Storage Analytics metrics and * CORS (Cross-Origin Resource Sharing) rules. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations.</a>. @@ -446,14 +466,16 @@ public Response setPropertiesNoCustomHeadersWithResponse(ShareServicePrope final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getProperties(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.getProperties(this.client.getUrl(), restype, comp, timeout, + this.client.getVersion(), this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Gets the properties of a storage account's File service, including properties for Storage Analytics metrics and * CORS (Cross-Origin Resource Sharing) rules. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations.</a>. @@ -471,14 +493,16 @@ public Response setPropertiesNoCustomHeadersWithResponse(ShareServicePrope final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return service.getProperties(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), - this.client.getFileRequestIntent(), accept, context); + return service + .getProperties(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Gets the properties of a storage account's File service, including properties for Storage Analytics metrics and * CORS (Cross-Origin Resource Sharing) rules. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations.</a>. @@ -490,13 +514,15 @@ public Response setPropertiesNoCustomHeadersWithResponse(ShareServicePrope */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getPropertiesAsync(Integer timeout) { - return getPropertiesWithResponseAsync(timeout).flatMap(res -> Mono.justOrEmpty(res.getValue())); + return getPropertiesWithResponseAsync(timeout) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets the properties of a storage account's File service, including properties for Storage Analytics metrics and * CORS (Cross-Origin Resource Sharing) rules. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations.</a>. @@ -509,13 +535,15 @@ public Mono getPropertiesAsync(Integer timeout) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getPropertiesAsync(Integer timeout, Context context) { - return getPropertiesWithResponseAsync(timeout, context).flatMap(res -> Mono.justOrEmpty(res.getValue())); + return getPropertiesWithResponseAsync(timeout, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets the properties of a storage account's File service, including properties for Storage Analytics metrics and * CORS (Cross-Origin Resource Sharing) rules. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations.</a>. @@ -531,14 +559,16 @@ public Mono> getPropertiesNoCustomHeadersWithRe final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getPropertiesNoCustomHeaders(this.client.getUrl(), restype, comp, - timeout, this.client.getVersion(), this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.getPropertiesNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, + this.client.getVersion(), this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Gets the properties of a storage account's File service, including properties for Storage Analytics metrics and * CORS (Cross-Origin Resource Sharing) rules. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations.</a>. @@ -556,14 +586,16 @@ public Mono> getPropertiesNoCustomHeadersWithRe final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return service.getPropertiesNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), this.client.getFileRequestIntent(), accept, context); + return service + .getPropertiesNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Gets the properties of a storage account's File service, including properties for Storage Analytics metrics and * CORS (Cross-Origin Resource Sharing) rules. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations.</a>. @@ -580,14 +612,18 @@ public ResponseBase getPro final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return service.getPropertiesSync(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), - this.client.getFileRequestIntent(), accept, context); + try { + return service.getPropertiesSync(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Gets the properties of a storage account's File service, including properties for Storage Analytics metrics and * CORS (Cross-Origin Resource Sharing) rules. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations.</a>. @@ -599,13 +635,17 @@ public ResponseBase getPro */ @ServiceMethod(returns = ReturnType.SINGLE) public ShareServiceProperties getProperties(Integer timeout) { - return getPropertiesWithResponse(timeout, Context.NONE).getValue(); + try { + return getPropertiesWithResponse(timeout, Context.NONE).getValue(); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Gets the properties of a storage account's File service, including properties for Storage Analytics metrics and * CORS (Cross-Origin Resource Sharing) rules. - * + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations.</a>. @@ -621,13 +661,17 @@ public Response getPropertiesNoCustomHeadersWithResponse final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return service.getPropertiesNoCustomHeadersSync(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), this.client.getFileRequestIntent(), accept, context); + try { + return service.getPropertiesNoCustomHeadersSync(this.client.getUrl(), restype, comp, timeout, + this.client.getVersion(), this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. - * + * * @param prefix Filters the results to return only entries whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. * The operation returns a marker value within the response body if the list returned was not complete. The marker @@ -658,13 +702,14 @@ public Mono> listSharesSegmentSinglePageAsync(S .withContext(context -> service.listSharesSegment(this.client.getUrl(), comp, prefix, marker, maxresults, includeConverted, timeout, this.client.getVersion(), this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().getShareItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders())); } /** * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. - * + * * @param prefix Filters the results to return only entries whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. * The operation returns a marker value within the response body if the list returned was not complete. The marker @@ -695,13 +740,14 @@ public Mono> listSharesSegmentSinglePageAsync(S return service .listSharesSegment(this.client.getUrl(), comp, prefix, marker, maxresults, includeConverted, timeout, this.client.getVersion(), this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().getShareItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders())); } /** * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. - * + * * @param prefix Filters the results to return only entries whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. * The operation returns a marker value within the response body if the list returned was not complete. The marker @@ -727,7 +773,7 @@ public PagedFlux listSharesSegmentAsync(String prefix, String /** * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. - * + * * @param prefix Filters the results to return only entries whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. * The operation returns a marker value within the response body if the list returned was not complete. The marker @@ -755,7 +801,7 @@ public PagedFlux listSharesSegmentAsync(String prefix, String /** * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. - * + * * @param prefix Filters the results to return only entries whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. * The operation returns a marker value within the response body if the list returned was not complete. The marker @@ -786,13 +832,14 @@ public Mono> listSharesSegmentNoCustomHeadersSi .withContext(context -> service.listSharesSegmentNoCustomHeaders(this.client.getUrl(), comp, prefix, marker, maxresults, includeConverted, timeout, this.client.getVersion(), this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().getShareItems(), res.getValue().getNextMarker(), null)); } /** * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. - * + * * @param prefix Filters the results to return only entries whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. * The operation returns a marker value within the response body if the list returned was not complete. The marker @@ -823,13 +870,14 @@ public Mono> listSharesSegmentNoCustomHeadersSi return service .listSharesSegmentNoCustomHeaders(this.client.getUrl(), comp, prefix, marker, maxresults, includeConverted, timeout, this.client.getVersion(), this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().getShareItems(), res.getValue().getNextMarker(), null)); } /** * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. - * + * * @param prefix Filters the results to return only entries whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. * The operation returns a marker value within the response body if the list returned was not complete. The marker @@ -856,7 +904,7 @@ public PagedFlux listSharesSegmentNoCustomHeadersAsync(String /** * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. - * + * * @param prefix Filters the results to return only entries whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. * The operation returns a marker value within the response body if the list returned was not complete. The marker @@ -883,7 +931,7 @@ public PagedFlux listSharesSegmentNoCustomHeadersAsync(String /** * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. - * + * * @param prefix Filters the results to return only entries whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. * The operation returns a marker value within the response body if the list returned was not complete. The marker @@ -913,13 +961,17 @@ public PagedResponse listSharesSegmentSinglePage(String prefi ResponseBase res = service.listSharesSegmentSync(this.client.getUrl(), comp, prefix, marker, maxresults, includeConverted, timeout, this.client.getVersion(), this.client.getFileRequestIntent(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getShareItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); + try { + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getShareItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. - * + * * @param prefix Filters the results to return only entries whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. * The operation returns a marker value within the response body if the list returned was not complete. The marker @@ -950,13 +1002,17 @@ public PagedResponse listSharesSegmentSinglePage(String prefi ResponseBase res = service.listSharesSegmentSync(this.client.getUrl(), comp, prefix, marker, maxresults, includeConverted, timeout, this.client.getVersion(), this.client.getFileRequestIntent(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getShareItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); + try { + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getShareItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. - * + * * @param prefix Filters the results to return only entries whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. * The operation returns a marker value within the response body if the list returned was not complete. The marker @@ -983,7 +1039,7 @@ public PagedIterable listSharesSegment(String prefix, String /** * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. - * + * * @param prefix Filters the results to return only entries whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. * The operation returns a marker value within the response body if the list returned was not complete. The marker @@ -1011,7 +1067,7 @@ public PagedIterable listSharesSegment(String prefix, String /** * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. - * + * * @param prefix Filters the results to return only entries whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. * The operation returns a marker value within the response body if the list returned was not complete. The marker @@ -1041,13 +1097,17 @@ public PagedResponse listSharesSegmentNoCustomHeadersSinglePa Response res = service.listSharesSegmentNoCustomHeadersSync(this.client.getUrl(), comp, prefix, marker, maxresults, includeConverted, timeout, this.client.getVersion(), this.client.getFileRequestIntent(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getShareItems(), res.getValue().getNextMarker(), null); + try { + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getShareItems(), res.getValue().getNextMarker(), null); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. - * + * * @param prefix Filters the results to return only entries whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. * The operation returns a marker value within the response body if the list returned was not complete. The marker @@ -1078,13 +1138,17 @@ public PagedResponse listSharesSegmentNoCustomHeadersSinglePa Response res = service.listSharesSegmentNoCustomHeadersSync(this.client.getUrl(), comp, prefix, marker, maxresults, includeConverted, timeout, this.client.getVersion(), this.client.getFileRequestIntent(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getShareItems(), res.getValue().getNextMarker(), null); + try { + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getShareItems(), res.getValue().getNextMarker(), null); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. - * + * * @param prefix Filters the results to return only entries whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. * The operation returns a marker value within the response body if the list returned was not complete. The marker @@ -1110,7 +1174,7 @@ public PagedIterable listSharesSegmentNoCustomHeaders(String /** * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. - * + * * @param prefix Filters the results to return only entries whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list to be returned with the next list operation. * The operation returns a marker value within the response body if the list returned was not complete. The marker @@ -1138,9 +1202,9 @@ public PagedIterable listSharesSegmentNoCustomHeaders(String /** * 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 ShareStorageExceptionInternal thrown if the request is rejected by server. @@ -1153,15 +1217,16 @@ public Mono> listSharesSegmentNextSinglePageAsy return FluxUtil .withContext(context -> service.listSharesSegmentNext(nextLink, this.client.getUrl(), this.client.getVersion(), this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().getShareItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders())); } /** * 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. @@ -1176,15 +1241,16 @@ public Mono> listSharesSegmentNextSinglePageAsy return service .listSharesSegmentNext(nextLink, this.client.getUrl(), this.client.getVersion(), this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().getShareItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders())); } /** * 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 ShareStorageExceptionInternal thrown if the request is rejected by server. @@ -1197,15 +1263,16 @@ public Mono> listSharesSegmentNextNoCustomHeade return FluxUtil .withContext(context -> service.listSharesSegmentNextNoCustomHeaders(nextLink, this.client.getUrl(), this.client.getVersion(), this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().getShareItems(), res.getValue().getNextMarker(), null)); } /** * 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. @@ -1220,15 +1287,16 @@ public Mono> listSharesSegmentNextNoCustomHeade return service .listSharesSegmentNextNoCustomHeaders(nextLink, this.client.getUrl(), this.client.getVersion(), this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().getShareItems(), res.getValue().getNextMarker(), 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 ShareStorageExceptionInternal thrown if the request is rejected by server. @@ -1241,15 +1309,19 @@ public PagedResponse listSharesSegmentNextSinglePage(String n ResponseBase res = service.listSharesSegmentNextSync(nextLink, this.client.getUrl(), this.client.getVersion(), this.client.getFileRequestIntent(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getShareItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); + try { + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getShareItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * 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. @@ -1263,15 +1335,19 @@ public PagedResponse listSharesSegmentNextSinglePage(String n ResponseBase res = service.listSharesSegmentNextSync(nextLink, this.client.getUrl(), this.client.getVersion(), this.client.getFileRequestIntent(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getShareItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); + try { + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getShareItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * 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 ShareStorageExceptionInternal thrown if the request is rejected by server. @@ -1283,15 +1359,19 @@ public PagedResponse listSharesSegmentNextNoCustomHeadersSing final String accept = "application/xml"; Response res = service.listSharesSegmentNextNoCustomHeadersSync(nextLink, this.client.getUrl(), this.client.getVersion(), this.client.getFileRequestIntent(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getShareItems(), res.getValue().getNextMarker(), null); + try { + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getShareItems(), res.getValue().getNextMarker(), null); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * 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. @@ -1305,7 +1385,11 @@ public PagedResponse listSharesSegmentNextNoCustomHeadersSing final String accept = "application/xml"; Response res = service.listSharesSegmentNextNoCustomHeadersSync(nextLink, this.client.getUrl(), this.client.getVersion(), this.client.getFileRequestIntent(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getShareItems(), res.getValue().getNextMarker(), null); + try { + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getShareItems(), res.getValue().getNextMarker(), null); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/SharesImpl.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/SharesImpl.java index a34f029be45d..4d4aaabea588 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/SharesImpl.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/SharesImpl.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.storage.file.share.implementation; import com.azure.core.annotation.BodyParam; @@ -53,11 +52,13 @@ import java.util.List; import java.util.Map; import reactor.core.publisher.Mono; +import com.azure.storage.file.share.implementation.util.ModelHelper; /** * An instance of this class provides access to all the operations defined in Shares. */ public final class SharesImpl { + /** * The proxy service used to perform REST calls. */ @@ -70,7 +71,7 @@ public final class SharesImpl { /** * Initializes an instance of SharesImpl. - * + * * @param client the instance of the service client containing this operation class. */ SharesImpl(AzureFileStorageImpl client) { @@ -85,6 +86,7 @@ public final class SharesImpl { @Host("{url}") @ServiceInterface(name = "AzureFileStorageShar") public interface SharesService { + @Put("/{shareName}") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) @@ -890,7 +892,7 @@ Response restoreNoCustomHeadersSync(@HostParam("url") String url, /** * Creates a new share under the specified account. If the share with the same name already exists, the operation * fails. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -919,16 +921,18 @@ public Mono> createWithResponseAsync(Str Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops) { final String restype = "share"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.create(this.client.getUrl(), shareName, restype, timeout, - metadata, quota, accessTier, this.client.getVersion(), enabledProtocols, rootSquash, - enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, - paidBurstingMaxIops, this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.create(this.client.getUrl(), shareName, restype, timeout, metadata, quota, + accessTier, this.client.getVersion(), enabledProtocols, rootSquash, + enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, + paidBurstingMaxIops, this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Creates a new share under the specified account. If the share with the same name already exists, the operation * fails. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -958,16 +962,18 @@ public Mono> createWithResponseAsync(Str Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Context context) { final String restype = "share"; final String accept = "application/xml"; - return service.create(this.client.getUrl(), shareName, restype, timeout, metadata, quota, accessTier, - this.client.getVersion(), enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, - paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, this.client.getFileRequestIntent(), - accept, context); + return service + .create(this.client.getUrl(), shareName, restype, timeout, metadata, quota, accessTier, + this.client.getVersion(), enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, + paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Creates a new share under the specified account. If the share with the same name already exists, the operation * fails. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -996,13 +1002,15 @@ public Mono createAsync(String shareName, Integer timeout, Map Mono.empty()); + paidBurstingMaxIops) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Creates a new share under the specified account. If the share with the same name already exists, the operation * fails. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -1032,13 +1040,15 @@ public Mono createAsync(String shareName, Integer timeout, Map Mono.empty()); + paidBurstingMaxIops, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Creates a new share under the specified account. If the share with the same name already exists, the operation * fails. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -1067,16 +1077,18 @@ public Mono> createNoCustomHeadersWithResponseAsync(String shareN Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops) { final String restype = "share"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.createNoCustomHeaders(this.client.getUrl(), shareName, restype, - timeout, metadata, quota, accessTier, this.client.getVersion(), enabledProtocols, rootSquash, - enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, - paidBurstingMaxIops, this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.createNoCustomHeaders(this.client.getUrl(), shareName, restype, timeout, + metadata, quota, accessTier, this.client.getVersion(), enabledProtocols, rootSquash, + enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, + paidBurstingMaxIops, this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Creates a new share under the specified account. If the share with the same name already exists, the operation * fails. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -1106,16 +1118,18 @@ public Mono> createNoCustomHeadersWithResponseAsync(String shareN Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Context context) { final String restype = "share"; final String accept = "application/xml"; - return service.createNoCustomHeaders(this.client.getUrl(), shareName, restype, timeout, metadata, quota, - accessTier, this.client.getVersion(), enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, - paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, this.client.getFileRequestIntent(), - accept, context); + return service + .createNoCustomHeaders(this.client.getUrl(), shareName, restype, timeout, metadata, quota, accessTier, + this.client.getVersion(), enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, + paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Creates a new share under the specified account. If the share with the same name already exists, the operation * fails. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -1145,16 +1159,20 @@ public ResponseBase createWithResponse(String shareNa Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Context context) { final String restype = "share"; final String accept = "application/xml"; - return service.createSync(this.client.getUrl(), shareName, restype, timeout, metadata, quota, accessTier, - this.client.getVersion(), enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, - paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, this.client.getFileRequestIntent(), - accept, context); + try { + return service.createSync(this.client.getUrl(), shareName, restype, timeout, metadata, quota, accessTier, + this.client.getVersion(), enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, + paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Creates a new share under the specified account. If the share with the same name already exists, the operation * fails. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -1188,7 +1206,7 @@ public void create(String shareName, Integer timeout, Map metada /** * Creates a new share under the specified account. If the share with the same name already exists, the operation * fails. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -1218,16 +1236,20 @@ public Response createNoCustomHeadersWithResponse(String shareName, Intege Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Context context) { final String restype = "share"; final String accept = "application/xml"; - return service.createNoCustomHeadersSync(this.client.getUrl(), shareName, restype, timeout, metadata, quota, - accessTier, this.client.getVersion(), enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, - paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, this.client.getFileRequestIntent(), - accept, context); + try { + return service.createNoCustomHeadersSync(this.client.getUrl(), shareName, restype, timeout, metadata, quota, + accessTier, this.client.getVersion(), enabledProtocols, rootSquash, + enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, + paidBurstingMaxIops, this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Returns all user-defined metadata and system properties for the specified share or share snapshot. The data * returned does not include the share's list of files. - * + * * @param shareName The name of the target share. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share * snapshot to query. @@ -1247,13 +1269,14 @@ public Mono> getPropertiesWithRes final String accept = "application/xml"; return FluxUtil .withContext(context -> service.getProperties(this.client.getUrl(), shareName, restype, sharesnapshot, - timeout, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context)); + timeout, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Returns all user-defined metadata and system properties for the specified share or share snapshot. The data * returned does not include the share's list of files. - * + * * @param shareName The name of the target share. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share * snapshot to query. @@ -1272,14 +1295,16 @@ public Mono> getPropertiesWithRes String sharesnapshot, Integer timeout, String leaseId, Context context) { final String restype = "share"; final String accept = "application/xml"; - return service.getProperties(this.client.getUrl(), shareName, restype, sharesnapshot, timeout, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + return service + .getProperties(this.client.getUrl(), shareName, restype, sharesnapshot, timeout, this.client.getVersion(), + leaseId, this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Returns all user-defined metadata and system properties for the specified share or share snapshot. The data * returned does not include the share's list of files. - * + * * @param shareName The name of the target share. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share * snapshot to query. @@ -1295,13 +1320,14 @@ public Mono> getPropertiesWithRes @ServiceMethod(returns = ReturnType.SINGLE) public Mono getPropertiesAsync(String shareName, String sharesnapshot, Integer timeout, String leaseId) { return getPropertiesWithResponseAsync(shareName, sharesnapshot, timeout, leaseId) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * Returns all user-defined metadata and system properties for the specified share or share snapshot. The data * returned does not include the share's list of files. - * + * * @param shareName The name of the target share. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share * snapshot to query. @@ -1319,13 +1345,14 @@ public Mono getPropertiesAsync(String shareName, String sharesnapshot, Int public Mono getPropertiesAsync(String shareName, String sharesnapshot, Integer timeout, String leaseId, Context context) { return getPropertiesWithResponseAsync(shareName, sharesnapshot, timeout, leaseId, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * Returns all user-defined metadata and system properties for the specified share or share snapshot. The data * returned does not include the share's list of files. - * + * * @param shareName The name of the target share. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share * snapshot to query. @@ -1343,15 +1370,17 @@ public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String Integer timeout, String leaseId) { final String restype = "share"; final String accept = "application/xml"; - return FluxUtil.withContext( - context -> service.getPropertiesNoCustomHeaders(this.client.getUrl(), shareName, restype, sharesnapshot, - timeout, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext( + context -> service.getPropertiesNoCustomHeaders(this.client.getUrl(), shareName, restype, sharesnapshot, + timeout, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Returns all user-defined metadata and system properties for the specified share or share snapshot. The data * returned does not include the share's list of files. - * + * * @param shareName The name of the target share. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share * snapshot to query. @@ -1370,14 +1399,16 @@ public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String Integer timeout, String leaseId, Context context) { final String restype = "share"; final String accept = "application/xml"; - return service.getPropertiesNoCustomHeaders(this.client.getUrl(), shareName, restype, sharesnapshot, timeout, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + return service + .getPropertiesNoCustomHeaders(this.client.getUrl(), shareName, restype, sharesnapshot, timeout, + this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Returns all user-defined metadata and system properties for the specified share or share snapshot. The data * returned does not include the share's list of files. - * + * * @param shareName The name of the target share. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share * snapshot to query. @@ -1396,14 +1427,18 @@ public ResponseBase getPropertiesWithResponse( String sharesnapshot, Integer timeout, String leaseId, Context context) { final String restype = "share"; final String accept = "application/xml"; - return service.getPropertiesSync(this.client.getUrl(), shareName, restype, sharesnapshot, timeout, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + try { + return service.getPropertiesSync(this.client.getUrl(), shareName, restype, sharesnapshot, timeout, + this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Returns all user-defined metadata and system properties for the specified share or share snapshot. The data * returned does not include the share's list of files. - * + * * @param shareName The name of the target share. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share * snapshot to query. @@ -1423,7 +1458,7 @@ public void getProperties(String shareName, String sharesnapshot, Integer timeou /** * Returns all user-defined metadata and system properties for the specified share or share snapshot. The data * returned does not include the share's list of files. - * + * * @param shareName The name of the target share. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share * snapshot to query. @@ -1442,14 +1477,18 @@ public Response getPropertiesNoCustomHeadersWithResponse(String shareName, Integer timeout, String leaseId, Context context) { final String restype = "share"; final String accept = "application/xml"; - return service.getPropertiesNoCustomHeadersSync(this.client.getUrl(), shareName, restype, sharesnapshot, - timeout, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + try { + return service.getPropertiesNoCustomHeadersSync(this.client.getUrl(), shareName, restype, sharesnapshot, + timeout, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Operation marks the specified share or share snapshot for deletion. The share or share snapshot and any files * contained within it are later deleted during garbage collection. - * + * * @param shareName The name of the target share. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share * snapshot to query. @@ -1470,13 +1509,13 @@ public Mono> deleteWithResponseAsync(Str final String accept = "application/xml"; return FluxUtil.withContext(context -> service.delete(this.client.getUrl(), shareName, restype, sharesnapshot, timeout, this.client.getVersion(), deleteSnapshots, leaseId, this.client.getFileRequestIntent(), accept, - context)); + context)).onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Operation marks the specified share or share snapshot for deletion. The share or share snapshot and any files * contained within it are later deleted during garbage collection. - * + * * @param shareName The name of the target share. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share * snapshot to query. @@ -1496,14 +1535,16 @@ public Mono> deleteWithResponseAsync(Str Integer timeout, DeleteSnapshotsOptionType deleteSnapshots, String leaseId, Context context) { final String restype = "share"; final String accept = "application/xml"; - return service.delete(this.client.getUrl(), shareName, restype, sharesnapshot, timeout, - this.client.getVersion(), deleteSnapshots, leaseId, this.client.getFileRequestIntent(), accept, context); + return service + .delete(this.client.getUrl(), shareName, restype, sharesnapshot, timeout, this.client.getVersion(), + deleteSnapshots, leaseId, this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Operation marks the specified share or share snapshot for deletion. The share or share snapshot and any files * contained within it are later deleted during garbage collection. - * + * * @param shareName The name of the target share. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share * snapshot to query. @@ -1521,13 +1562,14 @@ public Mono> deleteWithResponseAsync(Str public Mono deleteAsync(String shareName, String sharesnapshot, Integer timeout, DeleteSnapshotsOptionType deleteSnapshots, String leaseId) { return deleteWithResponseAsync(shareName, sharesnapshot, timeout, deleteSnapshots, leaseId) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * Operation marks the specified share or share snapshot for deletion. The share or share snapshot and any files * contained within it are later deleted during garbage collection. - * + * * @param shareName The name of the target share. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share * snapshot to query. @@ -1546,13 +1588,14 @@ public Mono deleteAsync(String shareName, String sharesnapshot, Integer ti public Mono deleteAsync(String shareName, String sharesnapshot, Integer timeout, DeleteSnapshotsOptionType deleteSnapshots, String leaseId, Context context) { return deleteWithResponseAsync(shareName, sharesnapshot, timeout, deleteSnapshots, leaseId, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * Operation marks the specified share or share snapshot for deletion. The share or share snapshot and any files * contained within it are later deleted during garbage collection. - * + * * @param shareName The name of the target share. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share * snapshot to query. @@ -1571,15 +1614,17 @@ public Mono> deleteNoCustomHeadersWithResponseAsync(String shareN Integer timeout, DeleteSnapshotsOptionType deleteSnapshots, String leaseId) { final String restype = "share"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.deleteNoCustomHeaders(this.client.getUrl(), shareName, restype, - sharesnapshot, timeout, this.client.getVersion(), deleteSnapshots, leaseId, - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.deleteNoCustomHeaders(this.client.getUrl(), shareName, restype, + sharesnapshot, timeout, this.client.getVersion(), deleteSnapshots, leaseId, + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Operation marks the specified share or share snapshot for deletion. The share or share snapshot and any files * contained within it are later deleted during garbage collection. - * + * * @param shareName The name of the target share. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share * snapshot to query. @@ -1599,14 +1644,16 @@ public Mono> deleteNoCustomHeadersWithResponseAsync(String shareN Integer timeout, DeleteSnapshotsOptionType deleteSnapshots, String leaseId, Context context) { final String restype = "share"; final String accept = "application/xml"; - return service.deleteNoCustomHeaders(this.client.getUrl(), shareName, restype, sharesnapshot, timeout, - this.client.getVersion(), deleteSnapshots, leaseId, this.client.getFileRequestIntent(), accept, context); + return service + .deleteNoCustomHeaders(this.client.getUrl(), shareName, restype, sharesnapshot, timeout, + this.client.getVersion(), deleteSnapshots, leaseId, this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Operation marks the specified share or share snapshot for deletion. The share or share snapshot and any files * contained within it are later deleted during garbage collection. - * + * * @param shareName The name of the target share. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share * snapshot to query. @@ -1626,14 +1673,19 @@ public ResponseBase deleteWithResponse(String shareNa Integer timeout, DeleteSnapshotsOptionType deleteSnapshots, String leaseId, Context context) { final String restype = "share"; final String accept = "application/xml"; - return service.deleteSync(this.client.getUrl(), shareName, restype, sharesnapshot, timeout, - this.client.getVersion(), deleteSnapshots, leaseId, this.client.getFileRequestIntent(), accept, context); + try { + return service.deleteSync(this.client.getUrl(), shareName, restype, sharesnapshot, timeout, + this.client.getVersion(), deleteSnapshots, leaseId, this.client.getFileRequestIntent(), accept, + context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Operation marks the specified share or share snapshot for deletion. The share or share snapshot and any files * contained within it are later deleted during garbage collection. - * + * * @param shareName The name of the target share. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share * snapshot to query. @@ -1655,7 +1707,7 @@ public void delete(String shareName, String sharesnapshot, Integer timeout, /** * Operation marks the specified share or share snapshot for deletion. The share or share snapshot and any files * contained within it are later deleted during garbage collection. - * + * * @param shareName The name of the target share. * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share * snapshot to query. @@ -1675,14 +1727,19 @@ public Response deleteNoCustomHeadersWithResponse(String shareName, String DeleteSnapshotsOptionType deleteSnapshots, String leaseId, Context context) { final String restype = "share"; final String accept = "application/xml"; - return service.deleteNoCustomHeadersSync(this.client.getUrl(), shareName, restype, sharesnapshot, timeout, - this.client.getVersion(), deleteSnapshots, leaseId, this.client.getFileRequestIntent(), accept, context); + try { + return service.deleteNoCustomHeadersSync(this.client.getUrl(), shareName, restype, sharesnapshot, timeout, + this.client.getVersion(), deleteSnapshots, leaseId, this.client.getFileRequestIntent(), accept, + context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -1709,15 +1766,17 @@ public Mono> acquireLeaseWithRespo final String action = "acquire"; final String restype = "share"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.acquireLease(this.client.getUrl(), shareName, comp, action, - restype, timeout, duration, proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.acquireLease(this.client.getUrl(), shareName, comp, action, restype, + timeout, duration, proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -1746,15 +1805,16 @@ public Mono> acquireLeaseWithRespo final String action = "acquire"; final String restype = "share"; final String accept = "application/xml"; - return service.acquireLease(this.client.getUrl(), shareName, comp, action, restype, timeout, duration, - proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), - accept, context); + return service + .acquireLease(this.client.getUrl(), shareName, comp, action, restype, timeout, duration, proposedLeaseId, + this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -1778,13 +1838,14 @@ public Mono> acquireLeaseWithRespo public Mono acquireLeaseAsync(String shareName, Integer timeout, Integer duration, String proposedLeaseId, String sharesnapshot, String requestId) { return acquireLeaseWithResponseAsync(shareName, timeout, duration, proposedLeaseId, sharesnapshot, requestId) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -1809,13 +1870,14 @@ public Mono acquireLeaseAsync(String shareName, Integer timeout, Integer d public Mono acquireLeaseAsync(String shareName, Integer timeout, Integer duration, String proposedLeaseId, String sharesnapshot, String requestId, Context context) { return acquireLeaseWithResponseAsync(shareName, timeout, duration, proposedLeaseId, sharesnapshot, requestId, - context).flatMap(ignored -> Mono.empty()); + context).onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -1842,15 +1904,17 @@ public Mono> acquireLeaseNoCustomHeadersWithResponseAsync(String final String action = "acquire"; final String restype = "share"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.acquireLeaseNoCustomHeaders(this.client.getUrl(), shareName, - comp, action, restype, timeout, duration, proposedLeaseId, this.client.getVersion(), sharesnapshot, - requestId, this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.acquireLeaseNoCustomHeaders(this.client.getUrl(), shareName, comp, action, + restype, timeout, duration, proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -1878,15 +1942,17 @@ public Mono> acquireLeaseNoCustomHeadersWithResponseAsync(String final String action = "acquire"; final String restype = "share"; final String accept = "application/xml"; - return service.acquireLeaseNoCustomHeaders(this.client.getUrl(), shareName, comp, action, restype, timeout, - duration, proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, - this.client.getFileRequestIntent(), accept, context); + return service + .acquireLeaseNoCustomHeaders(this.client.getUrl(), shareName, comp, action, restype, timeout, duration, + proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), + accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -1914,15 +1980,19 @@ public ResponseBase acquireLeaseWithResponse(St final String action = "acquire"; final String restype = "share"; final String accept = "application/xml"; - return service.acquireLeaseSync(this.client.getUrl(), shareName, comp, action, restype, timeout, duration, - proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), - accept, context); + try { + return service.acquireLeaseSync(this.client.getUrl(), shareName, comp, action, restype, timeout, duration, + proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), + accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -1950,7 +2020,7 @@ public void acquireLease(String shareName, Integer timeout, Integer duration, St /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -1978,15 +2048,19 @@ public Response acquireLeaseNoCustomHeadersWithResponse(String shareName, final String action = "acquire"; final String restype = "share"; final String accept = "application/xml"; - return service.acquireLeaseNoCustomHeadersSync(this.client.getUrl(), shareName, comp, action, restype, timeout, - duration, proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, - this.client.getFileRequestIntent(), accept, context); + try { + return service.acquireLeaseNoCustomHeadersSync(this.client.getUrl(), shareName, comp, action, restype, + timeout, duration, proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2008,15 +2082,17 @@ public Mono> releaseLeaseWithRespo final String action = "release"; final String restype = "share"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.releaseLease(this.client.getUrl(), shareName, comp, action, - restype, timeout, leaseId, this.client.getVersion(), sharesnapshot, requestId, - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.releaseLease(this.client.getUrl(), shareName, comp, action, restype, + timeout, leaseId, this.client.getVersion(), sharesnapshot, requestId, + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2039,14 +2115,16 @@ public Mono> releaseLeaseWithRespo final String action = "release"; final String restype = "share"; final String accept = "application/xml"; - return service.releaseLease(this.client.getUrl(), shareName, comp, action, restype, timeout, leaseId, - this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), accept, context); + return service + .releaseLease(this.client.getUrl(), shareName, comp, action, restype, timeout, leaseId, + this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2065,13 +2143,14 @@ public Mono> releaseLeaseWithRespo public Mono releaseLeaseAsync(String shareName, String leaseId, Integer timeout, String sharesnapshot, String requestId) { return releaseLeaseWithResponseAsync(shareName, leaseId, timeout, sharesnapshot, requestId) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2091,13 +2170,14 @@ public Mono releaseLeaseAsync(String shareName, String leaseId, Integer ti public Mono releaseLeaseAsync(String shareName, String leaseId, Integer timeout, String sharesnapshot, String requestId, Context context) { return releaseLeaseWithResponseAsync(shareName, leaseId, timeout, sharesnapshot, requestId, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2119,15 +2199,17 @@ public Mono> releaseLeaseNoCustomHeadersWithResponseAsync(String final String action = "release"; final String restype = "share"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.releaseLeaseNoCustomHeaders(this.client.getUrl(), shareName, - comp, action, restype, timeout, leaseId, this.client.getVersion(), sharesnapshot, requestId, - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.releaseLeaseNoCustomHeaders(this.client.getUrl(), shareName, comp, action, + restype, timeout, leaseId, this.client.getVersion(), sharesnapshot, requestId, + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2150,15 +2232,16 @@ public Mono> releaseLeaseNoCustomHeadersWithResponseAsync(String final String action = "release"; final String restype = "share"; final String accept = "application/xml"; - return service.releaseLeaseNoCustomHeaders(this.client.getUrl(), shareName, comp, action, restype, timeout, - leaseId, this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), accept, - context); + return service + .releaseLeaseNoCustomHeaders(this.client.getUrl(), shareName, comp, action, restype, timeout, leaseId, + this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2181,14 +2264,19 @@ public ResponseBase releaseLeaseWithResponse(St final String action = "release"; final String restype = "share"; final String accept = "application/xml"; - return service.releaseLeaseSync(this.client.getUrl(), shareName, comp, action, restype, timeout, leaseId, - this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), accept, context); + try { + return service.releaseLeaseSync(this.client.getUrl(), shareName, comp, action, restype, timeout, leaseId, + this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), accept, + context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2211,7 +2299,7 @@ public void releaseLease(String shareName, String leaseId, Integer timeout, Stri /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2234,15 +2322,19 @@ public Response releaseLeaseNoCustomHeadersWithResponse(String shareName, final String action = "release"; final String restype = "share"; final String accept = "application/xml"; - return service.releaseLeaseNoCustomHeadersSync(this.client.getUrl(), shareName, comp, action, restype, timeout, - leaseId, this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), accept, - context); + try { + return service.releaseLeaseNoCustomHeadersSync(this.client.getUrl(), shareName, comp, action, restype, + timeout, leaseId, this.client.getVersion(), sharesnapshot, requestId, + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2267,15 +2359,17 @@ public Mono> changeLeaseWithRespons final String action = "change"; final String restype = "share"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.changeLease(this.client.getUrl(), shareName, comp, action, - restype, timeout, leaseId, proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.changeLease(this.client.getUrl(), shareName, comp, action, restype, timeout, + leaseId, proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2302,15 +2396,16 @@ public Mono> changeLeaseWithRespons final String action = "change"; final String restype = "share"; final String accept = "application/xml"; - return service.changeLease(this.client.getUrl(), shareName, comp, action, restype, timeout, leaseId, - proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), - accept, context); + return service + .changeLease(this.client.getUrl(), shareName, comp, action, restype, timeout, leaseId, proposedLeaseId, + this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2332,13 +2427,14 @@ public Mono> changeLeaseWithRespons public Mono changeLeaseAsync(String shareName, String leaseId, Integer timeout, String proposedLeaseId, String sharesnapshot, String requestId) { return changeLeaseWithResponseAsync(shareName, leaseId, timeout, proposedLeaseId, sharesnapshot, requestId) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2361,13 +2457,14 @@ public Mono changeLeaseAsync(String shareName, String leaseId, Integer tim public Mono changeLeaseAsync(String shareName, String leaseId, Integer timeout, String proposedLeaseId, String sharesnapshot, String requestId, Context context) { return changeLeaseWithResponseAsync(shareName, leaseId, timeout, proposedLeaseId, sharesnapshot, requestId, - context).flatMap(ignored -> Mono.empty()); + context).onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2392,15 +2489,17 @@ public Mono> changeLeaseNoCustomHeadersWithResponseAsync(String s final String action = "change"; final String restype = "share"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.changeLeaseNoCustomHeaders(this.client.getUrl(), shareName, comp, - action, restype, timeout, leaseId, proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.changeLeaseNoCustomHeaders(this.client.getUrl(), shareName, comp, action, + restype, timeout, leaseId, proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2426,15 +2525,17 @@ public Mono> changeLeaseNoCustomHeadersWithResponseAsync(String s final String action = "change"; final String restype = "share"; final String accept = "application/xml"; - return service.changeLeaseNoCustomHeaders(this.client.getUrl(), shareName, comp, action, restype, timeout, - leaseId, proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, - this.client.getFileRequestIntent(), accept, context); + return service + .changeLeaseNoCustomHeaders(this.client.getUrl(), shareName, comp, action, restype, timeout, leaseId, + proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), + accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2460,15 +2561,19 @@ public ResponseBase changeLeaseWithResponse(Stri final String action = "change"; final String restype = "share"; final String accept = "application/xml"; - return service.changeLeaseSync(this.client.getUrl(), shareName, comp, action, restype, timeout, leaseId, - proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), - accept, context); + try { + return service.changeLeaseSync(this.client.getUrl(), shareName, comp, action, restype, timeout, leaseId, + proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), + accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2494,7 +2599,7 @@ public void changeLease(String shareName, String leaseId, Integer timeout, Strin /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2520,15 +2625,19 @@ public Response changeLeaseNoCustomHeadersWithResponse(String shareName, S final String action = "change"; final String restype = "share"; final String accept = "application/xml"; - return service.changeLeaseNoCustomHeadersSync(this.client.getUrl(), shareName, comp, action, restype, timeout, - leaseId, proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, - this.client.getFileRequestIntent(), accept, context); + try { + return service.changeLeaseNoCustomHeadersSync(this.client.getUrl(), shareName, comp, action, restype, + timeout, leaseId, proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2552,13 +2661,14 @@ public Mono> renewLeaseWithResponseA final String accept = "application/xml"; return FluxUtil.withContext(context -> service.renewLease(this.client.getUrl(), shareName, comp, action, restype, timeout, leaseId, this.client.getVersion(), sharesnapshot, requestId, - this.client.getFileRequestIntent(), accept, context)); + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2581,14 +2691,16 @@ public Mono> renewLeaseWithResponseA final String action = "renew"; final String restype = "share"; final String accept = "application/xml"; - return service.renewLease(this.client.getUrl(), shareName, comp, action, restype, timeout, leaseId, - this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), accept, context); + return service + .renewLease(this.client.getUrl(), shareName, comp, action, restype, timeout, leaseId, + this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2607,13 +2719,14 @@ public Mono> renewLeaseWithResponseA public Mono renewLeaseAsync(String shareName, String leaseId, Integer timeout, String sharesnapshot, String requestId) { return renewLeaseWithResponseAsync(shareName, leaseId, timeout, sharesnapshot, requestId) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2633,13 +2746,14 @@ public Mono renewLeaseAsync(String shareName, String leaseId, Integer time public Mono renewLeaseAsync(String shareName, String leaseId, Integer timeout, String sharesnapshot, String requestId, Context context) { return renewLeaseWithResponseAsync(shareName, leaseId, timeout, sharesnapshot, requestId, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2661,15 +2775,17 @@ public Mono> renewLeaseNoCustomHeadersWithResponseAsync(String sh final String action = "renew"; final String restype = "share"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.renewLeaseNoCustomHeaders(this.client.getUrl(), shareName, comp, - action, restype, timeout, leaseId, this.client.getVersion(), sharesnapshot, requestId, - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.renewLeaseNoCustomHeaders(this.client.getUrl(), shareName, comp, action, + restype, timeout, leaseId, this.client.getVersion(), sharesnapshot, requestId, + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2692,15 +2808,16 @@ public Mono> renewLeaseNoCustomHeadersWithResponseAsync(String sh final String action = "renew"; final String restype = "share"; final String accept = "application/xml"; - return service.renewLeaseNoCustomHeaders(this.client.getUrl(), shareName, comp, action, restype, timeout, - leaseId, this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), accept, - context); + return service + .renewLeaseNoCustomHeaders(this.client.getUrl(), shareName, comp, action, restype, timeout, leaseId, + this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2723,14 +2840,19 @@ public ResponseBase renewLeaseWithResponse(String final String action = "renew"; final String restype = "share"; final String accept = "application/xml"; - return service.renewLeaseSync(this.client.getUrl(), shareName, comp, action, restype, timeout, leaseId, - this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), accept, context); + try { + return service.renewLeaseSync(this.client.getUrl(), shareName, comp, action, restype, timeout, leaseId, + this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), accept, + context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2752,7 +2874,7 @@ public void renewLease(String shareName, String leaseId, Integer timeout, String /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -2775,15 +2897,19 @@ public Response renewLeaseNoCustomHeadersWithResponse(String shareName, St final String action = "renew"; final String restype = "share"; final String accept = "application/xml"; - return service.renewLeaseNoCustomHeadersSync(this.client.getUrl(), shareName, comp, action, restype, timeout, - leaseId, this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), accept, - context); + try { + return service.renewLeaseNoCustomHeadersSync(this.client.getUrl(), shareName, comp, action, restype, + timeout, leaseId, this.client.getVersion(), sharesnapshot, requestId, + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -2811,15 +2937,17 @@ public Mono> breakLeaseWithResponseA final String action = "break"; final String restype = "share"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.breakLease(this.client.getUrl(), shareName, comp, action, - restype, timeout, breakPeriod, leaseId, this.client.getVersion(), requestId, sharesnapshot, - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.breakLease(this.client.getUrl(), shareName, comp, action, restype, timeout, + breakPeriod, leaseId, this.client.getVersion(), requestId, sharesnapshot, + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -2848,14 +2976,16 @@ public Mono> breakLeaseWithResponseA final String action = "break"; final String restype = "share"; final String accept = "application/xml"; - return service.breakLease(this.client.getUrl(), shareName, comp, action, restype, timeout, breakPeriod, leaseId, - this.client.getVersion(), requestId, sharesnapshot, this.client.getFileRequestIntent(), accept, context); + return service + .breakLease(this.client.getUrl(), shareName, comp, action, restype, timeout, breakPeriod, leaseId, + this.client.getVersion(), requestId, sharesnapshot, this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -2880,13 +3010,14 @@ public Mono> breakLeaseWithResponseA public Mono breakLeaseAsync(String shareName, Integer timeout, Integer breakPeriod, String leaseId, String requestId, String sharesnapshot) { return breakLeaseWithResponseAsync(shareName, timeout, breakPeriod, leaseId, requestId, sharesnapshot) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -2912,13 +3043,14 @@ public Mono breakLeaseAsync(String shareName, Integer timeout, Integer bre public Mono breakLeaseAsync(String shareName, Integer timeout, Integer breakPeriod, String leaseId, String requestId, String sharesnapshot, Context context) { return breakLeaseWithResponseAsync(shareName, timeout, breakPeriod, leaseId, requestId, sharesnapshot, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -2946,15 +3078,17 @@ public Mono> breakLeaseNoCustomHeadersWithResponseAsync(String sh final String action = "break"; final String restype = "share"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.breakLeaseNoCustomHeaders(this.client.getUrl(), shareName, comp, - action, restype, timeout, breakPeriod, leaseId, this.client.getVersion(), requestId, sharesnapshot, - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.breakLeaseNoCustomHeaders(this.client.getUrl(), shareName, comp, action, + restype, timeout, breakPeriod, leaseId, this.client.getVersion(), requestId, sharesnapshot, + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -2983,15 +3117,17 @@ public Mono> breakLeaseNoCustomHeadersWithResponseAsync(String sh final String action = "break"; final String restype = "share"; final String accept = "application/xml"; - return service.breakLeaseNoCustomHeaders(this.client.getUrl(), shareName, comp, action, restype, timeout, - breakPeriod, leaseId, this.client.getVersion(), requestId, sharesnapshot, - this.client.getFileRequestIntent(), accept, context); + return service + .breakLeaseNoCustomHeaders(this.client.getUrl(), shareName, comp, action, restype, timeout, breakPeriod, + leaseId, this.client.getVersion(), requestId, sharesnapshot, this.client.getFileRequestIntent(), accept, + context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -3020,15 +3156,19 @@ public ResponseBase breakLeaseWithResponse(String final String action = "break"; final String restype = "share"; final String accept = "application/xml"; - return service.breakLeaseSync(this.client.getUrl(), shareName, comp, action, restype, timeout, breakPeriod, - leaseId, this.client.getVersion(), requestId, sharesnapshot, this.client.getFileRequestIntent(), accept, - context); + try { + return service.breakLeaseSync(this.client.getUrl(), shareName, comp, action, restype, timeout, breakPeriod, + leaseId, this.client.getVersion(), requestId, sharesnapshot, this.client.getFileRequestIntent(), accept, + context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -3057,7 +3197,7 @@ public void breakLease(String shareName, Integer timeout, Integer breakPeriod, S /** * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete * share operations. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -3086,14 +3226,18 @@ public Response breakLeaseNoCustomHeadersWithResponse(String shareName, In final String action = "break"; final String restype = "share"; final String accept = "application/xml"; - return service.breakLeaseNoCustomHeadersSync(this.client.getUrl(), shareName, comp, action, restype, timeout, - breakPeriod, leaseId, this.client.getVersion(), requestId, sharesnapshot, - this.client.getFileRequestIntent(), accept, context); + try { + return service.breakLeaseNoCustomHeadersSync(this.client.getUrl(), shareName, comp, action, restype, + timeout, breakPeriod, leaseId, this.client.getVersion(), requestId, sharesnapshot, + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Creates a read-only snapshot of a share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -3110,13 +3254,15 @@ public Mono> createSnapshotWithR final String restype = "share"; final String comp = "snapshot"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.createSnapshot(this.client.getUrl(), shareName, restype, comp, - timeout, metadata, this.client.getVersion(), this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.createSnapshot(this.client.getUrl(), shareName, restype, comp, timeout, + metadata, this.client.getVersion(), this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Creates a read-only snapshot of a share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -3134,13 +3280,15 @@ public Mono> createSnapshotWithR final String restype = "share"; final String comp = "snapshot"; final String accept = "application/xml"; - return service.createSnapshot(this.client.getUrl(), shareName, restype, comp, timeout, metadata, - this.client.getVersion(), this.client.getFileRequestIntent(), accept, context); + return service + .createSnapshot(this.client.getUrl(), shareName, restype, comp, timeout, metadata, this.client.getVersion(), + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Creates a read-only snapshot of a share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -3153,12 +3301,14 @@ public Mono> createSnapshotWithR */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono createSnapshotAsync(String shareName, Integer timeout, Map metadata) { - return createSnapshotWithResponseAsync(shareName, timeout, metadata).flatMap(ignored -> Mono.empty()); + return createSnapshotWithResponseAsync(shareName, timeout, metadata) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Creates a read-only snapshot of a share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -3173,12 +3323,14 @@ public Mono createSnapshotAsync(String shareName, Integer timeout, Map createSnapshotAsync(String shareName, Integer timeout, Map metadata, Context context) { - return createSnapshotWithResponseAsync(shareName, timeout, metadata, context).flatMap(ignored -> Mono.empty()); + return createSnapshotWithResponseAsync(shareName, timeout, metadata, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Creates a read-only snapshot of a share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -3195,14 +3347,15 @@ public Mono> createSnapshotNoCustomHeadersWithResponseAsync(Strin final String restype = "share"; final String comp = "snapshot"; final String accept = "application/xml"; - return FluxUtil.withContext( - context -> service.createSnapshotNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, - metadata, this.client.getVersion(), this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.createSnapshotNoCustomHeaders(this.client.getUrl(), shareName, restype, + comp, timeout, metadata, this.client.getVersion(), this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Creates a read-only snapshot of a share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -3220,13 +3373,15 @@ public Mono> createSnapshotNoCustomHeadersWithResponseAsync(Strin final String restype = "share"; final String comp = "snapshot"; final String accept = "application/xml"; - return service.createSnapshotNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, metadata, - this.client.getVersion(), this.client.getFileRequestIntent(), accept, context); + return service + .createSnapshotNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, metadata, + this.client.getVersion(), this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Creates a read-only snapshot of a share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -3244,13 +3399,17 @@ public ResponseBase createSnapshotWithRespons final String restype = "share"; final String comp = "snapshot"; final String accept = "application/xml"; - return service.createSnapshotSync(this.client.getUrl(), shareName, restype, comp, timeout, metadata, - this.client.getVersion(), this.client.getFileRequestIntent(), accept, context); + try { + return service.createSnapshotSync(this.client.getUrl(), shareName, restype, comp, timeout, metadata, + this.client.getVersion(), this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Creates a read-only snapshot of a share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -3267,7 +3426,7 @@ public void createSnapshot(String shareName, Integer timeout, Map createSnapshotNoCustomHeadersWithResponse(String shareName final String restype = "share"; final String comp = "snapshot"; final String accept = "application/xml"; - return service.createSnapshotNoCustomHeadersSync(this.client.getUrl(), shareName, restype, comp, timeout, - metadata, this.client.getVersion(), this.client.getFileRequestIntent(), accept, context); + try { + return service.createSnapshotNoCustomHeadersSync(this.client.getUrl(), shareName, restype, comp, timeout, + metadata, this.client.getVersion(), this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Create a permission (a security descriptor). - * + * * @param shareName The name of the target share. * @param sharePermission A permission (a security descriptor) at the share level. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3308,13 +3471,15 @@ public Mono> createPermissionW final String restype = "share"; final String comp = "filepermission"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.createPermission(this.client.getUrl(), shareName, restype, comp, - timeout, this.client.getVersion(), this.client.getFileRequestIntent(), sharePermission, accept, context)); + return FluxUtil + .withContext(context -> service.createPermission(this.client.getUrl(), shareName, restype, comp, timeout, + this.client.getVersion(), this.client.getFileRequestIntent(), sharePermission, accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Create a permission (a security descriptor). - * + * * @param shareName The name of the target share. * @param sharePermission A permission (a security descriptor) at the share level. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3332,13 +3497,15 @@ public Mono> createPermissionW final String restype = "share"; final String comp = "filepermission"; final String accept = "application/xml"; - return service.createPermission(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), this.client.getFileRequestIntent(), sharePermission, accept, context); + return service + .createPermission(this.client.getUrl(), shareName, restype, comp, timeout, this.client.getVersion(), + this.client.getFileRequestIntent(), sharePermission, accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Create a permission (a security descriptor). - * + * * @param shareName The name of the target share. * @param sharePermission A permission (a security descriptor) at the share level. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3351,12 +3518,14 @@ public Mono> createPermissionW */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono createPermissionAsync(String shareName, SharePermission sharePermission, Integer timeout) { - return createPermissionWithResponseAsync(shareName, sharePermission, timeout).flatMap(ignored -> Mono.empty()); + return createPermissionWithResponseAsync(shareName, sharePermission, timeout) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Create a permission (a security descriptor). - * + * * @param shareName The name of the target share. * @param sharePermission A permission (a security descriptor) at the share level. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3372,12 +3541,13 @@ public Mono createPermissionAsync(String shareName, SharePermission shareP public Mono createPermissionAsync(String shareName, SharePermission sharePermission, Integer timeout, Context context) { return createPermissionWithResponseAsync(shareName, sharePermission, timeout, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * Create a permission (a security descriptor). - * + * * @param shareName The name of the target share. * @param sharePermission A permission (a security descriptor) at the share level. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3396,12 +3566,13 @@ public Mono> createPermissionNoCustomHeadersWithResponseAsync(Str final String accept = "application/xml"; return FluxUtil.withContext( context -> service.createPermissionNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), this.client.getFileRequestIntent(), sharePermission, accept, context)); + this.client.getVersion(), this.client.getFileRequestIntent(), sharePermission, accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Create a permission (a security descriptor). - * + * * @param shareName The name of the target share. * @param sharePermission A permission (a security descriptor) at the share level. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3419,13 +3590,15 @@ public Mono> createPermissionNoCustomHeadersWithResponseAsync(Str final String restype = "share"; final String comp = "filepermission"; final String accept = "application/xml"; - return service.createPermissionNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), this.client.getFileRequestIntent(), sharePermission, accept, context); + return service + .createPermissionNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, + this.client.getVersion(), this.client.getFileRequestIntent(), sharePermission, accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Create a permission (a security descriptor). - * + * * @param shareName The name of the target share. * @param sharePermission A permission (a security descriptor) at the share level. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3443,13 +3616,17 @@ public ResponseBase createPermissionWithRes final String restype = "share"; final String comp = "filepermission"; final String accept = "application/xml"; - return service.createPermissionSync(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), this.client.getFileRequestIntent(), sharePermission, accept, context); + try { + return service.createPermissionSync(this.client.getUrl(), shareName, restype, comp, timeout, + this.client.getVersion(), this.client.getFileRequestIntent(), sharePermission, accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Create a permission (a security descriptor). - * + * * @param shareName The name of the target share. * @param sharePermission A permission (a security descriptor) at the share level. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3466,7 +3643,7 @@ public void createPermission(String shareName, SharePermission sharePermission, /** * Create a permission (a security descriptor). - * + * * @param shareName The name of the target share. * @param sharePermission A permission (a security descriptor) at the share level. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a @@ -3484,13 +3661,17 @@ public Response createPermissionNoCustomHeadersWithResponse(String shareNa final String restype = "share"; final String comp = "filepermission"; final String accept = "application/xml"; - return service.createPermissionNoCustomHeadersSync(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), this.client.getFileRequestIntent(), sharePermission, accept, context); + try { + return service.createPermissionNoCustomHeadersSync(this.client.getUrl(), shareName, restype, comp, timeout, + this.client.getVersion(), this.client.getFileRequestIntent(), sharePermission, accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Returns the permission (security descriptor) for a given key. - * + * * @param shareName The name of the target share. * @param filePermissionKey Key of the permission to be set for the directory/file. * @param filePermissionFormat Optional. Available for version 2023-06-01 and later. Specifies the format in which @@ -3513,14 +3694,16 @@ public Mono> getPermis final String restype = "share"; final String comp = "filepermission"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getPermission(this.client.getUrl(), shareName, restype, comp, - filePermissionKey, filePermissionFormat, timeout, this.client.getVersion(), - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.getPermission(this.client.getUrl(), shareName, restype, comp, + filePermissionKey, filePermissionFormat, timeout, this.client.getVersion(), + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Returns the permission (security descriptor) for a given key. - * + * * @param shareName The name of the target share. * @param filePermissionKey Key of the permission to be set for the directory/file. * @param filePermissionFormat Optional. Available for version 2023-06-01 and later. Specifies the format in which @@ -3545,14 +3728,15 @@ public Mono> getPermis final String restype = "share"; final String comp = "filepermission"; final String accept = "application/json"; - return service.getPermission(this.client.getUrl(), shareName, restype, comp, filePermissionKey, - filePermissionFormat, timeout, this.client.getVersion(), this.client.getFileRequestIntent(), accept, - context); + return service + .getPermission(this.client.getUrl(), shareName, restype, comp, filePermissionKey, filePermissionFormat, + timeout, this.client.getVersion(), this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Returns the permission (security descriptor) for a given key. - * + * * @param shareName The name of the target share. * @param filePermissionKey Key of the permission to be set for the directory/file. * @param filePermissionFormat Optional. Available for version 2023-06-01 and later. Specifies the format in which @@ -3572,12 +3756,13 @@ public Mono> getPermis public Mono getPermissionAsync(String shareName, String filePermissionKey, FilePermissionFormat filePermissionFormat, Integer timeout) { return getPermissionWithResponseAsync(shareName, filePermissionKey, filePermissionFormat, timeout) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Returns the permission (security descriptor) for a given key. - * + * * @param shareName The name of the target share. * @param filePermissionKey Key of the permission to be set for the directory/file. * @param filePermissionFormat Optional. Available for version 2023-06-01 and later. Specifies the format in which @@ -3598,12 +3783,13 @@ public Mono getPermissionAsync(String shareName, String filePer public Mono getPermissionAsync(String shareName, String filePermissionKey, FilePermissionFormat filePermissionFormat, Integer timeout, Context context) { return getPermissionWithResponseAsync(shareName, filePermissionKey, filePermissionFormat, timeout, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Returns the permission (security descriptor) for a given key. - * + * * @param shareName The name of the target share. * @param filePermissionKey Key of the permission to be set for the directory/file. * @param filePermissionFormat Optional. Available for version 2023-06-01 and later. Specifies the format in which @@ -3626,14 +3812,16 @@ public Mono> getPermissionNoCustomHeadersWithResponseA final String restype = "share"; final String comp = "filepermission"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getPermissionNoCustomHeaders(this.client.getUrl(), shareName, - restype, comp, filePermissionKey, filePermissionFormat, timeout, this.client.getVersion(), - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.getPermissionNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, + filePermissionKey, filePermissionFormat, timeout, this.client.getVersion(), + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Returns the permission (security descriptor) for a given key. - * + * * @param shareName The name of the target share. * @param filePermissionKey Key of the permission to be set for the directory/file. * @param filePermissionFormat Optional. Available for version 2023-06-01 and later. Specifies the format in which @@ -3657,14 +3845,16 @@ public Mono> getPermissionNoCustomHeadersWithResponseA final String restype = "share"; final String comp = "filepermission"; final String accept = "application/json"; - return service.getPermissionNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, filePermissionKey, - filePermissionFormat, timeout, this.client.getVersion(), this.client.getFileRequestIntent(), accept, - context); + return service + .getPermissionNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, filePermissionKey, + filePermissionFormat, timeout, this.client.getVersion(), this.client.getFileRequestIntent(), accept, + context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Returns the permission (security descriptor) for a given key. - * + * * @param shareName The name of the target share. * @param filePermissionKey Key of the permission to be set for the directory/file. * @param filePermissionFormat Optional. Available for version 2023-06-01 and later. Specifies the format in which @@ -3687,14 +3877,18 @@ public ResponseBase getPermissionWi final String restype = "share"; final String comp = "filepermission"; final String accept = "application/json"; - return service.getPermissionSync(this.client.getUrl(), shareName, restype, comp, filePermissionKey, - filePermissionFormat, timeout, this.client.getVersion(), this.client.getFileRequestIntent(), accept, - context); + try { + return service.getPermissionSync(this.client.getUrl(), shareName, restype, comp, filePermissionKey, + filePermissionFormat, timeout, this.client.getVersion(), this.client.getFileRequestIntent(), accept, + context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Returns the permission (security descriptor) for a given key. - * + * * @param shareName The name of the target share. * @param filePermissionKey Key of the permission to be set for the directory/file. * @param filePermissionFormat Optional. Available for version 2023-06-01 and later. Specifies the format in which @@ -3713,13 +3907,17 @@ public ResponseBase getPermissionWi @ServiceMethod(returns = ReturnType.SINGLE) public SharePermission getPermission(String shareName, String filePermissionKey, FilePermissionFormat filePermissionFormat, Integer timeout) { - return getPermissionWithResponse(shareName, filePermissionKey, filePermissionFormat, timeout, Context.NONE) - .getValue(); + try { + return getPermissionWithResponse(shareName, filePermissionKey, filePermissionFormat, timeout, Context.NONE) + .getValue(); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Returns the permission (security descriptor) for a given key. - * + * * @param shareName The name of the target share. * @param filePermissionKey Key of the permission to be set for the directory/file. * @param filePermissionFormat Optional. Available for version 2023-06-01 and later. Specifies the format in which @@ -3742,14 +3940,18 @@ public Response getPermissionNoCustomHeadersWithResponse(String final String restype = "share"; final String comp = "filepermission"; final String accept = "application/json"; - return service.getPermissionNoCustomHeadersSync(this.client.getUrl(), shareName, restype, comp, - filePermissionKey, filePermissionFormat, timeout, this.client.getVersion(), - this.client.getFileRequestIntent(), accept, context); + try { + return service.getPermissionNoCustomHeadersSync(this.client.getUrl(), shareName, restype, comp, + filePermissionKey, filePermissionFormat, timeout, this.client.getVersion(), + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Sets properties for the specified share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -3778,15 +3980,17 @@ public Mono> setPropertiesWithRes final String restype = "share"; final String comp = "properties"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.setProperties(this.client.getUrl(), shareName, restype, comp, - timeout, this.client.getVersion(), quota, accessTier, leaseId, rootSquash, - enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, - paidBurstingMaxIops, this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.setProperties(this.client.getUrl(), shareName, restype, comp, timeout, + this.client.getVersion(), quota, accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, + paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Sets properties for the specified share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -3816,14 +4020,16 @@ public Mono> setPropertiesWithRes final String restype = "share"; final String comp = "properties"; final String accept = "application/xml"; - return service.setProperties(this.client.getUrl(), shareName, restype, comp, timeout, this.client.getVersion(), - quota, accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, - paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, this.client.getFileRequestIntent(), accept, context); + return service + .setProperties(this.client.getUrl(), shareName, restype, comp, timeout, this.client.getVersion(), quota, + accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, + paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Sets properties for the specified share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -3850,12 +4056,14 @@ public Mono setPropertiesAsync(String shareName, Integer timeout, Integer Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops) { return setPropertiesWithResponseAsync(shareName, timeout, quota, accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, - paidBurstingMaxIops).flatMap(ignored -> Mono.empty()); + paidBurstingMaxIops) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Sets properties for the specified share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -3883,12 +4091,14 @@ public Mono setPropertiesAsync(String shareName, Integer timeout, Integer Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Context context) { return setPropertiesWithResponseAsync(shareName, timeout, quota, accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, - paidBurstingMaxIops, context).flatMap(ignored -> Mono.empty()); + paidBurstingMaxIops, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Sets properties for the specified share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -3917,15 +4127,17 @@ public Mono> setPropertiesNoCustomHeadersWithResponseAsync(String final String restype = "share"; final String comp = "properties"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.setPropertiesNoCustomHeaders(this.client.getUrl(), shareName, - restype, comp, timeout, this.client.getVersion(), quota, accessTier, leaseId, rootSquash, - enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, - paidBurstingMaxIops, this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.setPropertiesNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, + timeout, this.client.getVersion(), quota, accessTier, leaseId, rootSquash, + enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, + paidBurstingMaxIops, this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Sets properties for the specified share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -3955,15 +4167,17 @@ public Mono> setPropertiesNoCustomHeadersWithResponseAsync(String final String restype = "share"; final String comp = "properties"; final String accept = "application/xml"; - return service.setPropertiesNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), quota, accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, - paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, this.client.getFileRequestIntent(), - accept, context); + return service + .setPropertiesNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, + this.client.getVersion(), quota, accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, + paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Sets properties for the specified share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -3993,15 +4207,19 @@ public ResponseBase setPropertiesWithResponse( final String restype = "share"; final String comp = "properties"; final String accept = "application/xml"; - return service.setPropertiesSync(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), quota, accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, - paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, this.client.getFileRequestIntent(), - accept, context); + try { + return service.setPropertiesSync(this.client.getUrl(), shareName, restype, comp, timeout, + this.client.getVersion(), quota, accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, + paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Sets properties for the specified share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4032,7 +4250,7 @@ public void setProperties(String shareName, Integer timeout, Integer quota, Shar /** * Sets properties for the specified share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4062,15 +4280,19 @@ public Response setPropertiesNoCustomHeadersWithResponse(String shareName, final String restype = "share"; final String comp = "properties"; final String accept = "application/xml"; - return service.setPropertiesNoCustomHeadersSync(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), quota, accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, - paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, this.client.getFileRequestIntent(), - accept, context); + try { + return service.setPropertiesNoCustomHeadersSync(this.client.getUrl(), shareName, restype, comp, timeout, + this.client.getVersion(), quota, accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, + paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Sets one or more user-defined name-value pairs for the specified share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4088,13 +4310,15 @@ public Mono> setMetadataWithRespons final String restype = "share"; final String comp = "metadata"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.setMetadata(this.client.getUrl(), shareName, restype, comp, - timeout, metadata, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.setMetadata(this.client.getUrl(), shareName, restype, comp, timeout, + metadata, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Sets one or more user-defined name-value pairs for the specified share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4113,13 +4337,15 @@ public Mono> setMetadataWithRespons final String restype = "share"; final String comp = "metadata"; final String accept = "application/xml"; - return service.setMetadata(this.client.getUrl(), shareName, restype, comp, timeout, metadata, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + return service + .setMetadata(this.client.getUrl(), shareName, restype, comp, timeout, metadata, this.client.getVersion(), + leaseId, this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Sets one or more user-defined name-value pairs for the specified share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4134,12 +4360,14 @@ public Mono> setMetadataWithRespons @ServiceMethod(returns = ReturnType.SINGLE) public Mono setMetadataAsync(String shareName, Integer timeout, Map metadata, String leaseId) { - return setMetadataWithResponseAsync(shareName, timeout, metadata, leaseId).flatMap(ignored -> Mono.empty()); + return setMetadataWithResponseAsync(shareName, timeout, metadata, leaseId) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Sets one or more user-defined name-value pairs for the specified share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4156,12 +4384,13 @@ public Mono setMetadataAsync(String shareName, Integer timeout, Map setMetadataAsync(String shareName, Integer timeout, Map metadata, String leaseId, Context context) { return setMetadataWithResponseAsync(shareName, timeout, metadata, leaseId, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * Sets one or more user-defined name-value pairs for the specified share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4179,14 +4408,16 @@ public Mono> setMetadataNoCustomHeadersWithResponseAsync(String s final String restype = "share"; final String comp = "metadata"; final String accept = "application/xml"; - return FluxUtil.withContext( - context -> service.setMetadataNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, - metadata, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext( + context -> service.setMetadataNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, + metadata, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Sets one or more user-defined name-value pairs for the specified share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4205,13 +4436,15 @@ public Mono> setMetadataNoCustomHeadersWithResponseAsync(String s final String restype = "share"; final String comp = "metadata"; final String accept = "application/xml"; - return service.setMetadataNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, metadata, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + return service + .setMetadataNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, metadata, + this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Sets one or more user-defined name-value pairs for the specified share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4230,13 +4463,17 @@ public ResponseBase setMetadataWithResponse(Stri final String restype = "share"; final String comp = "metadata"; final String accept = "application/xml"; - return service.setMetadataSync(this.client.getUrl(), shareName, restype, comp, timeout, metadata, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + try { + return service.setMetadataSync(this.client.getUrl(), shareName, restype, comp, timeout, metadata, + this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Sets one or more user-defined name-value pairs for the specified share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4254,7 +4491,7 @@ public void setMetadata(String shareName, Integer timeout, Map m /** * Sets one or more user-defined name-value pairs for the specified share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4273,13 +4510,17 @@ public Response setMetadataNoCustomHeadersWithResponse(String shareName, I final String restype = "share"; final String comp = "metadata"; final String accept = "application/xml"; - return service.setMetadataNoCustomHeadersSync(this.client.getUrl(), shareName, restype, comp, timeout, metadata, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + try { + return service.setMetadataNoCustomHeadersSync(this.client.getUrl(), shareName, restype, comp, timeout, + metadata, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Returns information about stored access policies specified on the share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4297,13 +4538,15 @@ public Response setMetadataNoCustomHeadersWithResponse(String shareName, I final String restype = "share"; final String comp = "acl"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getAccessPolicy(this.client.getUrl(), shareName, restype, comp, - timeout, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.getAccessPolicy(this.client.getUrl(), shareName, restype, comp, timeout, + this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Returns information about stored access policies specified on the share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4322,13 +4565,15 @@ public Response setMetadataNoCustomHeadersWithResponse(String shareName, I final String restype = "share"; final String comp = "acl"; final String accept = "application/xml"; - return service.getAccessPolicy(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + return service + .getAccessPolicy(this.client.getUrl(), shareName, restype, comp, timeout, this.client.getVersion(), leaseId, + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Returns information about stored access policies specified on the share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4342,12 +4587,13 @@ public Response setMetadataNoCustomHeadersWithResponse(String shareName, I @ServiceMethod(returns = ReturnType.SINGLE) public Mono getAccessPolicyAsync(String shareName, Integer timeout, String leaseId) { return getAccessPolicyWithResponseAsync(shareName, timeout, leaseId) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Returns information about stored access policies specified on the share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4363,12 +4609,13 @@ public Mono getAccessPolicyAsync(String shareName, public Mono getAccessPolicyAsync(String shareName, Integer timeout, String leaseId, Context context) { return getAccessPolicyWithResponseAsync(shareName, timeout, leaseId, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Returns information about stored access policies specified on the share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4387,12 +4634,13 @@ public Mono getAccessPolicyAsync(String shareName, final String accept = "application/xml"; return FluxUtil .withContext(context -> service.getAccessPolicyNoCustomHeaders(this.client.getUrl(), shareName, restype, - comp, timeout, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context)); + comp, timeout, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Returns information about stored access policies specified on the share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4410,13 +4658,15 @@ public Mono> getAccessPolicyNoCustomHeade final String restype = "share"; final String comp = "acl"; final String accept = "application/xml"; - return service.getAccessPolicyNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + return service + .getAccessPolicyNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, + this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Returns information about stored access policies specified on the share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4434,13 +4684,17 @@ public Mono> getAccessPolicyNoCustomHeade final String restype = "share"; final String comp = "acl"; final String accept = "application/xml"; - return service.getAccessPolicySync(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + try { + return service.getAccessPolicySync(this.client.getUrl(), shareName, restype, comp, timeout, + this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Returns information about stored access policies specified on the share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4453,12 +4707,16 @@ public Mono> getAccessPolicyNoCustomHeade */ @ServiceMethod(returns = ReturnType.SINGLE) public ShareSignedIdentifierWrapper getAccessPolicy(String shareName, Integer timeout, String leaseId) { - return getAccessPolicyWithResponse(shareName, timeout, leaseId, Context.NONE).getValue(); + try { + return getAccessPolicyWithResponse(shareName, timeout, leaseId, Context.NONE).getValue(); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Returns information about stored access policies specified on the share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4476,13 +4734,17 @@ public Response getAccessPolicyNoCustomHeadersWith final String restype = "share"; final String comp = "acl"; final String accept = "application/xml"; - return service.getAccessPolicyNoCustomHeadersSync(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + try { + return service.getAccessPolicyNoCustomHeadersSync(this.client.getUrl(), shareName, restype, comp, timeout, + this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Sets a stored access policy for use with shared access signatures. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4503,12 +4765,12 @@ public Mono> setAccessPolicyWit ShareSignedIdentifierWrapper shareAclConverted = new ShareSignedIdentifierWrapper(shareAcl); return FluxUtil.withContext(context -> service.setAccessPolicy(this.client.getUrl(), shareName, restype, comp, timeout, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), shareAclConverted, accept, - context)); + context)).onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Sets a stored access policy for use with shared access signatures. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4528,13 +4790,15 @@ public Mono> setAccessPolicyWit final String comp = "acl"; final String accept = "application/xml"; ShareSignedIdentifierWrapper shareAclConverted = new ShareSignedIdentifierWrapper(shareAcl); - return service.setAccessPolicy(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), shareAclConverted, accept, context); + return service + .setAccessPolicy(this.client.getUrl(), shareName, restype, comp, timeout, this.client.getVersion(), leaseId, + this.client.getFileRequestIntent(), shareAclConverted, accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Sets a stored access policy for use with shared access signatures. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4549,12 +4813,14 @@ public Mono> setAccessPolicyWit @ServiceMethod(returns = ReturnType.SINGLE) public Mono setAccessPolicyAsync(String shareName, Integer timeout, String leaseId, List shareAcl) { - return setAccessPolicyWithResponseAsync(shareName, timeout, leaseId, shareAcl).flatMap(ignored -> Mono.empty()); + return setAccessPolicyWithResponseAsync(shareName, timeout, leaseId, shareAcl) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Sets a stored access policy for use with shared access signatures. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4571,12 +4837,13 @@ public Mono setAccessPolicyAsync(String shareName, Integer timeout, String public Mono setAccessPolicyAsync(String shareName, Integer timeout, String leaseId, List shareAcl, Context context) { return setAccessPolicyWithResponseAsync(shareName, timeout, leaseId, shareAcl, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * Sets a stored access policy for use with shared access signatures. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4595,14 +4862,16 @@ public Mono> setAccessPolicyNoCustomHeadersWithResponseAsync(Stri final String comp = "acl"; final String accept = "application/xml"; ShareSignedIdentifierWrapper shareAclConverted = new ShareSignedIdentifierWrapper(shareAcl); - return FluxUtil.withContext(context -> service.setAccessPolicyNoCustomHeaders(this.client.getUrl(), shareName, - restype, comp, timeout, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), - shareAclConverted, accept, context)); + return FluxUtil + .withContext(context -> service.setAccessPolicyNoCustomHeaders(this.client.getUrl(), shareName, restype, + comp, timeout, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), shareAclConverted, + accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Sets a stored access policy for use with shared access signatures. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4623,12 +4892,13 @@ public Mono> setAccessPolicyNoCustomHeadersWithResponseAsync(Stri final String accept = "application/xml"; ShareSignedIdentifierWrapper shareAclConverted = new ShareSignedIdentifierWrapper(shareAcl); return service.setAccessPolicyNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), shareAclConverted, accept, context); + this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), shareAclConverted, accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Sets a stored access policy for use with shared access signatures. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4648,13 +4918,18 @@ public ResponseBase setAccessPolicyWithRespo final String comp = "acl"; final String accept = "application/xml"; ShareSignedIdentifierWrapper shareAclConverted = new ShareSignedIdentifierWrapper(shareAcl); - return service.setAccessPolicySync(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), shareAclConverted, accept, context); + try { + return service.setAccessPolicySync(this.client.getUrl(), shareName, restype, comp, timeout, + this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), shareAclConverted, accept, + context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Sets a stored access policy for use with shared access signatures. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4673,7 +4948,7 @@ public void setAccessPolicy(String shareName, Integer timeout, String leaseId, /** * Sets a stored access policy for use with shared access signatures. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4693,13 +4968,18 @@ public Response setAccessPolicyNoCustomHeadersWithResponse(String shareNam final String comp = "acl"; final String accept = "application/xml"; ShareSignedIdentifierWrapper shareAclConverted = new ShareSignedIdentifierWrapper(shareAcl); - return service.setAccessPolicyNoCustomHeadersSync(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), shareAclConverted, accept, context); + try { + return service.setAccessPolicyNoCustomHeadersSync(this.client.getUrl(), shareName, restype, comp, timeout, + this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), shareAclConverted, accept, + context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Retrieves statistics related to the share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4716,13 +4996,15 @@ public Mono> getStatisticsW final String restype = "share"; final String comp = "stats"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getStatistics(this.client.getUrl(), shareName, restype, comp, - timeout, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.getStatistics(this.client.getUrl(), shareName, restype, comp, timeout, + this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Retrieves statistics related to the share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4740,13 +5022,15 @@ public Mono> getStatisticsW final String restype = "share"; final String comp = "stats"; final String accept = "application/xml"; - return service.getStatistics(this.client.getUrl(), shareName, restype, comp, timeout, this.client.getVersion(), - leaseId, this.client.getFileRequestIntent(), accept, context); + return service + .getStatistics(this.client.getUrl(), shareName, restype, comp, timeout, this.client.getVersion(), leaseId, + this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Retrieves statistics related to the share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4760,12 +5044,13 @@ public Mono> getStatisticsW @ServiceMethod(returns = ReturnType.SINGLE) public Mono getStatisticsAsync(String shareName, Integer timeout, String leaseId) { return getStatisticsWithResponseAsync(shareName, timeout, leaseId) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Retrieves statistics related to the share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4780,12 +5065,13 @@ public Mono getStatisticsAsync(String shareName, Integer timeout, St @ServiceMethod(returns = ReturnType.SINGLE) public Mono getStatisticsAsync(String shareName, Integer timeout, String leaseId, Context context) { return getStatisticsWithResponseAsync(shareName, timeout, leaseId, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Retrieves statistics related to the share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4804,12 +5090,13 @@ public Mono> getStatisticsNoCustomHeadersWithResponseAsync( final String accept = "application/xml"; return FluxUtil .withContext(context -> service.getStatisticsNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, - timeout, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context)); + timeout, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Retrieves statistics related to the share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4827,13 +5114,15 @@ public Mono> getStatisticsNoCustomHeadersWithResponseAsync( final String restype = "share"; final String comp = "stats"; final String accept = "application/xml"; - return service.getStatisticsNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + return service + .getStatisticsNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, + this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Retrieves statistics related to the share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4851,13 +5140,17 @@ public ResponseBase getStatisticsWithRes final String restype = "share"; final String comp = "stats"; final String accept = "application/xml"; - return service.getStatisticsSync(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + try { + return service.getStatisticsSync(this.client.getUrl(), shareName, restype, comp, timeout, + this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Retrieves statistics related to the share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4870,12 +5163,16 @@ public ResponseBase getStatisticsWithRes */ @ServiceMethod(returns = ReturnType.SINGLE) public ShareStats getStatistics(String shareName, Integer timeout, String leaseId) { - return getStatisticsWithResponse(shareName, timeout, leaseId, Context.NONE).getValue(); + try { + return getStatisticsWithResponse(shareName, timeout, leaseId, Context.NONE).getValue(); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Retrieves statistics related to the share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4893,13 +5190,17 @@ public Response getStatisticsNoCustomHeadersWithResponse(String shar final String restype = "share"; final String comp = "stats"; final String accept = "application/xml"; - return service.getStatisticsNoCustomHeadersSync(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + try { + return service.getStatisticsNoCustomHeadersSync(this.client.getUrl(), shareName, restype, comp, timeout, + this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Restores a previously deleted Share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4919,14 +5220,16 @@ public Mono> restoreWithResponseAsync(S final String restype = "share"; final String comp = "undelete"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.restore(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), requestId, deletedShareName, deletedShareVersion, - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.restore(this.client.getUrl(), shareName, restype, comp, timeout, + this.client.getVersion(), requestId, deletedShareName, deletedShareVersion, + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Restores a previously deleted Share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4947,13 +5250,15 @@ public Mono> restoreWithResponseAsync(S final String restype = "share"; final String comp = "undelete"; final String accept = "application/xml"; - return service.restore(this.client.getUrl(), shareName, restype, comp, timeout, this.client.getVersion(), - requestId, deletedShareName, deletedShareVersion, this.client.getFileRequestIntent(), accept, context); + return service + .restore(this.client.getUrl(), shareName, restype, comp, timeout, this.client.getVersion(), requestId, + deletedShareName, deletedShareVersion, this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Restores a previously deleted Share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4971,12 +5276,13 @@ public Mono> restoreWithResponseAsync(S public Mono restoreAsync(String shareName, Integer timeout, String requestId, String deletedShareName, String deletedShareVersion) { return restoreWithResponseAsync(shareName, timeout, requestId, deletedShareName, deletedShareVersion) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * Restores a previously deleted Share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -4995,12 +5301,13 @@ public Mono restoreAsync(String shareName, Integer timeout, String request public Mono restoreAsync(String shareName, Integer timeout, String requestId, String deletedShareName, String deletedShareVersion, Context context) { return restoreWithResponseAsync(shareName, timeout, requestId, deletedShareName, deletedShareVersion, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } /** * Restores a previously deleted Share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -5020,14 +5327,16 @@ public Mono> restoreNoCustomHeadersWithResponseAsync(String share final String restype = "share"; final String comp = "undelete"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.restoreNoCustomHeaders(this.client.getUrl(), shareName, restype, - comp, timeout, this.client.getVersion(), requestId, deletedShareName, deletedShareVersion, - this.client.getFileRequestIntent(), accept, context)); + return FluxUtil + .withContext(context -> service.restoreNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, + timeout, this.client.getVersion(), requestId, deletedShareName, deletedShareVersion, + this.client.getFileRequestIntent(), accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Restores a previously deleted Share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -5048,14 +5357,15 @@ public Mono> restoreNoCustomHeadersWithResponseAsync(String share final String restype = "share"; final String comp = "undelete"; final String accept = "application/xml"; - return service.restoreNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), requestId, deletedShareName, deletedShareVersion, - this.client.getFileRequestIntent(), accept, context); + return service + .restoreNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, this.client.getVersion(), + requestId, deletedShareName, deletedShareVersion, this.client.getFileRequestIntent(), accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Restores a previously deleted Share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -5076,13 +5386,18 @@ public ResponseBase restoreWithResponse(String share final String restype = "share"; final String comp = "undelete"; final String accept = "application/xml"; - return service.restoreSync(this.client.getUrl(), shareName, restype, comp, timeout, this.client.getVersion(), - requestId, deletedShareName, deletedShareVersion, this.client.getFileRequestIntent(), accept, context); + try { + return service.restoreSync(this.client.getUrl(), shareName, restype, comp, timeout, + this.client.getVersion(), requestId, deletedShareName, deletedShareVersion, + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** * Restores a previously deleted Share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -5103,7 +5418,7 @@ public void restore(String shareName, Integer timeout, String requestId, String /** * Restores a previously deleted Share. - * + * * @param shareName The name of the target share. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting @@ -5124,8 +5439,12 @@ public Response restoreNoCustomHeadersWithResponse(String shareName, Integ final String restype = "share"; final String comp = "undelete"; final String accept = "application/xml"; - return service.restoreNoCustomHeadersSync(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), requestId, deletedShareName, deletedShareVersion, - this.client.getFileRequestIntent(), accept, context); + try { + return service.restoreNoCustomHeadersSync(this.client.getUrl(), shareName, restype, comp, timeout, + this.client.getVersion(), requestId, deletedShareName, deletedShareVersion, + this.client.getFileRequestIntent(), accept, context); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/util/ModelHelper.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/util/ModelHelper.java index 4829b84aa75a..5279f7c6cad5 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/util/ModelHelper.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/util/ModelHelper.java @@ -83,8 +83,6 @@ import java.util.Map; import java.util.Set; import java.util.TreeSet; -import java.util.concurrent.Callable; -import java.util.function.Supplier; import static com.azure.core.http.HttpHeaderName.LAST_MODIFIED; @@ -632,31 +630,7 @@ public static LongRunningOperationStatus mapStatusToLongRunningOperationStatus(C * @param internal The internal exception. * @return The public exception. */ - public static Throwable mapToShareStorageException(Throwable internal) { - if (internal instanceof ShareStorageExceptionInternal) { - ShareStorageExceptionInternal internalException = (ShareStorageExceptionInternal) internal; - return new ShareStorageException(internalException.getMessage(), internalException.getResponse(), - internalException.getValue()); - } - - return internal; - } - - public static Callable wrapTimeoutServiceCallWithExceptionMapping(Supplier serviceCall) { - return () -> { - try { - return serviceCall.get(); - } catch (ShareStorageExceptionInternal internal) { - throw (ShareStorageException) mapToShareStorageException(internal); - } - }; - } - - public static T wrapServiceCallWithExceptionMapping(Supplier serviceCall) { - try { - return serviceCall.get(); - } catch (ShareStorageExceptionInternal internal) { - throw (ShareStorageException) mapToShareStorageException(internal); - } + public static ShareStorageException mapToShareStorageException(ShareStorageExceptionInternal internal) { + return new ShareStorageException(internal.getMessage(), internal.getResponse(), internal.getValue()); } } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/specialized/ShareLeaseAsyncClient.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/specialized/ShareLeaseAsyncClient.java index d6060c98ffe7..7d6b96b2f8d3 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/specialized/ShareLeaseAsyncClient.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/specialized/ShareLeaseAsyncClient.java @@ -14,7 +14,6 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.storage.file.share.ShareFileAsyncClient; import com.azure.storage.file.share.implementation.AzureFileStorageImpl; -import com.azure.storage.file.share.implementation.util.ModelHelper; import com.azure.storage.file.share.models.ShareTokenIntent; import com.azure.storage.file.share.options.ShareAcquireLeaseOptions; import com.azure.storage.file.share.options.ShareBreakLeaseOptions; @@ -178,13 +177,11 @@ Mono> acquireLeaseWithResponse(ShareAcquireLeaseOptions options Mono> response; if (this.isShareFile) { response = this.client.getFiles().acquireLeaseWithResponseAsync(shareName, resourcePath, null, - options.getDuration(), this.leaseId, null, context) - .onErrorMap(ModelHelper::mapToShareStorageException) + options.getDuration(), this.leaseId, null, context) .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getXMsLeaseId())); } else { - response = this.client.getShares().acquireLeaseWithResponseAsync(shareName, null, - options.getDuration(), this.leaseId, shareSnapshot, null, context) - .onErrorMap(ModelHelper::mapToShareStorageException) + response = this.client.getShares().acquireLeaseWithResponseAsync(shareName, null, options.getDuration(), + this.leaseId, shareSnapshot, null, context) .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getXMsLeaseId())); } @@ -237,12 +234,10 @@ Mono> releaseLeaseWithResponse(Context context) { context = context == null ? Context.NONE : context; if (this.isShareFile) { return this.client.getFiles().releaseLeaseNoCustomHeadersWithResponseAsync(shareName, resourcePath, - this.leaseId, null, null, context) - .onErrorMap(ModelHelper::mapToShareStorageException); + this.leaseId, null, null, context); } else { return this.client.getShares().releaseLeaseNoCustomHeadersWithResponseAsync(shareName, this.leaseId, null, - shareSnapshot, null, context) - .onErrorMap(ModelHelper::mapToShareStorageException); + shareSnapshot, null, context); } } @@ -319,12 +314,10 @@ Mono> breakLeaseWithResponse(ShareBreakLeaseOptions options, Cont : Math.toIntExact(options.getBreakPeriod().getSeconds()); if (this.isShareFile) { return this.client.getFiles() - .breakLeaseNoCustomHeadersWithResponseAsync(shareName, resourcePath, null, null, null, context) - .onErrorMap(ModelHelper::mapToShareStorageException); + .breakLeaseNoCustomHeadersWithResponseAsync(shareName, resourcePath, null, null, null, context); } else { return this.client.getShares().breakLeaseNoCustomHeadersWithResponseAsync(shareName, null, breakPeriod, - null, null, shareSnapshot, context) - .onErrorMap(ModelHelper::mapToShareStorageException); + null, null, shareSnapshot, context); } } @@ -376,14 +369,12 @@ Mono> changeLeaseWithResponse(String proposedId, Context contex Mono> response; if (this.isShareFile) { - response = this.client.getFiles().changeLeaseWithResponseAsync(shareName, resourcePath, this.leaseId, null, proposedId, - null, context) - .onErrorMap(ModelHelper::mapToShareStorageException) + response = this.client.getFiles().changeLeaseWithResponseAsync(shareName, resourcePath, this.leaseId, null, + proposedId, null, context) .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getXMsLeaseId())); } else { - response = this.client.getShares().changeLeaseWithResponseAsync(shareName, this.leaseId, null, proposedId, shareSnapshot, - null, context) - .onErrorMap(ModelHelper::mapToShareStorageException) + response = this.client.getShares().changeLeaseWithResponseAsync(shareName, this.leaseId, null, proposedId, + shareSnapshot, null, context) .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getXMsLeaseId())); } @@ -442,7 +433,6 @@ Mono> renewLeaseWithResponse(Context context) { } else { response = this.client.getShares().renewLeaseWithResponseAsync(shareName, this.leaseId, null, shareSnapshot, null, context) - .onErrorMap(ModelHelper::mapToShareStorageException) .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getXMsLeaseId())); } diff --git a/sdk/storage/azure-storage-file-share/swagger/src/main/java/ShareStorageCustomization.java b/sdk/storage/azure-storage-file-share/swagger/src/main/java/ShareStorageCustomization.java index 8caf44fde6a9..1749da82eb18 100644 --- a/sdk/storage/azure-storage-file-share/swagger/src/main/java/ShareStorageCustomization.java +++ b/sdk/storage/azure-storage-file-share/swagger/src/main/java/ShareStorageCustomization.java @@ -5,10 +5,23 @@ import com.azure.autorest.customization.Customization; import com.azure.autorest.customization.LibraryCustomization; import com.azure.autorest.customization.PackageCustomization; +import com.github.javaparser.ParseProblemException; import com.github.javaparser.StaticJavaParser; +import com.github.javaparser.ast.NodeList; import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; +import com.github.javaparser.ast.body.MethodDeclaration; +import com.github.javaparser.ast.body.Parameter; +import com.github.javaparser.ast.stmt.BlockStmt; +import com.github.javaparser.ast.stmt.CatchClause; +import com.github.javaparser.ast.stmt.Statement; +import com.github.javaparser.ast.stmt.TryStmt; +import com.github.javaparser.ast.type.ClassOrInterfaceType; +import com.github.javaparser.ast.type.Type; import org.slf4j.Logger; +import java.util.Arrays; +import java.util.List; + /** * Customization class for File Share Storage. */ @@ -28,6 +41,8 @@ public void customize(LibraryCustomization customization, Logger logger) { customizeFilesAndDirectoriesListSegment( customization.getPackage("com.azure.storage.file.share.implementation.models") .getClass("FilesAndDirectoriesListSegment")); + + updateImplToMapInternalException(customization.getPackage("com.azure.storage.file.share.implementation")); } // ShareFileRangeList has special serialization behaviors which Swagger cannot define correctly. It has a single @@ -147,4 +162,109 @@ private static void customizeFilesAndDirectoriesListSegment(ClassCustomization c ))); }); } + + /** + * Customizes the implementation classes that will perform calls to the service. The following logic is used: + *

+ * - Check for the return of the method not equaling to PagedFlux, PagedIterable, PollerFlux, or SyncPoller. Those + * types wrap other APIs and those APIs being update is the correct change. + * - For asynchronous methods, add a call to + * {@code .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException)} to handle + * mapping ShareStorageExceptionInternal to ShareStorageException. + * - For synchronous methods, wrap the return statement in a try-catch block that catches + * ShareStorageExceptionInternal and rethrows {@code ModelHelper.mapToShareStorageException(e)}. Or, for void + * methods wrap the last statement. + * + * @param implPackage The implementation package. + */ + private static void updateImplToMapInternalException(PackageCustomization implPackage) { + List implsToUpdate = Arrays.asList("DirectoriesImpl", "FilesImpl", "ServicesImpl", "SharesImpl"); + for (String implToUpdate : implsToUpdate) { + implPackage.getClass(implToUpdate).customizeAst(ast -> { + ast.addImport("com.azure.storage.file.share.implementation.util.ModelHelper"); + ast.addImport("com.azure.storage.file.share.models.ShareStorageException"); + ast.addImport("com.azure.storage.file.share.implementation.models.ShareStorageExceptionInternal"); + ast.getClassByName(implToUpdate).ifPresent(clazz -> { + clazz.getFields(); + + clazz.getMethods().forEach(methodDeclaration -> { + Type returnType = methodDeclaration.getType(); + // The way code generation works we only need to update the methods that have a class return type. + // As non-class return types, such as "void", call into the Response methods. + if (!returnType.isClassOrInterfaceType()) { + return; + } + + ClassOrInterfaceType returnTypeClass = returnType.asClassOrInterfaceType(); + String returnTypeName = returnTypeClass.getNameAsString(); + if (returnTypeName.equals("PagedFlux") || returnTypeName.equals("PagedIterable") + || returnTypeName.equals("PollerFlux") || returnTypeName.equals("SyncPoller")) { + return; + } + + if (returnTypeName.equals("Mono") || returnTypeName.equals("Flux")) { + addErrorMappingToAsyncMethod(methodDeclaration); + } else { + addErrorMappingToSyncMethod(methodDeclaration); + } + }); + }); + }); + } + } + + private static void addErrorMappingToAsyncMethod(MethodDeclaration method) { + BlockStmt body = method.getBody().get(); + + // Bit of hack to insert the 'onErrorMap' in the right location. + // Unfortunately, 'onErrorMap' returns which for some calls breaks typing, such as Void -> Object or + // PagedResponse -> PagedResponseBase. So, 'onErrorMap' needs to be inserted after the first method call. + // To do this, we track the first found '(' and the associated closing ')' to insert 'onErrorMap' after the ')'. + // So, 'service.methodCall(parameters).map()' becomes 'service.methodCall(parameters).onErrorMap().map()'. + String originalReturnStatement = body.getStatement(body.getStatements().size() - 1).asReturnStmt() + .getExpression().get().toString(); + int insertionPoint = findAsyncOnErrorMapInsertionPoint(originalReturnStatement); + String newReturnStatement = "return " + originalReturnStatement.substring(0, insertionPoint) + + ".onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException)" + + originalReturnStatement.substring(insertionPoint) + ";"; + try { + Statement newReturn = StaticJavaParser.parseStatement(newReturnStatement); + body.getStatements().set(body.getStatements().size() - 1, newReturn); + } catch (ParseProblemException ex) { + throw new RuntimeException("Failed to parse: " + newReturnStatement, ex); + } + } + + private static int findAsyncOnErrorMapInsertionPoint(String returnStatement) { + int openParenthesis = 0; + int closeParenthesis = 0; + for (int i = 0; i < returnStatement.length(); i++) { + char c = returnStatement.charAt(i); + if (c == '(') { + openParenthesis++; + } else if (c == ')') { + closeParenthesis++; + if (openParenthesis == closeParenthesis) { + return i + 1; + } + } + } + return -1; + } + + private static void addErrorMappingToSyncMethod(MethodDeclaration method) { + BlockStmt body = method.getBody().get(); + + // Turn the last statement into a BlockStmt that will be used as the try block. + BlockStmt tryBlock = new BlockStmt(new NodeList<>(body.getStatement(body.getStatements().size() - 1))); + BlockStmt catchBlock = new BlockStmt(new NodeList<>(StaticJavaParser.parseStatement( + "throw ModelHelper.mapToShareStorageException(internalException);"))); + Parameter catchParameter = new Parameter().setType("ShareStorageExceptionInternal") + .setName("internalException"); + CatchClause catchClause = new CatchClause(catchParameter, catchBlock); + TryStmt tryCatchMap = new TryStmt(tryBlock, new NodeList<>(catchClause), null); + + // Replace the last statement with the try-catch block. + body.getStatements().set(body.getStatements().size() - 1, tryCatchMap); + } } diff --git a/sdk/storage/azure-storage-queue/checkstyle-suppressions.xml b/sdk/storage/azure-storage-queue/checkstyle-suppressions.xml index fe84424cf134..87a5600d9177 100644 --- a/sdk/storage/azure-storage-queue/checkstyle-suppressions.xml +++ b/sdk/storage/azure-storage-queue/checkstyle-suppressions.xml @@ -21,4 +21,14 @@ + + + + + + + + + + diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueAsyncClient.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueAsyncClient.java index 65a895878a66..92b862392665 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueAsyncClient.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueAsyncClient.java @@ -225,8 +225,7 @@ public Mono> createWithResponse(Map metadata) { Mono> createWithResponse(Map metadata, Context context) { context = context == null ? Context.NONE : context; - return client.getQueues().createNoCustomHeadersWithResponseAsync(queueName, null, metadata, null, context) - .onErrorMap(ModelHelper::mapToQueueStorageException); + return client.getQueues().createNoCustomHeadersWithResponseAsync(queueName, null, metadata, null, context); } /** @@ -362,8 +361,7 @@ public Mono> deleteWithResponse() { Mono> deleteWithResponse(Context context) { context = context == null ? Context.NONE : context; - return client.getQueues().deleteNoCustomHeadersWithResponseAsync(queueName, null, null, context) - .onErrorMap(ModelHelper::mapToQueueStorageException); + return client.getQueues().deleteNoCustomHeadersWithResponseAsync(queueName, null, null, context); } /** @@ -497,7 +495,6 @@ public Mono> getPropertiesWithResponse() { try { return withContext(context -> client.getQueues().getPropertiesWithResponseAsync(queueName, null, null, context) - .onErrorMap(ModelHelper::mapToQueueStorageException) .map(response -> new SimpleResponse<>(response, ModelHelper.transformQueueProperties(response.getDeserializedHeaders())))); } catch (RuntimeException ex) { @@ -580,8 +577,7 @@ public Mono setMetadata(Map metadata) { public Mono> setMetadataWithResponse(Map metadata) { try { return withContext(context -> client.getQueues() - .setMetadataNoCustomHeadersWithResponseAsync(queueName, null, metadata, null, context)) - .onErrorMap(ModelHelper::mapToQueueStorageException); + .setMetadataNoCustomHeadersWithResponseAsync(queueName, null, metadata, null, context)); } catch (RuntimeException ex) { return monoError(LOGGER, ex); } @@ -613,7 +609,6 @@ public PagedFlux getAccessPolicy() { try { Function>> retriever = marker -> this.client.getQueues() .getAccessPolicyWithResponseAsync(queueName, null, null, Context.NONE) - .onErrorMap(ModelHelper::mapToQueueStorageException) .map(response -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), response.getValue().items(), null, response.getDeserializedHeaders())); @@ -716,8 +711,7 @@ Mono> setAccessPolicyWithResponse(Iterable .collect(Collectors.toList()); return client.getQueues() - .setAccessPolicyNoCustomHeadersWithResponseAsync(queueName, null, null, permissionsList, context) - .onErrorMap(ModelHelper::mapToQueueStorageException); + .setAccessPolicyNoCustomHeadersWithResponseAsync(queueName, null, null, permissionsList, context); } /** @@ -770,8 +764,7 @@ public Mono clearMessages() { public Mono> clearMessagesWithResponse() { try { return withContext(context -> client.getMessages() - .clearNoCustomHeadersWithResponseAsync(queueName, null, null, context)) - .onErrorMap(ModelHelper::mapToQueueStorageException); + .clearNoCustomHeadersWithResponseAsync(queueName, null, null, context)); } catch (RuntimeException ex) { return monoError(LOGGER, ex); } @@ -956,7 +949,6 @@ public Mono> sendMessageWithResponse(BinaryData mess QueueMessage queueMessage = new QueueMessage().setMessageText(messageText); return client.getMessages().enqueueWithResponseAsync(queueName, queueMessage, visibilityTimeoutInSeconds, timeToLiveInSeconds, null, null, context) - .onErrorMap(ModelHelper::mapToQueueStorageException) .map(response -> new SimpleResponse<>(response, response.getValue().items().get(0))); })); } catch (RuntimeException ex) { @@ -1073,7 +1065,6 @@ public PagedFlux receiveMessages(Integer maxMessages, Duration Function>> retriever = marker -> withContext(context -> this.client.getMessages().dequeueWithResponseAsync(queueName, maxMessages, visibilityTimeoutInSeconds, null, null, context)) - .onErrorMap(ModelHelper::mapToQueueStorageException) .flatMap(this::transformMessagesDequeueResponse); return new PagedFlux<>(() -> retriever.apply(null), retriever); @@ -1183,7 +1174,6 @@ public PagedFlux peekMessages(Integer maxMessages) { try { Function>> retriever = marker -> withContext(context -> this.client.getMessages().peekWithResponseAsync(queueName, maxMessages, null, null, context) - .onErrorMap(ModelHelper::mapToQueueStorageException) .flatMap(this::transformMessagesPeekResponse)); return new PagedFlux<>(() -> retriever.apply(null), retriever); @@ -1328,7 +1318,6 @@ public Mono> updateMessageWithResponse(String mess try { return withContext(context -> client.getMessageIds().updateWithResponseAsync(queueName, messageId, popReceipt, (int) visTimeout.getSeconds(), null, null, message, context) - .onErrorMap(ModelHelper::mapToQueueStorageException) .map(response -> new SimpleResponse<>(response, new UpdateMessageResult( response.getDeserializedHeaders().getXMsPopreceipt(), response.getDeserializedHeaders().getXMsTimeNextVisible())))); @@ -1413,8 +1402,7 @@ public Mono deleteMessage(String messageId, String popReceipt) { public Mono> deleteMessageWithResponse(String messageId, String popReceipt) { try { return withContext(context -> client.getMessageIds() - .deleteNoCustomHeadersWithResponseAsync(queueName, messageId, popReceipt, null, null, context)) - .onErrorMap(ModelHelper::mapToQueueStorageException); + .deleteNoCustomHeadersWithResponseAsync(queueName, messageId, popReceipt, null, null, context)); } catch (RuntimeException ex) { return monoError(LOGGER, ex); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClient.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClient.java index d3e2d63caab9..051ce2538f3b 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClient.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClient.java @@ -58,7 +58,6 @@ import java.util.stream.Collectors; import static com.azure.storage.common.implementation.StorageImplUtils.submitThreadPool; -import static com.azure.storage.queue.implementation.util.ModelHelper.wrapCallWithExceptionMapping; /** * This class provides a client that contains all the operations for interacting with a queue in Azure Storage Queue. @@ -214,9 +213,8 @@ public void create() { public Response createWithResponse(Map metadata, Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; try { - Supplier> operation = wrapCallWithExceptionMapping( - () -> this.azureQueueStorage.getQueues().createNoCustomHeadersWithResponse(queueName, null, metadata, - null, finalContext)); + Supplier> operation = () -> this.azureQueueStorage.getQueues() + .createNoCustomHeadersWithResponse(queueName, null, metadata, null, finalContext); return submitThreadPool(operation, LOGGER, timeout); } catch (RuntimeException e) { @@ -283,9 +281,8 @@ public Response createIfNotExistsWithResponse(Map metad Context context) { Context finalContext = context == null ? Context.NONE : context; try { - Supplier> operation = wrapCallWithExceptionMapping( - () -> this.azureQueueStorage.getQueues().createNoCustomHeadersWithResponse(queueName, null, metadata, - null, finalContext)); + Supplier> operation = () -> this.azureQueueStorage.getQueues() + .createNoCustomHeadersWithResponse(queueName, null, metadata, null, finalContext); Response response = submitThreadPool(operation, LOGGER, timeout); return new SimpleResponse<>(response, true); } catch (QueueStorageException e) { @@ -349,9 +346,8 @@ public void delete() { @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Supplier> operation = wrapCallWithExceptionMapping( - () -> this.azureQueueStorage.getQueues().deleteNoCustomHeadersWithResponse(queueName, null, null, - finalContext)); + Supplier> operation = () -> this.azureQueueStorage.getQueues() + .deleteNoCustomHeadersWithResponse(queueName, null, null, finalContext); return submitThreadPool(operation, LOGGER, timeout); } @@ -410,8 +406,8 @@ public boolean deleteIfExists() { public Response deleteIfExistsWithResponse(Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; try { - Supplier> operation = wrapCallWithExceptionMapping(() -> this.azureQueueStorage.getQueues() - .deleteNoCustomHeadersWithResponse(queueName, null, null, finalContext)); + Supplier> operation = () -> this.azureQueueStorage.getQueues() + .deleteNoCustomHeadersWithResponse(queueName, null, null, finalContext); Response response = submitThreadPool(operation, LOGGER, timeout); return new SimpleResponse<>(response, true); @@ -482,8 +478,8 @@ public QueueProperties getProperties() { @ServiceMethod(returns = ReturnType.SINGLE) public Response getPropertiesWithResponse(Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Supplier> operation = wrapCallWithExceptionMapping( - () -> this.azureQueueStorage.getQueues().getPropertiesWithResponse(queueName, null, null, finalContext)); + Supplier> operation = () -> this.azureQueueStorage.getQueues() + .getPropertiesWithResponse(queueName, null, null, finalContext); ResponseBase response = submitThreadPool(operation, LOGGER, timeout); return new SimpleResponse<>(response, ModelHelper.transformQueueProperties(response.getDeserializedHeaders())); @@ -566,8 +562,8 @@ public void setMetadata(Map metadata) { @ServiceMethod(returns = ReturnType.SINGLE) public Response setMetadataWithResponse(Map metadata, Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Supplier> operation = wrapCallWithExceptionMapping(() -> this.azureQueueStorage.getQueues() - .setMetadataNoCustomHeadersWithResponse(queueName, null, metadata, null, finalContext)); + Supplier> operation = () -> this.azureQueueStorage.getQueues() + .setMetadataNoCustomHeadersWithResponse(queueName, null, metadata, null, finalContext); return submitThreadPool(operation, LOGGER, timeout); } @@ -596,9 +592,8 @@ public Response setMetadataWithResponse(Map metadata, Dura */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable getAccessPolicy() { - ResponseBase responseBase = - wrapCallWithExceptionMapping(() -> azureQueueStorage.getQueues().getAccessPolicyWithResponse(queueName, - null, null, Context.NONE)).get(); + ResponseBase responseBase + = azureQueueStorage.getQueues().getAccessPolicyWithResponse(queueName, null, null, Context.NONE); Supplier> response = () -> new PagedResponseBase<>( responseBase.getRequest(), responseBase.getStatusCode(), responseBase.getHeaders(), @@ -672,8 +667,8 @@ public void setAccessPolicy(List permissions) { public Response setAccessPolicyWithResponse(List permissions, Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Supplier> operation = wrapCallWithExceptionMapping(() -> this.azureQueueStorage.getQueues() - .setAccessPolicyNoCustomHeadersWithResponse(queueName, null, null, permissions, finalContext)); + Supplier> operation = () -> this.azureQueueStorage.getQueues() + .setAccessPolicyNoCustomHeadersWithResponse(queueName, null, null, permissions, finalContext); return submitThreadPool(operation, LOGGER, timeout); } @@ -729,8 +724,8 @@ public void clearMessages() { @ServiceMethod(returns = ReturnType.SINGLE) public Response clearMessagesWithResponse(Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Supplier> operation = wrapCallWithExceptionMapping(() -> - this.azureQueueStorage.getMessages().clearNoCustomHeadersWithResponse(queueName, null, null, finalContext)); + Supplier> operation = () -> this.azureQueueStorage.getMessages() + .clearNoCustomHeadersWithResponse(queueName, null, null, finalContext); return submitThreadPool(operation, LOGGER, timeout); } @@ -904,8 +899,8 @@ public Response sendMessageWithResponse(BinaryData message, D QueueMessage queueMessage = new QueueMessage().setMessageText(finalMessage); Supplier> operation - = wrapCallWithExceptionMapping(() -> this.azureQueueStorage.getMessages().enqueueWithResponse(queueName, - queueMessage, visibilityTimeoutInSeconds, timeToLiveInSeconds, null, null, finalContext)); + = () -> this.azureQueueStorage.getMessages().enqueueWithResponse(queueName, queueMessage, + visibilityTimeoutInSeconds, timeToLiveInSeconds, null, null, finalContext); ResponseBase response = submitThreadPool(operation, LOGGER, timeout); @@ -1025,8 +1020,8 @@ PagedIterable receiveMessagesWithOptionalTimeout(Integer maxMe Context finalContext = context == null ? Context.NONE : context; Integer visibilityTimeoutInSeconds = (visibilityTimeout == null) ? null : (int) visibilityTimeout.getSeconds(); Supplier> operation - = wrapCallWithExceptionMapping(() -> this.azureQueueStorage.getMessages() - .dequeueWithResponse(queueName, maxMessages, visibilityTimeoutInSeconds, null, null, finalContext)); + = () -> this.azureQueueStorage.getMessages().dequeueWithResponse(queueName, maxMessages, + visibilityTimeoutInSeconds, null, null, finalContext); ResponseBase response = submitThreadPool(operation, LOGGER, timeout); @@ -1152,8 +1147,8 @@ public PagedIterable peekMessages(Integer maxMessages, Durati PagedIterable peekMessagesWithOptionalTimeout(Integer maxMessages, Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; Supplier> operation - = wrapCallWithExceptionMapping(() -> this.azureQueueStorage.getMessages() - .peekWithResponse(queueName, maxMessages, null, null, finalContext)); + = () -> this.azureQueueStorage.getMessages().peekWithResponse(queueName, maxMessages, null, null, + finalContext); ResponseBase response = submitThreadPool(operation, LOGGER, timeout); @@ -1289,9 +1284,9 @@ public Response updateMessageWithResponse(String messageId, } Context finalContext = context == null ? Context.NONE : context; Duration finalVisibilityTimeout = visibilityTimeout == null ? Duration.ZERO : visibilityTimeout; - Supplier> operation = wrapCallWithExceptionMapping( - () -> this.azureQueueStorage.getMessageIds().updateWithResponse(queueName, messageId, popReceipt, - (int) finalVisibilityTimeout.getSeconds(), null, null, message, finalContext)); + Supplier> operation = () -> this.azureQueueStorage.getMessageIds() + .updateWithResponse(queueName, messageId, popReceipt, (int) finalVisibilityTimeout.getSeconds(), null, null, + message, finalContext); ResponseBase response = submitThreadPool(operation, LOGGER, timeout); @@ -1361,8 +1356,8 @@ public void deleteMessage(String messageId, String popReceipt) { public Response deleteMessageWithResponse(String messageId, String popReceipt, Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Supplier> operation = wrapCallWithExceptionMapping(() -> this.azureQueueStorage.getMessageIds() - .deleteNoCustomHeadersWithResponse(queueName, messageId, popReceipt, null, null, finalContext)); + Supplier> operation = () -> this.azureQueueStorage.getMessageIds() + .deleteNoCustomHeadersWithResponse(queueName, messageId, popReceipt, null, null, finalContext); return submitThreadPool(operation, LOGGER, timeout); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceAsyncClient.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceAsyncClient.java index 8cb2e020ff82..a02afa61e12e 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceAsyncClient.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceAsyncClient.java @@ -19,7 +19,6 @@ import com.azure.storage.common.implementation.StorageImplUtils; import com.azure.storage.common.sas.AccountSasSignatureValues; import com.azure.storage.queue.implementation.AzureQueueStorageImpl; -import com.azure.storage.queue.implementation.util.ModelHelper; import com.azure.storage.queue.models.QueueCorsRule; import com.azure.storage.queue.models.QueueItem; import com.azure.storage.queue.models.QueueMessageDecodingError; @@ -344,10 +343,8 @@ PagedFlux listQueuesWithOptionalTimeout(String marker, QueuesSegmentO BiFunction>> retriever = (nextMarker, pageSize) -> StorageImplUtils.applyOptionalTimeout(this.client.getServices() - .listQueuesSegmentSinglePageAsync(prefix, nextMarker, - pageSize == null ? maxResultsPerPage : pageSize, include, - null, null, context), timeout) - .onErrorMap(ModelHelper::mapToQueueStorageException); + .listQueuesSegmentSinglePageAsync(prefix, nextMarker, pageSize == null ? maxResultsPerPage : pageSize, + include, null, null, context), timeout); return new PagedFlux<>(pageSize -> retriever.apply(marker, pageSize), retriever); } @@ -418,7 +415,6 @@ public Mono> getPropertiesWithResponse() { Mono> getPropertiesWithResponse(Context context) { context = context == null ? Context.NONE : context; return client.getServices().getPropertiesWithResponseAsync(null, null, context) - .onErrorMap(ModelHelper::mapToQueueStorageException) .map(response -> new SimpleResponse<>(response, response.getValue())); } @@ -542,8 +538,7 @@ public Mono> setPropertiesWithResponse(QueueServiceProperties pro Mono> setPropertiesWithResponse(QueueServiceProperties properties, Context context) { context = context == null ? Context.NONE : context; - return client.getServices().setPropertiesNoCustomHeadersWithResponseAsync(properties, null, null, context) - .onErrorMap(ModelHelper::mapToQueueStorageException); + return client.getServices().setPropertiesNoCustomHeadersWithResponseAsync(properties, null, null, context); } /** @@ -608,7 +603,6 @@ public Mono> getStatisticsWithResponse() { Mono> getStatisticsWithResponse(Context context) { context = context == null ? Context.NONE : context; return client.getServices().getStatisticsWithResponseAsync(null, null, context) - .onErrorMap(ModelHelper::mapToQueueStorageException) .map(response -> new SimpleResponse<>(response, response.getValue())); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClient.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClient.java index 2cb239443b5c..9c559e20bd48 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClient.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClient.java @@ -24,9 +24,10 @@ import com.azure.storage.queue.models.QueueMessageDecodingError; import com.azure.storage.queue.models.QueueServiceProperties; import com.azure.storage.queue.models.QueueServiceStatistics; -import com.azure.storage.queue.models.QueuesSegmentOptions; import com.azure.storage.queue.models.QueueStorageException; +import com.azure.storage.queue.models.QueuesSegmentOptions; import reactor.core.publisher.Mono; + import java.time.Duration; import java.util.ArrayList; import java.util.List; @@ -38,7 +39,6 @@ import java.util.function.Supplier; import static com.azure.storage.common.implementation.StorageImplUtils.submitThreadPool; -import static com.azure.storage.queue.implementation.util.ModelHelper.wrapCallWithExceptionMapping; /** * This class provides a client that contains all the operations for interacting with a queue account in Azure Storage. @@ -325,9 +325,9 @@ public PagedIterable listQueues(QueuesSegmentOptions options, Duratio } } BiFunction> retriever = (nextMarker, pageSize) -> { - Supplier> operation = wrapCallWithExceptionMapping(() -> - this.azureQueueStorage.getServices().listQueuesSegmentSinglePage(prefix, nextMarker, - pageSize == null ? maxResultsPerPage : pageSize, include, null, null, finalContext)); + Supplier> operation = () -> this.azureQueueStorage.getServices() + .listQueuesSegmentSinglePage(prefix, nextMarker, pageSize == null ? maxResultsPerPage : pageSize, + include, null, null, finalContext); return submitThreadPool(operation, LOGGER, timeout); @@ -393,8 +393,8 @@ public QueueServiceProperties getProperties() { @ServiceMethod(returns = ReturnType.SINGLE) public Response getPropertiesWithResponse(Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Supplier> operation = wrapCallWithExceptionMapping( - () -> this.azureQueueStorage.getServices().getPropertiesWithResponse(null, null, finalContext)); + Supplier> operation = () -> this.azureQueueStorage.getServices() + .getPropertiesWithResponse(null, null, finalContext); return submitThreadPool(operation, LOGGER, timeout); } @@ -527,8 +527,8 @@ public void setProperties(QueueServiceProperties properties) { public Response setPropertiesWithResponse(QueueServiceProperties properties, Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Supplier> operation = wrapCallWithExceptionMapping(() -> this.azureQueueStorage.getServices() - .setPropertiesNoCustomHeadersWithResponse(properties, null, null, finalContext)); + Supplier> operation = () -> this.azureQueueStorage.getServices() + .setPropertiesNoCustomHeadersWithResponse(properties, null, null, finalContext); return submitThreadPool(operation, LOGGER, timeout); } @@ -587,8 +587,7 @@ public QueueServiceStatistics getStatistics() { public Response getStatisticsWithResponse(Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; Supplier> operation - = wrapCallWithExceptionMapping(() -> this.azureQueueStorage.getServices() - .getStatisticsWithResponse(null, null, finalContext)); + = () -> this.azureQueueStorage.getServices().getStatisticsWithResponse(null, null, finalContext); return submitThreadPool(operation, LOGGER, timeout); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/MessageIdsImpl.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/MessageIdsImpl.java index 0ec2e43734f2..05bc00466a87 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/MessageIdsImpl.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/MessageIdsImpl.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.storage.queue.implementation; import com.azure.core.annotation.BodyParam; @@ -27,11 +26,13 @@ import com.azure.storage.queue.implementation.models.QueueMessage; import com.azure.storage.queue.implementation.models.QueueStorageExceptionInternal; import reactor.core.publisher.Mono; +import com.azure.storage.queue.implementation.util.ModelHelper; /** * An instance of this class provides access to all the operations defined in MessageIds. */ public final class MessageIdsImpl { + /** * The proxy service used to perform REST calls. */ @@ -44,7 +45,7 @@ public final class MessageIdsImpl { /** * Initializes an instance of MessageIdsImpl. - * + * * @param client the instance of the service client containing this operation class. */ MessageIdsImpl(AzureQueueStorageImpl client) { @@ -60,6 +61,7 @@ public final class MessageIdsImpl { @Host("{url}") @ServiceInterface(name = "AzureQueueStorageMes") public interface MessageIdsService { + @Put("/{queueName}/messages/{messageid}") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) @@ -145,7 +147,7 @@ Response deleteNoCustomHeadersSync(@HostParam("url") String url, @PathPara * operation updates the visibility timeout of a message. You can also use this operation to update the contents of * a message. A message must be in a format that can be included in an XML request with UTF-8 encoding, and the * encoded message can be up to 64KB in size. - * + * * @param queueName The queue name. * @param messageid The message ID name. * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get @@ -169,8 +171,10 @@ Response deleteNoCustomHeadersSync(@HostParam("url") String url, @PathPara public Mono> updateWithResponseAsync(String queueName, String messageid, String popReceipt, int visibilitytimeout, Integer timeout, String requestId, QueueMessage queueMessage) { final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.update(this.client.getUrl(), queueName, messageid, popReceipt, - visibilitytimeout, timeout, this.client.getVersion(), requestId, queueMessage, accept, context)); + return FluxUtil + .withContext(context -> service.update(this.client.getUrl(), queueName, messageid, popReceipt, + visibilitytimeout, timeout, this.client.getVersion(), requestId, queueMessage, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** @@ -178,7 +182,7 @@ public Mono> updateWithResponseAsync * operation updates the visibility timeout of a message. You can also use this operation to update the contents of * a message. A message must be in a format that can be included in an XML request with UTF-8 encoding, and the * encoded message can be up to 64KB in size. - * + * * @param queueName The queue name. * @param messageid The message ID name. * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get @@ -204,8 +208,10 @@ public Mono> updateWithResponseAsync String popReceipt, int visibilitytimeout, Integer timeout, String requestId, QueueMessage queueMessage, Context context) { final String accept = "application/xml"; - return service.update(this.client.getUrl(), queueName, messageid, popReceipt, visibilitytimeout, timeout, - this.client.getVersion(), requestId, queueMessage, accept, context); + return service + .update(this.client.getUrl(), queueName, messageid, popReceipt, visibilitytimeout, timeout, + this.client.getVersion(), requestId, queueMessage, accept, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** @@ -213,7 +219,7 @@ public Mono> updateWithResponseAsync * operation updates the visibility timeout of a message. You can also use this operation to update the contents of * a message. A message must be in a format that can be included in an XML request with UTF-8 encoding, and the * encoded message can be up to 64KB in size. - * + * * @param queueName The queue name. * @param messageid The message ID name. * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get @@ -237,7 +243,8 @@ public Mono> updateWithResponseAsync public Mono updateAsync(String queueName, String messageid, String popReceipt, int visibilitytimeout, Integer timeout, String requestId, QueueMessage queueMessage) { return updateWithResponseAsync(queueName, messageid, popReceipt, visibilitytimeout, timeout, requestId, - queueMessage).flatMap(ignored -> Mono.empty()); + queueMessage).onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) + .flatMap(ignored -> Mono.empty()); } /** @@ -245,7 +252,7 @@ public Mono updateAsync(String queueName, String messageid, String popRece * operation updates the visibility timeout of a message. You can also use this operation to update the contents of * a message. A message must be in a format that can be included in an XML request with UTF-8 encoding, and the * encoded message can be up to 64KB in size. - * + * * @param queueName The queue name. * @param messageid The message ID name. * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get @@ -270,7 +277,9 @@ public Mono updateAsync(String queueName, String messageid, String popRece public Mono updateAsync(String queueName, String messageid, String popReceipt, int visibilitytimeout, Integer timeout, String requestId, QueueMessage queueMessage, Context context) { return updateWithResponseAsync(queueName, messageid, popReceipt, visibilitytimeout, timeout, requestId, - queueMessage, context).flatMap(ignored -> Mono.empty()); + queueMessage, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) + .flatMap(ignored -> Mono.empty()); } /** @@ -278,7 +287,7 @@ public Mono updateAsync(String queueName, String messageid, String popRece * operation updates the visibility timeout of a message. You can also use this operation to update the contents of * a message. A message must be in a format that can be included in an XML request with UTF-8 encoding, and the * encoded message can be up to 64KB in size. - * + * * @param queueName The queue name. * @param messageid The message ID name. * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get @@ -302,9 +311,11 @@ public Mono updateAsync(String queueName, String messageid, String popRece public Mono> updateNoCustomHeadersWithResponseAsync(String queueName, String messageid, String popReceipt, int visibilitytimeout, Integer timeout, String requestId, QueueMessage queueMessage) { final String accept = "application/xml"; - return FluxUtil.withContext( - context -> service.updateNoCustomHeaders(this.client.getUrl(), queueName, messageid, popReceipt, - visibilitytimeout, timeout, this.client.getVersion(), requestId, queueMessage, accept, context)); + return FluxUtil + .withContext( + context -> service.updateNoCustomHeaders(this.client.getUrl(), queueName, messageid, popReceipt, + visibilitytimeout, timeout, this.client.getVersion(), requestId, queueMessage, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** @@ -312,7 +323,7 @@ public Mono> updateNoCustomHeadersWithResponseAsync(String queueN * operation updates the visibility timeout of a message. You can also use this operation to update the contents of * a message. A message must be in a format that can be included in an XML request with UTF-8 encoding, and the * encoded message can be up to 64KB in size. - * + * * @param queueName The queue name. * @param messageid The message ID name. * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get @@ -338,8 +349,10 @@ public Mono> updateNoCustomHeadersWithResponseAsync(String queueN String popReceipt, int visibilitytimeout, Integer timeout, String requestId, QueueMessage queueMessage, Context context) { final String accept = "application/xml"; - return service.updateNoCustomHeaders(this.client.getUrl(), queueName, messageid, popReceipt, visibilitytimeout, - timeout, this.client.getVersion(), requestId, queueMessage, accept, context); + return service + .updateNoCustomHeaders(this.client.getUrl(), queueName, messageid, popReceipt, visibilitytimeout, timeout, + this.client.getVersion(), requestId, queueMessage, accept, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** @@ -347,7 +360,7 @@ public Mono> updateNoCustomHeadersWithResponseAsync(String queueN * operation updates the visibility timeout of a message. You can also use this operation to update the contents of * a message. A message must be in a format that can be included in an XML request with UTF-8 encoding, and the * encoded message can be up to 64KB in size. - * + * * @param queueName The queue name. * @param messageid The message ID name. * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get @@ -373,8 +386,12 @@ public ResponseBase updateWithResponse(String que String popReceipt, int visibilitytimeout, Integer timeout, String requestId, QueueMessage queueMessage, Context context) { final String accept = "application/xml"; - return service.updateSync(this.client.getUrl(), queueName, messageid, popReceipt, visibilitytimeout, timeout, - this.client.getVersion(), requestId, queueMessage, accept, context); + try { + return service.updateSync(this.client.getUrl(), queueName, messageid, popReceipt, visibilitytimeout, + timeout, this.client.getVersion(), requestId, queueMessage, accept, context); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** @@ -382,7 +399,7 @@ public ResponseBase updateWithResponse(String que * operation updates the visibility timeout of a message. You can also use this operation to update the contents of * a message. A message must be in a format that can be included in an XML request with UTF-8 encoding, and the * encoded message can be up to 64KB in size. - * + * * @param queueName The queue name. * @param messageid The message ID name. * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get @@ -413,7 +430,7 @@ public void update(String queueName, String messageid, String popReceipt, int vi * operation updates the visibility timeout of a message. You can also use this operation to update the contents of * a message. A message must be in a format that can be included in an XML request with UTF-8 encoding, and the * encoded message can be up to 64KB in size. - * + * * @param queueName The queue name. * @param messageid The message ID name. * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get @@ -438,13 +455,17 @@ public void update(String queueName, String messageid, String popReceipt, int vi public Response updateNoCustomHeadersWithResponse(String queueName, String messageid, String popReceipt, int visibilitytimeout, Integer timeout, String requestId, QueueMessage queueMessage, Context context) { final String accept = "application/xml"; - return service.updateNoCustomHeadersSync(this.client.getUrl(), queueName, messageid, popReceipt, - visibilitytimeout, timeout, this.client.getVersion(), requestId, queueMessage, accept, context); + try { + return service.updateNoCustomHeadersSync(this.client.getUrl(), queueName, messageid, popReceipt, + visibilitytimeout, timeout, this.client.getVersion(), requestId, queueMessage, accept, context); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * The Delete operation deletes the specified message. - * + * * @param queueName The queue name. * @param messageid The message ID name. * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get @@ -463,13 +484,15 @@ public Response updateNoCustomHeadersWithResponse(String queueName, String public Mono> deleteWithResponseAsync(String queueName, String messageid, String popReceipt, Integer timeout, String requestId) { final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.delete(this.client.getUrl(), queueName, messageid, popReceipt, - timeout, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.delete(this.client.getUrl(), queueName, messageid, popReceipt, timeout, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * The Delete operation deletes the specified message. - * + * * @param queueName The queue name. * @param messageid The message ID name. * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get @@ -489,13 +512,15 @@ public Mono> deleteWithResponseAsync public Mono> deleteWithResponseAsync(String queueName, String messageid, String popReceipt, Integer timeout, String requestId, Context context) { final String accept = "application/xml"; - return service.delete(this.client.getUrl(), queueName, messageid, popReceipt, timeout, this.client.getVersion(), - requestId, accept, context); + return service + .delete(this.client.getUrl(), queueName, messageid, popReceipt, timeout, this.client.getVersion(), + requestId, accept, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * The Delete operation deletes the specified message. - * + * * @param queueName The queue name. * @param messageid The message ID name. * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get @@ -514,12 +539,13 @@ public Mono> deleteWithResponseAsync public Mono deleteAsync(String queueName, String messageid, String popReceipt, Integer timeout, String requestId) { return deleteWithResponseAsync(queueName, messageid, popReceipt, timeout, requestId) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Delete operation deletes the specified message. - * + * * @param queueName The queue name. * @param messageid The message ID name. * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get @@ -539,12 +565,13 @@ public Mono deleteAsync(String queueName, String messageid, String popRece public Mono deleteAsync(String queueName, String messageid, String popReceipt, Integer timeout, String requestId, Context context) { return deleteWithResponseAsync(queueName, messageid, popReceipt, timeout, requestId, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) .flatMap(ignored -> Mono.empty()); } /** * The Delete operation deletes the specified message. - * + * * @param queueName The queue name. * @param messageid The message ID name. * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get @@ -563,13 +590,15 @@ public Mono deleteAsync(String queueName, String messageid, String popRece public Mono> deleteNoCustomHeadersWithResponseAsync(String queueName, String messageid, String popReceipt, Integer timeout, String requestId) { final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.deleteNoCustomHeaders(this.client.getUrl(), queueName, messageid, - popReceipt, timeout, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.deleteNoCustomHeaders(this.client.getUrl(), queueName, messageid, + popReceipt, timeout, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * The Delete operation deletes the specified message. - * + * * @param queueName The queue name. * @param messageid The message ID name. * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get @@ -589,13 +618,15 @@ public Mono> deleteNoCustomHeadersWithResponseAsync(String queueN public Mono> deleteNoCustomHeadersWithResponseAsync(String queueName, String messageid, String popReceipt, Integer timeout, String requestId, Context context) { final String accept = "application/xml"; - return service.deleteNoCustomHeaders(this.client.getUrl(), queueName, messageid, popReceipt, timeout, - this.client.getVersion(), requestId, accept, context); + return service + .deleteNoCustomHeaders(this.client.getUrl(), queueName, messageid, popReceipt, timeout, + this.client.getVersion(), requestId, accept, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * The Delete operation deletes the specified message. - * + * * @param queueName The queue name. * @param messageid The message ID name. * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get @@ -615,13 +646,17 @@ public Mono> deleteNoCustomHeadersWithResponseAsync(String queueN public ResponseBase deleteWithResponse(String queueName, String messageid, String popReceipt, Integer timeout, String requestId, Context context) { final String accept = "application/xml"; - return service.deleteSync(this.client.getUrl(), queueName, messageid, popReceipt, timeout, - this.client.getVersion(), requestId, accept, context); + try { + return service.deleteSync(this.client.getUrl(), queueName, messageid, popReceipt, timeout, + this.client.getVersion(), requestId, accept, context); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * The Delete operation deletes the specified message. - * + * * @param queueName The queue name. * @param messageid The message ID name. * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get @@ -642,7 +677,7 @@ public void delete(String queueName, String messageid, String popReceipt, Intege /** * The Delete operation deletes the specified message. - * + * * @param queueName The queue name. * @param messageid The message ID name. * @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to the Get @@ -662,7 +697,11 @@ public void delete(String queueName, String messageid, String popReceipt, Intege public Response deleteNoCustomHeadersWithResponse(String queueName, String messageid, String popReceipt, Integer timeout, String requestId, Context context) { final String accept = "application/xml"; - return service.deleteNoCustomHeadersSync(this.client.getUrl(), queueName, messageid, popReceipt, timeout, - this.client.getVersion(), requestId, accept, context); + try { + return service.deleteNoCustomHeadersSync(this.client.getUrl(), queueName, messageid, popReceipt, timeout, + this.client.getVersion(), requestId, accept, context); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/MessagesImpl.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/MessagesImpl.java index 2324fe016023..5cc9dcc60141 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/MessagesImpl.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/MessagesImpl.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.storage.queue.implementation; import com.azure.core.annotation.BodyParam; @@ -33,11 +32,13 @@ import com.azure.storage.queue.implementation.models.QueueStorageExceptionInternal; import com.azure.storage.queue.implementation.models.SendMessageResultWrapper; import reactor.core.publisher.Mono; +import com.azure.storage.queue.implementation.util.ModelHelper; /** * An instance of this class provides access to all the operations defined in Messages. */ public final class MessagesImpl { + /** * The proxy service used to perform REST calls. */ @@ -50,7 +51,7 @@ public final class MessagesImpl { /** * Initializes an instance of MessagesImpl. - * + * * @param client the instance of the service client containing this operation class. */ MessagesImpl(AzureQueueStorageImpl client) { @@ -65,6 +66,7 @@ public final class MessagesImpl { @Host("{url}") @ServiceInterface(name = "AzureQueueStorageMes") public interface MessagesService { + @Get("/{queueName}/messages") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) @@ -213,7 +215,7 @@ Response peekNoCustomHeadersSync(@HostParam("u /** * The Dequeue operation retrieves one or more messages from the front of the queue. - * + * * @param queueName The queue name. * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single @@ -237,13 +239,15 @@ Response peekNoCustomHeadersSync(@HostParam("u public Mono> dequeueWithResponseAsync( String queueName, Integer numberOfMessages, Integer visibilitytimeout, Integer timeout, String requestId) { final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.dequeue(this.client.getUrl(), queueName, numberOfMessages, - visibilitytimeout, timeout, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.dequeue(this.client.getUrl(), queueName, numberOfMessages, + visibilitytimeout, timeout, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * The Dequeue operation retrieves one or more messages from the front of the queue. - * + * * @param queueName The queue name. * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single @@ -269,13 +273,15 @@ public Mono dequeueAsync(String queueName, Integer numberOfMessages, Integer visibilitytimeout, Integer timeout, String requestId) { return dequeueWithResponseAsync(queueName, numberOfMessages, visibilitytimeout, timeout, requestId) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * The Dequeue operation retrieves one or more messages from the front of the queue. - * + * * @param queueName The queue name. * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single @@ -327,12 +334,13 @@ public Mono dequeueAsync(String queueName, Inte public Mono dequeueAsync(String queueName, Integer numberOfMessages, Integer visibilitytimeout, Integer timeout, String requestId, Context context) { return dequeueWithResponseAsync(queueName, numberOfMessages, visibilitytimeout, timeout, requestId, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * The Dequeue operation retrieves one or more messages from the front of the queue. - * + * * @param queueName The queue name. * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single @@ -356,13 +364,15 @@ public Mono dequeueAsync(String queueName, Inte public Mono> dequeueNoCustomHeadersWithResponseAsync(String queueName, Integer numberOfMessages, Integer visibilitytimeout, Integer timeout, String requestId) { final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.dequeueNoCustomHeaders(this.client.getUrl(), queueName, - numberOfMessages, visibilitytimeout, timeout, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.dequeueNoCustomHeaders(this.client.getUrl(), queueName, numberOfMessages, + visibilitytimeout, timeout, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * The Dequeue operation retrieves one or more messages from the front of the queue. - * + * * @param queueName The queue name. * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single @@ -387,13 +397,15 @@ public Mono> dequeueNoCustomHeadersWit public Mono> dequeueNoCustomHeadersWithResponseAsync(String queueName, Integer numberOfMessages, Integer visibilitytimeout, Integer timeout, String requestId, Context context) { final String accept = "application/xml"; - return service.dequeueNoCustomHeaders(this.client.getUrl(), queueName, numberOfMessages, visibilitytimeout, - timeout, this.client.getVersion(), requestId, accept, context); + return service + .dequeueNoCustomHeaders(this.client.getUrl(), queueName, numberOfMessages, visibilitytimeout, timeout, + this.client.getVersion(), requestId, accept, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * The Dequeue operation retrieves one or more messages from the front of the queue. - * + * * @param queueName The queue name. * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single @@ -417,13 +429,17 @@ public Mono> dequeueNoCustomHeadersWit public ResponseBase dequeueWithResponse(String queueName, Integer numberOfMessages, Integer visibilitytimeout, Integer timeout, String requestId, Context context) { final String accept = "application/xml"; - return service.dequeueSync(this.client.getUrl(), queueName, numberOfMessages, visibilitytimeout, timeout, - this.client.getVersion(), requestId, accept, context); + try { + return service.dequeueSync(this.client.getUrl(), queueName, numberOfMessages, visibilitytimeout, timeout, + this.client.getVersion(), requestId, accept, context); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * The Dequeue operation retrieves one or more messages from the front of the queue. - * + * * @param queueName The queue name. * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single @@ -445,13 +461,17 @@ public ResponseBase deq @ServiceMethod(returns = ReturnType.SINGLE) public QueueMessageItemInternalWrapper dequeue(String queueName, Integer numberOfMessages, Integer visibilitytimeout, Integer timeout, String requestId) { - return dequeueWithResponse(queueName, numberOfMessages, visibilitytimeout, timeout, requestId, Context.NONE) - .getValue(); + try { + return dequeueWithResponse(queueName, numberOfMessages, visibilitytimeout, timeout, requestId, Context.NONE) + .getValue(); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * The Dequeue operation retrieves one or more messages from the front of the queue. - * + * * @param queueName The queue name. * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single @@ -475,13 +495,17 @@ public QueueMessageItemInternalWrapper dequeue(String queueName, Integer numberO public Response dequeueNoCustomHeadersWithResponse(String queueName, Integer numberOfMessages, Integer visibilitytimeout, Integer timeout, String requestId, Context context) { final String accept = "application/xml"; - return service.dequeueNoCustomHeadersSync(this.client.getUrl(), queueName, numberOfMessages, visibilitytimeout, - timeout, this.client.getVersion(), requestId, accept, context); + try { + return service.dequeueNoCustomHeadersSync(this.client.getUrl(), queueName, numberOfMessages, + visibilitytimeout, timeout, this.client.getVersion(), requestId, accept, context); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * The Clear operation deletes all messages from the specified queue. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -497,13 +521,15 @@ public Response dequeueNoCustomHeadersWithRespo public Mono> clearWithResponseAsync(String queueName, Integer timeout, String requestId) { final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.clear(this.client.getUrl(), queueName, timeout, - this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.clear(this.client.getUrl(), queueName, timeout, this.client.getVersion(), + requestId, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * The Clear operation deletes all messages from the specified queue. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -520,13 +546,14 @@ public Mono> clearWithResponseAsync(Str public Mono> clearWithResponseAsync(String queueName, Integer timeout, String requestId, Context context) { final String accept = "application/xml"; - return service.clear(this.client.getUrl(), queueName, timeout, this.client.getVersion(), requestId, accept, - context); + return service + .clear(this.client.getUrl(), queueName, timeout, this.client.getVersion(), requestId, accept, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * The Clear operation deletes all messages from the specified queue. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -540,12 +567,14 @@ public Mono> clearWithResponseAsync(Str */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono clearAsync(String queueName, Integer timeout, String requestId) { - return clearWithResponseAsync(queueName, timeout, requestId).flatMap(ignored -> Mono.empty()); + return clearWithResponseAsync(queueName, timeout, requestId) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) + .flatMap(ignored -> Mono.empty()); } /** * The Clear operation deletes all messages from the specified queue. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -560,12 +589,14 @@ public Mono clearAsync(String queueName, Integer timeout, String requestId */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono clearAsync(String queueName, Integer timeout, String requestId, Context context) { - return clearWithResponseAsync(queueName, timeout, requestId, context).flatMap(ignored -> Mono.empty()); + return clearWithResponseAsync(queueName, timeout, requestId, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) + .flatMap(ignored -> Mono.empty()); } /** * The Clear operation deletes all messages from the specified queue. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -581,13 +612,15 @@ public Mono clearAsync(String queueName, Integer timeout, String requestId public Mono> clearNoCustomHeadersWithResponseAsync(String queueName, Integer timeout, String requestId) { final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.clearNoCustomHeaders(this.client.getUrl(), queueName, timeout, - this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.clearNoCustomHeaders(this.client.getUrl(), queueName, timeout, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * The Clear operation deletes all messages from the specified queue. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -604,13 +637,15 @@ public Mono> clearNoCustomHeadersWithResponseAsync(String queueNa public Mono> clearNoCustomHeadersWithResponseAsync(String queueName, Integer timeout, String requestId, Context context) { final String accept = "application/xml"; - return service.clearNoCustomHeaders(this.client.getUrl(), queueName, timeout, this.client.getVersion(), - requestId, accept, context); + return service + .clearNoCustomHeaders(this.client.getUrl(), queueName, timeout, this.client.getVersion(), requestId, accept, + context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * The Clear operation deletes all messages from the specified queue. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -627,13 +662,17 @@ public Mono> clearNoCustomHeadersWithResponseAsync(String queueNa public ResponseBase clearWithResponse(String queueName, Integer timeout, String requestId, Context context) { final String accept = "application/xml"; - return service.clearSync(this.client.getUrl(), queueName, timeout, this.client.getVersion(), requestId, accept, - context); + try { + return service.clearSync(this.client.getUrl(), queueName, timeout, this.client.getVersion(), requestId, + accept, context); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * The Clear operation deletes all messages from the specified queue. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -651,7 +690,7 @@ public void clear(String queueName, Integer timeout, String requestId) { /** * The Clear operation deletes all messages from the specified queue. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -668,8 +707,12 @@ public void clear(String queueName, Integer timeout, String requestId) { public Response clearNoCustomHeadersWithResponse(String queueName, Integer timeout, String requestId, Context context) { final String accept = "application/xml"; - return service.clearNoCustomHeadersSync(this.client.getUrl(), queueName, timeout, this.client.getVersion(), - requestId, accept, context); + try { + return service.clearNoCustomHeadersSync(this.client.getUrl(), queueName, timeout, this.client.getVersion(), + requestId, accept, context); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** @@ -677,7 +720,7 @@ public Response clearNoCustomHeadersWithResponse(String queueName, Integer * specified to make the message invisible until the visibility timeout expires. A message must be in a format that * can be included in an XML request with UTF-8 encoding. The encoded message can be up to 64 KB in size for * versions 2011-08-18 and newer, or 8 KB in size for previous versions. - * + * * @param queueName The queue name. * @param queueMessage A Message object which can be stored in a Queue. * @param visibilitytimeout Optional. If specified, the request must be made using an x-ms-version of 2011-08-18 or @@ -705,8 +748,10 @@ public Mono> enqu String queueName, QueueMessage queueMessage, Integer visibilitytimeout, Integer messageTimeToLive, Integer timeout, String requestId) { final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.enqueue(this.client.getUrl(), queueName, visibilitytimeout, - messageTimeToLive, timeout, this.client.getVersion(), requestId, queueMessage, accept, context)); + return FluxUtil + .withContext(context -> service.enqueue(this.client.getUrl(), queueName, visibilitytimeout, + messageTimeToLive, timeout, this.client.getVersion(), requestId, queueMessage, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** @@ -714,7 +759,7 @@ public Mono> enqu * specified to make the message invisible until the visibility timeout expires. A message must be in a format that * can be included in an XML request with UTF-8 encoding. The encoded message can be up to 64 KB in size for * versions 2011-08-18 and newer, or 8 KB in size for previous versions. - * + * * @param queueName The queue name. * @param queueMessage A Message object which can be stored in a Queue. * @param visibilitytimeout Optional. If specified, the request must be made using an x-ms-version of 2011-08-18 or @@ -743,8 +788,10 @@ public Mono> enqu String queueName, QueueMessage queueMessage, Integer visibilitytimeout, Integer messageTimeToLive, Integer timeout, String requestId, Context context) { final String accept = "application/xml"; - return service.enqueue(this.client.getUrl(), queueName, visibilitytimeout, messageTimeToLive, timeout, - this.client.getVersion(), requestId, queueMessage, accept, context); + return service + .enqueue(this.client.getUrl(), queueName, visibilitytimeout, messageTimeToLive, timeout, + this.client.getVersion(), requestId, queueMessage, accept, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** @@ -752,7 +799,7 @@ public Mono> enqu * specified to make the message invisible until the visibility timeout expires. A message must be in a format that * can be included in an XML request with UTF-8 encoding. The encoded message can be up to 64 KB in size for * versions 2011-08-18 and newer, or 8 KB in size for previous versions. - * + * * @param queueName The queue name. * @param queueMessage A Message object which can be stored in a Queue. * @param visibilitytimeout Optional. If specified, the request must be made using an x-ms-version of 2011-08-18 or @@ -778,7 +825,8 @@ public Mono> enqu public Mono enqueueAsync(String queueName, QueueMessage queueMessage, Integer visibilitytimeout, Integer messageTimeToLive, Integer timeout, String requestId) { return enqueueWithResponseAsync(queueName, queueMessage, visibilitytimeout, messageTimeToLive, timeout, - requestId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + requestId).onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -786,7 +834,7 @@ public Mono enqueueAsync(String queueName, QueueMessag * specified to make the message invisible until the visibility timeout expires. A message must be in a format that * can be included in an XML request with UTF-8 encoding. The encoded message can be up to 64 KB in size for * versions 2011-08-18 and newer, or 8 KB in size for previous versions. - * + * * @param queueName The queue name. * @param queueMessage A Message object which can be stored in a Queue. * @param visibilitytimeout Optional. If specified, the request must be made using an x-ms-version of 2011-08-18 or @@ -813,7 +861,8 @@ public Mono enqueueAsync(String queueName, QueueMessag public Mono enqueueAsync(String queueName, QueueMessage queueMessage, Integer visibilitytimeout, Integer messageTimeToLive, Integer timeout, String requestId, Context context) { return enqueueWithResponseAsync(queueName, queueMessage, visibilitytimeout, messageTimeToLive, timeout, - requestId, context).flatMap(res -> Mono.justOrEmpty(res.getValue())); + requestId, context).onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -821,7 +870,7 @@ public Mono enqueueAsync(String queueName, QueueMessag * specified to make the message invisible until the visibility timeout expires. A message must be in a format that * can be included in an XML request with UTF-8 encoding. The encoded message can be up to 64 KB in size for * versions 2011-08-18 and newer, or 8 KB in size for previous versions. - * + * * @param queueName The queue name. * @param queueMessage A Message object which can be stored in a Queue. * @param visibilitytimeout Optional. If specified, the request must be made using an x-ms-version of 2011-08-18 or @@ -851,7 +900,8 @@ public Mono> enqueueNoCustomHeadersWithRespon final String accept = "application/xml"; return FluxUtil .withContext(context -> service.enqueueNoCustomHeaders(this.client.getUrl(), queueName, visibilitytimeout, - messageTimeToLive, timeout, this.client.getVersion(), requestId, queueMessage, accept, context)); + messageTimeToLive, timeout, this.client.getVersion(), requestId, queueMessage, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** @@ -859,7 +909,7 @@ public Mono> enqueueNoCustomHeadersWithRespon * specified to make the message invisible until the visibility timeout expires. A message must be in a format that * can be included in an XML request with UTF-8 encoding. The encoded message can be up to 64 KB in size for * versions 2011-08-18 and newer, or 8 KB in size for previous versions. - * + * * @param queueName The queue name. * @param queueMessage A Message object which can be stored in a Queue. * @param visibilitytimeout Optional. If specified, the request must be made using an x-ms-version of 2011-08-18 or @@ -888,8 +938,10 @@ public Mono> enqueueNoCustomHeadersWithRespon QueueMessage queueMessage, Integer visibilitytimeout, Integer messageTimeToLive, Integer timeout, String requestId, Context context) { final String accept = "application/xml"; - return service.enqueueNoCustomHeaders(this.client.getUrl(), queueName, visibilitytimeout, messageTimeToLive, - timeout, this.client.getVersion(), requestId, queueMessage, accept, context); + return service + .enqueueNoCustomHeaders(this.client.getUrl(), queueName, visibilitytimeout, messageTimeToLive, timeout, + this.client.getVersion(), requestId, queueMessage, accept, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** @@ -897,7 +949,7 @@ public Mono> enqueueNoCustomHeadersWithRespon * specified to make the message invisible until the visibility timeout expires. A message must be in a format that * can be included in an XML request with UTF-8 encoding. The encoded message can be up to 64 KB in size for * versions 2011-08-18 and newer, or 8 KB in size for previous versions. - * + * * @param queueName The queue name. * @param queueMessage A Message object which can be stored in a Queue. * @param visibilitytimeout Optional. If specified, the request must be made using an x-ms-version of 2011-08-18 or @@ -925,8 +977,12 @@ public ResponseBase enqueueWit QueueMessage queueMessage, Integer visibilitytimeout, Integer messageTimeToLive, Integer timeout, String requestId, Context context) { final String accept = "application/xml"; - return service.enqueueSync(this.client.getUrl(), queueName, visibilitytimeout, messageTimeToLive, timeout, - this.client.getVersion(), requestId, queueMessage, accept, context); + try { + return service.enqueueSync(this.client.getUrl(), queueName, visibilitytimeout, messageTimeToLive, timeout, + this.client.getVersion(), requestId, queueMessage, accept, context); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** @@ -934,7 +990,7 @@ public ResponseBase enqueueWit * specified to make the message invisible until the visibility timeout expires. A message must be in a format that * can be included in an XML request with UTF-8 encoding. The encoded message can be up to 64 KB in size for * versions 2011-08-18 and newer, or 8 KB in size for previous versions. - * + * * @param queueName The queue name. * @param queueMessage A Message object which can be stored in a Queue. * @param visibilitytimeout Optional. If specified, the request must be made using an x-ms-version of 2011-08-18 or @@ -959,8 +1015,12 @@ public ResponseBase enqueueWit @ServiceMethod(returns = ReturnType.SINGLE) public SendMessageResultWrapper enqueue(String queueName, QueueMessage queueMessage, Integer visibilitytimeout, Integer messageTimeToLive, Integer timeout, String requestId) { - return enqueueWithResponse(queueName, queueMessage, visibilitytimeout, messageTimeToLive, timeout, requestId, - Context.NONE).getValue(); + try { + return enqueueWithResponse(queueName, queueMessage, visibilitytimeout, messageTimeToLive, timeout, + requestId, Context.NONE).getValue(); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** @@ -968,7 +1028,7 @@ public SendMessageResultWrapper enqueue(String queueName, QueueMessage queueMess * specified to make the message invisible until the visibility timeout expires. A message must be in a format that * can be included in an XML request with UTF-8 encoding. The encoded message can be up to 64 KB in size for * versions 2011-08-18 and newer, or 8 KB in size for previous versions. - * + * * @param queueName The queue name. * @param queueMessage A Message object which can be stored in a Queue. * @param visibilitytimeout Optional. If specified, the request must be made using an x-ms-version of 2011-08-18 or @@ -996,14 +1056,18 @@ public Response enqueueNoCustomHeadersWithResponse(Str QueueMessage queueMessage, Integer visibilitytimeout, Integer messageTimeToLive, Integer timeout, String requestId, Context context) { final String accept = "application/xml"; - return service.enqueueNoCustomHeadersSync(this.client.getUrl(), queueName, visibilitytimeout, messageTimeToLive, - timeout, this.client.getVersion(), requestId, queueMessage, accept, context); + try { + return service.enqueueNoCustomHeadersSync(this.client.getUrl(), queueName, visibilitytimeout, + messageTimeToLive, timeout, this.client.getVersion(), requestId, queueMessage, accept, context); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * The Peek operation retrieves one or more messages from the front of the queue, but does not alter the visibility * of the message. - * + * * @param queueName The queue name. * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single @@ -1024,14 +1088,16 @@ public Response enqueueNoCustomHeadersWithResponse(Str peekWithResponseAsync(String queueName, Integer numberOfMessages, Integer timeout, String requestId) { final String peekonly = "true"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.peek(this.client.getUrl(), queueName, peekonly, numberOfMessages, - timeout, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.peek(this.client.getUrl(), queueName, peekonly, numberOfMessages, timeout, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * The Peek operation retrieves one or more messages from the front of the queue, but does not alter the visibility * of the message. - * + * * @param queueName The queue name. * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single @@ -1053,14 +1119,16 @@ public Mono> String queueName, Integer numberOfMessages, Integer timeout, String requestId, Context context) { final String peekonly = "true"; final String accept = "application/xml"; - return service.peek(this.client.getUrl(), queueName, peekonly, numberOfMessages, timeout, - this.client.getVersion(), requestId, accept, context); + return service + .peek(this.client.getUrl(), queueName, peekonly, numberOfMessages, timeout, this.client.getVersion(), + requestId, accept, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * The Peek operation retrieves one or more messages from the front of the queue, but does not alter the visibility * of the message. - * + * * @param queueName The queue name. * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single @@ -1079,13 +1147,14 @@ public Mono> public Mono peekAsync(String queueName, Integer numberOfMessages, Integer timeout, String requestId) { return peekWithResponseAsync(queueName, numberOfMessages, timeout, requestId) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * The Peek operation retrieves one or more messages from the front of the queue, but does not alter the visibility * of the message. - * + * * @param queueName The queue name. * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single @@ -1105,13 +1174,14 @@ public Mono peekAsync(String queueName, Intege public Mono peekAsync(String queueName, Integer numberOfMessages, Integer timeout, String requestId, Context context) { return peekWithResponseAsync(queueName, numberOfMessages, timeout, requestId, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * The Peek operation retrieves one or more messages from the front of the queue, but does not alter the visibility * of the message. - * + * * @param queueName The queue name. * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single @@ -1132,14 +1202,16 @@ public Mono> peekNoCustomHeadersWithR Integer numberOfMessages, Integer timeout, String requestId) { final String peekonly = "true"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.peekNoCustomHeaders(this.client.getUrl(), queueName, peekonly, - numberOfMessages, timeout, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.peekNoCustomHeaders(this.client.getUrl(), queueName, peekonly, + numberOfMessages, timeout, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * The Peek operation retrieves one or more messages from the front of the queue, but does not alter the visibility * of the message. - * + * * @param queueName The queue name. * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single @@ -1161,14 +1233,16 @@ public Mono> peekNoCustomHeadersWithR Integer numberOfMessages, Integer timeout, String requestId, Context context) { final String peekonly = "true"; final String accept = "application/xml"; - return service.peekNoCustomHeaders(this.client.getUrl(), queueName, peekonly, numberOfMessages, timeout, - this.client.getVersion(), requestId, accept, context); + return service + .peekNoCustomHeaders(this.client.getUrl(), queueName, peekonly, numberOfMessages, timeout, + this.client.getVersion(), requestId, accept, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * The Peek operation retrieves one or more messages from the front of the queue, but does not alter the visibility * of the message. - * + * * @param queueName The queue name. * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single @@ -1189,14 +1263,18 @@ public ResponseBase peekW Integer numberOfMessages, Integer timeout, String requestId, Context context) { final String peekonly = "true"; final String accept = "application/xml"; - return service.peekSync(this.client.getUrl(), queueName, peekonly, numberOfMessages, timeout, - this.client.getVersion(), requestId, accept, context); + try { + return service.peekSync(this.client.getUrl(), queueName, peekonly, numberOfMessages, timeout, + this.client.getVersion(), requestId, accept, context); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * The Peek operation retrieves one or more messages from the front of the queue, but does not alter the visibility * of the message. - * + * * @param queueName The queue name. * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single @@ -1214,13 +1292,17 @@ public ResponseBase peekW @ServiceMethod(returns = ReturnType.SINGLE) public PeekedMessageItemInternalWrapper peek(String queueName, Integer numberOfMessages, Integer timeout, String requestId) { - return peekWithResponse(queueName, numberOfMessages, timeout, requestId, Context.NONE).getValue(); + try { + return peekWithResponse(queueName, numberOfMessages, timeout, requestId, Context.NONE).getValue(); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * The Peek operation retrieves one or more messages from the front of the queue, but does not alter the visibility * of the message. - * + * * @param queueName The queue name. * @param numberOfMessages Optional. A nonzero integer value that specifies the number of messages to retrieve from * the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single @@ -1241,7 +1323,11 @@ public Response peekNoCustomHeadersWithRespons Integer numberOfMessages, Integer timeout, String requestId, Context context) { final String peekonly = "true"; final String accept = "application/xml"; - return service.peekNoCustomHeadersSync(this.client.getUrl(), queueName, peekonly, numberOfMessages, timeout, - this.client.getVersion(), requestId, accept, context); + try { + return service.peekNoCustomHeadersSync(this.client.getUrl(), queueName, peekonly, numberOfMessages, timeout, + this.client.getVersion(), requestId, accept, context); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/QueuesImpl.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/QueuesImpl.java index 17a56887e03a..27677de59515 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/QueuesImpl.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/QueuesImpl.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.storage.queue.implementation; import com.azure.core.annotation.BodyParam; @@ -35,11 +34,13 @@ import java.util.List; import java.util.Map; import reactor.core.publisher.Mono; +import com.azure.storage.queue.implementation.util.ModelHelper; /** * An instance of this class provides access to all the operations defined in Queues. */ public final class QueuesImpl { + /** * The proxy service used to perform REST calls. */ @@ -52,7 +53,7 @@ public final class QueuesImpl { /** * Initializes an instance of QueuesImpl. - * + * * @param client the instance of the service client containing this operation class. */ QueuesImpl(AzureQueueStorageImpl client) { @@ -67,6 +68,7 @@ public final class QueuesImpl { @Host("{url}") @ServiceInterface(name = "AzureQueueStorageQue") public interface QueuesService { + @Put("/{queueName}") @ExpectedResponses({ 201, 204 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) @@ -285,7 +287,7 @@ Response setAccessPolicyNoCustomHeadersSync(@HostParam("url") String url, /** * creates a new queue under the given account. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -305,13 +307,15 @@ Response setAccessPolicyNoCustomHeadersSync(@HostParam("url") String url, public Mono> createWithResponseAsync(String queueName, Integer timeout, Map metadata, String requestId) { final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.create(this.client.getUrl(), queueName, timeout, metadata, - this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.create(this.client.getUrl(), queueName, timeout, metadata, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * creates a new queue under the given account. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -332,13 +336,15 @@ public Mono> createWithResponseAsync(Str public Mono> createWithResponseAsync(String queueName, Integer timeout, Map metadata, String requestId, Context context) { final String accept = "application/xml"; - return service.create(this.client.getUrl(), queueName, timeout, metadata, this.client.getVersion(), requestId, - accept, context); + return service + .create(this.client.getUrl(), queueName, timeout, metadata, this.client.getVersion(), requestId, accept, + context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * creates a new queue under the given account. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -356,12 +362,14 @@ public Mono> createWithResponseAsync(Str */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono createAsync(String queueName, Integer timeout, Map metadata, String requestId) { - return createWithResponseAsync(queueName, timeout, metadata, requestId).flatMap(ignored -> Mono.empty()); + return createWithResponseAsync(queueName, timeout, metadata, requestId) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) + .flatMap(ignored -> Mono.empty()); } /** * creates a new queue under the given account. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -382,12 +390,13 @@ public Mono createAsync(String queueName, Integer timeout, Map createAsync(String queueName, Integer timeout, Map metadata, String requestId, Context context) { return createWithResponseAsync(queueName, timeout, metadata, requestId, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) .flatMap(ignored -> Mono.empty()); } /** * creates a new queue under the given account. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -407,13 +416,15 @@ public Mono createAsync(String queueName, Integer timeout, Map> createNoCustomHeadersWithResponseAsync(String queueName, Integer timeout, Map metadata, String requestId) { final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.createNoCustomHeaders(this.client.getUrl(), queueName, timeout, - metadata, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.createNoCustomHeaders(this.client.getUrl(), queueName, timeout, metadata, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * creates a new queue under the given account. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -434,13 +445,15 @@ public Mono> createNoCustomHeadersWithResponseAsync(String queueN public Mono> createNoCustomHeadersWithResponseAsync(String queueName, Integer timeout, Map metadata, String requestId, Context context) { final String accept = "application/xml"; - return service.createNoCustomHeaders(this.client.getUrl(), queueName, timeout, metadata, - this.client.getVersion(), requestId, accept, context); + return service + .createNoCustomHeaders(this.client.getUrl(), queueName, timeout, metadata, this.client.getVersion(), + requestId, accept, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * creates a new queue under the given account. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -461,13 +474,17 @@ public Mono> createNoCustomHeadersWithResponseAsync(String queueN public ResponseBase createWithResponse(String queueName, Integer timeout, Map metadata, String requestId, Context context) { final String accept = "application/xml"; - return service.createSync(this.client.getUrl(), queueName, timeout, metadata, this.client.getVersion(), - requestId, accept, context); + try { + return service.createSync(this.client.getUrl(), queueName, timeout, metadata, this.client.getVersion(), + requestId, accept, context); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * creates a new queue under the given account. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -489,7 +506,7 @@ public void create(String queueName, Integer timeout, Map metada /** * creates a new queue under the given account. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -510,13 +527,17 @@ public void create(String queueName, Integer timeout, Map metada public Response createNoCustomHeadersWithResponse(String queueName, Integer timeout, Map metadata, String requestId, Context context) { final String accept = "application/xml"; - return service.createNoCustomHeadersSync(this.client.getUrl(), queueName, timeout, metadata, - this.client.getVersion(), requestId, accept, context); + try { + return service.createNoCustomHeadersSync(this.client.getUrl(), queueName, timeout, metadata, + this.client.getVersion(), requestId, accept, context); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * operation permanently deletes the specified queue. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -532,13 +553,15 @@ public Response createNoCustomHeadersWithResponse(String queueName, Intege public Mono> deleteWithResponseAsync(String queueName, Integer timeout, String requestId) { final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.delete(this.client.getUrl(), queueName, timeout, - this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.delete(this.client.getUrl(), queueName, timeout, this.client.getVersion(), + requestId, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * operation permanently deletes the specified queue. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -555,13 +578,14 @@ public Mono> deleteWithResponseAsync(Str public Mono> deleteWithResponseAsync(String queueName, Integer timeout, String requestId, Context context) { final String accept = "application/xml"; - return service.delete(this.client.getUrl(), queueName, timeout, this.client.getVersion(), requestId, accept, - context); + return service + .delete(this.client.getUrl(), queueName, timeout, this.client.getVersion(), requestId, accept, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * operation permanently deletes the specified queue. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -575,12 +599,14 @@ public Mono> deleteWithResponseAsync(Str */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String queueName, Integer timeout, String requestId) { - return deleteWithResponseAsync(queueName, timeout, requestId).flatMap(ignored -> Mono.empty()); + return deleteWithResponseAsync(queueName, timeout, requestId) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) + .flatMap(ignored -> Mono.empty()); } /** * operation permanently deletes the specified queue. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -595,12 +621,14 @@ public Mono deleteAsync(String queueName, Integer timeout, String requestI */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String queueName, Integer timeout, String requestId, Context context) { - return deleteWithResponseAsync(queueName, timeout, requestId, context).flatMap(ignored -> Mono.empty()); + return deleteWithResponseAsync(queueName, timeout, requestId, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) + .flatMap(ignored -> Mono.empty()); } /** * operation permanently deletes the specified queue. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -616,13 +644,15 @@ public Mono deleteAsync(String queueName, Integer timeout, String requestI public Mono> deleteNoCustomHeadersWithResponseAsync(String queueName, Integer timeout, String requestId) { final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.deleteNoCustomHeaders(this.client.getUrl(), queueName, timeout, - this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.deleteNoCustomHeaders(this.client.getUrl(), queueName, timeout, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * operation permanently deletes the specified queue. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -639,13 +669,15 @@ public Mono> deleteNoCustomHeadersWithResponseAsync(String queueN public Mono> deleteNoCustomHeadersWithResponseAsync(String queueName, Integer timeout, String requestId, Context context) { final String accept = "application/xml"; - return service.deleteNoCustomHeaders(this.client.getUrl(), queueName, timeout, this.client.getVersion(), - requestId, accept, context); + return service + .deleteNoCustomHeaders(this.client.getUrl(), queueName, timeout, this.client.getVersion(), requestId, + accept, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * operation permanently deletes the specified queue. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -662,13 +694,17 @@ public Mono> deleteNoCustomHeadersWithResponseAsync(String queueN public ResponseBase deleteWithResponse(String queueName, Integer timeout, String requestId, Context context) { final String accept = "application/xml"; - return service.deleteSync(this.client.getUrl(), queueName, timeout, this.client.getVersion(), requestId, accept, - context); + try { + return service.deleteSync(this.client.getUrl(), queueName, timeout, this.client.getVersion(), requestId, + accept, context); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * operation permanently deletes the specified queue. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -686,7 +722,7 @@ public void delete(String queueName, Integer timeout, String requestId) { /** * operation permanently deletes the specified queue. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -703,14 +739,18 @@ public void delete(String queueName, Integer timeout, String requestId) { public Response deleteNoCustomHeadersWithResponse(String queueName, Integer timeout, String requestId, Context context) { final String accept = "application/xml"; - return service.deleteNoCustomHeadersSync(this.client.getUrl(), queueName, timeout, this.client.getVersion(), - requestId, accept, context); + try { + return service.deleteNoCustomHeadersSync(this.client.getUrl(), queueName, timeout, this.client.getVersion(), + requestId, accept, context); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * Retrieves user-defined metadata and queue properties on the specified queue. Metadata is associated with the * queue as name-values pairs. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -727,14 +767,16 @@ public Mono> getPropertiesWithRes Integer timeout, String requestId) { final String comp = "metadata"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getProperties(this.client.getUrl(), queueName, comp, timeout, - this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.getProperties(this.client.getUrl(), queueName, comp, timeout, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * Retrieves user-defined metadata and queue properties on the specified queue. Metadata is associated with the * queue as name-values pairs. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -752,14 +794,16 @@ public Mono> getPropertiesWithRes Integer timeout, String requestId, Context context) { final String comp = "metadata"; final String accept = "application/xml"; - return service.getProperties(this.client.getUrl(), queueName, comp, timeout, this.client.getVersion(), - requestId, accept, context); + return service + .getProperties(this.client.getUrl(), queueName, comp, timeout, this.client.getVersion(), requestId, accept, + context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * Retrieves user-defined metadata and queue properties on the specified queue. Metadata is associated with the * queue as name-values pairs. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -773,13 +817,15 @@ public Mono> getPropertiesWithRes */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getPropertiesAsync(String queueName, Integer timeout, String requestId) { - return getPropertiesWithResponseAsync(queueName, timeout, requestId).flatMap(ignored -> Mono.empty()); + return getPropertiesWithResponseAsync(queueName, timeout, requestId) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Retrieves user-defined metadata and queue properties on the specified queue. Metadata is associated with the * queue as name-values pairs. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -794,13 +840,15 @@ public Mono getPropertiesAsync(String queueName, Integer timeout, String r */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getPropertiesAsync(String queueName, Integer timeout, String requestId, Context context) { - return getPropertiesWithResponseAsync(queueName, timeout, requestId, context).flatMap(ignored -> Mono.empty()); + return getPropertiesWithResponseAsync(queueName, timeout, requestId, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) + .flatMap(ignored -> Mono.empty()); } /** * Retrieves user-defined metadata and queue properties on the specified queue. Metadata is associated with the * queue as name-values pairs. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -817,14 +865,16 @@ public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String String requestId) { final String comp = "metadata"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getPropertiesNoCustomHeaders(this.client.getUrl(), queueName, - comp, timeout, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.getPropertiesNoCustomHeaders(this.client.getUrl(), queueName, comp, timeout, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * Retrieves user-defined metadata and queue properties on the specified queue. Metadata is associated with the * queue as name-values pairs. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -842,14 +892,16 @@ public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String String requestId, Context context) { final String comp = "metadata"; final String accept = "application/xml"; - return service.getPropertiesNoCustomHeaders(this.client.getUrl(), queueName, comp, timeout, - this.client.getVersion(), requestId, accept, context); + return service + .getPropertiesNoCustomHeaders(this.client.getUrl(), queueName, comp, timeout, this.client.getVersion(), + requestId, accept, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * Retrieves user-defined metadata and queue properties on the specified queue. Metadata is associated with the * queue as name-values pairs. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -867,14 +919,18 @@ public ResponseBase getPropertiesWithResponse( String requestId, Context context) { final String comp = "metadata"; final String accept = "application/xml"; - return service.getPropertiesSync(this.client.getUrl(), queueName, comp, timeout, this.client.getVersion(), - requestId, accept, context); + try { + return service.getPropertiesSync(this.client.getUrl(), queueName, comp, timeout, this.client.getVersion(), + requestId, accept, context); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * Retrieves user-defined metadata and queue properties on the specified queue. Metadata is associated with the * queue as name-values pairs. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -893,7 +949,7 @@ public void getProperties(String queueName, Integer timeout, String requestId) { /** * Retrieves user-defined metadata and queue properties on the specified queue. Metadata is associated with the * queue as name-values pairs. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -911,13 +967,17 @@ public Response getPropertiesNoCustomHeadersWithResponse(String queueName, Context context) { final String comp = "metadata"; final String accept = "application/xml"; - return service.getPropertiesNoCustomHeadersSync(this.client.getUrl(), queueName, comp, timeout, - this.client.getVersion(), requestId, accept, context); + try { + return service.getPropertiesNoCustomHeadersSync(this.client.getUrl(), queueName, comp, timeout, + this.client.getVersion(), requestId, accept, context); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * sets user-defined metadata on the specified queue. Metadata is associated with the queue as name-value pairs. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -938,13 +998,15 @@ public Mono> setMetadataWithRespons Integer timeout, Map metadata, String requestId) { final String comp = "metadata"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.setMetadata(this.client.getUrl(), queueName, comp, timeout, - metadata, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.setMetadata(this.client.getUrl(), queueName, comp, timeout, metadata, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * sets user-defined metadata on the specified queue. Metadata is associated with the queue as name-value pairs. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -966,13 +1028,15 @@ public Mono> setMetadataWithRespons Integer timeout, Map metadata, String requestId, Context context) { final String comp = "metadata"; final String accept = "application/xml"; - return service.setMetadata(this.client.getUrl(), queueName, comp, timeout, metadata, this.client.getVersion(), - requestId, accept, context); + return service + .setMetadata(this.client.getUrl(), queueName, comp, timeout, metadata, this.client.getVersion(), requestId, + accept, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * sets user-defined metadata on the specified queue. Metadata is associated with the queue as name-value pairs. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -991,12 +1055,14 @@ public Mono> setMetadataWithRespons @ServiceMethod(returns = ReturnType.SINGLE) public Mono setMetadataAsync(String queueName, Integer timeout, Map metadata, String requestId) { - return setMetadataWithResponseAsync(queueName, timeout, metadata, requestId).flatMap(ignored -> Mono.empty()); + return setMetadataWithResponseAsync(queueName, timeout, metadata, requestId) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) + .flatMap(ignored -> Mono.empty()); } /** * sets user-defined metadata on the specified queue. Metadata is associated with the queue as name-value pairs. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -1017,12 +1083,13 @@ public Mono setMetadataAsync(String queueName, Integer timeout, Map setMetadataAsync(String queueName, Integer timeout, Map metadata, String requestId, Context context) { return setMetadataWithResponseAsync(queueName, timeout, metadata, requestId, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) .flatMap(ignored -> Mono.empty()); } /** * sets user-defined metadata on the specified queue. Metadata is associated with the queue as name-value pairs. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -1043,13 +1110,15 @@ public Mono> setMetadataNoCustomHeadersWithResponseAsync(String q Map metadata, String requestId) { final String comp = "metadata"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.setMetadataNoCustomHeaders(this.client.getUrl(), queueName, comp, - timeout, metadata, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.setMetadataNoCustomHeaders(this.client.getUrl(), queueName, comp, timeout, + metadata, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * sets user-defined metadata on the specified queue. Metadata is associated with the queue as name-value pairs. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -1071,13 +1140,15 @@ public Mono> setMetadataNoCustomHeadersWithResponseAsync(String q Map metadata, String requestId, Context context) { final String comp = "metadata"; final String accept = "application/xml"; - return service.setMetadataNoCustomHeaders(this.client.getUrl(), queueName, comp, timeout, metadata, - this.client.getVersion(), requestId, accept, context); + return service + .setMetadataNoCustomHeaders(this.client.getUrl(), queueName, comp, timeout, metadata, + this.client.getVersion(), requestId, accept, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * sets user-defined metadata on the specified queue. Metadata is associated with the queue as name-value pairs. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -1099,13 +1170,17 @@ public ResponseBase setMetadataWithResponse(Stri Map metadata, String requestId, Context context) { final String comp = "metadata"; final String accept = "application/xml"; - return service.setMetadataSync(this.client.getUrl(), queueName, comp, timeout, metadata, - this.client.getVersion(), requestId, accept, context); + try { + return service.setMetadataSync(this.client.getUrl(), queueName, comp, timeout, metadata, + this.client.getVersion(), requestId, accept, context); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * sets user-defined metadata on the specified queue. Metadata is associated with the queue as name-value pairs. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -1127,7 +1202,7 @@ public void setMetadata(String queueName, Integer timeout, Map m /** * sets user-defined metadata on the specified queue. Metadata is associated with the queue as name-value pairs. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -1149,14 +1224,18 @@ public Response setMetadataNoCustomHeadersWithResponse(String queueName, I Map metadata, String requestId, Context context) { final String comp = "metadata"; final String accept = "application/xml"; - return service.setMetadataNoCustomHeadersSync(this.client.getUrl(), queueName, comp, timeout, metadata, - this.client.getVersion(), requestId, accept, context); + try { + return service.setMetadataNoCustomHeadersSync(this.client.getUrl(), queueName, comp, timeout, metadata, + this.client.getVersion(), requestId, accept, context); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * returns details about any stored access policies specified on the queue that may be used with Shared Access * Signatures. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -1174,14 +1253,16 @@ public Response setMetadataNoCustomHeadersWithResponse(String queueName, I getAccessPolicyWithResponseAsync(String queueName, Integer timeout, String requestId) { final String comp = "acl"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getAccessPolicy(this.client.getUrl(), queueName, comp, timeout, - this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.getAccessPolicy(this.client.getUrl(), queueName, comp, timeout, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * returns details about any stored access policies specified on the queue that may be used with Shared Access * Signatures. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -1200,14 +1281,16 @@ public Response setMetadataNoCustomHeadersWithResponse(String queueName, I getAccessPolicyWithResponseAsync(String queueName, Integer timeout, String requestId, Context context) { final String comp = "acl"; final String accept = "application/xml"; - return service.getAccessPolicy(this.client.getUrl(), queueName, comp, timeout, this.client.getVersion(), - requestId, accept, context); + return service + .getAccessPolicy(this.client.getUrl(), queueName, comp, timeout, this.client.getVersion(), requestId, + accept, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * returns details about any stored access policies specified on the queue that may be used with Shared Access * Signatures. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -1223,13 +1306,14 @@ public Response setMetadataNoCustomHeadersWithResponse(String queueName, I public Mono getAccessPolicyAsync(String queueName, Integer timeout, String requestId) { return getAccessPolicyWithResponseAsync(queueName, timeout, requestId) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * returns details about any stored access policies specified on the queue that may be used with Shared Access * Signatures. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -1246,13 +1330,14 @@ public Mono getAccessPolicyAsync(String queueName, public Mono getAccessPolicyAsync(String queueName, Integer timeout, String requestId, Context context) { return getAccessPolicyWithResponseAsync(queueName, timeout, requestId, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * returns details about any stored access policies specified on the queue that may be used with Shared Access * Signatures. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -1269,14 +1354,16 @@ public Mono getAccessPolicyAsync(String queueName, getAccessPolicyNoCustomHeadersWithResponseAsync(String queueName, Integer timeout, String requestId) { final String comp = "acl"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getAccessPolicyNoCustomHeaders(this.client.getUrl(), queueName, - comp, timeout, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.getAccessPolicyNoCustomHeaders(this.client.getUrl(), queueName, comp, + timeout, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * returns details about any stored access policies specified on the queue that may be used with Shared Access * Signatures. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -1294,14 +1381,16 @@ public Mono> getAccessPolicyNoCustomHeade String queueName, Integer timeout, String requestId, Context context) { final String comp = "acl"; final String accept = "application/xml"; - return service.getAccessPolicyNoCustomHeaders(this.client.getUrl(), queueName, comp, timeout, - this.client.getVersion(), requestId, accept, context); + return service + .getAccessPolicyNoCustomHeaders(this.client.getUrl(), queueName, comp, timeout, this.client.getVersion(), + requestId, accept, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * returns details about any stored access policies specified on the queue that may be used with Shared Access * Signatures. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -1319,14 +1408,18 @@ public Mono> getAccessPolicyNoCustomHeade getAccessPolicyWithResponse(String queueName, Integer timeout, String requestId, Context context) { final String comp = "acl"; final String accept = "application/xml"; - return service.getAccessPolicySync(this.client.getUrl(), queueName, comp, timeout, this.client.getVersion(), - requestId, accept, context); + try { + return service.getAccessPolicySync(this.client.getUrl(), queueName, comp, timeout, this.client.getVersion(), + requestId, accept, context); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * returns details about any stored access policies specified on the queue that may be used with Shared Access * Signatures. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -1340,13 +1433,17 @@ public Mono> getAccessPolicyNoCustomHeade */ @ServiceMethod(returns = ReturnType.SINGLE) public QueueSignedIdentifierWrapper getAccessPolicy(String queueName, Integer timeout, String requestId) { - return getAccessPolicyWithResponse(queueName, timeout, requestId, Context.NONE).getValue(); + try { + return getAccessPolicyWithResponse(queueName, timeout, requestId, Context.NONE).getValue(); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * returns details about any stored access policies specified on the queue that may be used with Shared Access * Signatures. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -1364,13 +1461,17 @@ public Response getAccessPolicyNoCustomHeadersWith Integer timeout, String requestId, Context context) { final String comp = "acl"; final String accept = "application/xml"; - return service.getAccessPolicyNoCustomHeadersSync(this.client.getUrl(), queueName, comp, timeout, - this.client.getVersion(), requestId, accept, context); + try { + return service.getAccessPolicyNoCustomHeadersSync(this.client.getUrl(), queueName, comp, timeout, + this.client.getVersion(), requestId, accept, context); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * sets stored access policies for the queue that may be used with Shared Access Signatures. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -1389,13 +1490,15 @@ public Mono> setAccessPolicyWit final String comp = "acl"; final String accept = "application/xml"; QueueSignedIdentifierWrapper queueAclConverted = new QueueSignedIdentifierWrapper(queueAcl); - return FluxUtil.withContext(context -> service.setAccessPolicy(this.client.getUrl(), queueName, comp, timeout, - this.client.getVersion(), requestId, queueAclConverted, accept, context)); + return FluxUtil + .withContext(context -> service.setAccessPolicy(this.client.getUrl(), queueName, comp, timeout, + this.client.getVersion(), requestId, queueAclConverted, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * sets stored access policies for the queue that may be used with Shared Access Signatures. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -1415,13 +1518,15 @@ public Mono> setAccessPolicyWit final String comp = "acl"; final String accept = "application/xml"; QueueSignedIdentifierWrapper queueAclConverted = new QueueSignedIdentifierWrapper(queueAcl); - return service.setAccessPolicy(this.client.getUrl(), queueName, comp, timeout, this.client.getVersion(), - requestId, queueAclConverted, accept, context); + return service + .setAccessPolicy(this.client.getUrl(), queueName, comp, timeout, this.client.getVersion(), requestId, + queueAclConverted, accept, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * sets stored access policies for the queue that may be used with Shared Access Signatures. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -1438,12 +1543,13 @@ public Mono> setAccessPolicyWit public Mono setAccessPolicyAsync(String queueName, Integer timeout, String requestId, List queueAcl) { return setAccessPolicyWithResponseAsync(queueName, timeout, requestId, queueAcl) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) .flatMap(ignored -> Mono.empty()); } /** * sets stored access policies for the queue that may be used with Shared Access Signatures. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -1461,12 +1567,13 @@ public Mono setAccessPolicyAsync(String queueName, Integer timeout, String public Mono setAccessPolicyAsync(String queueName, Integer timeout, String requestId, List queueAcl, Context context) { return setAccessPolicyWithResponseAsync(queueName, timeout, requestId, queueAcl, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) .flatMap(ignored -> Mono.empty()); } /** * sets stored access policies for the queue that may be used with Shared Access Signatures. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -1485,13 +1592,15 @@ public Mono> setAccessPolicyNoCustomHeadersWithResponseAsync(Stri final String comp = "acl"; final String accept = "application/xml"; QueueSignedIdentifierWrapper queueAclConverted = new QueueSignedIdentifierWrapper(queueAcl); - return FluxUtil.withContext(context -> service.setAccessPolicyNoCustomHeaders(this.client.getUrl(), queueName, - comp, timeout, this.client.getVersion(), requestId, queueAclConverted, accept, context)); + return FluxUtil + .withContext(context -> service.setAccessPolicyNoCustomHeaders(this.client.getUrl(), queueName, comp, + timeout, this.client.getVersion(), requestId, queueAclConverted, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * sets stored access policies for the queue that may be used with Shared Access Signatures. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -1511,13 +1620,15 @@ public Mono> setAccessPolicyNoCustomHeadersWithResponseAsync(Stri final String comp = "acl"; final String accept = "application/xml"; QueueSignedIdentifierWrapper queueAclConverted = new QueueSignedIdentifierWrapper(queueAcl); - return service.setAccessPolicyNoCustomHeaders(this.client.getUrl(), queueName, comp, timeout, - this.client.getVersion(), requestId, queueAclConverted, accept, context); + return service + .setAccessPolicyNoCustomHeaders(this.client.getUrl(), queueName, comp, timeout, this.client.getVersion(), + requestId, queueAclConverted, accept, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * sets stored access policies for the queue that may be used with Shared Access Signatures. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -1537,13 +1648,17 @@ public ResponseBase setAccessPolicyWithRespo final String comp = "acl"; final String accept = "application/xml"; QueueSignedIdentifierWrapper queueAclConverted = new QueueSignedIdentifierWrapper(queueAcl); - return service.setAccessPolicySync(this.client.getUrl(), queueName, comp, timeout, this.client.getVersion(), - requestId, queueAclConverted, accept, context); + try { + return service.setAccessPolicySync(this.client.getUrl(), queueName, comp, timeout, this.client.getVersion(), + requestId, queueAclConverted, accept, context); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * sets stored access policies for the queue that may be used with Shared Access Signatures. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -1563,7 +1678,7 @@ public void setAccessPolicy(String queueName, Integer timeout, String requestId, /** * sets stored access policies for the queue that may be used with Shared Access Signatures. - * + * * @param queueName The queue name. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -1583,7 +1698,11 @@ public Response setAccessPolicyNoCustomHeadersWithResponse(String queueNam final String comp = "acl"; final String accept = "application/xml"; QueueSignedIdentifierWrapper queueAclConverted = new QueueSignedIdentifierWrapper(queueAcl); - return service.setAccessPolicyNoCustomHeadersSync(this.client.getUrl(), queueName, comp, timeout, - this.client.getVersion(), requestId, queueAclConverted, accept, context); + try { + return service.setAccessPolicyNoCustomHeadersSync(this.client.getUrl(), queueName, comp, timeout, + this.client.getVersion(), requestId, queueAclConverted, accept, context); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/ServicesImpl.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/ServicesImpl.java index 322dbb50f2c3..2ac55bda093f 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/ServicesImpl.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/ServicesImpl.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.storage.queue.implementation; import com.azure.core.annotation.BodyParam; @@ -40,11 +39,13 @@ import java.util.Objects; import java.util.stream.Collectors; import reactor.core.publisher.Mono; +import com.azure.storage.queue.implementation.util.ModelHelper; /** * An instance of this class provides access to all the operations defined in Services. */ public final class ServicesImpl { + /** * The proxy service used to perform REST calls. */ @@ -57,7 +58,7 @@ public final class ServicesImpl { /** * Initializes an instance of ServicesImpl. - * + * * @param client the instance of the service client containing this operation class. */ ServicesImpl(AzureQueueStorageImpl client) { @@ -72,6 +73,7 @@ public final class ServicesImpl { @Host("{url}") @ServiceInterface(name = "AzureQueueStorageSer") public interface ServicesService { + @Put("/") @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(QueueStorageExceptionInternal.class) @@ -260,7 +262,7 @@ Response listQueuesSegmentNextNoCustomHeadersSync( /** * Sets properties for a storage account's Queue service endpoint, including properties for Storage Analytics and * CORS (Cross-Origin Resource Sharing) rules. - * + * * @param queueServiceProperties The StorageService properties. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -278,14 +280,16 @@ public Mono> setPropertiesWithR final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.setProperties(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), requestId, queueServiceProperties, accept, context)); + return FluxUtil + .withContext(context -> service.setProperties(this.client.getUrl(), restype, comp, timeout, + this.client.getVersion(), requestId, queueServiceProperties, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * Sets properties for a storage account's Queue service endpoint, including properties for Storage Analytics and * CORS (Cross-Origin Resource Sharing) rules. - * + * * @param queueServiceProperties The StorageService properties. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -304,14 +308,16 @@ public Mono> setPropertiesWithR final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return service.setProperties(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), requestId, - queueServiceProperties, accept, context); + return service + .setProperties(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), requestId, + queueServiceProperties, accept, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * Sets properties for a storage account's Queue service endpoint, including properties for Storage Analytics and * CORS (Cross-Origin Resource Sharing) rules. - * + * * @param queueServiceProperties The StorageService properties. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -327,13 +333,14 @@ public Mono> setPropertiesWithR public Mono setPropertiesAsync(QueueServiceProperties queueServiceProperties, Integer timeout, String requestId) { return setPropertiesWithResponseAsync(queueServiceProperties, timeout, requestId) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) .flatMap(ignored -> Mono.empty()); } /** * Sets properties for a storage account's Queue service endpoint, including properties for Storage Analytics and * CORS (Cross-Origin Resource Sharing) rules. - * + * * @param queueServiceProperties The StorageService properties. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -350,13 +357,14 @@ public Mono setPropertiesAsync(QueueServiceProperties queueServiceProperti public Mono setPropertiesAsync(QueueServiceProperties queueServiceProperties, Integer timeout, String requestId, Context context) { return setPropertiesWithResponseAsync(queueServiceProperties, timeout, requestId, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) .flatMap(ignored -> Mono.empty()); } /** * Sets properties for a storage account's Queue service endpoint, including properties for Storage Analytics and * CORS (Cross-Origin Resource Sharing) rules. - * + * * @param queueServiceProperties The StorageService properties. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -374,14 +382,16 @@ public Mono> setPropertiesNoCustomHeadersWithResponseAsync( final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.setPropertiesNoCustomHeaders(this.client.getUrl(), restype, comp, - timeout, this.client.getVersion(), requestId, queueServiceProperties, accept, context)); + return FluxUtil + .withContext(context -> service.setPropertiesNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, + this.client.getVersion(), requestId, queueServiceProperties, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * Sets properties for a storage account's Queue service endpoint, including properties for Storage Analytics and * CORS (Cross-Origin Resource Sharing) rules. - * + * * @param queueServiceProperties The StorageService properties. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -400,14 +410,16 @@ public Mono> setPropertiesNoCustomHeadersWithResponseAsync( final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return service.setPropertiesNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), requestId, queueServiceProperties, accept, context); + return service + .setPropertiesNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), + requestId, queueServiceProperties, accept, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * Sets properties for a storage account's Queue service endpoint, including properties for Storage Analytics and * CORS (Cross-Origin Resource Sharing) rules. - * + * * @param queueServiceProperties The StorageService properties. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -426,14 +438,18 @@ public ResponseBase setPropertiesWithRespons final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return service.setPropertiesSync(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), - requestId, queueServiceProperties, accept, context); + try { + return service.setPropertiesSync(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), + requestId, queueServiceProperties, accept, context); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * Sets properties for a storage account's Queue service endpoint, including properties for Storage Analytics and * CORS (Cross-Origin Resource Sharing) rules. - * + * * @param queueServiceProperties The StorageService properties. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -452,7 +468,7 @@ public void setProperties(QueueServiceProperties queueServiceProperties, Integer /** * Sets properties for a storage account's Queue service endpoint, including properties for Storage Analytics and * CORS (Cross-Origin Resource Sharing) rules. - * + * * @param queueServiceProperties The StorageService properties. * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting @@ -471,14 +487,18 @@ public Response setPropertiesNoCustomHeadersWithResponse(QueueServicePrope final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return service.setPropertiesNoCustomHeadersSync(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), requestId, queueServiceProperties, accept, context); + try { + return service.setPropertiesNoCustomHeadersSync(this.client.getUrl(), restype, comp, timeout, + this.client.getVersion(), requestId, queueServiceProperties, accept, context); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * gets the properties of a storage account's Queue service, including properties for Storage Analytics and CORS * (Cross-Origin Resource Sharing) rules. - * + * * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting * Timeouts for Queue Service Operations.</a>. @@ -496,14 +516,16 @@ public Response setPropertiesNoCustomHeadersWithResponse(QueueServicePrope final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getProperties(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.getProperties(this.client.getUrl(), restype, comp, timeout, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * gets the properties of a storage account's Queue service, including properties for Storage Analytics and CORS * (Cross-Origin Resource Sharing) rules. - * + * * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting * Timeouts for Queue Service Operations.</a>. @@ -522,14 +544,16 @@ public Response setPropertiesNoCustomHeadersWithResponse(QueueServicePrope final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return service.getProperties(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), requestId, - accept, context); + return service + .getProperties(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), requestId, accept, + context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * gets the properties of a storage account's Queue service, including properties for Storage Analytics and CORS * (Cross-Origin Resource Sharing) rules. - * + * * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting * Timeouts for Queue Service Operations.</a>. @@ -543,13 +567,15 @@ public Response setPropertiesNoCustomHeadersWithResponse(QueueServicePrope */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getPropertiesAsync(Integer timeout, String requestId) { - return getPropertiesWithResponseAsync(timeout, requestId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + return getPropertiesWithResponseAsync(timeout, requestId) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * gets the properties of a storage account's Queue service, including properties for Storage Analytics and CORS * (Cross-Origin Resource Sharing) rules. - * + * * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting * Timeouts for Queue Service Operations.</a>. @@ -565,13 +591,14 @@ public Mono getPropertiesAsync(Integer timeout, String r @ServiceMethod(returns = ReturnType.SINGLE) public Mono getPropertiesAsync(Integer timeout, String requestId, Context context) { return getPropertiesWithResponseAsync(timeout, requestId, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * gets the properties of a storage account's Queue service, including properties for Storage Analytics and CORS * (Cross-Origin Resource Sharing) rules. - * + * * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting * Timeouts for Queue Service Operations.</a>. @@ -589,14 +616,16 @@ public Mono> getPropertiesNoCustomHeadersWithRe final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getPropertiesNoCustomHeaders(this.client.getUrl(), restype, comp, - timeout, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.getPropertiesNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * gets the properties of a storage account's Queue service, including properties for Storage Analytics and CORS * (Cross-Origin Resource Sharing) rules. - * + * * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting * Timeouts for Queue Service Operations.</a>. @@ -615,14 +644,16 @@ public Mono> getPropertiesNoCustomHeadersWithRe final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return service.getPropertiesNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), requestId, accept, context); + return service + .getPropertiesNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), + requestId, accept, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * gets the properties of a storage account's Queue service, including properties for Storage Analytics and CORS * (Cross-Origin Resource Sharing) rules. - * + * * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting * Timeouts for Queue Service Operations.</a>. @@ -641,14 +672,18 @@ public ResponseBase getPro final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return service.getPropertiesSync(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), - requestId, accept, context); + try { + return service.getPropertiesSync(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), + requestId, accept, context); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * gets the properties of a storage account's Queue service, including properties for Storage Analytics and CORS * (Cross-Origin Resource Sharing) rules. - * + * * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting * Timeouts for Queue Service Operations.</a>. @@ -662,13 +697,17 @@ public ResponseBase getPro */ @ServiceMethod(returns = ReturnType.SINGLE) public QueueServiceProperties getProperties(Integer timeout, String requestId) { - return getPropertiesWithResponse(timeout, requestId, Context.NONE).getValue(); + try { + return getPropertiesWithResponse(timeout, requestId, Context.NONE).getValue(); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * gets the properties of a storage account's Queue service, including properties for Storage Analytics and CORS * (Cross-Origin Resource Sharing) rules. - * + * * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting * Timeouts for Queue Service Operations.</a>. @@ -687,14 +726,18 @@ public Response getPropertiesNoCustomHeadersWithResponse final String restype = "service"; final String comp = "properties"; final String accept = "application/xml"; - return service.getPropertiesNoCustomHeadersSync(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), requestId, accept, context); + try { + return service.getPropertiesNoCustomHeadersSync(this.client.getUrl(), restype, comp, timeout, + this.client.getVersion(), requestId, accept, context); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * Retrieves statistics related to replication for the Queue service. It is only available on the secondary location * endpoint when read-access geo-redundant replication is enabled for the storage account. - * + * * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting * Timeouts for Queue Service Operations.</a>. @@ -711,14 +754,16 @@ public Response getPropertiesNoCustomHeadersWithResponse final String restype = "service"; final String comp = "stats"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getStatistics(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.getStatistics(this.client.getUrl(), restype, comp, timeout, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * Retrieves statistics related to replication for the Queue service. It is only available on the secondary location * endpoint when read-access geo-redundant replication is enabled for the storage account. - * + * * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting * Timeouts for Queue Service Operations.</a>. @@ -736,14 +781,16 @@ public Response getPropertiesNoCustomHeadersWithResponse final String restype = "service"; final String comp = "stats"; final String accept = "application/xml"; - return service.getStatistics(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), requestId, - accept, context); + return service + .getStatistics(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), requestId, accept, + context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * Retrieves statistics related to replication for the Queue service. It is only available on the secondary location * endpoint when read-access geo-redundant replication is enabled for the storage account. - * + * * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting * Timeouts for Queue Service Operations.</a>. @@ -756,13 +803,15 @@ public Response getPropertiesNoCustomHeadersWithResponse */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getStatisticsAsync(Integer timeout, String requestId) { - return getStatisticsWithResponseAsync(timeout, requestId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + return getStatisticsWithResponseAsync(timeout, requestId) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Retrieves statistics related to replication for the Queue service. It is only available on the secondary location * endpoint when read-access geo-redundant replication is enabled for the storage account. - * + * * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting * Timeouts for Queue Service Operations.</a>. @@ -777,13 +826,14 @@ public Mono getStatisticsAsync(Integer timeout, String r @ServiceMethod(returns = ReturnType.SINGLE) public Mono getStatisticsAsync(Integer timeout, String requestId, Context context) { return getStatisticsWithResponseAsync(timeout, requestId, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Retrieves statistics related to replication for the Queue service. It is only available on the secondary location * endpoint when read-access geo-redundant replication is enabled for the storage account. - * + * * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting * Timeouts for Queue Service Operations.</a>. @@ -800,14 +850,16 @@ public Mono> getStatisticsNoCustomHeadersWithRe final String restype = "service"; final String comp = "stats"; final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getStatisticsNoCustomHeaders(this.client.getUrl(), restype, comp, - timeout, this.client.getVersion(), requestId, accept, context)); + return FluxUtil + .withContext(context -> service.getStatisticsNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * Retrieves statistics related to replication for the Queue service. It is only available on the secondary location * endpoint when read-access geo-redundant replication is enabled for the storage account. - * + * * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting * Timeouts for Queue Service Operations.</a>. @@ -825,14 +877,16 @@ public Mono> getStatisticsNoCustomHeadersWithRe final String restype = "service"; final String comp = "stats"; final String accept = "application/xml"; - return service.getStatisticsNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), requestId, accept, context); + return service + .getStatisticsNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), + requestId, accept, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException); } /** * Retrieves statistics related to replication for the Queue service. It is only available on the secondary location * endpoint when read-access geo-redundant replication is enabled for the storage account. - * + * * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting * Timeouts for Queue Service Operations.</a>. @@ -850,14 +904,18 @@ public ResponseBase getSta final String restype = "service"; final String comp = "stats"; final String accept = "application/xml"; - return service.getStatisticsSync(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), - requestId, accept, context); + try { + return service.getStatisticsSync(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), + requestId, accept, context); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * Retrieves statistics related to replication for the Queue service. It is only available on the secondary location * endpoint when read-access geo-redundant replication is enabled for the storage account. - * + * * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting * Timeouts for Queue Service Operations.</a>. @@ -870,13 +928,17 @@ public ResponseBase getSta */ @ServiceMethod(returns = ReturnType.SINGLE) public QueueServiceStatistics getStatistics(Integer timeout, String requestId) { - return getStatisticsWithResponse(timeout, requestId, Context.NONE).getValue(); + try { + return getStatisticsWithResponse(timeout, requestId, Context.NONE).getValue(); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * Retrieves statistics related to replication for the Queue service. It is only available on the secondary location * endpoint when read-access geo-redundant replication is enabled for the storage account. - * + * * @param timeout The The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations>Setting * Timeouts for Queue Service Operations.</a>. @@ -894,13 +956,17 @@ public Response getStatisticsNoCustomHeadersWithResponse final String restype = "service"; final String comp = "stats"; final String accept = "application/xml"; - return service.getStatisticsNoCustomHeadersSync(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), requestId, accept, context); + try { + return service.getStatisticsNoCustomHeadersSync(this.client.getUrl(), restype, comp, timeout, + this.client.getVersion(), requestId, accept, context); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * The List Queues Segment operation returns a list of the queues under the specified account. - * + * * @param prefix Filters the results to return only queues whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list of queues to be returned with the next * listing operation. The operation returns the NextMarker value within the response body if the listing operation @@ -938,13 +1004,14 @@ public Mono> listQueuesSegmentSinglePageAsync(String pr return FluxUtil .withContext(context -> service.listQueuesSegment(this.client.getUrl(), comp, prefix, marker, maxresults, includeConverted, timeout, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().getQueueItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders())); } /** * The List Queues Segment operation returns a list of the queues under the specified account. - * + * * @param prefix Filters the results to return only queues whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list of queues to be returned with the next * listing operation. The operation returns the NextMarker value within the response body if the listing operation @@ -983,13 +1050,14 @@ public Mono> listQueuesSegmentSinglePageAsync(String pr return service .listQueuesSegment(this.client.getUrl(), comp, prefix, marker, maxresults, includeConverted, timeout, this.client.getVersion(), requestId, accept, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().getQueueItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders())); } /** * The List Queues Segment operation returns a list of the queues under the specified account. - * + * * @param prefix Filters the results to return only queues whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list of queues to be returned with the next * listing operation. The operation returns the NextMarker value within the response body if the listing operation @@ -1024,7 +1092,7 @@ public PagedFlux listQueuesSegmentAsync(String prefix, String marker, /** * The List Queues Segment operation returns a list of the queues under the specified account. - * + * * @param prefix Filters the results to return only queues whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list of queues to be returned with the next * listing operation. The operation returns the NextMarker value within the response body if the listing operation @@ -1060,7 +1128,7 @@ public PagedFlux listQueuesSegmentAsync(String prefix, String marker, /** * The List Queues Segment operation returns a list of the queues under the specified account. - * + * * @param prefix Filters the results to return only queues whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list of queues to be returned with the next * listing operation. The operation returns the NextMarker value within the response body if the listing operation @@ -1098,13 +1166,14 @@ public Mono> listQueuesSegmentNoCustomHeadersSinglePage return FluxUtil .withContext(context -> service.listQueuesSegmentNoCustomHeaders(this.client.getUrl(), comp, prefix, marker, maxresults, includeConverted, timeout, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().getQueueItems(), res.getValue().getNextMarker(), null)); } /** * The List Queues Segment operation returns a list of the queues under the specified account. - * + * * @param prefix Filters the results to return only queues whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list of queues to be returned with the next * listing operation. The operation returns the NextMarker value within the response body if the listing operation @@ -1143,13 +1212,14 @@ public Mono> listQueuesSegmentNoCustomHeadersSinglePage return service .listQueuesSegmentNoCustomHeaders(this.client.getUrl(), comp, prefix, marker, maxresults, includeConverted, timeout, this.client.getVersion(), requestId, accept, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().getQueueItems(), res.getValue().getNextMarker(), null)); } /** * The List Queues Segment operation returns a list of the queues under the specified account. - * + * * @param prefix Filters the results to return only queues whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list of queues to be returned with the next * listing operation. The operation returns the NextMarker value within the response body if the listing operation @@ -1183,7 +1253,7 @@ public PagedFlux listQueuesSegmentNoCustomHeadersAsync(String prefix, /** * The List Queues Segment operation returns a list of the queues under the specified account. - * + * * @param prefix Filters the results to return only queues whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list of queues to be returned with the next * listing operation. The operation returns the NextMarker value within the response body if the listing operation @@ -1219,7 +1289,7 @@ public PagedFlux listQueuesSegmentNoCustomHeadersAsync(String prefix, /** * The List Queues Segment operation returns a list of the queues under the specified account. - * + * * @param prefix Filters the results to return only queues whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list of queues to be returned with the next * listing operation. The operation returns the NextMarker value within the response body if the listing operation @@ -1256,13 +1326,17 @@ public PagedResponse listQueuesSegmentSinglePage(String prefix, Strin ResponseBase res = service.listQueuesSegmentSync(this.client.getUrl(), comp, prefix, marker, maxresults, includeConverted, timeout, this.client.getVersion(), requestId, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getQueueItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); + try { + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getQueueItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * The List Queues Segment operation returns a list of the queues under the specified account. - * + * * @param prefix Filters the results to return only queues whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list of queues to be returned with the next * listing operation. The operation returns the NextMarker value within the response body if the listing operation @@ -1300,13 +1374,17 @@ public PagedResponse listQueuesSegmentSinglePage(String prefix, Strin ResponseBase res = service.listQueuesSegmentSync(this.client.getUrl(), comp, prefix, marker, maxresults, includeConverted, timeout, this.client.getVersion(), requestId, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getQueueItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); + try { + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getQueueItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * The List Queues Segment operation returns a list of the queues under the specified account. - * + * * @param prefix Filters the results to return only queues whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list of queues to be returned with the next * listing operation. The operation returns the NextMarker value within the response body if the listing operation @@ -1341,7 +1419,7 @@ public PagedIterable listQueuesSegment(String prefix, String marker, /** * The List Queues Segment operation returns a list of the queues under the specified account. - * + * * @param prefix Filters the results to return only queues whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list of queues to be returned with the next * listing operation. The operation returns the NextMarker value within the response body if the listing operation @@ -1377,7 +1455,7 @@ public PagedIterable listQueuesSegment(String prefix, String marker, /** * The List Queues Segment operation returns a list of the queues under the specified account. - * + * * @param prefix Filters the results to return only queues whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list of queues to be returned with the next * listing operation. The operation returns the NextMarker value within the response body if the listing operation @@ -1414,13 +1492,17 @@ public PagedResponse listQueuesSegmentNoCustomHeadersSinglePage(Strin Response res = service.listQueuesSegmentNoCustomHeadersSync(this.client.getUrl(), comp, prefix, marker, maxresults, includeConverted, timeout, this.client.getVersion(), requestId, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getQueueItems(), res.getValue().getNextMarker(), null); + try { + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getQueueItems(), res.getValue().getNextMarker(), null); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * The List Queues Segment operation returns a list of the queues under the specified account. - * + * * @param prefix Filters the results to return only queues whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list of queues to be returned with the next * listing operation. The operation returns the NextMarker value within the response body if the listing operation @@ -1458,13 +1540,17 @@ public PagedResponse listQueuesSegmentNoCustomHeadersSinglePage(Strin Response res = service.listQueuesSegmentNoCustomHeadersSync(this.client.getUrl(), comp, prefix, marker, maxresults, includeConverted, timeout, this.client.getVersion(), requestId, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getQueueItems(), res.getValue().getNextMarker(), null); + try { + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getQueueItems(), res.getValue().getNextMarker(), null); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * The List Queues Segment operation returns a list of the queues under the specified account. - * + * * @param prefix Filters the results to return only queues whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list of queues to be returned with the next * listing operation. The operation returns the NextMarker value within the response body if the listing operation @@ -1498,7 +1584,7 @@ public PagedIterable listQueuesSegmentNoCustomHeaders(String prefix, /** * The List Queues Segment operation returns a list of the queues under the specified account. - * + * * @param prefix Filters the results to return only queues whose name begins with the specified prefix. * @param marker A string value that identifies the portion of the list of queues to be returned with the next * listing operation. The operation returns the NextMarker value within the response body if the listing operation @@ -1533,9 +1619,9 @@ public PagedIterable listQueuesSegmentNoCustomHeaders(String prefix, /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - * + * * The nextLink parameter. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. @@ -1551,15 +1637,16 @@ public Mono> listQueuesSegmentNextSinglePageAsync(Strin return FluxUtil .withContext(context -> service.listQueuesSegmentNext(nextLink, this.client.getUrl(), this.client.getVersion(), requestId, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().getQueueItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - * + * * The nextLink parameter. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. @@ -1576,15 +1663,16 @@ public Mono> listQueuesSegmentNextSinglePageAsync(Strin final String accept = "application/xml"; return service .listQueuesSegmentNext(nextLink, this.client.getUrl(), this.client.getVersion(), requestId, accept, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().getQueueItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - * + * * The nextLink parameter. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. @@ -1601,15 +1689,16 @@ public Mono> listQueuesSegmentNextNoCustomHeadersSingle return FluxUtil .withContext(context -> service.listQueuesSegmentNextNoCustomHeaders(nextLink, this.client.getUrl(), this.client.getVersion(), requestId, accept, context)) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().getQueueItems(), res.getValue().getNextMarker(), null)); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - * + * * The nextLink parameter. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. @@ -1627,15 +1716,16 @@ public Mono> listQueuesSegmentNextNoCustomHeadersSingle return service .listQueuesSegmentNextNoCustomHeaders(nextLink, this.client.getUrl(), this.client.getVersion(), requestId, accept, context) + .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().getQueueItems(), res.getValue().getNextMarker(), null)); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - * + * * The nextLink parameter. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. @@ -1650,15 +1740,19 @@ public PagedResponse listQueuesSegmentNextSinglePage(String nextLink, ResponseBase res = service.listQueuesSegmentNextSync(nextLink, this.client.getUrl(), this.client.getVersion(), requestId, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getQueueItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); + try { + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getQueueItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - * + * * The nextLink parameter. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. @@ -1675,15 +1769,19 @@ public PagedResponse listQueuesSegmentNextSinglePage(String nextLink, ResponseBase res = service.listQueuesSegmentNextSync(nextLink, this.client.getUrl(), this.client.getVersion(), requestId, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getQueueItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); + try { + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getQueueItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - * + * * The nextLink parameter. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. @@ -1697,15 +1795,19 @@ public PagedResponse listQueuesSegmentNextNoCustomHeadersSinglePage(S final String accept = "application/xml"; Response res = service.listQueuesSegmentNextNoCustomHeadersSync(nextLink, this.client.getUrl(), this.client.getVersion(), requestId, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getQueueItems(), res.getValue().getNextMarker(), null); + try { + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getQueueItems(), res.getValue().getNextMarker(), null); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - * + * * The nextLink parameter. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. @@ -1721,7 +1823,11 @@ public PagedResponse listQueuesSegmentNextNoCustomHeadersSinglePage(S final String accept = "application/xml"; Response res = service.listQueuesSegmentNextNoCustomHeadersSync(nextLink, this.client.getUrl(), this.client.getVersion(), requestId, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getQueueItems(), res.getValue().getNextMarker(), null); + try { + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getQueueItems(), res.getValue().getNextMarker(), null); + } catch (QueueStorageExceptionInternal internalException) { + throw ModelHelper.mapToQueueStorageException(internalException); + } } } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java index d7c1fc771b79..26cc1d86a0ab 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/util/ModelHelper.java @@ -17,7 +17,6 @@ import java.util.Base64; import java.util.Objects; -import java.util.function.Supplier; public class ModelHelper { private static final ClientLogger LOGGER = new ClientLogger(ModelHelper.class); @@ -99,23 +98,7 @@ public static QueueProperties transformQueueProperties(QueuesGetPropertiesHeader * @param internal The internal exception. * @return The public exception. */ - public static Throwable mapToQueueStorageException(Throwable internal) { - if (internal instanceof QueueStorageExceptionInternal) { - QueueStorageExceptionInternal internalException = (QueueStorageExceptionInternal) internal; - return new QueueStorageException(internalException.getMessage(), internalException.getResponse(), - internalException.getValue()); - } - - return internal; - } - - public static Supplier wrapCallWithExceptionMapping(Supplier serviceCall) { - return () -> { - try { - return serviceCall.get(); - } catch (QueueStorageExceptionInternal internal) { - throw (QueueStorageException) mapToQueueStorageException(internal); - } - }; + public static QueueStorageException mapToQueueStorageException(QueueStorageExceptionInternal internal) { + return new QueueStorageException(internal.getMessage(), internal.getResponse(), internal.getValue()); } } diff --git a/sdk/storage/azure-storage-queue/swagger/README.md b/sdk/storage/azure-storage-queue/swagger/README.md index 78a7a0cf3966..c62e454adaae 100644 --- a/sdk/storage/azure-storage-queue/swagger/README.md +++ b/sdk/storage/azure-storage-queue/swagger/README.md @@ -30,6 +30,7 @@ default-http-exception-type: com.azure.storage.queue.implementation.models.Queue models-subpackage: implementation.models custom-types: QueueErrorCode,QueueSignedIdentifier,SendMessageResult,QueueMessageItem,PeekedMessageItem,QueueItem,QueueServiceProperties,QueueServiceStatistics,QueueCorsRule,QueueAccessPolicy,QueueAnalyticsLogging,QueueMetrics,QueueRetentionPolicy,GeoReplicationStatus,GeoReplicationStatusType,GeoReplication custom-types-subpackage: models +customization-class: src/main/java/QueueStorageCustomization.java generic-response-type: true use-input-stream-for-binary: true no-custom-headers: true diff --git a/sdk/storage/azure-storage-queue/swagger/pom.xml b/sdk/storage/azure-storage-queue/swagger/pom.xml new file mode 100644 index 000000000000..12c08a6ad2fb --- /dev/null +++ b/sdk/storage/azure-storage-queue/swagger/pom.xml @@ -0,0 +1,17 @@ + + + + + com.azure + azure-code-customization-parent + 1.0.0-beta.1 + ../../../parents/azure-code-customization-parent + + + com.azure + azure-storage-queue-customization + 1.0.0-beta.1 + 4.0.0 + diff --git a/sdk/storage/azure-storage-queue/swagger/src/main/java/QueueStorageCustomization.java b/sdk/storage/azure-storage-queue/swagger/src/main/java/QueueStorageCustomization.java new file mode 100644 index 000000000000..a4a17928bd1a --- /dev/null +++ b/sdk/storage/azure-storage-queue/swagger/src/main/java/QueueStorageCustomization.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import com.azure.autorest.customization.Customization; +import com.azure.autorest.customization.LibraryCustomization; +import com.azure.autorest.customization.PackageCustomization; +import com.github.javaparser.ParseProblemException; +import com.github.javaparser.StaticJavaParser; +import com.github.javaparser.ast.NodeList; +import com.github.javaparser.ast.body.MethodDeclaration; +import com.github.javaparser.ast.body.Parameter; +import com.github.javaparser.ast.stmt.BlockStmt; +import com.github.javaparser.ast.stmt.CatchClause; +import com.github.javaparser.ast.stmt.Statement; +import com.github.javaparser.ast.stmt.TryStmt; +import com.github.javaparser.ast.type.ClassOrInterfaceType; +import com.github.javaparser.ast.type.Type; +import org.slf4j.Logger; + +import java.util.Arrays; +import java.util.List; + +/** + * Customization class for Blob Storage. + */ +public class QueueStorageCustomization extends Customization { + @Override + public void customize(LibraryCustomization customization, Logger logger) { + updateImplToMapInternalException(customization.getPackage("com.azure.storage.queue.implementation")); + } + + /** + * Customizes the implementation classes that will perform calls to the service. The following logic is used: + *

+ * - Check for the return of the method not equaling to PagedFlux, PagedIterable, PollerFlux, or SyncPoller. Those + * types wrap other APIs and those APIs being update is the correct change. + * - For asynchronous methods, add a call to + * {@code .onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException)} to handle + * mapping QueueStorageExceptionInternal to QueueStorageException. + * - For synchronous methods, wrap the return statement in a try-catch block that catches + * QueueStorageExceptionInternal and rethrows {@code ModelHelper.mapToQueueStorageException(e)}. Or, for void + * methods wrap the last statement. + * + * @param implPackage The implementation package. + */ + private static void updateImplToMapInternalException(PackageCustomization implPackage) { + List implsToUpdate = Arrays.asList("MessageIdsImpl", "MessagesImpl", "QueuesImpl", "ServicesImpl"); + for (String implToUpdate : implsToUpdate) { + implPackage.getClass(implToUpdate).customizeAst(ast -> { + ast.addImport("com.azure.storage.queue.implementation.util.ModelHelper"); + ast.addImport("com.azure.storage.queue.models.QueueStorageException"); + ast.addImport("com.azure.storage.queue.implementation.models.QueueStorageExceptionInternal"); + ast.getClassByName(implToUpdate).ifPresent(clazz -> { + clazz.getFields(); + + clazz.getMethods().forEach(methodDeclaration -> { + Type returnType = methodDeclaration.getType(); + // The way code generation works we only need to update the methods that have a class return type. + // As non-class return types, such as "void", call into the Response methods. + if (!returnType.isClassOrInterfaceType()) { + return; + } + + ClassOrInterfaceType returnTypeClass = returnType.asClassOrInterfaceType(); + String returnTypeName = returnTypeClass.getNameAsString(); + if (returnTypeName.equals("PagedFlux") || returnTypeName.equals("PagedIterable") + || returnTypeName.equals("PollerFlux") || returnTypeName.equals("SyncPoller")) { + return; + } + + if (returnTypeName.equals("Mono") || returnTypeName.equals("Flux")) { + addErrorMappingToAsyncMethod(methodDeclaration); + } else { + addErrorMappingToSyncMethod(methodDeclaration); + } + }); + }); + }); + } + } + + private static void addErrorMappingToAsyncMethod(MethodDeclaration method) { + BlockStmt body = method.getBody().get(); + + // Bit of hack to insert the 'onErrorMap' in the right location. + // Unfortunately, 'onErrorMap' returns which for some calls breaks typing, such as Void -> Object or + // PagedResponse -> PagedResponseBase. So, 'onErrorMap' needs to be inserted after the first method call. + // To do this, we track the first found '(' and the associated closing ')' to insert 'onErrorMap' after the ')'. + // So, 'service.methodCall(parameters).map()' becomes 'service.methodCall(parameters).onErrorMap().map()'. + String originalReturnStatement = body.getStatement(body.getStatements().size() - 1).asReturnStmt() + .getExpression().get().toString(); + int insertionPoint = findAsyncOnErrorMapInsertionPoint(originalReturnStatement); + String newReturnStatement = "return " + originalReturnStatement.substring(0, insertionPoint) + + ".onErrorMap(QueueStorageExceptionInternal.class, ModelHelper::mapToQueueStorageException)" + + originalReturnStatement.substring(insertionPoint) + ";"; + try { + Statement newReturn = StaticJavaParser.parseStatement(newReturnStatement); + body.getStatements().set(body.getStatements().size() - 1, newReturn); + } catch (ParseProblemException ex) { + throw new RuntimeException("Failed to parse: " + newReturnStatement, ex); + } + } + + private static int findAsyncOnErrorMapInsertionPoint(String returnStatement) { + int openParenthesis = 0; + int closeParenthesis = 0; + for (int i = 0; i < returnStatement.length(); i++) { + char c = returnStatement.charAt(i); + if (c == '(') { + openParenthesis++; + } else if (c == ')') { + closeParenthesis++; + if (openParenthesis == closeParenthesis) { + return i + 1; + } + } + } + return -1; + } + + private static void addErrorMappingToSyncMethod(MethodDeclaration method) { + BlockStmt body = method.getBody().get(); + + // Turn the last statement into a BlockStmt that will be used as the try block. + BlockStmt tryBlock = new BlockStmt(new NodeList<>(body.getStatement(body.getStatements().size() - 1))); + BlockStmt catchBlock = new BlockStmt(new NodeList<>(StaticJavaParser.parseStatement( + "throw ModelHelper.mapToQueueStorageException(internalException);"))); + Parameter catchParameter = new Parameter().setType("QueueStorageExceptionInternal") + .setName("internalException"); + CatchClause catchClause = new CatchClause(catchParameter, catchBlock); + TryStmt tryCatchMap = new TryStmt(tryBlock, new NodeList<>(catchClause), null); + + // Replace the last statement with the try-catch block. + body.getStatements().set(body.getStatements().size() - 1, tryCatchMap); + } +} From 8af7351fdc47ffb424c3c50072f8ae60cb29ea86 Mon Sep 17 00:00:00 2001 From: James Suplizio Date: Tue, 27 Aug 2024 10:58:44 -0700 Subject: [PATCH 057/128] Add namespaces (packages) to packageInfo (#41639) * Add namespaces (packages) to packageInfo * Actually name the script correctly * Fix incorrect parameter name * correct fail the step if no namespaces can be determined for one of the libraries being processed * Fix the pom file to remove the duplicate org.apache.maven.plugins:maven-jar-plugin definition * turn off docs for spring-cloud-azure-appconfiguration-config-web until it actually generates docs * Updates for feedback * Fix dependency version issue --- eng/pipelines/templates/jobs/ci.yml | 10 ++ .../stages/archetype-sdk-client-patch.yml | 10 ++ .../Save-Package-Namespaces-Property.ps1 | 103 ++++++++++++++++++ eng/scripts/docs/Docs-ToC.ps1 | 40 ++++--- sdk/spring/ci.yml | 4 +- .../pom.xml | 2 +- .../pom.xml | 26 ++--- 7 files changed, 162 insertions(+), 33 deletions(-) create mode 100644 eng/scripts/Save-Package-Namespaces-Property.ps1 diff --git a/eng/pipelines/templates/jobs/ci.yml b/eng/pipelines/templates/jobs/ci.yml index 2822000b3ee2..d1bad5e988eb 100644 --- a/eng/pipelines/templates/jobs/ci.yml +++ b/eng/pipelines/templates/jobs/ci.yml @@ -197,6 +197,16 @@ jobs: -Artifacts ('${{ replace(convertToJson(parameters.ReleaseArtifacts), '''', '`''') }}' | ConvertFrom-Json | Where-Object -Not skipPublishPackage ) -InformationAction Continue + - task: Powershell@2 + inputs: + filePath: $(Build.SourcesDirectory)/eng/scripts/Save-Package-Namespaces-Property.ps1 + arguments: > + -ArtifactStagingDirectory $(Build.ArtifactStagingDirectory) + -ArtifactsList ('$(ArtifactsJson)' | ConvertFrom-Json) + pwsh: true + workingDirectory: $(Pipeline.Workspace) + displayName: Update package properties with namespaces + - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml parameters: ArtifactPath: $(Build.ArtifactStagingDirectory) diff --git a/eng/pipelines/templates/stages/archetype-sdk-client-patch.yml b/eng/pipelines/templates/stages/archetype-sdk-client-patch.yml index daf985ee0e00..f3672569eebc 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-client-patch.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-client-patch.yml @@ -160,6 +160,16 @@ extends: -Artifacts ('$(ArtifactsJsonEscaped)' | ConvertFrom-Json | Where-Object -Not skipPublishPackage) -InformationAction Continue + - task: Powershell@2 + inputs: + filePath: $(Build.SourcesDirectory)/eng/scripts/Save-Package-Namespaces-Property.ps1 + arguments: > + -ArtifactStagingDirectory $(Build.ArtifactStagingDirectory) + -ArtifactsList ('$(ArtifactsJson)' | ConvertFrom-Json) + pwsh: true + workingDirectory: $(Pipeline.Workspace) + displayName: Update package properties with namespaces + - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml parameters: ArtifactPath: $(Build.ArtifactStagingDirectory) diff --git a/eng/scripts/Save-Package-Namespaces-Property.ps1 b/eng/scripts/Save-Package-Namespaces-Property.ps1 new file mode 100644 index 000000000000..1b4fac330c5b --- /dev/null +++ b/eng/scripts/Save-Package-Namespaces-Property.ps1 @@ -0,0 +1,103 @@ +<# +.SYNOPSIS +Given an artifact staging directory, loop through all of the PackageInfo files +in the PackageInfo subdirectory and compute the namespaces if they don't already +exist. Yes, they're called packages in Java but namespaces are being used to keep +code that processes them common amongst the languages. + +.DESCRIPTION +Given an artifact staging directory, loop through all of the PackageInfo files +in the PackageInfo subdirectory. For each PackageInfo file, find its corresponding +javadoc jar file and use that to compute the namespace information. + +.PARAMETER ArtifactStagingDirectory +The root directory of the staged artifacts. The PackageInfo files will be in the +PackageInfo subdirectory. The artifacts root directories are GroupId based, meaning +any artifact with that GroupId will be in a subdirectory. For example: Most Spring +libraries are com.azure.spring and their javadoc jars will be under that subdirectory +but azure-spring-data-cosmos' GroupId is com.azure and its javadoc jar will be under +com.azure. + +.PARAMETER ArtifactsList +The list of artifacts to gather namespaces for, this is only done for libraries that are +producing docs. +-ArtifactsList ('$(ArtifactsJson)' | ConvertFrom-Json) +#> +[CmdletBinding()] +Param ( + [Parameter(Mandatory = $True)] + [string] $ArtifactStagingDirectory, + [Parameter(Mandatory=$true)] + [array] $ArtifactsList +) + +$ArtifactsList = $ArtifactsList | Where-Object -Not "skipPublishDocMs" + +. (Join-Path $PSScriptRoot ".." common scripts common.ps1) + +if (-not $ArtifactsList) { + Write-Host "ArtifactsList is empty, nothing to process. This can happen if skipPublishDocMs is set to true for all libraries being built." + exit 0 +} + +Write-Host "ArtifactStagingDirectory=$ArtifactStagingDirectory" +if (-not (Test-Path -Path $ArtifactStagingDirectory)) { + LogError "ArtifactStagingDirectory '$ArtifactStagingDirectory' does not exist." + exit 1 +} + +Write-Host "" +Write-Host "ArtifactsList:" +$ArtifactsList | Format-Table -Property GroupId, Name | Out-String | Write-Host + +$packageInfoDirectory = Join-Path $ArtifactStagingDirectory "PackageInfo" + +$foundError = $false +# At this point the packageInfo files should have been already been created. +# The only thing being done here is adding or updating namespaces for libraries +# that will be producing docs. This ArtifactsList is +foreach($artifact in $ArtifactsList) { + # Get the version from the packageInfo file + $packageInfoFile = Join-Path $packageInfoDirectory "$($artifact.Name).json" + Write-Host "processing $($packageInfoFile.FullName)" + $packageInfo = ConvertFrom-Json (Get-Content $packageInfoFile -Raw) + $version = $packageInfo.Version + # If the dev version is set, use that. This will be set for nightly builds + if ($packageInfo.DevVersion) { + $version = $packageInfo.DevVersion + } + # From the $packageInfo piece together the path to the javadoc jar file + $javadocJar = Join-Path $ArtifactStagingDirectory $packageInfo.Group $packageInfo.Name "$($packageInfo.Name)-$($version)-javadoc.jar" + if (!(Test-Path $javadocJar -PathType Leaf)) { + LogError "Javadoc Jar file, $javadocJar, was not found. Please ensure that a Javadoc jar is being created for the library." + $foundError = $true + continue + } + $namespaces = Fetch-Namespaces-From-Javadoc $packageInfo.Name $packageInfo.Group $version $javadocJar + if ($namespaces.Count -gt 0) { + Write-Host "Adding/Updating Namespaces property with the following namespaces:" + $namespaces | Write-Host + if ($packageInfo.PSobject.Properties.Name -contains "Namespaces") { + Write-Host "Contains Namespaces property, updating" + $packageInfo.Namespaces = $namespaces + } + else { + Write-Host "Adding Namespaces property" + $packageInfo = $packageInfo | Add-Member -MemberType NoteProperty -Name Namespaces -Value $namespaces -PassThru + } + $packageInfoJson = ConvertTo-Json -InputObject $packageInfo -Depth 100 + Write-Host "The updated packageInfo for $packageInfoFile is:" + Write-Host "$packageInfoJson" + Set-Content ` + -Path $packageInfoFile ` + -Value $packageInfoJson + } else { + LogError "Unable to determine namespaces for $($packageInfo.Group):$($packageInfo.Name). Please ensure that skipPublishDocMs isn't incorrectly set to true or that the library isn't producing an empty java doc jar." + $foundError = $true + } +} + +if ($foundError) { + exit 1 +} +exit 0 \ No newline at end of file diff --git a/eng/scripts/docs/Docs-ToC.ps1 b/eng/scripts/docs/Docs-ToC.ps1 index 153229377075..ae64aef5468c 100644 --- a/eng/scripts/docs/Docs-ToC.ps1 +++ b/eng/scripts/docs/Docs-ToC.ps1 @@ -144,7 +144,7 @@ function Get-Toc-Children($package, $docRepoLocation) { } # Given a library, groupId and version, return the list of namespaces -function Fetch-Namespaces-From-Javadoc($package, $groupId, $version) { +function Fetch-Namespaces-From-Javadoc($package, $groupId, $version, $javadocJarFile = $null) { $namespaces = @() # Create a temporary directory to drop the jar into @@ -152,19 +152,31 @@ function Fetch-Namespaces-From-Javadoc($package, $groupId, $version) { New-Item $tempDirectory -ItemType Directory | Out-Null $artifact = "${groupId}:${package}:${version}:jar:javadoc" try { - # Download the Jar file - Write-Host "mvn dependency:copy -Dartifact=""$artifact"" -DoutputDirectory=""$tempDirectory""" - $mvnResults = mvn ` - dependency:copy ` - -Dartifact="$artifact" ` - -DoutputDirectory="$tempDirectory" - - if ($LASTEXITCODE -ne 0) { - LogWarning "Could not download javadoc artifact: $artifact" - $mvnResults | Write-Host + # If the $javadocJarFile is passed in, copy it to the $tempDirectory, otherwise download it + # from the dev feed or maven + if ($javadocJarFile) { + if (Test-Path $javadocJar -PathType Leaf) { + Copy-Item $javadocJarFile -Destination $tempDirectory + } else { + LogWarning "javadocJar parameter's jar file, $javadocJar, does not exist." + } } else { + # Download the Jar file + Write-Host "mvn dependency:copy -Dartifact=""$artifact"" -DoutputDirectory=""$tempDirectory""" + $mvnResults = mvn ` + dependency:copy ` + -Dartifact="$artifact" ` + -DoutputDirectory="$tempDirectory" + if ($LASTEXITCODE -ne 0) { + LogWarning "Could not download javadoc artifact: $artifact" + $mvnResults | Write-Host + } + } + $javadocLocation = "$tempDirectory/$package-$version-javadoc.jar" + # If the Jar file doesn't exit the error has already been reported above and + # processing will return an empty namespaces list + if (Test-Path $javadocLocation -PathType Leaf) { # Unpack the Jar file - $javadocLocation = "$tempDirectory/$package-$version-javadoc.jar" $unpackDirectory = Join-Path $tempDirectory "unpackedJavadoc" New-Item $unpackDirectory -ItemType Directory | Out-Null Add-Type -AssemblyName System.IO.Compression.FileSystem @@ -205,12 +217,12 @@ function Fetch-Namespaces-From-Javadoc($package, $groupId, $version) { } } else { - LogWarning "Unable to determine namespaces from $artifact." + LogWarning "Unable to determine namespaces from $artifact. Please ensure that the a javadoc jar is being built for the artifact and that it's not empty (ex. START/END: Empty Java Doc & Sources isn't in the POM file)." } } } catch { - LogError "Exception while trying to download: $artifact" + LogError "Exception while trying to retrieve namespaces from: $artifact" LogError $_ LogError $_.ScriptStackTrace } diff --git a/sdk/spring/ci.yml b/sdk/spring/ci.yml index d68609fb6b36..f42a7fb39940 100644 --- a/sdk/spring/ci.yml +++ b/sdk/spring/ci.yml @@ -578,8 +578,8 @@ extends: - name: spring-cloud-azure-appconfiguration-config-web groupId: com.azure.spring safeName: springcloudazureappconfigurationconfigweb - skipPublishDocGithubIo: false - skipPublishDocMs: false + skipPublishDocGithubIo: true + skipPublishDocMs: true skipUpdatePackageJson: true skipVerifyChangelog: true releaseInBatch: ${{ parameters.release_springcloudazureappconfigurationconfigweb }} diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/pom.xml b/sdk/spring/spring-cloud-azure-appconfiguration-config/pom.xml index b68abc0933e3..63d5c90c1882 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/pom.xml +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/pom.xml @@ -26,7 +26,7 @@ org.springframework.boot spring-boot-configuration-processor - 3.3.2 + 3.3.3 true diff --git a/sdk/spring/spring-cloud-azure-starter-appconfiguration-config/pom.xml b/sdk/spring/spring-cloud-azure-starter-appconfiguration-config/pom.xml index 73aa8d0224a4..d8d9831b3e14 100644 --- a/sdk/spring/spring-cloud-azure-starter-appconfiguration-config/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-appconfiguration-config/pom.xml @@ -145,21 +145,15 @@ - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.4.2 + + empty-javadoc-jar-with-readme @@ -223,8 +217,8 @@ - + From c8a40efa080eb687cf5c86f7675a8dc39bdfa87a Mon Sep 17 00:00:00 2001 From: James Suplizio Date: Tue, 27 Aug 2024 12:21:10 -0700 Subject: [PATCH 058/128] Publish code coverage results from 1 to2 (#41656) * Update PublishCodeCoverageResults task version from 1 to 2 * Add prerequisite task * last commit missed a file needing a save --- eng/pipelines/templates/steps/build-and-test-native.yml | 9 +++++++-- eng/pipelines/templates/steps/build-and-test.yml | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/eng/pipelines/templates/steps/build-and-test-native.yml b/eng/pipelines/templates/steps/build-and-test-native.yml index b00feb30431f..a2697f2fe538 100644 --- a/eng/pipelines/templates/steps/build-and-test-native.yml +++ b/eng/pipelines/templates/steps/build-and-test-native.yml @@ -133,12 +133,17 @@ steps: ${{ if ne(parameters.TestResultsFiles, '') }}: testResultsFiles: ${{ parameters.TestResultsFiles }} + # Dotnet core sdk task 7.0.x. This is a prerequisite for PublishCodeCoverageResults@2 + - task: UseDotNet@2 + displayName: 'Use .NET Core sdk 7.0.x' + inputs: + version: 7.0.x + # Azure DevOps only seems to respect the last code coverage result published, so only do this for Windows + Java LTS. # Code coverage reporting is set up only for Track 2 modules. - - task: PublishCodeCoverageResults@1 + - task: PublishCodeCoverageResults@2 condition: eq(variables['RunAggregateReports'], 'true') inputs: - codeCoverageTool: JaCoCo summaryFileLocation: target/site/test-coverage/jacoco.xml reportDirectory: target/site/test-coverage/ failIfCoverageEmpty: false diff --git a/eng/pipelines/templates/steps/build-and-test.yml b/eng/pipelines/templates/steps/build-and-test.yml index 856b0b462efe..9740c68a551b 100644 --- a/eng/pipelines/templates/steps/build-and-test.yml +++ b/eng/pipelines/templates/steps/build-and-test.yml @@ -259,11 +259,16 @@ steps: ${{ if ne(parameters.TestResultsFiles, '') }}: testResultsFiles: ${{ parameters.TestResultsFiles }} + # Dotnet core sdk task 7.0.x. This is a prerequisite for PublishCodeCoverageResults@2 + - task: UseDotNet@2 + displayName: 'Use .NET Core sdk 7.0.x' + inputs: + version: 7.0.x + # Azure DevOps only seems to respect the last code coverage result published, so only do this for Windows + Java LTS. # Code coverage reporting is set up only for Track 2 modules. - - task: PublishCodeCoverageResults@1 + - task: PublishCodeCoverageResults@2 inputs: - codeCoverageTool: JaCoCo summaryFileLocation: target/site/test-coverage/jacoco.xml reportDirectory: target/site/test-coverage/ failIfCoverageEmpty: false From de56545cdb297c583f78587de706ee499c92c49d Mon Sep 17 00:00:00 2001 From: James Suplizio Date: Tue, 27 Aug 2024 13:00:24 -0700 Subject: [PATCH 059/128] Fix typo (#41658) --- eng/scripts/docs/Docs-ToC.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/scripts/docs/Docs-ToC.ps1 b/eng/scripts/docs/Docs-ToC.ps1 index ae64aef5468c..567d5662bc72 100644 --- a/eng/scripts/docs/Docs-ToC.ps1 +++ b/eng/scripts/docs/Docs-ToC.ps1 @@ -155,10 +155,10 @@ function Fetch-Namespaces-From-Javadoc($package, $groupId, $version, $javadocJar # If the $javadocJarFile is passed in, copy it to the $tempDirectory, otherwise download it # from the dev feed or maven if ($javadocJarFile) { - if (Test-Path $javadocJar -PathType Leaf) { + if (Test-Path $javadocJarFile -PathType Leaf) { Copy-Item $javadocJarFile -Destination $tempDirectory } else { - LogWarning "javadocJar parameter's jar file, $javadocJar, does not exist." + LogWarning "$javadocJarFile, does not exist." } } else { # Download the Jar file From be350a0296e358c89caf7aaac4cca0ddeb53413a Mon Sep 17 00:00:00 2001 From: Shawn Fang <45607042+mssfang@users.noreply.github.com> Date: Tue, 27 Aug 2024 13:30:06 -0700 Subject: [PATCH 060/128] prepare for 1.2.27 bom release (#41659) --- sdk/boms/azure-sdk-bom/CHANGELOG.md | 6 ++ sdk/boms/azure-sdk-bom/README.md | 2 +- sdk/boms/azure-sdk-bom/pom.xml | 126 ++++++++++++++-------------- 3 files changed, 70 insertions(+), 64 deletions(-) diff --git a/sdk/boms/azure-sdk-bom/CHANGELOG.md b/sdk/boms/azure-sdk-bom/CHANGELOG.md index 9c93ded7ea57..9fddbb42eeef 100644 --- a/sdk/boms/azure-sdk-bom/CHANGELOG.md +++ b/sdk/boms/azure-sdk-bom/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +## 1.2.27 (2024-08-27) + +### Dependency Updates + +- Updated Azure SDK dependency versions to the latest releases. + ## 1.2.26 (2024-07-30) ### Dependency Updates diff --git a/sdk/boms/azure-sdk-bom/README.md b/sdk/boms/azure-sdk-bom/README.md index 80ffc6c33bc4..c1d093d172be 100644 --- a/sdk/boms/azure-sdk-bom/README.md +++ b/sdk/boms/azure-sdk-bom/README.md @@ -21,7 +21,7 @@ result in all dependencies being included in your project. com.azure azure-sdk-bom - 1.2.26 + 1.2.27 pom import diff --git a/sdk/boms/azure-sdk-bom/pom.xml b/sdk/boms/azure-sdk-bom/pom.xml index d907d8aac557..31ef415116c9 100644 --- a/sdk/boms/azure-sdk-bom/pom.xml +++ b/sdk/boms/azure-sdk-bom/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.azure azure-sdk-bom - 1.2.26 + 1.2.27 pom Azure Java SDK BOM (Bill of Materials) Azure Java SDK BOM (Bill of Materials) @@ -38,22 +38,22 @@ com.azure azure-ai-contentsafety - 1.0.5 + 1.0.6 com.azure azure-ai-formrecognizer - 4.1.9 + 4.1.10 com.azure azure-ai-metricsadvisor - 1.2.0 + 1.2.1 com.azure azure-ai-textanalytics - 5.5.0 + 5.5.1 com.azure @@ -63,97 +63,97 @@ com.azure azure-communication-callautomation - 1.2.3 + 1.2.4 com.azure azure-communication-chat - 1.5.3 + 1.5.4 com.azure azure-communication-common - 1.3.5 + 1.3.6 com.azure azure-communication-email - 1.0.15 + 1.0.16 com.azure azure-communication-identity - 1.5.7 + 1.5.8 com.azure azure-communication-jobrouter - 1.1.6 + 1.1.7 com.azure azure-communication-messages - 1.0.5 + 1.0.6 com.azure azure-communication-phonenumbers - 1.1.15 + 1.1.16 com.azure azure-communication-rooms - 1.1.4 + 1.1.5 com.azure azure-communication-sms - 1.1.26 + 1.1.27 com.azure azure-containers-containerregistry - 1.2.10 + 1.2.11 com.azure azure-core - 1.50.0 + 1.51.0 com.azure azure-core-amqp - 2.9.7 + 2.9.8 com.azure azure-core-http-netty - 1.15.2 + 1.15.3 com.azure azure-core-http-okhttp - 1.12.1 + 1.12.2 com.azure azure-core-management - 1.15.1 + 1.15.2 com.azure azure-core-serializer-json-gson - 1.2.14 + 1.3.0 com.azure azure-core-serializer-json-jackson - 1.4.14 + 1.5.0 com.azure azure-cosmos - 4.63.0 + 4.63.2 com.azure @@ -163,142 +163,142 @@ com.azure azure-data-appconfiguration - 1.6.3 + 1.7.0 com.azure azure-data-schemaregistry - 1.4.8 + 1.4.9 com.azure azure-data-schemaregistry-apacheavro - 1.1.19 + 1.1.20 com.azure azure-data-tables - 12.4.3 + 12.4.4 com.azure azure-developer-devcenter - 1.0.2 + 1.0.3 com.azure azure-developer-loadtesting - 1.0.15 + 1.0.16 com.azure azure-digitaltwins-core - 1.3.22 + 1.3.23 com.azure azure-identity - 1.13.1 + 1.13.2 com.azure azure-identity-broker - 1.1.3 + 1.1.4 com.azure azure-identity-extensions - 1.1.18 + 1.1.19 com.azure azure-iot-deviceupdate - 1.0.20 + 1.0.21 com.azure azure-json - 1.1.0 + 1.2.0 com.azure azure-messaging-eventgrid - 4.22.4 + 4.24.0 com.azure azure-messaging-eventgrid-namespaces - 1.0.0 + 1.0.1 com.azure azure-messaging-eventhubs - 5.18.6 + 5.18.7 com.azure azure-messaging-eventhubs-checkpointstore-blob - 1.19.6 + 1.19.7 com.azure azure-messaging-servicebus - 7.17.2 + 7.17.3 com.azure azure-messaging-webpubsub - 1.2.17 + 1.3.0 com.azure azure-messaging-webpubsub-client - 1.0.5 + 1.0.6 com.azure azure-mixedreality-authentication - 1.2.26 + 1.2.27 com.azure azure-mixedreality-remoterendering - 1.1.31 + 1.1.32 com.azure azure-monitor-ingestion - 1.2.3 + 1.2.4 com.azure azure-monitor-query - 1.5.0 + 1.5.1 com.azure azure-search-documents - 11.7.0 + 11.7.1 com.azure azure-security-attestation - 1.1.26 + 1.1.27 com.azure azure-security-confidentialledger - 1.0.22 + 1.0.23 com.azure azure-security-keyvault-administration - 4.5.6 + 4.5.7 com.azure azure-security-keyvault-certificates - 4.6.5 + 4.6.6 com.azure @@ -308,57 +308,57 @@ com.azure azure-security-keyvault-keys - 4.8.6 + 4.8.7 com.azure azure-security-keyvault-secrets - 4.8.5 + 4.8.6 com.azure azure-storage-blob - 12.27.0 + 12.27.1 com.azure azure-storage-blob-batch - 12.23.0 + 12.23.1 com.azure azure-storage-blob-cryptography - 12.26.0 + 12.26.1 com.azure azure-storage-common - 12.26.0 + 12.26.1 com.azure azure-storage-file-datalake - 12.20.0 + 12.20.1 com.azure azure-storage-file-share - 12.23.0 + 12.23.1 com.azure azure-storage-internal-avro - 12.12.0 + 12.12.1 com.azure azure-storage-queue - 12.22.0 + 12.22.1 com.azure azure-xml - 1.0.0 + 1.1.0 From f1fe13d4115b1b93871629401aaa530985eb72f8 Mon Sep 17 00:00:00 2001 From: Bill Wert Date: Tue, 27 Aug 2024 13:52:04 -0700 Subject: [PATCH 061/128] Move logging token acquisition to VERBOSE (#41648) --- .../java/com/azure/core/implementation/AccessTokenCache.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/core/azure-core/src/main/java/com/azure/core/implementation/AccessTokenCache.java b/sdk/core/azure-core/src/main/java/com/azure/core/implementation/AccessTokenCache.java index 03f54f7aeb1d..3c97223d993b 100644 --- a/sdk/core/azure-core/src/main/java/com/azure/core/implementation/AccessTokenCache.java +++ b/sdk/core/azure-core/src/main/java/com/azure/core/implementation/AccessTokenCache.java @@ -228,7 +228,7 @@ private Supplier retrieveTokenSync(TokenRequestContext tokenRequest try { if (tokenRefresh != null) { AccessToken token = tokenRefresh.get(); - buildTokenRefreshLog(LogLevel.INFORMATIONAL, cachedToken, now).log("Acquired a new access token."); + buildTokenRefreshLog(LogLevel.VERBOSE, cachedToken, now).log("Acquired a new access token."); OffsetDateTime nextTokenRefreshTime = OffsetDateTime.now().plus(REFRESH_DELAY); AccessTokenCacheInfo updatedInfo = new AccessTokenCacheInfo(token, nextTokenRefreshTime); this.cacheInfo.set(updatedInfo); @@ -267,7 +267,7 @@ private boolean checkIfForceRefreshRequired(TokenRequestContext tokenRequestCont Throwable error = signal.getThrowable(); AccessToken cache = cacheInfo.get().getCachedAccessToken(); if (signal.isOnNext() && accessToken != null) { // SUCCESS - buildTokenRefreshLog(LogLevel.INFORMATIONAL, cache, now).log("Acquired a new access token."); + buildTokenRefreshLog(LogLevel.VERBOSE, cache, now).log("Acquired a new access token."); sinksOne.tryEmitValue(accessToken); OffsetDateTime nextTokenRefresh = OffsetDateTime.now().plus(REFRESH_DELAY); cacheInfo.set(new AccessTokenCacheInfo(accessToken, nextTokenRefresh)); From b66f356ebe1ee5e1058ac35e198f290ba9d96d47 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 27 Aug 2024 14:49:30 -0700 Subject: [PATCH 062/128] Sync eng/common directory with azure-sdk-tools for PR 8875 (#41660) * chore(): add playwright-testing to product slugs * Update eng/common/scripts/Test-SampleMetadata.ps1 --------- Co-authored-by: Siddharth Singha Roy Co-authored-by: Wes Haggard --- eng/common/scripts/Test-SampleMetadata.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eng/common/scripts/Test-SampleMetadata.ps1 b/eng/common/scripts/Test-SampleMetadata.ps1 index 8499b70a4926..c091ca51def0 100644 --- a/eng/common/scripts/Test-SampleMetadata.ps1 +++ b/eng/common/scripts/Test-SampleMetadata.ps1 @@ -422,6 +422,8 @@ begin { "office-word", "office-yammer", "passport-azure-ad", + "playwright", + "playwright-testing", "power-apps", "power-automate", "power-bi", From ded2a4cf837f02a70f7157c484c38058da2441d0 Mon Sep 17 00:00:00 2001 From: ivywei0125 <110525714+ivywei0125@users.noreply.github.com> Date: Wed, 28 Aug 2024 13:10:31 +0800 Subject: [PATCH 063/128] [App Configuration] Add test case for feature management lib (#41498) * add feature management common test cases * add test case for no filters * initialize feature manager and call `featureManager.isEnabled()` to compare the result * update the schema of test case * get sample file and tests file by listFiles api * update the todo comment. Throw exception and use little endian are breaking change, will have both when update to 6.xx version. * use `getContextClassLoader().getResource` to get the resource folder path * address comment: typo wording error fix, add "@SuppressWarnings" * address comment: typo wording error fix * address comment: update member name * add running log * use contains to filter out the "TargetingFilter.sample.json" * add some info log * sort the file list * move to another the package to avoid making feature manager construction as public * address comment: use logging, remove else * address comment: throw exception when empty "feature_management" section. * address comment: rename symbol * Update ValidationsTest.java * fixing linting * address comment: ignore both targeting filter test case --------- Co-authored-by: Matt Metcalf --- .../feature/management/ValidationsTest.java | 174 +++++++++++++ .../filters/TargetingFilterTest.java | 45 +--- .../TargetingFilterTestContextAccessor.java | 27 ++ .../validationstests/models/IsEnabled.java | 36 +++ .../models/ValidationTestCase.java | 99 ++++++++ .../validationstests/models/Variant.java | 36 +++ .../validations-tests/NoFilters.sample.json | 44 ++++ .../validations-tests/NoFilters.tests.json | 68 ++++++ .../RequirementType.sample.json | 144 +++++++++++ .../RequirementType.tests.json | 68 ++++++ .../TargetingFilter.modified.sample.json | 60 +++++ .../TargetingFilter.modified.tests.json | 98 ++++++++ .../TargetingFilter.sample.json | 60 +++++ .../TargetingFilter.tests.json | 230 ++++++++++++++++++ .../TimeWindowFilter.sample.json | 84 +++++++ .../TimeWindowFilter.tests.json | 57 +++++ 16 files changed, 1297 insertions(+), 33 deletions(-) create mode 100644 sdk/spring/spring-cloud-azure-feature-management/src/test/java/com/azure/spring/cloud/feature/management/ValidationsTest.java create mode 100644 sdk/spring/spring-cloud-azure-feature-management/src/test/java/com/azure/spring/cloud/feature/management/filters/TargetingFilterTestContextAccessor.java create mode 100644 sdk/spring/spring-cloud-azure-feature-management/src/test/java/com/azure/spring/cloud/feature/management/validationstests/models/IsEnabled.java create mode 100644 sdk/spring/spring-cloud-azure-feature-management/src/test/java/com/azure/spring/cloud/feature/management/validationstests/models/ValidationTestCase.java create mode 100644 sdk/spring/spring-cloud-azure-feature-management/src/test/java/com/azure/spring/cloud/feature/management/validationstests/models/Variant.java create mode 100644 sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/NoFilters.sample.json create mode 100644 sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/NoFilters.tests.json create mode 100644 sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/RequirementType.sample.json create mode 100644 sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/RequirementType.tests.json create mode 100644 sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/TargetingFilter.modified.sample.json create mode 100644 sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/TargetingFilter.modified.tests.json create mode 100644 sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/TargetingFilter.sample.json create mode 100644 sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/TargetingFilter.tests.json create mode 100644 sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/TimeWindowFilter.sample.json create mode 100644 sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/TimeWindowFilter.tests.json diff --git a/sdk/spring/spring-cloud-azure-feature-management/src/test/java/com/azure/spring/cloud/feature/management/ValidationsTest.java b/sdk/spring/spring-cloud-azure-feature-management/src/test/java/com/azure/spring/cloud/feature/management/ValidationsTest.java new file mode 100644 index 000000000000..35d43967f85e --- /dev/null +++ b/sdk/spring/spring-cloud-azure-feature-management/src/test/java/com/azure/spring/cloud/feature/management/ValidationsTest.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.spring.cloud.feature.management; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.mockito.Mockito.when; + +import java.io.File; +import java.io.IOException; +import java.net.URL; +import java.nio.file.Files; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.stream.Stream; + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.ApplicationContext; +import org.springframework.test.context.junit.jupiter.SpringExtension; + +import com.azure.spring.cloud.feature.management.filters.TargetingFilter; +import com.azure.spring.cloud.feature.management.filters.TargetingFilterTestContextAccessor; +import com.azure.spring.cloud.feature.management.filters.TimeWindowFilter; +import com.azure.spring.cloud.feature.management.implementation.FeatureManagementConfigProperties; +import com.azure.spring.cloud.feature.management.implementation.FeatureManagementProperties; +import com.azure.spring.cloud.feature.management.validationstests.models.ValidationTestCase; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.json.JsonMapper; +import com.fasterxml.jackson.databind.type.CollectionType; +import com.fasterxml.jackson.databind.type.TypeFactory; + +@ExtendWith(SpringExtension.class) +public class ValidationsTest { + @Mock + private ApplicationContext context; + + @Mock + private FeatureManagementConfigProperties configProperties; + + private static final Logger LOGGER = LoggerFactory.getLogger(ValidationsTest.class); + + private static final ObjectMapper OBJECT_MAPPER = JsonMapper.builder() + .configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true).build(); + + private static final String TEST_CASE_FOLDER_PATH = "validations-tests"; + + private final String inputsUser = "user"; + + private final String inputsGroups = "groups"; + + private static final String SAMPLE_FILE_NAME_FILTER = "sample"; + + private static final String TESTS_FILE_NAME_FILTER = "tests"; + + @BeforeEach + public void setup() { + MockitoAnnotations.openMocks(this); + when(configProperties.isFailFast()).thenReturn(true); + when(context.getBean(Mockito.contains("TimeWindow"))).thenReturn(new TimeWindowFilter()); + } + + @AfterEach + public void cleanup() throws Exception { + MockitoAnnotations.openMocks(this).close(); + } + + private boolean hasException(ValidationTestCase testCase) { + final String exceptionStr = testCase.getIsEnabled().getException(); + return exceptionStr != null && !exceptionStr.isEmpty(); + } + + private boolean hasInput(ValidationTestCase testCase) { + final LinkedHashMap inputsMap = testCase.getInputs(); + return inputsMap != null && !inputsMap.isEmpty(); + } + + private static File[] getFileList(String fileNameFilter) { + final URL folderUrl = Thread.currentThread().getContextClassLoader().getResource(TEST_CASE_FOLDER_PATH); + assert folderUrl != null; + + final File folderFile = new File(folderUrl.getFile()); + final File[] filteredFiles = folderFile + .listFiles(pathname -> pathname.getName().toLowerCase().contains(fileNameFilter)); + assert filteredFiles != null; + + Arrays.sort(filteredFiles, Comparator.comparing(File::getName)); + return filteredFiles; + } + + private List readTestcasesFromFile(File testFile) throws IOException { + final String jsonString = Files.readString(testFile.toPath()); + final CollectionType typeReference = TypeFactory.defaultInstance().constructCollectionType(List.class, + ValidationTestCase.class); + return OBJECT_MAPPER.readValue(jsonString, typeReference); + } + + @SuppressWarnings("unchecked") + private static LinkedHashMap readConfigurationFromFile(File sampleFile) throws IOException { + final String jsonString = Files.readString(sampleFile.toPath()); + final LinkedHashMap configurations = OBJECT_MAPPER.readValue(jsonString, new TypeReference<>() { + }); + final Object featureManagementSection = configurations.get("feature_management"); + if (featureManagementSection.getClass().isAssignableFrom(LinkedHashMap.class)) { + return (LinkedHashMap) featureManagementSection; + } + throw new IllegalArgumentException("feature_management part is not a map"); + } + + static Stream testProvider() throws IOException { + List arguments = new ArrayList<>(); + File[] files = getFileList(TESTS_FILE_NAME_FILTER); + + final File[] sampleFiles = getFileList(SAMPLE_FILE_NAME_FILTER); + List properties = new ArrayList<>(); + for (File sampleFile : sampleFiles) { + final FeatureManagementProperties managementProperties = new FeatureManagementProperties(); + managementProperties.putAll(readConfigurationFromFile(sampleFile)); + properties.add(managementProperties); + } + + for (int i = 0; i < files.length; i++) { + if (files[i].getName().contains(("TargetingFilter"))) { + continue; // TODO(mametcal). Not run the test case until we release the little endian fix + } + arguments.add(Arguments.of(files[i].getName(), files[i], properties.get(i))); + } + + return arguments.stream(); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("testProvider") + void validationTest(String name, File testsFile, FeatureManagementProperties managementProperties) + throws IOException { + LOGGER.debug("Running test case from file: " + name); + final FeatureManager featureManager = new FeatureManager(context, managementProperties, configProperties); + List testCases = readTestcasesFromFile(testsFile); + for (ValidationTestCase testCase : testCases) { + LOGGER.debug("Test case : " + testCase.getDescription()); + if (hasException(testCase)) { // TODO(mametcal). Currently we didn't throw the exception when parameter is + // invalid + assertNull(managementProperties.getOnOff().get(testCase.getFeatureFlagName())); + continue; + } + if (hasInput(testCase)) { // Set inputs + final Object userObj = testCase.getInputs().get(inputsUser); + final Object groupsObj = testCase.getInputs().get(inputsGroups); + final String user = userObj != null ? userObj.toString() : null; + @SuppressWarnings("unchecked") + final List groups = groupsObj != null ? (List) groupsObj : null; + when(context.getBean(Mockito.contains("Targeting"))) + .thenReturn(new TargetingFilter(new TargetingFilterTestContextAccessor(user, groups))); + } + + final Boolean result = featureManager.isEnabled(testCase.getFeatureFlagName()); + assertEquals(result.toString(), testCase.getIsEnabled().getResult()); + } + } +} diff --git a/sdk/spring/spring-cloud-azure-feature-management/src/test/java/com/azure/spring/cloud/feature/management/filters/TargetingFilterTest.java b/sdk/spring/spring-cloud-azure-feature-management/src/test/java/com/azure/spring/cloud/feature/management/filters/TargetingFilterTest.java index 19c06b3ce4c7..5d1323510c7f 100644 --- a/sdk/spring/spring-cloud-azure-feature-management/src/test/java/com/azure/spring/cloud/feature/management/filters/TargetingFilterTest.java +++ b/sdk/spring/spring-cloud-azure-feature-management/src/test/java/com/azure/spring/cloud/feature/management/filters/TargetingFilterTest.java @@ -18,8 +18,6 @@ import com.azure.spring.cloud.feature.management.implementation.TestConfiguration; import com.azure.spring.cloud.feature.management.models.FeatureFilterEvaluationContext; import com.azure.spring.cloud.feature.management.models.TargetingException; -import com.azure.spring.cloud.feature.management.targeting.TargetingContext; -import com.azure.spring.cloud.feature.management.targeting.TargetingContextAccessor; import com.azure.spring.cloud.feature.management.targeting.TargetingEvaluationOptions; @SpringBootTest(classes = { TestConfiguration.class, SpringBootTest.class }) @@ -48,10 +46,10 @@ public void targetedUser() { parameters.put(GROUPS, new LinkedHashMap()); parameters.put(DEFAULT_ROLLOUT_PERCENTAGE, 0); parameters.put("Exclusion", emptyExclusion()); - + Map excludes = new LinkedHashMap<>(); Map excludedGroups = new LinkedHashMap<>(); - + excludes.put(GROUPS, excludedGroups); context.setParameters(parameters); @@ -341,20 +339,20 @@ public void excludeUser() { TargetingFilter filter = new TargetingFilter(new TargetingFilterTestContextAccessor("Doe", null)); assertTrue(filter.evaluate(context)); - + // Now the users is excluded Map excludes = new LinkedHashMap<>(); Map excludedUsers = new LinkedHashMap<>(); excludedUsers.put("0", "Doe"); - + excludes.put(USERS, excludedUsers); parameters.put("Exclusion", excludes); - + context.setParameters(parameters); - + assertFalse(filter.evaluate(context)); } - + @Test public void excludeGroup() { FeatureFilterEvaluationContext context = new FeatureFilterEvaluationContext(); @@ -380,20 +378,20 @@ public void excludeGroup() { TargetingFilter filter = new TargetingFilter(new TargetingFilterTestContextAccessor(null, targetedGroups)); assertTrue(filter.evaluate(context)); - + // Now the users is excluded Map excludes = new LinkedHashMap<>(); Map excludedGroups = new LinkedHashMap<>(); excludedGroups.put("0", "g1"); - + excludes.put(GROUPS, excludedGroups); parameters.put("Exclusion", excludes); - + context.setParameters(parameters); - + assertFalse(filter.evaluate(context)); } - + private Map emptyExclusion() { Map excludes = new LinkedHashMap<>(); List excludedUsers = new ArrayList<>(); @@ -402,23 +400,4 @@ private Map emptyExclusion() { excludes.put(GROUPS, excludedGroups); return excludes; } - - class TargetingFilterTestContextAccessor implements TargetingContextAccessor { - - private String user; - - private ArrayList groups; - - TargetingFilterTestContextAccessor(String user, ArrayList groups) { - this.user = user; - this.groups = groups; - } - - @Override - public void configureTargetingContext(TargetingContext context) { - context.setUserId(user); - context.setGroups(groups); - } - - } } diff --git a/sdk/spring/spring-cloud-azure-feature-management/src/test/java/com/azure/spring/cloud/feature/management/filters/TargetingFilterTestContextAccessor.java b/sdk/spring/spring-cloud-azure-feature-management/src/test/java/com/azure/spring/cloud/feature/management/filters/TargetingFilterTestContextAccessor.java new file mode 100644 index 000000000000..a61de4cb0919 --- /dev/null +++ b/sdk/spring/spring-cloud-azure-feature-management/src/test/java/com/azure/spring/cloud/feature/management/filters/TargetingFilterTestContextAccessor.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.spring.cloud.feature.management.filters; + +import com.azure.spring.cloud.feature.management.targeting.TargetingContext; +import com.azure.spring.cloud.feature.management.targeting.TargetingContextAccessor; + +import java.util.List; + +public class TargetingFilterTestContextAccessor implements TargetingContextAccessor { + + private String user; + + private List groups; + + public TargetingFilterTestContextAccessor(String user, List groups) { + this.user = user; + this.groups = groups; + } + + @Override + public void configureTargetingContext(TargetingContext context) { + context.setUserId(user); + context.setGroups(groups); + } + +} diff --git a/sdk/spring/spring-cloud-azure-feature-management/src/test/java/com/azure/spring/cloud/feature/management/validationstests/models/IsEnabled.java b/sdk/spring/spring-cloud-azure-feature-management/src/test/java/com/azure/spring/cloud/feature/management/validationstests/models/IsEnabled.java new file mode 100644 index 000000000000..0f10f4175e5e --- /dev/null +++ b/sdk/spring/spring-cloud-azure-feature-management/src/test/java/com/azure/spring/cloud/feature/management/validationstests/models/IsEnabled.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.spring.cloud.feature.management.validationstests.models; + +public class IsEnabled { + private String result; + private String exception; + + /** + * @return result + * */ + public String getResult() { + return result; + } + + /** + * @param result the result of validation test case + * */ + public void setResult(String result) { + this.result = result; + } + + /** + * @return exception + * */ + public String getException() { + return exception; + } + + /** + * @param exception the exception message throws when run test case + * */ + public void setException(String exception) { + this.exception = exception; + } +} diff --git a/sdk/spring/spring-cloud-azure-feature-management/src/test/java/com/azure/spring/cloud/feature/management/validationstests/models/ValidationTestCase.java b/sdk/spring/spring-cloud-azure-feature-management/src/test/java/com/azure/spring/cloud/feature/management/validationstests/models/ValidationTestCase.java new file mode 100644 index 000000000000..3d2891b148e9 --- /dev/null +++ b/sdk/spring/spring-cloud-azure-feature-management/src/test/java/com/azure/spring/cloud/feature/management/validationstests/models/ValidationTestCase.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.spring.cloud.feature.management.validationstests.models; + +import java.util.LinkedHashMap; + +public class ValidationTestCase { + private String friendlyName; + private String featureFlagName; + private LinkedHashMap inputs; + private IsEnabled isEnabled; + private Variant variant; + private String description; + + /** + * @return friendly name of test case + * */ + public String getFriendlyName() { + return friendlyName; + } + + /** + * @param friendlyName the friendly name of test case + * */ + public void setFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + } + + /** + * @return the name of feature flag + * */ + public String getFeatureFlagName() { + return featureFlagName; + } + + /** + * @param featureFlagName the name of feature flag + * */ + public void setFeatureFlagName(String featureFlagName) { + this.featureFlagName = featureFlagName; + } + + /** + * @return the inputs of feature flag + * */ + public LinkedHashMap getInputs() { + return inputs; + } + + /** + * @param inputs the inputs of feature flag + * */ + public void setInputs(LinkedHashMap inputs) { + this.inputs = inputs; + } + + /** + * @return IsEnabled object to represent result of feature flag, enabled or exception + * */ + public IsEnabled getIsEnabled() { + return isEnabled; + } + + /** + * @param isEnabled the result of feature flag, enabled or exception + * */ + public void setIsEnabled(IsEnabled isEnabled) { + this.isEnabled = isEnabled; + } + + /** + * @return variant + * */ + public Variant getVariant() { + return variant; + } + + /** + * @param variant the variant of test case + * */ + public void setVariant(Variant variant) { + this.variant = variant; + } + + /** + * @return description + * */ + public String getDescription() { + return description; + } + + /** + * @param description the description of test case + * */ + public void setDescription(String description) { + this.description = description; + } +} + diff --git a/sdk/spring/spring-cloud-azure-feature-management/src/test/java/com/azure/spring/cloud/feature/management/validationstests/models/Variant.java b/sdk/spring/spring-cloud-azure-feature-management/src/test/java/com/azure/spring/cloud/feature/management/validationstests/models/Variant.java new file mode 100644 index 000000000000..ee209ab255e3 --- /dev/null +++ b/sdk/spring/spring-cloud-azure-feature-management/src/test/java/com/azure/spring/cloud/feature/management/validationstests/models/Variant.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.spring.cloud.feature.management.validationstests.models; + +public class Variant { + private String result; + private String exception; + + /** + * @return result + * */ + public String getResult() { + return result; + } + + /** + * @param result the result of variant feature flag + * */ + public void setResult(String result) { + this.result = result; + } + + /** + * @return exception + * */ + public String getException() { + return exception; + } + + /** + * @param exception the exception message throws when run variant test case + * */ + public void setException(String exception) { + this.exception = exception; + } +} diff --git a/sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/NoFilters.sample.json b/sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/NoFilters.sample.json new file mode 100644 index 000000000000..6860ba53c506 --- /dev/null +++ b/sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/NoFilters.sample.json @@ -0,0 +1,44 @@ +{ + "feature_management": { + "feature_flags": [ + { + "id": "BooleanTrue", + "description": "A feature flag with no Filters, that returns true.", + "enabled": true, + "conditions": { + "client_filters": [] + } + }, + { + "id": "BooleanFalse", + "description": "A feature flag with no Filters, that returns false.", + "enabled": false, + "conditions": { + "client_filters": [] + } + }, + { + "id": "InvalidEnabled", + "description": "A feature flag with an invalid 'enabled' value, that returns false.", + "enabled": "invalid", + "conditions": { + "client_filters": [] + } + }, + { + "id": "Minimal", + "enabled": true + }, + { + "id": "NoEnabled" + }, + { + "id": "EmptyConditions", + "description": "A feature flag with no values in conditions, that returns true.", + "enabled": true, + "conditions": { + } + } + ] + } +} \ No newline at end of file diff --git a/sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/NoFilters.tests.json b/sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/NoFilters.tests.json new file mode 100644 index 000000000000..01445d679299 --- /dev/null +++ b/sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/NoFilters.tests.json @@ -0,0 +1,68 @@ +[ + { + "FeatureFlagName": "BooleanTrue", + "Inputs": {}, + "IsEnabled": { + "Result": "true" + }, + "Variant": { + "Result": null + }, + "Description": "An Enabled Feature Flag with no Filters." + }, + { + "FeatureFlagName": "BooleanFalse", + "Inputs": {}, + "IsEnabled": { + "Result": "false" + }, + "Variant": { + "Result": null + }, + "Description": "A Disabled Feature Flag with no Filters." + }, + { + "FeatureFlagName": "InvalidEnabled", + "Inputs": {}, + "IsEnabled": { + "Exception": "Invalid setting 'enabled' with value 'invalid' for feature 'InvalidEnabled'." + }, + "Variant": { + "Result": null + }, + "Description": "A Feature Flag with an invalid Enabled Value." + }, + { + "FeatureFlagName": "Minimal", + "Inputs": {}, + "IsEnabled": { + "Result": "true" + }, + "Variant": { + "Result": null + }, + "Description": "A Feature Flag with just a key and enabled." + }, + { + "FeatureFlagName": "NoEnabled", + "Inputs": {}, + "IsEnabled": { + "Result": "false" + }, + "Variant": { + "Result": null + }, + "Description": "Validates that the default value of enabled is False." + }, + { + "FeatureFlagName": "EmptyConditions", + "Inputs": {}, + "IsEnabled": { + "Result": "true" + }, + "Variant": { + "Result": null + }, + "Description": "A feature flag with no Conditions, returns true as it's enabled." + } +] \ No newline at end of file diff --git a/sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/RequirementType.sample.json b/sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/RequirementType.sample.json new file mode 100644 index 000000000000..5bf5b6ecfe5e --- /dev/null +++ b/sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/RequirementType.sample.json @@ -0,0 +1,144 @@ +{ + "feature_management": { + "feature_flags": [ + { + "id": "DefaultRequirementTypeFirstFilterPassed", + "description": "A feature flag that has multiple filters, but doesn't specify any requirement type, which is the default. Will always return true.", + "enabled": true, + "conditions": { + "client_filters": [ + { + "name": "Microsoft.TimeWindow", + "parameters": { + "Start": "Tue, 27 Jun 2023 06:00:00 GMT" + } + }, + { + "name": "Microsoft.TimeWindow", + "parameters": { + "Start": "Thu, 29 Jun 2023 07:00:00 GMT", + "End": "Wed, 30 Aug 2023 07:00:00 GMT" + } + } + ] + } + }, + { + "id": "DefaultRequirementTypeLastFilterPassed", + "description": "Same as DefaultRequirementTypeFirstFilterPassed, but filter order is switched. Will always return true.", + "enabled": true, + "conditions": { + "client_filters": [ + { + "name": "Microsoft.TimeWindow", + "parameters": { + "Start": "Thu, 29 Jun 2023 07:00:00 GMT", + "End": "Wed, 30 Aug 2023 07:00:00 GMT" + } + }, + { + "name": "Microsoft.TimeWindow", + "parameters": { + "Start": "Tue, 27 Jun 2023 06:00:00 GMT" + } + } + ] + } + }, + { + "id": "RequirementTypeAnyFirstFilterPassed", + "description": "Same as DefaultRequirementTypeFirstFilterPassed, but requirement type is specified. Will always return true.", + "enabled": true, + "conditions": { + "client_filters": [ + { + "name": "Microsoft.TimeWindow", + "parameters": { + "Start": "Tue, 27 Jun 2023 06:00:00 GMT" + } + }, + { + "name": "Microsoft.TimeWindow", + "parameters": { + "Start": "Thu, 29 Jun 2023 07:00:00 GMT", + "End": "Wed, 30 Aug 2023 07:00:00 GMT" + } + } + ], + "requirement_type": "Any" + } + }, + { + "id": "RequirementTypeAnyLastFilterPassed", + "description": "Same as DefaultRequirementTypeLastFilterPassed, but requirement type is specified. Will always return true.", + "enabled": true, + "conditions": { + "client_filters": [ + { + "name": "Microsoft.TimeWindow", + "parameters": { + "Start": "Thu, 29 Jun 2023 07:00:00 GMT", + "End": "Wed, 30 Aug 2023 07:00:00 GMT" + } + }, + { + "name": "Microsoft.TimeWindow", + "parameters": { + "Start": "Tue, 27 Jun 2023 06:00:00 GMT" + } + } + ], + "requirement_type": "Any" + } + }, + { + "id": "RequirementTypeAllPassed", + "description": "Requirement type All. Will always return true.", + "enabled": true, + "conditions": { + "client_filters": [ + { + "name": "Microsoft.Targeting", + "parameters": { + "Audience": { + "DefaultRolloutPercentage": 100 + } + } + }, + { + "name": "Microsoft.TimeWindow", + "parameters": { + "Start": "Tue, 27 Jun 2023 06:00:00 GMT" + } + } + ], + "requirement_type": "All" + } + }, + { + "id": "RequirementTypeAllLastFilterFailed", + "description": "Requirement type All. Will always return false.", + "enabled": true, + "conditions": { + "client_filters": [ + { + "name": "Microsoft.Targeting", + "parameters": { + "Audience": { + "DefaultRolloutPercentage": 100 + } + } + }, + { + "name": "Microsoft.TimeWindow", + "parameters": { + "End": "Tue, 27 Jun 2023 06:00:00 GMT" + } + } + ], + "requirement_type": "All" + } + } + ] + } +} \ No newline at end of file diff --git a/sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/RequirementType.tests.json b/sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/RequirementType.tests.json new file mode 100644 index 000000000000..74df4d8c4133 --- /dev/null +++ b/sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/RequirementType.tests.json @@ -0,0 +1,68 @@ +[ + { + "FeatureFlagName": "DefaultRequirementTypeFirstFilterPassed", + "Inputs": {}, + "IsEnabled": { + "Result": "true" + }, + "Variant": { + "Result": null + }, + "Description": "Feature Flag with two feature filters, first returns true, so it's enabled." + }, + { + "FeatureFlagName": "DefaultRequirementTypeLastFilterPassed", + "Inputs": {}, + "IsEnabled": { + "Result": "true" + }, + "Variant": { + "Result": null + }, + "Description": "Feature Flag with two feature filters, second returns true, so it's enabled." + }, + { + "FeatureFlagName": "RequirementTypeAnyFirstFilterPassed", + "Inputs": {}, + "IsEnabled": { + "Result": "true" + }, + "Variant": { + "Result": null + }, + "Description": "Feature Flag with two feature filters and requirement type specified as Any. Second filter returns true." + }, + { + "FeatureFlagName": "RequirementTypeAnyLastFilterPassed", + "Inputs": {}, + "IsEnabled": { + "Result": "true" + }, + "Variant": { + "Result": null + }, + "Description": "Feature Flag with two feature filters and requirement type specified as Any. Neither filter returns true." + }, + { + "FeatureFlagName": "RequirementTypeAllPassed", + "Inputs": {"user":"Adam"}, + "IsEnabled": { + "Result": "true" + }, + "Variant": { + "Result": null + }, + "Description": "Feature Flag with two feature filters and requirement type specified as All. Both filters return true." + }, + { + "FeatureFlagName": "RequirementTypeAllLastFilterFailed", + "Inputs": {"user":"Adam"}, + "IsEnabled": { + "Result": "false" + }, + "Variant": { + "Result": null + }, + "Description": "Feature Flag with two feature filters and requirement type specified as All. Only the first filter returns true." + } +] diff --git a/sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/TargetingFilter.modified.sample.json b/sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/TargetingFilter.modified.sample.json new file mode 100644 index 000000000000..8f332e65c804 --- /dev/null +++ b/sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/TargetingFilter.modified.sample.json @@ -0,0 +1,60 @@ +{ + "feature_management": { + "feature_flags": [ + { + "id": "ComplexTargeting", + "description": "A feature flag using a targeting filter, that will return true for Alice, Stage1, and 50% of Stage2, and false for Dave and Stage3. The default rollout percentage is 25%.", + "enabled": true, + "conditions": { + "client_filters": [ + { + "name": "Microsoft.Targeting", + "parameters": { + "Audience": { + "Users": [ + "Alice" + ], + "Groups": [ + { + "Name": "Stage1", + "RolloutPercentage": 100 + }, + { + "Name": "Stage2", + "RolloutPercentage": 50 + } + ], + "DefaultRolloutPercentage": 25, + "Exclusion": { + "Users": ["Dave"], + "Groups": ["Stage3"] + } + } + } + } + ] + } + }, + { + "id": "RolloutPercentageUpdate", + "description": "A feature flag using a targeting filter, that will return true 62% of the time.", + "enabled": true, + "conditions": { + "client_filters": [ + { + "name": "Microsoft.Targeting", + "parameters": { + "Audience": { + "Users": [], + "Groups": [], + "DefaultRolloutPercentage": 62, + "Exclusion": {} + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/TargetingFilter.modified.tests.json b/sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/TargetingFilter.modified.tests.json new file mode 100644 index 000000000000..1c1425bf3d47 --- /dev/null +++ b/sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/TargetingFilter.modified.tests.json @@ -0,0 +1,98 @@ +[ + { + "FriendlyName": "Aiden62", + "FeatureFlagName": "RolloutPercentageUpdate", + "Inputs": {"user":"Aiden"}, + "IsEnabled": { + "Result": "true" + }, + "Variant": { + "Result": null + }, + "Description": "Targeting Filter, 62% default rollout Aiden is part of it." + }, + { + "FriendlyName": "Aiden62 - Stage1", + "FeatureFlagName": "RolloutPercentageUpdate", + "Inputs": {"user":"Aiden", "groups":["Stage1"]}, + "IsEnabled": { + "Result": "true" + }, + "Variant": { + "Result": null + }, + "Description": "Targeting Filter, group is not part of default rollout calculation, no change." + }, + { + "FriendlyName": "Aiden62 - Stage2", + "FeatureFlagName": "RolloutPercentageUpdate", + "Inputs": {"user":"Aiden", "groups":["Stage2"]}, + "IsEnabled": { + "Result": "true" + }, + "Variant": { + "Result": null + }, + "Description": "Targeting Filter, group is not part of default rollout calculation, no change." + }, + { + "FriendlyName": "Aiden62 - Stage3", + "FeatureFlagName": "RolloutPercentageUpdate", + "Inputs": {"user":"Aiden", "groups":["Stage3"]}, + "IsEnabled": { + "Result": "true" + }, + "Variant": { + "Result": null + }, + "Description": "Targeting Filter, group is not part of default rollout calculation, no change." + }, + { + "FriendlyName": "Brittney62", + "FeatureFlagName": "RolloutPercentageUpdate", + "Inputs": {"user":"Brittney"}, + "IsEnabled": { + "Result": "true" + }, + "Variant": { + "Result": null + }, + "Description": "Targeting Filter, 62% default rollout Brittney is part of it." + }, + { + "FriendlyName": "Brittney62 - Stage1", + "FeatureFlagName": "RolloutPercentageUpdate", + "Inputs": {"user":"Brittney", "groups":["Stage1"]}, + "IsEnabled": { + "Result": "true" + }, + "Variant": { + "Result": null + }, + "Description": "Targeting Filter, group is not part of default rollout calculation, no change." + }, + { + "FriendlyName": "Brittney62 - Stage2", + "FeatureFlagName": "RolloutPercentageUpdate", + "Inputs": {"user":"Brittney", "groups":["Stage2"]}, + "IsEnabled": { + "Result": "true" + }, + "Variant": { + "Result": null + }, + "Description": "Targeting Filter, group is not part of default rollout calculation, no change." + }, + { + "FriendlyName": "Brittney62 - Stage3", + "FeatureFlagName": "RolloutPercentageUpdate", + "Inputs": {"user":"Brittney", "groups":["Stage3"]}, + "IsEnabled": { + "Result": "true" + }, + "Variant": { + "Result": null + }, + "Description": "Targeting Filter, group is not part of default rollout calculation, no change." + } +] \ No newline at end of file diff --git a/sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/TargetingFilter.sample.json b/sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/TargetingFilter.sample.json new file mode 100644 index 000000000000..4342df5d20b0 --- /dev/null +++ b/sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/TargetingFilter.sample.json @@ -0,0 +1,60 @@ +{ + "feature_management": { + "feature_flags": [ + { + "id": "ComplexTargeting", + "description": "A feature flag using a targeting filter, that will return true for Alice, Stage1, and 50% of Stage2. Dave and Stage3 are excluded. The default rollout percentage is 25%.", + "enabled": true, + "conditions": { + "client_filters": [ + { + "name": "Microsoft.Targeting", + "parameters": { + "Audience": { + "Users": [ + "Alice" + ], + "Groups": [ + { + "Name": "Stage1", + "RolloutPercentage": 100 + }, + { + "Name": "Stage2", + "RolloutPercentage": 50 + } + ], + "DefaultRolloutPercentage": 25, + "Exclusion": { + "Users": ["Dave"], + "Groups": ["Stage3"] + } + } + } + } + ] + } + }, + { + "id": "RolloutPercentageUpdate", + "description": "A feature flag using a targeting filter, that will return true 61% of the time. Changing to 62% makes the user Brittney true.", + "enabled": true, + "conditions": { + "client_filters": [ + { + "name": "Microsoft.Targeting", + "parameters": { + "Audience": { + "Users": [], + "Groups": [], + "DefaultRolloutPercentage": 61, + "Exclusion": {} + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/TargetingFilter.tests.json b/sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/TargetingFilter.tests.json new file mode 100644 index 000000000000..60e2f412ab5e --- /dev/null +++ b/sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/TargetingFilter.tests.json @@ -0,0 +1,230 @@ +[ + { + "FriendlyName": "DisabledDefaultRollout", + "FeatureFlagName": "ComplexTargeting", + "Inputs": {"user":"Aiden"}, + "IsEnabled": { + "Result": "false" + }, + "Variant": { + "Result": null + }, + "Description": "Targeting Filter, Aiden is not part of the default rollout." + }, + { + "FriendlyName": "EnabledDefaultRollout", + "FeatureFlagName": "ComplexTargeting", + "Inputs": {"user":"Blossom"}, + "IsEnabled": { + "Result": "true" + }, + "Variant": { + "Result": null + }, + "Description": "Targeting Filter, Blossom is part of the default rollout." + }, + { + "FriendlyName": "TargetedUser", + "FeatureFlagName": "ComplexTargeting", + "Inputs": {"user":"Alice"}, + "IsEnabled": { + "Result": "true" + }, + "Variant": { + "Result": null + }, + "Description": "Targeting Filter, Alice is a targeted user." + }, + { + "FriendlyName": "TargetedGroup", + "FeatureFlagName": "ComplexTargeting", + "Inputs": {"user":"Aiden", "groups":["Stage1"]}, + "IsEnabled": { + "Result": "true" + }, + "Variant": { + "Result": null + }, + "Description": "Targeting Filter, Aiden is now targeted because Stage1 is 100% rolled out." + }, + { + "FriendlyName": "DisabledTargetedGroup", + "FeatureFlagName": "ComplexTargeting", + "Inputs": {"groups":["Stage2"]}, + "IsEnabled": { + "Result": "false" + }, + "Variant": { + "Result": null + }, + "Description": "empty/no user will hit the 50% rollout of group stage 2, so it is targeted." + }, + { + "FriendlyName": "EnabledTargetedGroup50", + "FeatureFlagName": "ComplexTargeting", + "Inputs": {"user":"Aiden", "groups":["Stage2"]}, + "IsEnabled": { + "Result": "true" + }, + "Variant": { + "Result": null + }, + "Description": "Targeting Filter, Aiden who is not part of the default rollout is part of the first 50% of Stage 2." + }, + { + "FriendlyName": "DisabledTargetedGroup50", + "FeatureFlagName": "ComplexTargeting", + "Inputs": {"user":"Chris", "groups":["Stage2"]}, + "IsEnabled": { + "Result": "false" + }, + "Variant": { + "Result": null + }, + "Description": "Targeting Filter, Chris is neither part of the default rollout nor part of the first 50% of Stage 2." + }, + { + "FriendlyName": "ExcludedGroup", + "FeatureFlagName": "ComplexTargeting", + "Inputs": {"groups":["Stage3"]}, + "IsEnabled": { + "Result": "false" + }, + "Variant": { + "Result": null + }, + "Description": "Targeting Filter, the Stage 3 is the group on the exclusion list." + }, + { + "FriendlyName": "ExcludedGroupTargetedUser", + "FeatureFlagName": "ComplexTargeting", + "Inputs": {"user":"Alice", "groups":["Stage3"]}, + "IsEnabled": { + "Result": "false" + }, + "Variant": { + "Result": null + }, + "Description": "Alice is excluded because she is part of the Stage 3 group, even if she is an included user. " + }, + { + "FriendlyName": "ExcludedGroupDefaultRollout", + "FeatureFlagName": "ComplexTargeting", + "Inputs": {"user":"Blossom", "groups":["Stage3"]}, + "IsEnabled": { + "Result": "false" + }, + "Variant": { + "Result": null + }, + "Description": "Targeting Filter, Blossom who was Expected Result by the default rollout is now excluded as part of the Stage 3 group." + }, + { + "FriendlyName": "ExcludedUser", + "FeatureFlagName": "ComplexTargeting", + "Inputs": {"user":"Dave", "groups":["Stage1"]}, + "IsEnabled": { + "Result": "false" + }, + "Variant": { + "Result": null + }, + "Description": "Targeting Filter, Dave is on the exclusion list, is still excluded even though he is part of the 100% rolled out Stage 1." + }, + { + "FriendlyName": "Aiden61", + "FeatureFlagName": "RolloutPercentageUpdate", + "Inputs": {"user":"Aiden"}, + "IsEnabled": { + "Result": "true" + }, + "Variant": { + "Result": null + }, + "Description": "Targeting Filter, 62% default rollout Aiden is part of it." + }, + { + "FriendlyName": "Aiden61 - Stage1", + "FeatureFlagName": "RolloutPercentageUpdate", + "Inputs": {"user":"Aiden", "groups":["Stage1"]}, + "IsEnabled": { + "Result": "true" + }, + "Variant": { + "Result": null + }, + "Description": "Targeting Filter, group is not part of default rollout calculation, no change." + }, + { + "FriendlyName": "Aiden61 - Stage2", + "FeatureFlagName": "RolloutPercentageUpdate", + "Inputs": {"user":"Aiden", "groups":["Stage2"]}, + "IsEnabled": { + "Result": "true" + }, + "Variant": { + "Result": null + }, + "Description": "Targeting Filter, group is not part of default rollout calculation, no change." + }, + { + "FriendlyName": "Aiden61 - Stage3", + "FeatureFlagName": "RolloutPercentageUpdate", + "Inputs": {"user":"Aiden", "groups":["Stage3"]}, + "IsEnabled": { + "Result": "true" + }, + "Variant": { + "Result": null + }, + "Description": "Targeting Filter, group is not part of default rollout calculation, no change." + }, + { + "FriendlyName": "Brittney61", + "FeatureFlagName": "RolloutPercentageUpdate", + "Inputs": {"user":"Brittney"}, + "IsEnabled": { + "Result": "false" + }, + "Variant": { + "Result": null + }, + "Description": "Targeting Filter, 62% default rollout Brittney is not part of it." + }, + { + "FriendlyName": "Brittney61 - Stage1", + "FeatureFlagName": "RolloutPercentageUpdate", + "Inputs": {"user":"Brittney", "groups":["Stage1"]}, + "IsEnabled": { + "Result": "false" + }, + "Variant": { + "Result": null + }, + "Description": "Targeting Filter, group is not part of default rollout calculation, no change." + }, + { + "FriendlyName": "Brittney61 - Stage2", + "FeatureFlagName": "RolloutPercentageUpdate", + "Inputs": {"user":"Brittney", "groups":["Stage2"]}, + "IsEnabled": { + "Result": "false" + }, + "Variant": { + "Result": null + }, + "Description": "Targeting Filter, group is not part of default rollout calculation, no change." + }, + { + "FriendlyName": "Brittney61 - Stage3", + "FeatureFlagName": "RolloutPercentageUpdate", + "Inputs": {"user":"Brittney", "groups":["Stage3"]}, + "IsEnabled": { + "Result": "false" + }, + "Variant": { + "Result": null + }, + "Description": "Targeting Filter, group is not part of default rollout calculation, no change." + } +] \ No newline at end of file diff --git a/sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/TimeWindowFilter.sample.json b/sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/TimeWindowFilter.sample.json new file mode 100644 index 000000000000..462277b8f62c --- /dev/null +++ b/sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/TimeWindowFilter.sample.json @@ -0,0 +1,84 @@ +{ + "feature_management": { + "feature_flags": [ + { + "id": "PastTimeWindow", + "description": "A feature flag using a time window filter, that is active from 2023-06-29 07:00:00 to 2023-08-30 07:00:00. Will always return false as the current time is outside the time window.", + "enabled": true, + "conditions": { + "client_filters": [ + { + "name": "Microsoft.TimeWindow", + "parameters": { + "Start": "Thu, 29 Jun 2023 07:00:00 GMT", + "End": "Wed, 30 Aug 2023 07:00:00 GMT" + } + } + ] + } + }, + { + "id": "FutureTimeWindow", + "description": "A feature flag using a time window filter, that is active from 3023-06-27 06:00:00 to 3023-06-28 06:05:00. Will always return false as the time window has yet been reached.", + "enabled": true, + "conditions": { + "client_filters": [ + { + "name": "Microsoft.TimeWindow", + "parameters": { + "Start": "Fri, 27 Jun 3023 06:00:00 GMT", + "End": "Sat, 28 Jun 3023 06:05:00 GMT" + } + } + ] + } + }, + { + "id": "PresentTimeWindow", + "description": "A feature flag using a time window filter, that is active from 2023-06-27 06:00:00 to 3023-06-28 06:05:00. Will always return true as we are in the time window.", + "enabled": true, + "conditions": { + "client_filters": [ + { + "name": "Microsoft.TimeWindow", + "parameters": { + "Start": "Thu, 29 Jun 2023 07:00:00 GMT", + "End": "Sat, 28 Jun 3023 06:05:00 GMT" + } + } + ] + } + }, + { + "id": "StartedTimeWindow", + "description": "A feature flag using a time window filter, that will always return true as the current time is within the time window.", + "enabled": true, + "conditions": { + "client_filters": [ + { + "name": "Microsoft.TimeWindow", + "parameters": { + "Start": "Tue, 27 Jun 2023 06:00:00 GMT" + } + } + ] + } + }, + { + "id": "WillEndTimeWindow", + "description": "A feature flag using a time window filter, that will always return true as the current time is within the time window.", + "enabled": true, + "conditions": { + "client_filters": [ + { + "name": "Microsoft.TimeWindow", + "parameters": { + "End": "Sat, 28 Jun 3023 06:05:00 GMT" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/TimeWindowFilter.tests.json b/sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/TimeWindowFilter.tests.json new file mode 100644 index 000000000000..1bbd40f57d47 --- /dev/null +++ b/sdk/spring/spring-cloud-azure-feature-management/src/test/resources/validations-tests/TimeWindowFilter.tests.json @@ -0,0 +1,57 @@ +[ + { + "FeatureFlagName": "PastTimeWindow", + "Inputs": {}, + "IsEnabled": { + "Result": "false" + }, + "Variant": { + "Result": null + }, + "Description": "Time Window filter where both Start and End have already passed." + }, + { + "FeatureFlagName": "FutureTimeWindow", + "Inputs": {}, + "IsEnabled": { + "Result": "false" + }, + "Variant": { + "Result": null + }, + "Description": "Time Window filter where neither Start nor End have happened." + }, + { + "FeatureFlagName": "PresentTimeWindow", + "Inputs": {}, + "IsEnabled": { + "Result": "true" + }, + "Variant": { + "Result": null + }, + "Description": "Time Window filter where Start has happened but End hasn't happened." + }, + { + "FeatureFlagName": "StartedTimeWindow", + "Inputs": {}, + "IsEnabled": { + "Result": "true" + }, + "Variant": { + "Result": null + }, + "Description": "Time Window filter with a Start that has passed." + }, + { + "FeatureFlagName": "WillEndTimeWindow", + "Inputs": {}, + "IsEnabled": { + "Result": "true" + }, + "Variant": { + "Result": null + }, + "Description": "Time Window filter where the End hasn't passed." + } +] From f1cd2ea1602b6c7cb2fe74bf1c450b076627dfc2 Mon Sep 17 00:00:00 2001 From: Xiaolu Dai <31124698+saragluna@users.noreply.github.com> Date: Wed, 28 Aug 2024 14:28:14 +0800 Subject: [PATCH 064/128] Retrieve TokenCredential from ConfigurableBootstrapContext for env post processor (#41580) * get TokenCredential from ConfigurableBootstrapContext --------- Co-authored-by: Muyao Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> --- sdk/spring/CHANGELOG.md | 11 ++++- ...AzureTokenCredentialAutoConfiguration.java | 4 ++ .../KeyVaultEnvironmentPostProcessor.java | 32 ++++++++----- ...KeyVaultEnvironmentPostProcessorTests.java | 45 +++++++++++++++++-- ...ultSecretPropertySourceUserAgentTests.java | 3 +- ...tractAzureServiceClientBuilderFactory.java | 6 ++- 6 files changed, 82 insertions(+), 19 deletions(-) diff --git a/sdk/spring/CHANGELOG.md b/sdk/spring/CHANGELOG.md index 1bc4e48e28fe..5e7f5b03870b 100644 --- a/sdk/spring/CHANGELOG.md +++ b/sdk/spring/CHANGELOG.md @@ -1,7 +1,16 @@ # Release History -# (Unreleased) + +## 5.16.0-beta.1 (unreleased) + +#### Dependency Updates Upgrade Spring Boot dependencies version to 3.3.3 and Spring Cloud dependencies version to 2023.0.3 +### Spring Cloud Azure Autoconfigure +This section includes changes in `spring-cloud-azure-autoconfigure` module. + +#### Features Added +- Provide extension point to configure token credential for Key Vault property source [#41580](https://github.com/Azure/azure-sdk-for-java/pull/41580). + ## 5.15.0 (2024-08-07) - This release is compatible with Spring Boot 3.0.0-3.0.13, 3.1.0-3.1.12, 3.2.0-3.2.7, 3.3.0-3.3.2. (Note: 3.0.x (x>13), 3.1.y (y>12), 3.2.z (z>7) and 3.3.m (m>2) should be supported, but they aren't tested with this release.) - This release is compatible with Spring Cloud 2022.0.0-2022.0.5, 2023.0.0-2023.0.3. (Note: 2022.0.x (x>5) and 2023.0.y (y>3) should be supported, but they aren't tested with this release.) diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/context/AzureTokenCredentialAutoConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/context/AzureTokenCredentialAutoConfiguration.java index 6a1950c7d41c..c6a9ee8e2760 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/context/AzureTokenCredentialAutoConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/context/AzureTokenCredentialAutoConfiguration.java @@ -22,6 +22,8 @@ import com.azure.spring.cloud.core.implementation.factory.credential.ManagedIdentityCredentialBuilderFactory; import com.azure.spring.cloud.core.implementation.factory.credential.UsernamePasswordCredentialBuilderFactory; import com.azure.spring.cloud.core.provider.authentication.TokenCredentialOptionsProvider; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactoryAware; @@ -51,6 +53,7 @@ @Configuration(proxyBeanMethods = false) @AutoConfigureAfter(TaskExecutionAutoConfiguration.class) public class AzureTokenCredentialAutoConfiguration extends AzureServiceConfigurationBase { + private static final Logger LOGGER = LoggerFactory.getLogger(AzureTokenCredentialAutoConfiguration.class); private final IdentityClientProperties identityClientProperties; @@ -68,6 +71,7 @@ TokenCredential tokenCredential(DefaultAzureCredentialBuilderFactory factory, if (globalTokenCredential != null) { return globalTokenCredential; } else { + LOGGER.debug("No global token credential found, constructing default credential."); return factory.build().build(); } } diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/keyvault/environment/KeyVaultEnvironmentPostProcessor.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/keyvault/environment/KeyVaultEnvironmentPostProcessor.java index 9b8a54b8fdcb..8d2c3744a5ff 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/keyvault/environment/KeyVaultEnvironmentPostProcessor.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/keyvault/environment/KeyVaultEnvironmentPostProcessor.java @@ -3,20 +3,23 @@ package com.azure.spring.cloud.autoconfigure.implementation.keyvault.environment; +import com.azure.core.credential.TokenCredential; import com.azure.security.keyvault.secrets.SecretClient; import com.azure.spring.cloud.autoconfigure.implementation.context.properties.AzureGlobalProperties; import com.azure.spring.cloud.autoconfigure.implementation.keyvault.secrets.properties.AzureKeyVaultPropertySourceProperties; import com.azure.spring.cloud.autoconfigure.implementation.keyvault.secrets.properties.AzureKeyVaultSecretProperties; +import com.azure.spring.cloud.core.implementation.credential.resolver.AzureTokenCredentialResolver; import com.azure.spring.cloud.core.implementation.util.AzurePropertiesUtils; import com.azure.spring.cloud.core.implementation.util.AzureSpringIdentifier; import com.azure.spring.cloud.service.implementation.keyvault.secrets.SecretClientBuilderFactory; import org.apache.commons.logging.Log; +import org.springframework.boot.ConfigurableBootstrapContext; import org.springframework.boot.SpringApplication; import org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor; import org.springframework.boot.context.properties.bind.Bindable; import org.springframework.boot.context.properties.bind.Binder; import org.springframework.boot.env.EnvironmentPostProcessor; -import org.springframework.boot.logging.DeferredLog; +import org.springframework.boot.logging.DeferredLogFactory; import org.springframework.core.Ordered; import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.core.env.MutablePropertySources; @@ -44,21 +47,17 @@ public class KeyVaultEnvironmentPostProcessor implements EnvironmentPostProcesso private static final String SKIP_CONFIGURE_REASON_FORMAT = "Skip configuring Key Vault PropertySource because %s."; private final Log logger; + private final ConfigurableBootstrapContext bootstrapContext; /** * Creates a new instance of {@link KeyVaultEnvironmentPostProcessor}. - * @param logger The logger used in this class. + * @param loggerFactory The logger factory to get the logger. + * @param bootstrapContext The bootstrap context. */ - public KeyVaultEnvironmentPostProcessor(Log logger) { - this.logger = logger; - } - - /** - * Construct a {@link KeyVaultEnvironmentPostProcessor} instance with a new {@link DeferredLog}. - */ - public KeyVaultEnvironmentPostProcessor() { - this.logger = new DeferredLog(); + public KeyVaultEnvironmentPostProcessor(DeferredLogFactory loggerFactory, ConfigurableBootstrapContext bootstrapContext) { + this.logger = loggerFactory.getLog(getClass()); + this.bootstrapContext = bootstrapContext; } /** @@ -155,6 +154,17 @@ private AzureKeyVaultSecretProperties toAzureKeyVaultSecretProperties( SecretClient buildSecretClient(AzureKeyVaultSecretProperties secretProperties) { SecretClientBuilderFactory factory = new SecretClientBuilderFactory(secretProperties); factory.setSpringIdentifier(AzureSpringIdentifier.AZURE_SPRING_KEY_VAULT_SECRETS); + + if (bootstrapContext != null && bootstrapContext.isRegistered(TokenCredential.class)) { + // If TokenCredential is registered in bootstrap context, use it to build SecretClient. + // This will ignore the credential properties configured + TokenCredential registerCredential = bootstrapContext.get(TokenCredential.class); + logger.debug(registerCredential.getClass().getSimpleName() + " is registered in bootstrap context, use it to build SecretClient."); + factory.setTokenCredentialResolver( + new AzureTokenCredentialResolver(ignored -> registerCredential) + ); + } + return factory.build().buildClient(); } diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/keyvault/environment/KeyVaultEnvironmentPostProcessorTests.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/keyvault/environment/KeyVaultEnvironmentPostProcessorTests.java index 923d3aa3c5a5..2db4a7a93438 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/keyvault/environment/KeyVaultEnvironmentPostProcessorTests.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/keyvault/environment/KeyVaultEnvironmentPostProcessorTests.java @@ -3,6 +3,7 @@ package com.azure.spring.cloud.autoconfigure.implementation.keyvault.environment; +import com.azure.core.credential.TokenCredential; import com.azure.security.keyvault.secrets.SecretClient; import com.azure.spring.cloud.autoconfigure.implementation.keyvault.secrets.properties.AzureKeyVaultPropertySourceProperties; import com.azure.spring.cloud.autoconfigure.implementation.keyvault.secrets.properties.AzureKeyVaultSecretProperties; @@ -10,8 +11,9 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.mockito.MockedStatic; +import org.springframework.boot.ConfigurableBootstrapContext; import org.springframework.boot.SpringApplication; -import org.springframework.boot.logging.DeferredLog; +import org.springframework.boot.logging.DeferredLogs; import org.springframework.core.env.MutablePropertySources; import org.springframework.core.env.PropertySource; import org.springframework.core.env.SystemEnvironmentPropertySource; @@ -29,7 +31,11 @@ import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mockStatic; +import static org.mockito.Mockito.never; import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; import static org.springframework.core.env.StandardEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME; class KeyVaultEnvironmentPostProcessorTests { @@ -43,19 +49,50 @@ class KeyVaultEnvironmentPostProcessorTests { private KeyVaultEnvironmentPostProcessor processor; private MockEnvironment environment; private MutablePropertySources propertySources; + private ConfigurableBootstrapContext context; @BeforeEach void beforeEach() { - processor = spy(new KeyVaultEnvironmentPostProcessor(new DeferredLog())); + processor = spy(new KeyVaultEnvironmentPostProcessor(new DeferredLogs(), null)); environment = new MockEnvironment(); propertySources = environment.getPropertySources(); SecretClient secretClient = mock(SecretClient.class); doReturn(secretClient).when(processor).buildSecretClient(any(AzureKeyVaultSecretProperties.class)); } + @Test + void testContextRegisterWithTokenCredentialRegistered() { + context = mock(ConfigurableBootstrapContext.class); + TokenCredential tokenCredential = mock(TokenCredential.class); + when(context.get(TokenCredential.class)).thenReturn(tokenCredential); + when(context.isRegistered(TokenCredential.class)).thenReturn(true); + processor = spy(new KeyVaultEnvironmentPostProcessor(new DeferredLogs(), context)); + AzureKeyVaultSecretProperties secretProperties = new AzureKeyVaultSecretProperties(); + secretProperties.setEndpoint(ENDPOINT_0); + + processor.buildSecretClient(secretProperties); + + verify(context, times(1)).get(TokenCredential.class); + } + + @Test + void testContextRegisterWithoutTokenCredentialRegistered() { + context = mock(ConfigurableBootstrapContext.class); + TokenCredential tokenCredential = mock(TokenCredential.class); + when(context.get(TokenCredential.class)).thenReturn(tokenCredential); + when(context.isRegistered(TokenCredential.class)).thenReturn(false); + processor = spy(new KeyVaultEnvironmentPostProcessor(new DeferredLogs(), context)); + AzureKeyVaultSecretProperties secretProperties = new AzureKeyVaultSecretProperties(); + secretProperties.setEndpoint(ENDPOINT_0); + + processor.buildSecretClient(secretProperties); + + verify(context, never()).get(TokenCredential.class); + } + @Test void postProcessorHasConfiguredOrder() { - final KeyVaultEnvironmentPostProcessor processor = new KeyVaultEnvironmentPostProcessor(); + final KeyVaultEnvironmentPostProcessor processor = new KeyVaultEnvironmentPostProcessor(new DeferredLogs(), null); assertEquals(processor.getOrder(), KeyVaultEnvironmentPostProcessor.ORDER); } @@ -308,7 +345,7 @@ void buildKeyVaultPropertySourceWithExceptionTest() { environment.setProperty("spring.cloud.azure.keyvault.secret.property-sources[0].name", NAME_0); environment.setProperty("spring.cloud.azure.keyvault.secret.property-sources[0].endpoint", ENDPOINT_0); assertThrows(IllegalStateException.class, - () -> new KeyVaultEnvironmentPostProcessor().postProcessEnvironment(environment, application)); + () -> new KeyVaultEnvironmentPostProcessor(new DeferredLogs(), null).postProcessEnvironment(environment, application)); } } diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/keyvault/environment/KeyVaultSecretPropertySourceUserAgentTests.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/keyvault/environment/KeyVaultSecretPropertySourceUserAgentTests.java index decfc4a29478..94006e7ceae9 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/keyvault/environment/KeyVaultSecretPropertySourceUserAgentTests.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/keyvault/environment/KeyVaultSecretPropertySourceUserAgentTests.java @@ -11,6 +11,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.parallel.Isolated; +import org.springframework.boot.logging.DeferredLogs; import org.springframework.boot.test.system.CapturedOutput; import org.springframework.boot.test.system.OutputCaptureExtension; @@ -32,7 +33,7 @@ public void userAgentTest(CapturedOutput output) { properties.getRetry().getFixed().setDelay(Duration.ofSeconds(1)); properties.getRetry().getFixed().setMaxRetries(0); - KeyVaultEnvironmentPostProcessor environmentPostProcessor = new KeyVaultEnvironmentPostProcessor(); + KeyVaultEnvironmentPostProcessor environmentPostProcessor = new KeyVaultEnvironmentPostProcessor(new DeferredLogs(), null); SecretClient secretClient = environmentPostProcessor.buildSecretClient(properties); try { secretClient.getSecret("property-source-name1"); diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureServiceClientBuilderFactory.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureServiceClientBuilderFactory.java index 27423835fcc2..a2e8c565d8f2 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureServiceClientBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/implementation/factory/AbstractAzureServiceClientBuilderFactory.java @@ -200,6 +200,8 @@ protected void configureCredential(T builder) { () -> new IllegalArgumentException("Consumer should not be null")); + LOGGER.debug("Will configure the credential of type {} for {}.", azureCredential.getClass().getSimpleName(), + builder.getClass().getSimpleName()); consumer.accept(azureCredential); credentialConfigured = true; } @@ -244,8 +246,8 @@ protected void configureConnectionString(T builder) { */ protected void configureDefaultCredential(T builder) { if (!credentialConfigured) { - LOGGER.info("Will configure the default credential of type {} for {}.", - this.defaultTokenCredential.getClass().getSimpleName(), builder.getClass()); + LOGGER.debug("Will configure the default credential of type {} for {}.", + this.defaultTokenCredential.getClass().getSimpleName(), builder.getClass().getSimpleName()); consumeDefaultTokenCredential().accept(builder, this.defaultTokenCredential); } } From 74c418dbea8c81e589e88b21797edd97bcae4564 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 28 Aug 2024 02:39:04 -0700 Subject: [PATCH 065/128] [Automation] Generate SDK based on TypeSpec 0.20.0 (#41666) * [Automation] Generate SDK based on TypeSpec 0.20.0 * update assets.json * revert healthinsights changes --------- Co-authored-by: Haoling Dong --- eng/emitter-package-lock.json | 14 +- eng/emitter-package.json | 2 +- sdk/batch/azure-compute-batch/assets.json | 2 +- .../azure/compute/batch/BatchAsyncClient.java | 115 ++-- .../com/azure/compute/batch/BatchClient.java | 105 +++- .../batch/implementation/BatchClientImpl.java | 496 ++++++++++-------- ...zure-compute-batch_apiview_properties.json | 6 +- .../JobRouterAdministrationClientImpl.java | 80 +-- .../implementation/JobRouterClientImpl.java | 76 +-- ...nication-jobrouter_apiview_properties.json | 12 +- .../MessageTemplateClientImpl.java | 12 +- .../NotificationMessagesClientImpl.java | 28 +- ...unication-messages_apiview_properties.json | 12 +- .../computefleet/fluent/AzureFleetClient.java | 2 +- .../AzureFleetClientBuilder.java | 7 +- .../implementation/AzureFleetClientImpl.java | 6 +- .../implementation/FleetsClientImpl.java | 52 +- .../implementation/OperationsClientImpl.java | 8 +- .../contentsafety/BlocklistAsyncClient.java | 36 +- .../ai/contentsafety/BlocklistClient.java | 36 +- .../implementation/BlocklistClientImpl.java | 110 ++-- .../ContentSafetyClientImpl.java | 36 +- ...e-ai-contentsafety_apiview_properties.json | 12 +- .../DeploymentEnvironmentsClientImpl.java | 102 ++-- .../implementation/DevBoxesClientImpl.java | 142 +++-- .../implementation/DevCenterClientImpl.java | 16 +- ...eveloper-devcenter_apiview_properties.json | 18 +- .../fluent/DeviceRegistryClient.java | 2 +- .../AssetEndpointProfilesClientImpl.java | 49 +- .../implementation/AssetsClientImpl.java | 44 +- .../DeviceRegistryClientBuilder.java | 7 +- .../DeviceRegistryClientImpl.java | 6 +- .../OperationStatusClientImpl.java | 2 +- .../implementation/OperationsClientImpl.java | 8 +- .../fluent/DevOpsInfrastructureClient.java | 2 +- .../DevOpsInfrastructureClientBuilder.java | 7 +- .../DevOpsInfrastructureClientImpl.java | 6 +- .../ImageVersionsClientImpl.java | 8 +- .../implementation/OperationsClientImpl.java | 8 +- .../implementation/PoolsClientImpl.java | 41 +- .../ResourceDetailsClientImpl.java | 8 +- .../implementation/SkusClientImpl.java | 8 +- .../SubscriptionUsagesClientImpl.java | 8 +- .../azure-ai-documentintelligence/assets.json | 2 +- .../DocumentIntelligenceAsyncClient.java | 16 + .../DocumentIntelligenceClient.java | 16 + ...tIntelligenceAdministrationClientImpl.java | 188 ++++--- .../DocumentIntelligenceClientImpl.java | 142 ++++- ...cumentintelligence_apiview_properties.json | 12 +- .../easm/implementation/EasmClientImpl.java | 261 +++++---- ...tics-defender-easm_apiview_properties.json | 6 +- .../EventGridReceiverClientImpl.java | 52 +- .../EventGridSenderClientImpl.java | 8 +- ...entgrid-namespaces_apiview_properties.json | 12 +- .../azure/ai/vision/face/FaceAsyncClient.java | 4 +- .../com/azure/ai/vision/face/FaceClient.java | 4 +- .../face/implementation/FaceClientImpl.java | 67 ++- .../implementation/FaceSessionClientImpl.java | 70 +-- ...ure-ai-vision-face_apiview_properties.json | 12 +- .../DeidentificationAsyncClient.java | 9 +- .../DeidentificationClient.java | 8 +- .../DeidentificationClientImpl.java | 71 +-- ...h-deidentification_apiview_properties.json | 6 +- .../fluent/HealthDataAIServicesClient.java | 2 +- .../DeidServicesClientImpl.java | 46 +- .../HealthDataAIServicesClientBuilder.java | 7 +- .../HealthDataAIServicesClientImpl.java | 6 +- .../implementation/OperationsClientImpl.java | 8 +- .../PrivateEndpointConnectionsClientImpl.java | 21 +- .../PrivateLinksClientImpl.java | 8 +- .../mongocluster/fluent/DocumentDBClient.java | 2 +- .../DocumentDBClientBuilder.java | 7 +- .../implementation/DocumentDBClientImpl.java | 6 +- .../FirewallRulesClientImpl.java | 28 +- .../MongoClustersClientImpl.java | 64 ++- .../implementation/OperationsClientImpl.java | 8 +- .../PrivateEndpointConnectionsClientImpl.java | 21 +- .../PrivateLinksClientImpl.java | 8 +- .../implementation/AssistantsClientImpl.java | 340 ++++++------ sdk/openai/azure-ai-openai/assets.json | 2 +- .../implementation/OpenAIClientImpl.java | 108 ++-- .../azure-ai-openai_apiview_properties.json | 6 +- .../implementation/DiscoveriesImpl.java | 54 +- .../datamap/implementation/EntitiesImpl.java | 336 +++++++----- .../implementation/GlossariesImpl.java | 285 +++++----- .../datamap/implementation/LineagesImpl.java | 12 +- .../implementation/RelationshipsImpl.java | 36 +- .../implementation/TypeDefinitionsImpl.java | 125 +++-- ...cs-purview-datamap_apiview_properties.json | 2 +- .../standbypool/fluent/StandbyPoolClient.java | 2 +- .../implementation/OperationsClientImpl.java | 8 +- ...tainerGroupPoolRuntimeViewsClientImpl.java | 10 +- .../StandbyContainerGroupPoolsClientImpl.java | 44 +- .../StandbyPoolClientBuilder.java | 7 +- .../implementation/StandbyPoolClientImpl.java | 6 +- ...tualMachinePoolRuntimeViewsClientImpl.java | 10 +- .../StandbyVirtualMachinePoolsClientImpl.java | 44 +- .../StandbyVirtualMachinesClientImpl.java | 10 +- .../DocumentTranslationClientImpl.java | 55 +- .../SingleDocumentTranslationClientImpl.java | 8 +- ...anslation-document_apiview_properties.json | 12 +- .../TextTranslationClientImpl.java | 87 +-- 102 files changed, 2758 insertions(+), 1816 deletions(-) diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index c5794a34ad2d..45a18f407b3d 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -5,7 +5,7 @@ "packages": { "": { "dependencies": { - "@azure-tools/typespec-java": "0.19.3" + "@azure-tools/typespec-java": "0.20.0" }, "devDependencies": { "@azure-tools/typespec-autorest": "0.45.0", @@ -161,9 +161,9 @@ } }, "node_modules/@azure-tools/typespec-java": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-java/-/typespec-java-0.19.3.tgz", - "integrity": "sha512-MmRiOR6mVLrXVTbEEVT9u0jlGmtPJlOz56fcdrE1nEGCuuDUwVNHL+R1cUC1ozLrbw2yTxllEUYobfxUklKFJA==", + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-java/-/typespec-java-0.20.0.tgz", + "integrity": "sha512-U7jm9kp6w6uc/IoZFFcRcsiUeuoO+T9XWbGhVNXFvOGAX9//+4aaV+rK2xvIWAHa08hnGX9D14t3qRade6ymvQ==", "license": "MIT", "dependencies": { "@autorest/codemodel": "~4.20.0", @@ -692,9 +692,9 @@ } }, "node_modules/micromatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", - "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "license": "MIT", "dependencies": { "braces": "^3.0.3", diff --git a/eng/emitter-package.json b/eng/emitter-package.json index e04bb11a2ba7..a7b86596a0e2 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -1,7 +1,7 @@ { "main": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-java": "0.19.3" + "@azure-tools/typespec-java": "0.20.0" }, "devDependencies": { "@azure-tools/typespec-autorest": "0.45.0", diff --git a/sdk/batch/azure-compute-batch/assets.json b/sdk/batch/azure-compute-batch/assets.json index 2682b077ab00..98da5da699f4 100644 --- a/sdk/batch/azure-compute-batch/assets.json +++ b/sdk/batch/azure-compute-batch/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/batch/azure-compute-batch", - "Tag": "java/batch/azure-compute-batch_70c93036ed" + "Tag": "java/batch/azure-compute-batch_f58320abba" } diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/BatchAsyncClient.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/BatchAsyncClient.java index 1b30b8b19c22..c101beb2ae72 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/BatchAsyncClient.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/BatchAsyncClient.java @@ -3385,8 +3385,11 @@ PagedFlux listApplications(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return contains information about an application in an Azure Batch Account along with {@link Response} on - * successful completion of {@link Mono}. + * @return information about the specified Application. + * + * This operation returns only Applications and versions that are available for + * use on Compute Nodes; that is, that can be used in an Package reference along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -6518,8 +6521,11 @@ public Mono> enablePoolAutoScaleWithResponse(String poolId, Binar * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the results and errors from an execution of a Pool autoscale formula along with {@link Response} on - * successful completion of {@link Mono}. + * @return the result of evaluating an automatic scaling formula on the Pool. + * + * This API is primarily for validating an autoscale formula, as it simply returns + * the result without applying the formula to the Pool along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -13391,7 +13397,10 @@ PagedFlux listJobPreparationAndReleaseTaskStatus(String jobId, Reque * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the Task and TaskSlot counts for a Job along with {@link Response} on successful completion of + * @return the Task counts for the specified Job. + * + * Task counts provide a count of the Tasks by active, running or completed Task + * state, and a count of Tasks which succeeded or failed along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -20203,11 +20212,10 @@ public Mono> deleteTaskWithResponse(String jobId, String taskId, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return batch will retry Tasks when a recovery operation is triggered on a Node. - * Examples of recovery operations include (but are not limited to) when an - * unhealthy Node is rebooted or a Compute Node disappeared due to host failure. - * Retries due to recovery operations are independent of and are not counted - * against the maxTaskRetryCount along with {@link Response} on successful completion of {@link Mono}. + * @return information about the specified Task. + * + * For multi-instance Tasks, information such as affinityId, executionInfo and + * nodeInfo refer to the primary Task along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -22523,8 +22531,11 @@ public Mono> enableNodeSchedulingWithResponse(String poolId, Stri * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the remote login settings for a Compute Node along with {@link Response} on successful completion of - * {@link Mono}. + * @return the settings required for remote login to a Compute Node. + * + * Before you can remotely login to a Compute Node using the remote login + * settings, you must create a user Account on the Compute Node along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -23944,8 +23955,10 @@ PagedFlux listApplicationsInternal() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return contains information about an application in an Azure Batch Account on successful completion of - * {@link Mono}. + * @return information about the specified Application. + * + * This operation returns only Applications and versions that are available for + * use on Compute Nodes; that is, that can be used in an Package reference on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -23975,8 +23988,10 @@ Mono getApplicationInternal(String applicationId, Integer time * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return contains information about an application in an Azure Batch Account on successful completion of - * {@link Mono}. + * @return information about the specified Application. + * + * This operation returns only Applications and versions that are available for + * use on Compute Nodes; that is, that can be used in an Package reference on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -24921,7 +24936,10 @@ PagedFlux listJobPreparationAndReleaseT * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Task and TaskSlot counts for a Job on successful completion of {@link Mono}. + * @return the Task counts for the specified Job. + * + * Task counts provide a count of the Tasks by active, running or completed Task + * state, and a count of Tasks which succeeded or failed on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -24950,7 +24968,10 @@ Mono getJobTaskCountsInternal(String jobId, Integer timeO * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Task and TaskSlot counts for a Job on successful completion of {@link Mono}. + * @return the Task counts for the specified Job. + * + * Task counts provide a count of the Tasks by active, running or completed Task + * state, and a count of Tasks which succeeded or failed on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -25629,11 +25650,10 @@ Mono deleteTaskInternal(String jobId, String taskId) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return batch will retry Tasks when a recovery operation is triggered on a Node. - * Examples of recovery operations include (but are not limited to) when an - * unhealthy Node is rebooted or a Compute Node disappeared due to host failure. - * Retries due to recovery operations are independent of and are not counted - * against the maxTaskRetryCount on successful completion of {@link Mono}. + * @return information about the specified Task. + * + * For multi-instance Tasks, information such as affinityId, executionInfo and + * nodeInfo refer to the primary Task on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -25695,11 +25715,10 @@ Mono getTaskInternal(String jobId, String taskId, Integer timeOutInSe * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return batch will retry Tasks when a recovery operation is triggered on a Node. - * Examples of recovery operations include (but are not limited to) when an - * unhealthy Node is rebooted or a Compute Node disappeared due to host failure. - * Retries due to recovery operations are independent of and are not counted - * against the maxTaskRetryCount on successful completion of {@link Mono}. + * @return information about the specified Task. + * + * For multi-instance Tasks, information such as affinityId, executionInfo and + * nodeInfo refer to the primary Task on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -26435,7 +26454,10 @@ Mono enableNodeSchedulingInternal(String poolId, String nodeId) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the remote login settings for a Compute Node on successful completion of {@link Mono}. + * @return the settings required for remote login to a Compute Node. + * + * Before you can remotely login to a Compute Node using the remote login + * settings, you must create a user Account on the Compute Node on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -26465,7 +26487,10 @@ Mono getNodeRemoteLoginSettingsInternal(String poo * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the remote login settings for a Compute Node on successful completion of {@link Mono}. + * @return the settings required for remote login to a Compute Node. + * + * Before you can remotely login to a Compute Node using the remote login + * settings, you must create a user Account on the Compute Node on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -26852,6 +26877,8 @@ PagedFlux listNodeFilesInternal(String poolId, String nodeId) { * * * + * * *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: "application/json; + * odata=minimalmetadata".
If-Modified-SinceOffsetDateTimeNoA timestamp indicating the last modified time * of the resource known to the * client. The operation will be performed only if the resource on the service has @@ -27006,6 +27033,14 @@ public Mono> terminateJobWithResponse(String jobId, RequestOption * instead.".
* You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: "application/json; + * odata=minimalmetadata".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -27094,6 +27129,14 @@ public Mono> rebootNodeWithResponse(String poolId, String nodeId,
      * instead.".
      * 
      * You can add these to a request with {@link RequestOptions#addQueryParam}
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: "application/json; + * odata=minimalmetadata".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -28379,8 +28422,10 @@ Mono enablePoolAutoScaleInternal(String poolId, BatchPoolEnableAutoScaleCo
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
      * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
-     * @return the results and errors from an execution of a Pool autoscale formula on successful completion of
-     * {@link Mono}.
+     * @return the result of evaluating an automatic scaling formula on the Pool.
+     *
+     * This API is primarily for validating an autoscale formula, as it simply returns
+     * the result without applying the formula to the Pool on successful completion of {@link Mono}.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
@@ -28411,8 +28456,10 @@ Mono evaluatePoolAutoScaleInternal(String poolId, BatchPoolEvaluat
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
      * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
-     * @return the results and errors from an execution of a Pool autoscale formula on successful completion of
-     * {@link Mono}.
+     * @return the result of evaluating an automatic scaling formula on the Pool.
+     *
+     * This API is primarily for validating an autoscale formula, as it simply returns
+     * the result without applying the formula to the Pool on successful completion of {@link Mono}.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/BatchClient.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/BatchClient.java
index 1e6720ba9e5e..f3913a234d2f 100644
--- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/BatchClient.java
+++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/BatchClient.java
@@ -3233,7 +3233,10 @@ PagedIterable listApplications(RequestOptions requestOptions) {
      * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @return contains information about an application in an Azure Batch Account along with {@link Response}.
+     * @return information about the specified Application.
+     *
+     * This operation returns only Applications and versions that are available for
+     * use on Compute Nodes; that is, that can be used in an Package reference along with {@link Response}.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
@@ -6364,7 +6367,10 @@ public Response enablePoolAutoScaleWithResponse(String poolId, BinaryData
      * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @return the results and errors from an execution of a Pool autoscale formula along with {@link Response}.
+     * @return the result of evaluating an automatic scaling formula on the Pool.
+     *
+     * This API is primarily for validating an autoscale formula, as it simply returns
+     * the result without applying the formula to the Pool along with {@link Response}.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
@@ -13234,7 +13240,10 @@ PagedIterable listJobPreparationAndReleaseTaskStatus(String jobId, R
      * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @return the Task and TaskSlot counts for a Job along with {@link Response}.
+     * @return the Task counts for the specified Job.
+     *
+     * Task counts provide a count of the Tasks by active, running or completed Task
+     * state, and a count of Tasks which succeeded or failed along with {@link Response}.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
@@ -20038,11 +20047,10 @@ public Response deleteTaskWithResponse(String jobId, String taskId, Reques
      * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @return batch will retry Tasks when a recovery operation is triggered on a Node.
-     * Examples of recovery operations include (but are not limited to) when an
-     * unhealthy Node is rebooted or a Compute Node disappeared due to host failure.
-     * Retries due to recovery operations are independent of and are not counted
-     * against the maxTaskRetryCount along with {@link Response}.
+     * @return information about the specified Task.
+     *
+     * For multi-instance Tasks, information such as affinityId, executionInfo and
+     * nodeInfo refer to the primary Task along with {@link Response}.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
@@ -22351,7 +22359,10 @@ public Response enableNodeSchedulingWithResponse(String poolId, String nod
      * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @return the remote login settings for a Compute Node along with {@link Response}.
+     * @return the settings required for remote login to a Compute Node.
+     *
+     * Before you can remotely login to a Compute Node using the remote login
+     * settings, you must create a user Account on the Compute Node along with {@link Response}.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
@@ -23753,7 +23764,10 @@ PagedIterable listApplicationsInternal() {
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
      * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
-     * @return contains information about an application in an Azure Batch Account.
+     * @return information about the specified Application.
+     *
+     * This operation returns only Applications and versions that are available for
+     * use on Compute Nodes; that is, that can be used in an Package reference.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
@@ -23783,7 +23797,10 @@ BatchApplication getApplicationInternal(String applicationId, Integer timeOutInS
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
      * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
-     * @return contains information about an application in an Azure Batch Account.
+     * @return information about the specified Application.
+     *
+     * This operation returns only Applications and versions that are available for
+     * use on Compute Nodes; that is, that can be used in an Package reference.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
@@ -24632,7 +24649,10 @@ PagedIterable listJobsFromScheduleInternal(String jobScheduleId) {
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
      * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
-     * @return the Task and TaskSlot counts for a Job.
+     * @return the Task counts for the specified Job.
+     *
+     * Task counts provide a count of the Tasks by active, running or completed Task
+     * state, and a count of Tasks which succeeded or failed.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
@@ -24661,7 +24681,10 @@ BatchTaskCountsResult getJobTaskCountsInternal(String jobId, Integer timeOutInSe
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
      * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
-     * @return the Task and TaskSlot counts for a Job.
+     * @return the Task counts for the specified Job.
+     *
+     * Task counts provide a count of the Tasks by active, running or completed Task
+     * state, and a count of Tasks which succeeded or failed.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
@@ -25306,11 +25329,10 @@ void deleteTaskInternal(String jobId, String taskId) {
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
      * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
-     * @return batch will retry Tasks when a recovery operation is triggered on a Node.
-     * Examples of recovery operations include (but are not limited to) when an
-     * unhealthy Node is rebooted or a Compute Node disappeared due to host failure.
-     * Retries due to recovery operations are independent of and are not counted
-     * against the maxTaskRetryCount.
+     * @return information about the specified Task.
+     *
+     * For multi-instance Tasks, information such as affinityId, executionInfo and
+     * nodeInfo refer to the primary Task.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
@@ -25371,11 +25393,10 @@ BatchTask getTaskInternal(String jobId, String taskId, Integer timeOutInSeconds,
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
      * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
-     * @return batch will retry Tasks when a recovery operation is triggered on a Node.
-     * Examples of recovery operations include (but are not limited to) when an
-     * unhealthy Node is rebooted or a Compute Node disappeared due to host failure.
-     * Retries due to recovery operations are independent of and are not counted
-     * against the maxTaskRetryCount.
+     * @return information about the specified Task.
+     *
+     * For multi-instance Tasks, information such as affinityId, executionInfo and
+     * nodeInfo refer to the primary Task.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
@@ -26057,7 +26078,10 @@ void enableNodeSchedulingInternal(String poolId, String nodeId) {
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
      * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
-     * @return the remote login settings for a Compute Node.
+     * @return the settings required for remote login to a Compute Node.
+     *
+     * Before you can remotely login to a Compute Node using the remote login
+     * settings, you must create a user Account on the Compute Node.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
@@ -26087,7 +26111,10 @@ BatchNodeRemoteLoginSettings getNodeRemoteLoginSettingsInternal(String poolId, S
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
      * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
-     * @return the remote login settings for a Compute Node.
+     * @return the settings required for remote login to a Compute Node.
+     *
+     * Before you can remotely login to a Compute Node using the remote login
+     * settings, you must create a user Account on the Compute Node.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
@@ -26433,6 +26460,8 @@ PagedIterable listNodeFilesInternal(String poolId, String nodeId)
      * 
      * 
      * 
+     * 
      * 
      * 
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: "application/json; + * odata=minimalmetadata".
If-Modified-SinceOffsetDateTimeNoA timestamp indicating the last modified time * of the resource known to the * client. The operation will be performed only if the resource on the service has @@ -26587,6 +26616,14 @@ public Response terminateJobWithResponse(String jobId, RequestOptions requ * instead.".
* You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: "application/json; + * odata=minimalmetadata".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -26675,6 +26712,14 @@ public Response rebootNodeWithResponse(String poolId, String nodeId, Reque
      * instead.".
      * 
      * You can add these to a request with {@link RequestOptions#addQueryParam}
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: "application/json; + * odata=minimalmetadata".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -27792,7 +27837,10 @@ void enablePoolAutoScaleInternal(String poolId, BatchPoolEnableAutoScaleContent
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
      * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
-     * @return the results and errors from an execution of a Pool autoscale formula.
+     * @return the result of evaluating an automatic scaling formula on the Pool.
+     *
+     * This API is primarily for validating an autoscale formula, as it simply returns
+     * the result without applying the formula to the Pool.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
@@ -27823,7 +27871,10 @@ AutoScaleRun evaluatePoolAutoScaleInternal(String poolId, BatchPoolEvaluateAutoS
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
      * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
-     * @return the results and errors from an execution of a Pool autoscale formula.
+     * @return the result of evaluating an automatic scaling formula on the Pool.
+     *
+     * This API is primarily for validating an autoscale formula, as it simply returns
+     * the result without applying the formula to the Pool.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/implementation/BatchClientImpl.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/implementation/BatchClientImpl.java
index 54e0962c9c3f..0bdf474956b0 100644
--- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/implementation/BatchClientImpl.java
+++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/implementation/BatchClientImpl.java
@@ -166,7 +166,7 @@ public interface BatchClientService {
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listApplicationsInternal(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Get("/applications")
@@ -176,7 +176,7 @@ Mono> listApplicationsInternal(@HostParam("endpoint") Strin
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listApplicationsInternalSync(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Get("/applications/{applicationId}")
@@ -187,7 +187,7 @@ Response listApplicationsInternalSync(@HostParam("endpoint") String
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getApplicationInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("applicationId") String applicationId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/applications/{applicationId}")
         @ExpectedResponses({ 200 })
@@ -197,7 +197,7 @@ Mono> getApplicationInternal(@HostParam("endpoint") String
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response getApplicationInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("applicationId") String applicationId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/poolusagemetrics")
         @ExpectedResponses({ 200 })
@@ -206,7 +206,7 @@ Response getApplicationInternalSync(@HostParam("endpoint") String en
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listPoolUsageMetricsInternal(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Get("/poolusagemetrics")
@@ -216,7 +216,7 @@ Mono> listPoolUsageMetricsInternal(@HostParam("endpoint") S
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listPoolUsageMetricsInternalSync(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Post("/pools")
@@ -227,7 +227,7 @@ Response listPoolUsageMetricsInternalSync(@HostParam("endpoint") Str
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> createPoolInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @HeaderParam("accept") String accept, @BodyParam("application/json; odata=minimalmetadata") BinaryData pool,
+            @HeaderParam("Accept") String accept, @BodyParam("application/json; odata=minimalmetadata") BinaryData pool,
             RequestOptions requestOptions, Context context);
 
         @Post("/pools")
@@ -238,7 +238,7 @@ Mono> createPoolInternal(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response createPoolInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @HeaderParam("accept") String accept, @BodyParam("application/json; odata=minimalmetadata") BinaryData pool,
+            @HeaderParam("Accept") String accept, @BodyParam("application/json; odata=minimalmetadata") BinaryData pool,
             RequestOptions requestOptions, Context context);
 
         @Get("/pools")
@@ -248,7 +248,7 @@ Response createPoolInternalSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listPoolsInternal(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Get("/pools")
@@ -258,7 +258,7 @@ Mono> listPoolsInternal(@HostParam("endpoint") String endpo
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listPoolsInternalSync(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Delete("/pools/{poolId}")
@@ -269,7 +269,7 @@ Response listPoolsInternalSync(@HostParam("endpoint") String endpoin
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> deletePoolInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Delete("/pools/{poolId}")
         @ExpectedResponses({ 202 })
@@ -279,7 +279,7 @@ Mono> deletePoolInternal(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response deletePoolInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Head("/pools/{poolId}")
         @ExpectedResponses({ 200, 404 })
@@ -288,7 +288,7 @@ Response deletePoolInternalSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> poolExistsInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Head("/pools/{poolId}")
         @ExpectedResponses({ 200, 404 })
@@ -297,7 +297,7 @@ Mono> poolExistsInternal(@HostParam("endpoint") String endpoin
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response poolExistsInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/pools/{poolId}")
         @ExpectedResponses({ 200 })
@@ -307,7 +307,7 @@ Response poolExistsInternalSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getPoolInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/pools/{poolId}")
         @ExpectedResponses({ 200 })
@@ -317,7 +317,7 @@ Mono> getPoolInternal(@HostParam("endpoint") String endpoin
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response getPoolInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Patch("/pools/{poolId}")
         @ExpectedResponses({ 200 })
@@ -327,7 +327,7 @@ Response getPoolInternalSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> updatePoolInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @PathParam("poolId") String poolId, @HeaderParam("accept") String accept,
+            @PathParam("poolId") String poolId, @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData pool, RequestOptions requestOptions,
             Context context);
 
@@ -339,7 +339,7 @@ Mono> updatePoolInternal(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response updatePoolInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @PathParam("poolId") String poolId, @HeaderParam("accept") String accept,
+            @PathParam("poolId") String poolId, @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData pool, RequestOptions requestOptions,
             Context context);
 
@@ -351,7 +351,7 @@ Response updatePoolInternalSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> disablePoolAutoScaleInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Post("/pools/{poolId}/disableautoscale")
         @ExpectedResponses({ 200 })
@@ -361,7 +361,7 @@ Mono> disablePoolAutoScaleInternal(@HostParam("endpoint") String
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response disablePoolAutoScaleInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Post("/pools/{poolId}/enableautoscale")
         @ExpectedResponses({ 200 })
@@ -371,7 +371,7 @@ Response disablePoolAutoScaleInternalSync(@HostParam("endpoint") String en
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> enablePoolAutoScaleInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
-            @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept,
+            @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData content, RequestOptions requestOptions,
             Context context);
 
@@ -383,7 +383,7 @@ Mono> enablePoolAutoScaleInternal(@HostParam("endpoint") String e
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response enablePoolAutoScaleInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
-            @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept,
+            @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData content, RequestOptions requestOptions,
             Context context);
 
@@ -395,7 +395,7 @@ Response enablePoolAutoScaleInternalSync(@HostParam("endpoint") String end
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> evaluatePoolAutoScaleInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @PathParam("poolId") String poolId, @HeaderParam("accept") String accept,
+            @PathParam("poolId") String poolId, @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData content, RequestOptions requestOptions,
             Context context);
 
@@ -407,7 +407,7 @@ Mono> evaluatePoolAutoScaleInternal(@HostParam("endpoint")
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response evaluatePoolAutoScaleInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @PathParam("poolId") String poolId, @HeaderParam("accept") String accept,
+            @PathParam("poolId") String poolId, @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData content, RequestOptions requestOptions,
             Context context);
 
@@ -419,7 +419,7 @@ Response evaluatePoolAutoScaleInternalSync(@HostParam("endpoint") St
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> resizePoolInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
-            @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept,
+            @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData content, RequestOptions requestOptions,
             Context context);
 
@@ -431,7 +431,7 @@ Mono> resizePoolInternal(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response resizePoolInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
-            @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept,
+            @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData content, RequestOptions requestOptions,
             Context context);
 
@@ -443,7 +443,7 @@ Response resizePoolInternalSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> stopPoolResizeInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Post("/pools/{poolId}/stopresize")
         @ExpectedResponses({ 202 })
@@ -453,7 +453,7 @@ Mono> stopPoolResizeInternal(@HostParam("endpoint") String endpoi
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response stopPoolResizeInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Post("/pools/{poolId}/updateproperties")
         @ExpectedResponses({ 204 })
@@ -463,7 +463,7 @@ Response stopPoolResizeInternalSync(@HostParam("endpoint") String endpoint
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> replacePoolPropertiesInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @PathParam("poolId") String poolId, @HeaderParam("accept") String accept,
+            @PathParam("poolId") String poolId, @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData pool, RequestOptions requestOptions,
             Context context);
 
@@ -475,7 +475,7 @@ Mono> replacePoolPropertiesInternal(@HostParam("endpoint") String
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response replacePoolPropertiesInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @PathParam("poolId") String poolId, @HeaderParam("accept") String accept,
+            @PathParam("poolId") String poolId, @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData pool, RequestOptions requestOptions,
             Context context);
 
@@ -487,7 +487,7 @@ Response replacePoolPropertiesInternalSync(@HostParam("endpoint") String e
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> removeNodesInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
-            @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept,
+            @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData content, RequestOptions requestOptions,
             Context context);
 
@@ -499,7 +499,7 @@ Mono> removeNodesInternal(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response removeNodesInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
-            @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept,
+            @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData content, RequestOptions requestOptions,
             Context context);
 
@@ -510,7 +510,7 @@ Response removeNodesInternalSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listSupportedImagesInternal(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Get("/supportedimages")
@@ -520,7 +520,7 @@ Mono> listSupportedImagesInternal(@HostParam("endpoint") St
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listSupportedImagesInternalSync(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Get("/nodecounts")
@@ -530,7 +530,7 @@ Response listSupportedImagesInternalSync(@HostParam("endpoint") Stri
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listPoolNodeCountsInternal(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Get("/nodecounts")
@@ -540,7 +540,7 @@ Mono> listPoolNodeCountsInternal(@HostParam("endpoint") Str
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listPoolNodeCountsInternalSync(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Delete("/jobs/{jobId}")
@@ -551,7 +551,7 @@ Response listPoolNodeCountsInternalSync(@HostParam("endpoint") Strin
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> deleteJobInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Delete("/jobs/{jobId}")
         @ExpectedResponses({ 202 })
@@ -561,7 +561,7 @@ Mono> deleteJobInternal(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response deleteJobInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/jobs/{jobId}")
         @ExpectedResponses({ 200 })
@@ -571,7 +571,7 @@ Response deleteJobInternalSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getJobInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/jobs/{jobId}")
         @ExpectedResponses({ 200 })
@@ -581,7 +581,7 @@ Mono> getJobInternal(@HostParam("endpoint") String endpoint
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response getJobInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Patch("/jobs/{jobId}")
         @ExpectedResponses({ 200 })
@@ -591,7 +591,7 @@ Response getJobInternalSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> updateJobInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @PathParam("jobId") String jobId, @HeaderParam("accept") String accept,
+            @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData job, RequestOptions requestOptions,
             Context context);
 
@@ -603,7 +603,7 @@ Mono> updateJobInternal(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response updateJobInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @PathParam("jobId") String jobId, @HeaderParam("accept") String accept,
+            @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData job, RequestOptions requestOptions,
             Context context);
 
@@ -615,7 +615,7 @@ Response updateJobInternalSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> replaceJobInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @PathParam("jobId") String jobId, @HeaderParam("accept") String accept,
+            @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData job, RequestOptions requestOptions,
             Context context);
 
@@ -627,7 +627,7 @@ Mono> replaceJobInternal(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response replaceJobInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @PathParam("jobId") String jobId, @HeaderParam("accept") String accept,
+            @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData job, RequestOptions requestOptions,
             Context context);
 
@@ -639,7 +639,7 @@ Response replaceJobInternalSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> disableJobInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @PathParam("jobId") String jobId, @HeaderParam("accept") String accept,
+            @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData content, RequestOptions requestOptions,
             Context context);
 
@@ -651,7 +651,7 @@ Mono> disableJobInternal(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response disableJobInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @PathParam("jobId") String jobId, @HeaderParam("accept") String accept,
+            @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData content, RequestOptions requestOptions,
             Context context);
 
@@ -663,7 +663,7 @@ Response disableJobInternalSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> enableJobInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Post("/jobs/{jobId}/enable")
         @ExpectedResponses({ 202 })
@@ -673,7 +673,7 @@ Mono> enableJobInternal(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response enableJobInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Post("/jobs/{jobId}/terminate")
         @ExpectedResponses({ 202 })
@@ -682,9 +682,8 @@ Response enableJobInternalSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> terminateJobInternal(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @PathParam("jobId") String jobId, @HeaderParam("accept") String accept, RequestOptions requestOptions,
-            Context context);
+            @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Post("/jobs/{jobId}/terminate")
         @ExpectedResponses({ 202 })
@@ -693,9 +692,8 @@ Mono> terminateJobInternal(@HostParam("endpoint") String endpoint
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response terminateJobInternalSync(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @PathParam("jobId") String jobId, @HeaderParam("accept") String accept, RequestOptions requestOptions,
-            Context context);
+            @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Post("/jobs")
         @ExpectedResponses({ 201 })
@@ -705,7 +703,7 @@ Response terminateJobInternalSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> createJobInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @HeaderParam("accept") String accept, @BodyParam("application/json; odata=minimalmetadata") BinaryData job,
+            @HeaderParam("Accept") String accept, @BodyParam("application/json; odata=minimalmetadata") BinaryData job,
             RequestOptions requestOptions, Context context);
 
         @Post("/jobs")
@@ -716,7 +714,7 @@ Mono> createJobInternal(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response createJobInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @HeaderParam("accept") String accept, @BodyParam("application/json; odata=minimalmetadata") BinaryData job,
+            @HeaderParam("Accept") String accept, @BodyParam("application/json; odata=minimalmetadata") BinaryData job,
             RequestOptions requestOptions, Context context);
 
         @Get("/jobs")
@@ -726,7 +724,7 @@ Response createJobInternalSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listJobsInternal(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Get("/jobs")
@@ -736,7 +734,7 @@ Mono> listJobsInternal(@HostParam("endpoint") String endpoi
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listJobsInternalSync(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Get("/jobschedules/{jobScheduleId}/jobs")
@@ -747,7 +745,7 @@ Response listJobsInternalSync(@HostParam("endpoint") String endpoint
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listJobsFromScheduleInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobScheduleId") String jobScheduleId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/jobschedules/{jobScheduleId}/jobs")
         @ExpectedResponses({ 200 })
@@ -757,7 +755,7 @@ Mono> listJobsFromScheduleInternal(@HostParam("endpoint") S
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listJobsFromScheduleInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobScheduleId") String jobScheduleId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/jobs/{jobId}/jobpreparationandreleasetaskstatus")
         @ExpectedResponses({ 200 })
@@ -767,7 +765,7 @@ Response listJobsFromScheduleInternalSync(@HostParam("endpoint") Str
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listJobPreparationAndReleaseTaskStatusInternal(
             @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion,
-            @PathParam("jobId") String jobId, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("/jobs/{jobId}/jobpreparationandreleasetaskstatus")
@@ -778,7 +776,7 @@ Mono> listJobPreparationAndReleaseTaskStatusInternal(
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listJobPreparationAndReleaseTaskStatusInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/jobs/{jobId}/taskcounts")
         @ExpectedResponses({ 200 })
@@ -788,7 +786,7 @@ Response listJobPreparationAndReleaseTaskStatusInternalSync(@HostPar
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getJobTaskCountsInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/jobs/{jobId}/taskcounts")
         @ExpectedResponses({ 200 })
@@ -798,7 +796,7 @@ Mono> getJobTaskCountsInternal(@HostParam("endpoint") Strin
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response getJobTaskCountsInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Head("/jobschedules/{jobScheduleId}")
         @ExpectedResponses({ 200, 404 })
@@ -807,7 +805,7 @@ Response getJobTaskCountsInternalSync(@HostParam("endpoint") String
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> jobScheduleExistsInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobScheduleId") String jobScheduleId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Head("/jobschedules/{jobScheduleId}")
         @ExpectedResponses({ 200, 404 })
@@ -816,7 +814,7 @@ Mono> jobScheduleExistsInternal(@HostParam("endpoint") String
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response jobScheduleExistsInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobScheduleId") String jobScheduleId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Delete("/jobschedules/{jobScheduleId}")
         @ExpectedResponses({ 202 })
@@ -826,7 +824,7 @@ Response jobScheduleExistsInternalSync(@HostParam("endpoint") String en
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> deleteJobScheduleInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobScheduleId") String jobScheduleId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Delete("/jobschedules/{jobScheduleId}")
         @ExpectedResponses({ 202 })
@@ -836,7 +834,7 @@ Mono> deleteJobScheduleInternal(@HostParam("endpoint") String end
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response deleteJobScheduleInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobScheduleId") String jobScheduleId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/jobschedules/{jobScheduleId}")
         @ExpectedResponses({ 200 })
@@ -846,7 +844,7 @@ Response deleteJobScheduleInternalSync(@HostParam("endpoint") String endpo
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getJobScheduleInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobScheduleId") String jobScheduleId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/jobschedules/{jobScheduleId}")
         @ExpectedResponses({ 200 })
@@ -856,7 +854,7 @@ Mono> getJobScheduleInternal(@HostParam("endpoint") String
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response getJobScheduleInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobScheduleId") String jobScheduleId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Patch("/jobschedules/{jobScheduleId}")
         @ExpectedResponses({ 200 })
@@ -866,7 +864,7 @@ Response getJobScheduleInternalSync(@HostParam("endpoint") String en
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> updateJobScheduleInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @PathParam("jobScheduleId") String jobScheduleId, @HeaderParam("accept") String accept,
+            @PathParam("jobScheduleId") String jobScheduleId, @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData jobSchedule, RequestOptions requestOptions,
             Context context);
 
@@ -878,7 +876,7 @@ Mono> updateJobScheduleInternal(@HostParam("endpoint") String end
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response updateJobScheduleInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @PathParam("jobScheduleId") String jobScheduleId, @HeaderParam("accept") String accept,
+            @PathParam("jobScheduleId") String jobScheduleId, @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData jobSchedule, RequestOptions requestOptions,
             Context context);
 
@@ -890,7 +888,7 @@ Response updateJobScheduleInternalSync(@HostParam("endpoint") String endpo
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> replaceJobScheduleInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @PathParam("jobScheduleId") String jobScheduleId, @HeaderParam("accept") String accept,
+            @PathParam("jobScheduleId") String jobScheduleId, @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData jobSchedule, RequestOptions requestOptions,
             Context context);
 
@@ -902,7 +900,7 @@ Mono> replaceJobScheduleInternal(@HostParam("endpoint") String en
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response replaceJobScheduleInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @PathParam("jobScheduleId") String jobScheduleId, @HeaderParam("accept") String accept,
+            @PathParam("jobScheduleId") String jobScheduleId, @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData jobSchedule, RequestOptions requestOptions,
             Context context);
 
@@ -914,7 +912,7 @@ Response replaceJobScheduleInternalSync(@HostParam("endpoint") String endp
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> disableJobScheduleInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobScheduleId") String jobScheduleId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Post("/jobschedules/{jobScheduleId}/disable")
         @ExpectedResponses({ 204 })
@@ -924,7 +922,7 @@ Mono> disableJobScheduleInternal(@HostParam("endpoint") String en
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response disableJobScheduleInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobScheduleId") String jobScheduleId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Post("/jobschedules/{jobScheduleId}/enable")
         @ExpectedResponses({ 204 })
@@ -934,7 +932,7 @@ Response disableJobScheduleInternalSync(@HostParam("endpoint") String endp
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> enableJobScheduleInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobScheduleId") String jobScheduleId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Post("/jobschedules/{jobScheduleId}/enable")
         @ExpectedResponses({ 204 })
@@ -944,7 +942,7 @@ Mono> enableJobScheduleInternal(@HostParam("endpoint") String end
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response enableJobScheduleInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobScheduleId") String jobScheduleId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Post("/jobschedules/{jobScheduleId}/terminate")
         @ExpectedResponses({ 202 })
@@ -954,7 +952,7 @@ Response enableJobScheduleInternalSync(@HostParam("endpoint") String endpo
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> terminateJobScheduleInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobScheduleId") String jobScheduleId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Post("/jobschedules/{jobScheduleId}/terminate")
         @ExpectedResponses({ 202 })
@@ -964,7 +962,7 @@ Mono> terminateJobScheduleInternal(@HostParam("endpoint") String
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response terminateJobScheduleInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobScheduleId") String jobScheduleId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Post("/jobschedules")
         @ExpectedResponses({ 201 })
@@ -974,7 +972,7 @@ Response terminateJobScheduleInternalSync(@HostParam("endpoint") String en
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> createJobScheduleInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @HeaderParam("accept") String accept,
+            @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData jobSchedule, RequestOptions requestOptions,
             Context context);
 
@@ -986,7 +984,7 @@ Mono> createJobScheduleInternal(@HostParam("endpoint") String end
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response createJobScheduleInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @HeaderParam("accept") String accept,
+            @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData jobSchedule, RequestOptions requestOptions,
             Context context);
 
@@ -997,7 +995,7 @@ Response createJobScheduleInternalSync(@HostParam("endpoint") String endpo
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listJobSchedulesInternal(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Get("/jobschedules")
@@ -1007,7 +1005,7 @@ Mono> listJobSchedulesInternal(@HostParam("endpoint") Strin
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listJobSchedulesInternalSync(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Post("/jobs/{jobId}/tasks")
@@ -1018,7 +1016,7 @@ Response listJobSchedulesInternalSync(@HostParam("endpoint") String
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> createTaskInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @PathParam("jobId") String jobId, @HeaderParam("accept") String accept,
+            @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData task, RequestOptions requestOptions,
             Context context);
 
@@ -1030,7 +1028,7 @@ Mono> createTaskInternal(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response createTaskInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @PathParam("jobId") String jobId, @HeaderParam("accept") String accept,
+            @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData task, RequestOptions requestOptions,
             Context context);
 
@@ -1042,7 +1040,7 @@ Response createTaskInternalSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listTasksInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/jobs/{jobId}/tasks")
         @ExpectedResponses({ 200 })
@@ -1052,7 +1050,7 @@ Mono> listTasksInternal(@HostParam("endpoint") String endpo
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listTasksInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Post("/jobs/{jobId}/addtaskcollection")
         @ExpectedResponses({ 200 })
@@ -1062,7 +1060,7 @@ Response listTasksInternalSync(@HostParam("endpoint") String endpoin
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> createTaskCollectionInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @PathParam("jobId") String jobId, @HeaderParam("accept") String accept,
+            @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData taskCollection,
             RequestOptions requestOptions, Context context);
 
@@ -1074,7 +1072,7 @@ Mono> createTaskCollectionInternal(@HostParam("endpoint") S
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response createTaskCollectionInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @PathParam("jobId") String jobId, @HeaderParam("accept") String accept,
+            @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData taskCollection,
             RequestOptions requestOptions, Context context);
 
@@ -1086,7 +1084,7 @@ Response createTaskCollectionInternalSync(@HostParam("endpoint") Str
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> deleteTaskInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
-            @PathParam("taskId") String taskId, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @PathParam("taskId") String taskId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Delete("/jobs/{jobId}/tasks/{taskId}")
@@ -1097,7 +1095,7 @@ Mono> deleteTaskInternal(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response deleteTaskInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
-            @PathParam("taskId") String taskId, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @PathParam("taskId") String taskId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("/jobs/{jobId}/tasks/{taskId}")
@@ -1108,7 +1106,7 @@ Response deleteTaskInternalSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getTaskInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
-            @PathParam("taskId") String taskId, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @PathParam("taskId") String taskId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("/jobs/{jobId}/tasks/{taskId}")
@@ -1119,7 +1117,7 @@ Mono> getTaskInternal(@HostParam("endpoint") String endpoin
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response getTaskInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
-            @PathParam("taskId") String taskId, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @PathParam("taskId") String taskId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Put("/jobs/{jobId}/tasks/{taskId}")
@@ -1130,7 +1128,7 @@ Response getTaskInternalSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> replaceTaskInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @PathParam("jobId") String jobId, @PathParam("taskId") String taskId, @HeaderParam("accept") String accept,
+            @PathParam("jobId") String jobId, @PathParam("taskId") String taskId, @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData task, RequestOptions requestOptions,
             Context context);
 
@@ -1142,7 +1140,7 @@ Mono> replaceTaskInternal(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response replaceTaskInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @PathParam("jobId") String jobId, @PathParam("taskId") String taskId, @HeaderParam("accept") String accept,
+            @PathParam("jobId") String jobId, @PathParam("taskId") String taskId, @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData task, RequestOptions requestOptions,
             Context context);
 
@@ -1154,7 +1152,7 @@ Response replaceTaskInternalSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listSubTasksInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
-            @PathParam("taskId") String taskId, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @PathParam("taskId") String taskId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("/jobs/{jobId}/tasks/{taskId}/subtasksinfo")
@@ -1165,7 +1163,7 @@ Mono> listSubTasksInternal(@HostParam("endpoint") String en
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listSubTasksInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
-            @PathParam("taskId") String taskId, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @PathParam("taskId") String taskId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Post("/jobs/{jobId}/tasks/{taskId}/terminate")
@@ -1176,7 +1174,7 @@ Response listSubTasksInternalSync(@HostParam("endpoint") String endp
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> terminateTaskInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
-            @PathParam("taskId") String taskId, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @PathParam("taskId") String taskId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Post("/jobs/{jobId}/tasks/{taskId}/terminate")
@@ -1187,7 +1185,7 @@ Mono> terminateTaskInternal(@HostParam("endpoint") String endpoin
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response terminateTaskInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
-            @PathParam("taskId") String taskId, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @PathParam("taskId") String taskId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Post("/jobs/{jobId}/tasks/{taskId}/reactivate")
@@ -1198,7 +1196,7 @@ Response terminateTaskInternalSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> reactivateTaskInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
-            @PathParam("taskId") String taskId, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @PathParam("taskId") String taskId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Post("/jobs/{jobId}/tasks/{taskId}/reactivate")
@@ -1209,7 +1207,7 @@ Mono> reactivateTaskInternal(@HostParam("endpoint") String endpoi
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response reactivateTaskInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
-            @PathParam("taskId") String taskId, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @PathParam("taskId") String taskId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Delete("/jobs/{jobId}/tasks/{taskId}/files/{filePath}")
@@ -1221,7 +1219,7 @@ Response reactivateTaskInternalSync(@HostParam("endpoint") String endpoint
         Mono> deleteTaskFileInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
             @PathParam("taskId") String taskId, @PathParam("filePath") String filePath,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Delete("/jobs/{jobId}/tasks/{taskId}/files/{filePath}")
         @ExpectedResponses({ 200 })
@@ -1232,7 +1230,7 @@ Mono> deleteTaskFileInternal(@HostParam("endpoint") String endpoi
         Response deleteTaskFileInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
             @PathParam("taskId") String taskId, @PathParam("filePath") String filePath,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/jobs/{jobId}/tasks/{taskId}/files/{filePath}")
         @ExpectedResponses({ 200 })
@@ -1243,7 +1241,7 @@ Response deleteTaskFileInternalSync(@HostParam("endpoint") String endpoint
         Mono> getTaskFileInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
             @PathParam("taskId") String taskId, @PathParam("filePath") String filePath,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/jobs/{jobId}/tasks/{taskId}/files/{filePath}")
         @ExpectedResponses({ 200 })
@@ -1254,7 +1252,7 @@ Mono> getTaskFileInternal(@HostParam("endpoint") String end
         Response getTaskFileInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
             @PathParam("taskId") String taskId, @PathParam("filePath") String filePath,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Head("/jobs/{jobId}/tasks/{taskId}/files/{filePath}")
         @ExpectedResponses({ 200 })
@@ -1265,7 +1263,7 @@ Response getTaskFileInternalSync(@HostParam("endpoint") String endpo
         Mono> getTaskFilePropertiesInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
             @PathParam("taskId") String taskId, @PathParam("filePath") String filePath,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Head("/jobs/{jobId}/tasks/{taskId}/files/{filePath}")
         @ExpectedResponses({ 200 })
@@ -1276,7 +1274,7 @@ Mono> getTaskFilePropertiesInternal(@HostParam("endpoint") String
         Response getTaskFilePropertiesInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
             @PathParam("taskId") String taskId, @PathParam("filePath") String filePath,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/jobs/{jobId}/tasks/{taskId}/files")
         @ExpectedResponses({ 200 })
@@ -1286,7 +1284,7 @@ Response getTaskFilePropertiesInternalSync(@HostParam("endpoint") String e
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listTaskFilesInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
-            @PathParam("taskId") String taskId, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @PathParam("taskId") String taskId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("/jobs/{jobId}/tasks/{taskId}/files")
@@ -1297,7 +1295,7 @@ Mono> listTaskFilesInternal(@HostParam("endpoint") String e
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listTaskFilesInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId,
-            @PathParam("taskId") String taskId, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @PathParam("taskId") String taskId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Post("/pools/{poolId}/nodes/{nodeId}/users")
@@ -1309,7 +1307,7 @@ Response listTaskFilesInternalSync(@HostParam("endpoint") String end
         Mono> createNodeUserInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
             @PathParam("poolId") String poolId, @PathParam("nodeId") String nodeId,
-            @HeaderParam("accept") String accept, @BodyParam("application/json; odata=minimalmetadata") BinaryData user,
+            @HeaderParam("Accept") String accept, @BodyParam("application/json; odata=minimalmetadata") BinaryData user,
             RequestOptions requestOptions, Context context);
 
         @Post("/pools/{poolId}/nodes/{nodeId}/users")
@@ -1321,7 +1319,7 @@ Mono> createNodeUserInternal(@HostParam("endpoint") String endpoi
         Response createNodeUserInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
             @PathParam("poolId") String poolId, @PathParam("nodeId") String nodeId,
-            @HeaderParam("accept") String accept, @BodyParam("application/json; odata=minimalmetadata") BinaryData user,
+            @HeaderParam("Accept") String accept, @BodyParam("application/json; odata=minimalmetadata") BinaryData user,
             RequestOptions requestOptions, Context context);
 
         @Delete("/pools/{poolId}/nodes/{nodeId}/users/{userName}")
@@ -1333,7 +1331,7 @@ Response createNodeUserInternalSync(@HostParam("endpoint") String endpoint
         Mono> deleteNodeUserInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
             @PathParam("nodeId") String nodeId, @PathParam("userName") String userName,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Delete("/pools/{poolId}/nodes/{nodeId}/users/{userName}")
         @ExpectedResponses({ 200 })
@@ -1344,7 +1342,7 @@ Mono> deleteNodeUserInternal(@HostParam("endpoint") String endpoi
         Response deleteNodeUserInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
             @PathParam("nodeId") String nodeId, @PathParam("userName") String userName,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Put("/pools/{poolId}/nodes/{nodeId}/users/{userName}")
         @ExpectedResponses({ 200 })
@@ -1355,7 +1353,7 @@ Response deleteNodeUserInternalSync(@HostParam("endpoint") String endpoint
         Mono> replaceNodeUserInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
             @PathParam("poolId") String poolId, @PathParam("nodeId") String nodeId,
-            @PathParam("userName") String userName, @HeaderParam("accept") String accept,
+            @PathParam("userName") String userName, @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData content, RequestOptions requestOptions,
             Context context);
 
@@ -1368,7 +1366,7 @@ Mono> replaceNodeUserInternal(@HostParam("endpoint") String endpo
         Response replaceNodeUserInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
             @PathParam("poolId") String poolId, @PathParam("nodeId") String nodeId,
-            @PathParam("userName") String userName, @HeaderParam("accept") String accept,
+            @PathParam("userName") String userName, @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData content, RequestOptions requestOptions,
             Context context);
 
@@ -1380,7 +1378,7 @@ Response replaceNodeUserInternalSync(@HostParam("endpoint") String endpoin
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getNodeInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
-            @PathParam("nodeId") String nodeId, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @PathParam("nodeId") String nodeId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("/pools/{poolId}/nodes/{nodeId}")
@@ -1391,7 +1389,7 @@ Mono> getNodeInternal(@HostParam("endpoint") String endpoin
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response getNodeInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
-            @PathParam("nodeId") String nodeId, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @PathParam("nodeId") String nodeId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Post("/pools/{poolId}/nodes/{nodeId}/reboot")
@@ -1401,9 +1399,9 @@ Response getNodeInternalSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> rebootNodeInternal(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @PathParam("poolId") String poolId, @PathParam("nodeId") String nodeId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
+            @PathParam("nodeId") String nodeId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
+            Context context);
 
         @Post("/pools/{poolId}/nodes/{nodeId}/reboot")
         @ExpectedResponses({ 202 })
@@ -1412,9 +1410,9 @@ Mono> rebootNodeInternal(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response rebootNodeInternalSync(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @PathParam("poolId") String poolId, @PathParam("nodeId") String nodeId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
+            @PathParam("nodeId") String nodeId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
+            Context context);
 
         @Post("/pools/{poolId}/nodes/{nodeId}/disablescheduling")
         @ExpectedResponses({ 200 })
@@ -1423,9 +1421,9 @@ Response rebootNodeInternalSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> disableNodeSchedulingInternal(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @PathParam("poolId") String poolId, @PathParam("nodeId") String nodeId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
+            @PathParam("nodeId") String nodeId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
+            Context context);
 
         @Post("/pools/{poolId}/nodes/{nodeId}/disablescheduling")
         @ExpectedResponses({ 200 })
@@ -1434,9 +1432,9 @@ Mono> disableNodeSchedulingInternal(@HostParam("endpoint") String
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response disableNodeSchedulingInternalSync(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
-            @PathParam("poolId") String poolId, @PathParam("nodeId") String nodeId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
+            @PathParam("nodeId") String nodeId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
+            Context context);
 
         @Post("/pools/{poolId}/nodes/{nodeId}/enablescheduling")
         @ExpectedResponses({ 200 })
@@ -1446,7 +1444,7 @@ Response disableNodeSchedulingInternalSync(@HostParam("endpoint") String e
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> enableNodeSchedulingInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
-            @PathParam("nodeId") String nodeId, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @PathParam("nodeId") String nodeId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Post("/pools/{poolId}/nodes/{nodeId}/enablescheduling")
@@ -1457,7 +1455,7 @@ Mono> enableNodeSchedulingInternal(@HostParam("endpoint") String
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response enableNodeSchedulingInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
-            @PathParam("nodeId") String nodeId, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @PathParam("nodeId") String nodeId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("/pools/{poolId}/nodes/{nodeId}/remoteloginsettings")
@@ -1468,7 +1466,7 @@ Response enableNodeSchedulingInternalSync(@HostParam("endpoint") String en
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getNodeRemoteLoginSettingsInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
-            @PathParam("nodeId") String nodeId, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @PathParam("nodeId") String nodeId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("/pools/{poolId}/nodes/{nodeId}/remoteloginsettings")
@@ -1479,7 +1477,7 @@ Mono> getNodeRemoteLoginSettingsInternal(@HostParam("endpoi
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response getNodeRemoteLoginSettingsInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
-            @PathParam("nodeId") String nodeId, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @PathParam("nodeId") String nodeId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Post("/pools/{poolId}/nodes/{nodeId}/uploadbatchservicelogs")
@@ -1491,7 +1489,7 @@ Response getNodeRemoteLoginSettingsInternalSync(@HostParam("endpoint
         Mono> uploadNodeLogsInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
             @PathParam("poolId") String poolId, @PathParam("nodeId") String nodeId,
-            @HeaderParam("accept") String accept,
+            @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData content, RequestOptions requestOptions,
             Context context);
 
@@ -1504,7 +1502,7 @@ Mono> uploadNodeLogsInternal(@HostParam("endpoint") String
         Response uploadNodeLogsInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType,
             @PathParam("poolId") String poolId, @PathParam("nodeId") String nodeId,
-            @HeaderParam("accept") String accept,
+            @HeaderParam("Accept") String accept,
             @BodyParam("application/json; odata=minimalmetadata") BinaryData content, RequestOptions requestOptions,
             Context context);
 
@@ -1516,7 +1514,7 @@ Response uploadNodeLogsInternalSync(@HostParam("endpoint") String en
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listNodesInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/pools/{poolId}/nodes")
         @ExpectedResponses({ 200 })
@@ -1526,7 +1524,7 @@ Mono> listNodesInternal(@HostParam("endpoint") String endpo
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listNodesInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/pools/{poolId}/nodes/{nodeId}/extensions/{extensionName}")
         @ExpectedResponses({ 200 })
@@ -1537,7 +1535,7 @@ Response listNodesInternalSync(@HostParam("endpoint") String endpoin
         Mono> getNodeExtensionInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
             @PathParam("nodeId") String nodeId, @PathParam("extensionName") String extensionName,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/pools/{poolId}/nodes/{nodeId}/extensions/{extensionName}")
         @ExpectedResponses({ 200 })
@@ -1548,7 +1546,7 @@ Mono> getNodeExtensionInternal(@HostParam("endpoint") Strin
         Response getNodeExtensionInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
             @PathParam("nodeId") String nodeId, @PathParam("extensionName") String extensionName,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/pools/{poolId}/nodes/{nodeId}/extensions")
         @ExpectedResponses({ 200 })
@@ -1558,7 +1556,7 @@ Response getNodeExtensionInternalSync(@HostParam("endpoint") String
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listNodeExtensionsInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
-            @PathParam("nodeId") String nodeId, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @PathParam("nodeId") String nodeId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("/pools/{poolId}/nodes/{nodeId}/extensions")
@@ -1569,7 +1567,7 @@ Mono> listNodeExtensionsInternal(@HostParam("endpoint") Str
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listNodeExtensionsInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
-            @PathParam("nodeId") String nodeId, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @PathParam("nodeId") String nodeId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Delete("/pools/{poolId}/nodes/{nodeId}/files/{filePath}")
@@ -1581,7 +1579,7 @@ Response listNodeExtensionsInternalSync(@HostParam("endpoint") Strin
         Mono> deleteNodeFileInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
             @PathParam("nodeId") String nodeId, @PathParam("filePath") String filePath,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Delete("/pools/{poolId}/nodes/{nodeId}/files/{filePath}")
         @ExpectedResponses({ 200 })
@@ -1592,7 +1590,7 @@ Mono> deleteNodeFileInternal(@HostParam("endpoint") String endpoi
         Response deleteNodeFileInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
             @PathParam("nodeId") String nodeId, @PathParam("filePath") String filePath,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/pools/{poolId}/nodes/{nodeId}/files/{filePath}")
         @ExpectedResponses({ 200 })
@@ -1603,7 +1601,7 @@ Response deleteNodeFileInternalSync(@HostParam("endpoint") String endpoint
         Mono> getNodeFileInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
             @PathParam("nodeId") String nodeId, @PathParam("filePath") String filePath,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/pools/{poolId}/nodes/{nodeId}/files/{filePath}")
         @ExpectedResponses({ 200 })
@@ -1614,7 +1612,7 @@ Mono> getNodeFileInternal(@HostParam("endpoint") String end
         Response getNodeFileInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
             @PathParam("nodeId") String nodeId, @PathParam("filePath") String filePath,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Head("/pools/{poolId}/nodes/{nodeId}/files/{filePath}")
         @ExpectedResponses({ 200 })
@@ -1625,7 +1623,7 @@ Response getNodeFileInternalSync(@HostParam("endpoint") String endpo
         Mono> getNodeFilePropertiesInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
             @PathParam("nodeId") String nodeId, @PathParam("filePath") String filePath,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Head("/pools/{poolId}/nodes/{nodeId}/files/{filePath}")
         @ExpectedResponses({ 200 })
@@ -1636,7 +1634,7 @@ Mono> getNodeFilePropertiesInternal(@HostParam("endpoint") String
         Response getNodeFilePropertiesInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
             @PathParam("nodeId") String nodeId, @PathParam("filePath") String filePath,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/pools/{poolId}/nodes/{nodeId}/files")
         @ExpectedResponses({ 200 })
@@ -1646,7 +1644,7 @@ Response getNodeFilePropertiesInternalSync(@HostParam("endpoint") String e
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listNodeFilesInternal(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
-            @PathParam("nodeId") String nodeId, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @PathParam("nodeId") String nodeId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("/pools/{poolId}/nodes/{nodeId}/files")
@@ -1657,7 +1655,7 @@ Mono> listNodeFilesInternal(@HostParam("endpoint") String e
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listNodeFilesInternalSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("poolId") String poolId,
-            @PathParam("nodeId") String nodeId, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @PathParam("nodeId") String nodeId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("{nextLink}")
@@ -1668,7 +1666,7 @@ Response listNodeFilesInternalSync(@HostParam("endpoint") String end
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listApplicationsInternalNext(
             @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("{nextLink}")
         @ExpectedResponses({ 200 })
@@ -1678,7 +1676,7 @@ Mono> listApplicationsInternalNext(
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listApplicationsInternalNextSync(
             @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("{nextLink}")
         @ExpectedResponses({ 200 })
@@ -1688,7 +1686,7 @@ Response listApplicationsInternalNextSync(
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listPoolUsageMetricsInternalNext(
             @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("{nextLink}")
         @ExpectedResponses({ 200 })
@@ -1698,7 +1696,7 @@ Mono> listPoolUsageMetricsInternalNext(
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listPoolUsageMetricsInternalNextSync(
             @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("{nextLink}")
         @ExpectedResponses({ 200 })
@@ -1707,7 +1705,7 @@ Response listPoolUsageMetricsInternalNextSync(
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listPoolsInternalNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
-            @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("{nextLink}")
@@ -1717,7 +1715,7 @@ Mono> listPoolsInternalNext(@PathParam(value = "nextLink",
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listPoolsInternalNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
-            @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("{nextLink}")
@@ -1728,7 +1726,7 @@ Response listPoolsInternalNextSync(@PathParam(value = "nextLink", en
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listSupportedImagesInternalNext(
             @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("{nextLink}")
         @ExpectedResponses({ 200 })
@@ -1738,7 +1736,7 @@ Mono> listSupportedImagesInternalNext(
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listSupportedImagesInternalNextSync(
             @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("{nextLink}")
         @ExpectedResponses({ 200 })
@@ -1748,7 +1746,7 @@ Response listSupportedImagesInternalNextSync(
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listPoolNodeCountsInternalNext(
             @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("{nextLink}")
         @ExpectedResponses({ 200 })
@@ -1758,7 +1756,7 @@ Mono> listPoolNodeCountsInternalNext(
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listPoolNodeCountsInternalNextSync(
             @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("{nextLink}")
         @ExpectedResponses({ 200 })
@@ -1767,7 +1765,7 @@ Response listPoolNodeCountsInternalNextSync(
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listJobsInternalNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
-            @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("{nextLink}")
@@ -1777,7 +1775,7 @@ Mono> listJobsInternalNext(@PathParam(value = "nextLink", e
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listJobsInternalNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
-            @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("{nextLink}")
@@ -1788,7 +1786,7 @@ Response listJobsInternalNextSync(@PathParam(value = "nextLink", enc
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listJobsFromScheduleInternalNext(
             @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("{nextLink}")
         @ExpectedResponses({ 200 })
@@ -1798,7 +1796,7 @@ Mono> listJobsFromScheduleInternalNext(
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listJobsFromScheduleInternalNextSync(
             @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("{nextLink}")
         @ExpectedResponses({ 200 })
@@ -1808,7 +1806,7 @@ Response listJobsFromScheduleInternalNextSync(
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listJobPreparationAndReleaseTaskStatusInternalNext(
             @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("{nextLink}")
         @ExpectedResponses({ 200 })
@@ -1818,7 +1816,7 @@ Mono> listJobPreparationAndReleaseTaskStatusInternalNext(
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listJobPreparationAndReleaseTaskStatusInternalNextSync(
             @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("{nextLink}")
         @ExpectedResponses({ 200 })
@@ -1828,7 +1826,7 @@ Response listJobPreparationAndReleaseTaskStatusInternalNextSync(
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listJobSchedulesInternalNext(
             @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("{nextLink}")
         @ExpectedResponses({ 200 })
@@ -1838,7 +1836,7 @@ Mono> listJobSchedulesInternalNext(
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listJobSchedulesInternalNextSync(
             @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("{nextLink}")
         @ExpectedResponses({ 200 })
@@ -1847,7 +1845,7 @@ Response listJobSchedulesInternalNextSync(
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listTasksInternalNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
-            @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("{nextLink}")
@@ -1857,7 +1855,7 @@ Mono> listTasksInternalNext(@PathParam(value = "nextLink",
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listTasksInternalNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
-            @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("{nextLink}")
@@ -1868,7 +1866,7 @@ Response listTasksInternalNextSync(@PathParam(value = "nextLink", en
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listSubTasksInternalNext(
             @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("{nextLink}")
         @ExpectedResponses({ 200 })
@@ -1878,7 +1876,7 @@ Mono> listSubTasksInternalNext(
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listSubTasksInternalNextSync(
             @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("{nextLink}")
         @ExpectedResponses({ 200 })
@@ -1888,7 +1886,7 @@ Response listSubTasksInternalNextSync(
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listTaskFilesInternalNext(
             @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("{nextLink}")
         @ExpectedResponses({ 200 })
@@ -1898,7 +1896,7 @@ Mono> listTaskFilesInternalNext(
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listTaskFilesInternalNextSync(
             @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("{nextLink}")
         @ExpectedResponses({ 200 })
@@ -1907,7 +1905,7 @@ Response listTaskFilesInternalNextSync(
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listNodesInternalNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
-            @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("{nextLink}")
@@ -1917,7 +1915,7 @@ Mono> listNodesInternalNext(@PathParam(value = "nextLink",
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listNodesInternalNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
-            @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("{nextLink}")
@@ -1928,7 +1926,7 @@ Response listNodesInternalNextSync(@PathParam(value = "nextLink", en
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listNodeExtensionsInternalNext(
             @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("{nextLink}")
         @ExpectedResponses({ 200 })
@@ -1938,7 +1936,7 @@ Mono> listNodeExtensionsInternalNext(
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listNodeExtensionsInternalNextSync(
             @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("{nextLink}")
         @ExpectedResponses({ 200 })
@@ -1948,7 +1946,7 @@ Response listNodeExtensionsInternalNextSync(
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listNodeFilesInternalNext(
             @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("{nextLink}")
         @ExpectedResponses({ 200 })
@@ -1958,7 +1956,7 @@ Mono> listNodeFilesInternalNext(
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listNodeFilesInternalNextSync(
             @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
     }
 
     /**
@@ -2232,8 +2230,11 @@ public PagedIterable listApplicationsInternal(RequestOptions request
      * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @return contains information about an application in an Azure Batch Account along with {@link Response} on
-     * successful completion of {@link Mono}.
+     * @return information about the specified Application.
+     * 
+     * This operation returns only Applications and versions that are available for
+     * use on Compute Nodes; that is, that can be used in an Package reference along with {@link Response} on successful
+     * completion of {@link Mono}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> getApplicationInternalWithResponseAsync(String applicationId,
@@ -2278,7 +2279,10 @@ public Mono> getApplicationInternalWithResponseAsync(String
      * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @return contains information about an application in an Azure Batch Account along with {@link Response}.
+     * @return information about the specified Application.
+     * 
+     * This operation returns only Applications and versions that are available for
+     * use on Compute Nodes; that is, that can be used in an Package reference along with {@link Response}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response getApplicationInternalWithResponse(String applicationId,
@@ -6104,8 +6108,11 @@ public Response enablePoolAutoScaleInternalWithResponse(String poolId, Bin
      * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @return the results and errors from an execution of a Pool autoscale formula along with {@link Response} on
-     * successful completion of {@link Mono}.
+     * @return the result of evaluating an automatic scaling formula on the Pool.
+     * 
+     * This API is primarily for validating an autoscale formula, as it simply returns
+     * the result without applying the formula to the Pool along with {@link Response} on successful completion of
+     * {@link Mono}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> evaluatePoolAutoScaleInternalWithResponseAsync(String poolId, BinaryData content,
@@ -6165,7 +6172,10 @@ public Mono> evaluatePoolAutoScaleInternalWithResponseAsync
      * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @return the results and errors from an execution of a Pool autoscale formula along with {@link Response}.
+     * @return the result of evaluating an automatic scaling formula on the Pool.
+     * 
+     * This API is primarily for validating an autoscale formula, as it simply returns
+     * the result without applying the formula to the Pool along with {@link Response}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response evaluatePoolAutoScaleInternalWithResponse(String poolId, BinaryData content,
@@ -10186,6 +10196,8 @@ public Response enableJobInternalWithResponse(String jobId, RequestOptions
      * 
      * 
      * 
+     * 
      * 
      * 
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: "application/json; + * odata=minimalmetadata".
If-Modified-SinceOffsetDateTimeNoA timestamp indicating the last modified time * of the resource known to the * client. The operation will be performed only if the resource on the service has @@ -10222,7 +10234,6 @@ public Response enableJobInternalWithResponse(String jobId, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> terminateJobInternalWithResponseAsync(String jobId, RequestOptions requestOptions) { - final String contentType = "application/json; odata=minimalmetadata"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { @@ -10231,7 +10242,7 @@ public Mono> terminateJobInternalWithResponseAsync(String jobId, } }); return FluxUtil.withContext(context -> service.terminateJobInternal(this.getEndpoint(), - this.getServiceVersion().getVersion(), contentType, jobId, accept, requestOptionsLocal, context)); + this.getServiceVersion().getVersion(), jobId, accept, requestOptionsLocal, context)); } /** @@ -10256,6 +10267,8 @@ public Mono> terminateJobInternalWithResponseAsync(String jobId, * * * + * * *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: "application/json; + * odata=minimalmetadata".
If-Modified-SinceOffsetDateTimeNoA timestamp indicating the last modified time * of the resource known to the * client. The operation will be performed only if the resource on the service has @@ -10292,7 +10305,6 @@ public Mono> terminateJobInternalWithResponseAsync(String jobId, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response terminateJobInternalWithResponse(String jobId, RequestOptions requestOptions) { - final String contentType = "application/json; odata=minimalmetadata"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { @@ -10300,8 +10312,8 @@ public Response terminateJobInternalWithResponse(String jobId, RequestOpti requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json; odata=minimalmetadata"); } }); - return service.terminateJobInternalSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, - jobId, accept, requestOptionsLocal, Context.NONE); + return service.terminateJobInternalSync(this.getEndpoint(), this.getServiceVersion().getVersion(), jobId, + accept, requestOptionsLocal, Context.NONE); } /** @@ -15203,7 +15215,10 @@ public PagedIterable listJobPreparationAndReleaseTaskStatusInternal( * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the Task and TaskSlot counts for a Job along with {@link Response} on successful completion of + * @return the Task counts for the specified Job. + * + * Task counts provide a count of the Tasks by active, running or completed Task + * state, and a count of Tasks which succeeded or failed along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -15257,7 +15272,10 @@ public Mono> getJobTaskCountsInternalWithResponseAsync(Stri * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the Task and TaskSlot counts for a Job along with {@link Response}. + * @return the Task counts for the specified Job. + * + * Task counts provide a count of the Tasks by active, running or completed Task + * state, and a count of Tasks which succeeded or failed along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getJobTaskCountsInternalWithResponse(String jobId, RequestOptions requestOptions) { @@ -23156,11 +23174,10 @@ public Response deleteTaskInternalWithResponse(String jobId, String taskId * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return batch will retry Tasks when a recovery operation is triggered on a Node. - * Examples of recovery operations include (but are not limited to) when an - * unhealthy Node is rebooted or a Compute Node disappeared due to host failure. - * Retries due to recovery operations are independent of and are not counted - * against the maxTaskRetryCount along with {@link Response} on successful completion of {@link Mono}. + * @return information about the specified Task. + * + * For multi-instance Tasks, information such as affinityId, executionInfo and + * nodeInfo refer to the primary Task along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getTaskInternalWithResponseAsync(String jobId, String taskId, @@ -23400,11 +23417,10 @@ public Mono> getTaskInternalWithResponseAsync(String jobId, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return batch will retry Tasks when a recovery operation is triggered on a Node. - * Examples of recovery operations include (but are not limited to) when an - * unhealthy Node is rebooted or a Compute Node disappeared due to host failure. - * Retries due to recovery operations are independent of and are not counted - * against the maxTaskRetryCount along with {@link Response}. + * @return information about the specified Task. + * + * For multi-instance Tasks, information such as affinityId, executionInfo and + * nodeInfo refer to the primary Task along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getTaskInternalWithResponse(String jobId, String taskId, @@ -24529,7 +24545,7 @@ public Response deleteTaskFileInternalWithResponse(String jobId, String ta @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getTaskFileInternalWithResponseAsync(String jobId, String taskId, String filePath, RequestOptions requestOptions) { - final String accept = "application/octet-stream, application/json"; + final String accept = "application/octet-stream"; return FluxUtil.withContext(context -> service.getTaskFileInternal(this.getEndpoint(), this.getServiceVersion().getVersion(), jobId, taskId, filePath, accept, requestOptions, context)); } @@ -24581,7 +24597,7 @@ public Mono> getTaskFileInternalWithResponseAsync(String jo @ServiceMethod(returns = ReturnType.SINGLE) public Response getTaskFileInternalWithResponse(String jobId, String taskId, String filePath, RequestOptions requestOptions) { - final String accept = "application/octet-stream, application/json"; + final String accept = "application/octet-stream"; return service.getTaskFileInternalSync(this.getEndpoint(), this.getServiceVersion().getVersion(), jobId, taskId, filePath, accept, requestOptions, Context.NONE); } @@ -25558,6 +25574,14 @@ public Response getNodeInternalWithResponse(String poolId, String no * instead.".
* You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: "application/json; + * odata=minimalmetadata".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -25578,7 +25602,6 @@ public Response getNodeInternalWithResponse(String poolId, String no
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> rebootNodeInternalWithResponseAsync(String poolId, String nodeId,
         RequestOptions requestOptions) {
-        final String contentType = "application/json; odata=minimalmetadata";
         final String accept = "application/json";
         RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
         requestOptionsLocal.addRequestCallback(requestLocal -> {
@@ -25587,7 +25610,7 @@ public Mono> rebootNodeInternalWithResponseAsync(String poolId, S
             }
         });
         return FluxUtil.withContext(context -> service.rebootNodeInternal(this.getEndpoint(),
-            this.getServiceVersion().getVersion(), contentType, poolId, nodeId, accept, requestOptionsLocal, context));
+            this.getServiceVersion().getVersion(), poolId, nodeId, accept, requestOptionsLocal, context));
     }
 
     /**
@@ -25603,6 +25626,14 @@ public Mono> rebootNodeInternalWithResponseAsync(String poolId, S
      * instead.".
* You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: "application/json; + * odata=minimalmetadata".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -25622,7 +25653,6 @@ public Mono> rebootNodeInternalWithResponseAsync(String poolId, S
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response rebootNodeInternalWithResponse(String poolId, String nodeId, RequestOptions requestOptions) {
-        final String contentType = "application/json; odata=minimalmetadata";
         final String accept = "application/json";
         RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
         requestOptionsLocal.addRequestCallback(requestLocal -> {
@@ -25630,8 +25660,8 @@ public Response rebootNodeInternalWithResponse(String poolId, String nodeI
                 requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json; odata=minimalmetadata");
             }
         });
-        return service.rebootNodeInternalSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType,
-            poolId, nodeId, accept, requestOptionsLocal, Context.NONE);
+        return service.rebootNodeInternalSync(this.getEndpoint(), this.getServiceVersion().getVersion(), poolId, nodeId,
+            accept, requestOptionsLocal, Context.NONE);
     }
 
     /**
@@ -25648,6 +25678,14 @@ public Response rebootNodeInternalWithResponse(String poolId, String nodeI
      * instead.".
      * 
      * You can add these to a request with {@link RequestOptions#addQueryParam}
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: "application/json; + * odata=minimalmetadata".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -25668,7 +25706,6 @@ public Response rebootNodeInternalWithResponse(String poolId, String nodeI
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> disableNodeSchedulingInternalWithResponseAsync(String poolId, String nodeId,
         RequestOptions requestOptions) {
-        final String contentType = "application/json; odata=minimalmetadata";
         final String accept = "application/json";
         RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
         requestOptionsLocal.addRequestCallback(requestLocal -> {
@@ -25677,7 +25714,7 @@ public Mono> disableNodeSchedulingInternalWithResponseAsync(Strin
             }
         });
         return FluxUtil.withContext(context -> service.disableNodeSchedulingInternal(this.getEndpoint(),
-            this.getServiceVersion().getVersion(), contentType, poolId, nodeId, accept, requestOptionsLocal, context));
+            this.getServiceVersion().getVersion(), poolId, nodeId, accept, requestOptionsLocal, context));
     }
 
     /**
@@ -25694,6 +25731,14 @@ public Mono> disableNodeSchedulingInternalWithResponseAsync(Strin
      * instead.".
      * 
      * You can add these to a request with {@link RequestOptions#addQueryParam}
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: "application/json; + * odata=minimalmetadata".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -25714,7 +25759,6 @@ public Mono> disableNodeSchedulingInternalWithResponseAsync(Strin
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response disableNodeSchedulingInternalWithResponse(String poolId, String nodeId,
         RequestOptions requestOptions) {
-        final String contentType = "application/json; odata=minimalmetadata";
         final String accept = "application/json";
         RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
         requestOptionsLocal.addRequestCallback(requestLocal -> {
@@ -25723,7 +25767,7 @@ public Response disableNodeSchedulingInternalWithResponse(String poolId, S
             }
         });
         return service.disableNodeSchedulingInternalSync(this.getEndpoint(), this.getServiceVersion().getVersion(),
-            contentType, poolId, nodeId, accept, requestOptionsLocal, Context.NONE);
+            poolId, nodeId, accept, requestOptionsLocal, Context.NONE);
     }
 
     /**
@@ -25821,8 +25865,11 @@ public Response enableNodeSchedulingInternalWithResponse(String poolId, St
      * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @return the remote login settings for a Compute Node along with {@link Response} on successful completion of
-     * {@link Mono}.
+     * @return the settings required for remote login to a Compute Node.
+     * 
+     * Before you can remotely login to a Compute Node using the remote login
+     * settings, you must create a user Account on the Compute Node along with {@link Response} on successful completion
+     * of {@link Mono}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> getNodeRemoteLoginSettingsInternalWithResponseAsync(String poolId, String nodeId,
@@ -25863,7 +25910,10 @@ public Mono> getNodeRemoteLoginSettingsInternalWithResponse
      * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @return the remote login settings for a Compute Node along with {@link Response}.
+     * @return the settings required for remote login to a Compute Node.
+     * 
+     * Before you can remotely login to a Compute Node using the remote login
+     * settings, you must create a user Account on the Compute Node along with {@link Response}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response getNodeRemoteLoginSettingsInternalWithResponse(String poolId, String nodeId,
@@ -27367,7 +27417,7 @@ public Response deleteNodeFileInternalWithResponse(String poolId, String n
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> getNodeFileInternalWithResponseAsync(String poolId, String nodeId,
         String filePath, RequestOptions requestOptions) {
-        final String accept = "application/octet-stream, application/json";
+        final String accept = "application/octet-stream";
         return FluxUtil.withContext(context -> service.getNodeFileInternal(this.getEndpoint(),
             this.getServiceVersion().getVersion(), poolId, nodeId, filePath, accept, requestOptions, context));
     }
@@ -27419,7 +27469,7 @@ public Mono> getNodeFileInternalWithResponseAsync(String po
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response getNodeFileInternalWithResponse(String poolId, String nodeId, String filePath,
         RequestOptions requestOptions) {
-        final String accept = "application/octet-stream, application/json";
+        final String accept = "application/octet-stream";
         return service.getNodeFileInternalSync(this.getEndpoint(), this.getServiceVersion().getVersion(), poolId,
             nodeId, filePath, accept, requestOptions, Context.NONE);
     }
@@ -28704,6 +28754,10 @@ private PagedResponse listSupportedImagesInternalNextSinglePage(Stri
     }
 
     /**
+     * Gets the number of Compute Nodes in each state, grouped by Pool. Note that the
+     * numbers returned may not always be up to date. If you need exact node counts,
+     * use a list query.
+     * 
      * Get the next page of items.
      * 

Response Body Schema

* @@ -28752,6 +28806,10 @@ private Mono> listPoolNodeCountsInternalNextSinglePage } /** + * Gets the number of Compute Nodes in each state, grouped by Pool. Note that the + * numbers returned may not always be up to date. If you need exact node counts, + * use a list query. + * * Get the next page of items. *

Response Body Schema

* diff --git a/sdk/batch/azure-compute-batch/src/main/resources/META-INF/azure-compute-batch_apiview_properties.json b/sdk/batch/azure-compute-batch/src/main/resources/META-INF/azure-compute-batch_apiview_properties.json index 2f624dc6467c..2ae3877cfbc2 100644 --- a/sdk/batch/azure-compute-batch/src/main/resources/META-INF/azure-compute-batch_apiview_properties.json +++ b/sdk/batch/azure-compute-batch/src/main/resources/META-INF/azure-compute-batch_apiview_properties.json @@ -1,7 +1,7 @@ { "flavor": "azure", "CrossLanguageDefinitionId": { - "com.azure.compute.batch.BatchAsyncClient": "Azure.Batch.BatchClient", + "com.azure.compute.batch.BatchAsyncClient": "Azure.Batch.Batch", "com.azure.compute.batch.BatchAsyncClient.createJobInternal": "Azure.Batch.Batch.createJob", "com.azure.compute.batch.BatchAsyncClient.createJobInternalWithResponse": "Azure.Batch.Batch.createJob", "com.azure.compute.batch.BatchAsyncClient.createJobScheduleInternal": "Azure.Batch.Batch.createJobSchedule", @@ -125,7 +125,7 @@ "com.azure.compute.batch.BatchAsyncClient.updatePoolInternalWithResponse": "Azure.Batch.Batch.updatePool", "com.azure.compute.batch.BatchAsyncClient.uploadNodeLogsInternal": "Azure.Batch.Batch.uploadNodeLogs", "com.azure.compute.batch.BatchAsyncClient.uploadNodeLogsInternalWithResponse": "Azure.Batch.Batch.uploadNodeLogs", - "com.azure.compute.batch.BatchClient": "Azure.Batch.BatchClient", + "com.azure.compute.batch.BatchClient": "Azure.Batch.Batch", "com.azure.compute.batch.BatchClient.createJobInternal": "Azure.Batch.Batch.createJob", "com.azure.compute.batch.BatchClient.createJobInternalWithResponse": "Azure.Batch.Batch.createJob", "com.azure.compute.batch.BatchClient.createJobScheduleInternal": "Azure.Batch.Batch.createJobSchedule", @@ -249,7 +249,7 @@ "com.azure.compute.batch.BatchClient.updatePoolInternalWithResponse": "Azure.Batch.Batch.updatePool", "com.azure.compute.batch.BatchClient.uploadNodeLogsInternal": "Azure.Batch.Batch.uploadNodeLogs", "com.azure.compute.batch.BatchClient.uploadNodeLogsInternalWithResponse": "Azure.Batch.Batch.uploadNodeLogs", - "com.azure.compute.batch.BatchClientBuilder": "Azure.Batch.BatchClient", + "com.azure.compute.batch.BatchClientBuilder": "Azure.Batch.Batch", "com.azure.compute.batch.models.AccessScope": "Azure.Batch.AccessScope", "com.azure.compute.batch.models.AffinityInfo": "Azure.Batch.AffinityInfo", "com.azure.compute.batch.models.AllocationState": "Azure.Batch.AllocationState", diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterAdministrationClientImpl.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterAdministrationClientImpl.java index c575096419fb..05c1de59db08 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterAdministrationClientImpl.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterAdministrationClientImpl.java @@ -167,7 +167,7 @@ public interface JobRouterAdministrationClientService { Mono> upsertDistributionPolicy(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("distributionPolicyId") String distributionPolicyId, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -180,7 +180,7 @@ Mono> upsertDistributionPolicy(@HostParam("endpoint") Strin Response upsertDistributionPolicySync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("distributionPolicyId") String distributionPolicyId, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -192,7 +192,7 @@ Response upsertDistributionPolicySync(@HostParam("endpoint") String @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getDistributionPolicy(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("distributionPolicyId") String distributionPolicyId, @HeaderParam("accept") String accept, + @PathParam("distributionPolicyId") String distributionPolicyId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/routing/distributionPolicies/{distributionPolicyId}") @@ -203,7 +203,7 @@ Mono> getDistributionPolicy(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(HttpResponseException.class) Response getDistributionPolicySync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("distributionPolicyId") String distributionPolicyId, @HeaderParam("accept") String accept, + @PathParam("distributionPolicyId") String distributionPolicyId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/routing/distributionPolicies") @@ -213,7 +213,7 @@ Response getDistributionPolicySync(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listDistributionPolicies(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/routing/distributionPolicies") @@ -223,7 +223,7 @@ Mono> listDistributionPolicies(@HostParam("endpoint") Strin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listDistributionPoliciesSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/routing/distributionPolicies/{distributionPolicyId}") @@ -234,7 +234,7 @@ Response listDistributionPoliciesSync(@HostParam("endpoint") String @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteDistributionPolicy(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("distributionPolicyId") String distributionPolicyId, @HeaderParam("accept") String accept, + @PathParam("distributionPolicyId") String distributionPolicyId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/routing/distributionPolicies/{distributionPolicyId}") @@ -245,7 +245,7 @@ Mono> deleteDistributionPolicy(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteDistributionPolicySync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("distributionPolicyId") String distributionPolicyId, @HeaderParam("accept") String accept, + @PathParam("distributionPolicyId") String distributionPolicyId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Patch("/routing/classificationPolicies/{classificationPolicyId}") @@ -257,7 +257,7 @@ Response deleteDistributionPolicySync(@HostParam("endpoint") String endpoi Mono> upsertClassificationPolicy(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("classificationPolicyId") String classificationPolicyId, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -270,7 +270,7 @@ Mono> upsertClassificationPolicy(@HostParam("endpoint") Str Response upsertClassificationPolicySync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("classificationPolicyId") String classificationPolicyId, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -282,7 +282,7 @@ Response upsertClassificationPolicySync(@HostParam("endpoint") Strin @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getClassificationPolicy(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("classificationPolicyId") String classificationPolicyId, @HeaderParam("accept") String accept, + @PathParam("classificationPolicyId") String classificationPolicyId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/routing/classificationPolicies/{classificationPolicyId}") @@ -293,7 +293,7 @@ Mono> getClassificationPolicy(@HostParam("endpoint") String @UnexpectedResponseExceptionType(HttpResponseException.class) Response getClassificationPolicySync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("classificationPolicyId") String classificationPolicyId, @HeaderParam("accept") String accept, + @PathParam("classificationPolicyId") String classificationPolicyId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/routing/classificationPolicies") @@ -303,7 +303,7 @@ Response getClassificationPolicySync(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listClassificationPolicies(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/routing/classificationPolicies") @@ -313,7 +313,7 @@ Mono> listClassificationPolicies(@HostParam("endpoint") Str @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listClassificationPoliciesSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/routing/classificationPolicies/{classificationPolicyId}") @@ -324,7 +324,7 @@ Response listClassificationPoliciesSync(@HostParam("endpoint") Strin @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteClassificationPolicy(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("classificationPolicyId") String classificationPolicyId, @HeaderParam("accept") String accept, + @PathParam("classificationPolicyId") String classificationPolicyId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/routing/classificationPolicies/{classificationPolicyId}") @@ -335,7 +335,7 @@ Mono> deleteClassificationPolicy(@HostParam("endpoint") String en @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteClassificationPolicySync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("classificationPolicyId") String classificationPolicyId, @HeaderParam("accept") String accept, + @PathParam("classificationPolicyId") String classificationPolicyId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Patch("/routing/exceptionPolicies/{exceptionPolicyId}") @@ -346,7 +346,7 @@ Response deleteClassificationPolicySync(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> upsertExceptionPolicy(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("exceptionPolicyId") String exceptionPolicyId, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -358,7 +358,7 @@ Mono> upsertExceptionPolicy(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(HttpResponseException.class) Response upsertExceptionPolicySync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("exceptionPolicyId") String exceptionPolicyId, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -370,7 +370,7 @@ Response upsertExceptionPolicySync(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getExceptionPolicy(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("exceptionPolicyId") String exceptionPolicyId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/routing/exceptionPolicies/{exceptionPolicyId}") @ExpectedResponses({ 200 }) @@ -380,7 +380,7 @@ Mono> getExceptionPolicy(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(HttpResponseException.class) Response getExceptionPolicySync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("exceptionPolicyId") String exceptionPolicyId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/routing/exceptionPolicies") @ExpectedResponses({ 200 }) @@ -389,7 +389,7 @@ Response getExceptionPolicySync(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listExceptionPolicies(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/routing/exceptionPolicies") @@ -399,7 +399,7 @@ Mono> listExceptionPolicies(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listExceptionPoliciesSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/routing/exceptionPolicies/{exceptionPolicyId}") @@ -410,7 +410,7 @@ Response listExceptionPoliciesSync(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteExceptionPolicy(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("exceptionPolicyId") String exceptionPolicyId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/routing/exceptionPolicies/{exceptionPolicyId}") @ExpectedResponses({ 204 }) @@ -420,7 +420,7 @@ Mono> deleteExceptionPolicy(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteExceptionPolicySync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("exceptionPolicyId") String exceptionPolicyId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Patch("/routing/queues/{queueId}") @ExpectedResponses({ 200, 201 }) @@ -430,7 +430,7 @@ Response deleteExceptionPolicySync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> upsertQueue(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("queueId") String queueId, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -442,7 +442,7 @@ Mono> upsertQueue(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response upsertQueueSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("queueId") String queueId, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -454,7 +454,7 @@ Response upsertQueueSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getQueue(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("queueId") String queueId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/routing/queues/{queueId}") @ExpectedResponses({ 200 }) @@ -464,7 +464,7 @@ Mono> getQueue(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response getQueueSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("queueId") String queueId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/routing/queues") @ExpectedResponses({ 200 }) @@ -473,7 +473,7 @@ Response getQueueSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listQueues(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/routing/queues") @@ -483,7 +483,7 @@ Mono> listQueues(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listQueuesSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/routing/queues/{queueId}") @@ -494,7 +494,7 @@ Response listQueuesSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteQueue(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("queueId") String queueId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/routing/queues/{queueId}") @ExpectedResponses({ 204 }) @@ -504,7 +504,7 @@ Mono> deleteQueue(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteQueueSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("queueId") String queueId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -514,7 +514,7 @@ Response deleteQueueSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listDistributionPoliciesNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -524,7 +524,7 @@ Mono> listDistributionPoliciesNext( @UnexpectedResponseExceptionType(HttpResponseException.class) Response listDistributionPoliciesNextSync( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -534,7 +534,7 @@ Response listDistributionPoliciesNextSync( @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listClassificationPoliciesNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -544,7 +544,7 @@ Mono> listClassificationPoliciesNext( @UnexpectedResponseExceptionType(HttpResponseException.class) Response listClassificationPoliciesNextSync( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -554,7 +554,7 @@ Response listClassificationPoliciesNextSync( @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listExceptionPoliciesNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -564,7 +564,7 @@ Mono> listExceptionPoliciesNext( @UnexpectedResponseExceptionType(HttpResponseException.class) Response listExceptionPoliciesNextSync( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -573,7 +573,7 @@ Response listExceptionPoliciesNextSync( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listQueuesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -583,7 +583,7 @@ Mono> listQueuesNext(@PathParam(value = "nextLink", encoded @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listQueuesNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterClientImpl.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterClientImpl.java index a7f25e9ce546..d00db9d025fb 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterClientImpl.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterClientImpl.java @@ -166,7 +166,7 @@ public interface JobRouterClientService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> upsertJob(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -178,7 +178,7 @@ Mono> upsertJob(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response upsertJobSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -190,7 +190,7 @@ Response upsertJobSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getJob(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/routing/jobs/{jobId}") @ExpectedResponses({ 200 }) @@ -200,7 +200,7 @@ Mono> getJob(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response getJobSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/routing/jobs/{jobId}") @ExpectedResponses({ 204 }) @@ -210,7 +210,7 @@ Response getJobSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteJob(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/routing/jobs/{jobId}") @ExpectedResponses({ 204 }) @@ -220,7 +220,7 @@ Mono> deleteJob(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteJobSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/routing/jobs/{jobId}:reclassify") @ExpectedResponses({ 200 }) @@ -230,7 +230,7 @@ Response deleteJobSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> reclassifyJob(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/routing/jobs/{jobId}:reclassify") @ExpectedResponses({ 200 }) @@ -240,7 +240,7 @@ Mono> reclassifyJob(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response reclassifyJobSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/routing/jobs/{jobId}:cancel") @ExpectedResponses({ 200 }) @@ -250,7 +250,7 @@ Response reclassifyJobSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> cancelJob(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/routing/jobs/{jobId}:cancel") @ExpectedResponses({ 200 }) @@ -260,7 +260,7 @@ Mono> cancelJob(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response cancelJobSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/routing/jobs/{jobId}/assignments/{assignmentId}:complete") @ExpectedResponses({ 200 }) @@ -270,7 +270,7 @@ Response cancelJobSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> completeJob(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, - @PathParam("assignmentId") String assignmentId, @HeaderParam("accept") String accept, + @PathParam("assignmentId") String assignmentId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/routing/jobs/{jobId}/assignments/{assignmentId}:complete") @@ -281,7 +281,7 @@ Mono> completeJob(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response completeJobSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, - @PathParam("assignmentId") String assignmentId, @HeaderParam("accept") String accept, + @PathParam("assignmentId") String assignmentId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/routing/jobs/{jobId}/assignments/{assignmentId}:close") @@ -292,7 +292,7 @@ Response completeJobSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> closeJob(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, - @PathParam("assignmentId") String assignmentId, @HeaderParam("accept") String accept, + @PathParam("assignmentId") String assignmentId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/routing/jobs/{jobId}/assignments/{assignmentId}:close") @@ -303,7 +303,7 @@ Mono> closeJob(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response closeJobSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, - @PathParam("assignmentId") String assignmentId, @HeaderParam("accept") String accept, + @PathParam("assignmentId") String assignmentId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/routing/jobs") @@ -313,7 +313,7 @@ Response closeJobSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listJobs(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/routing/jobs") @@ -323,7 +323,7 @@ Mono> listJobs(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listJobsSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/routing/jobs/{jobId}/position") @@ -334,7 +334,7 @@ Response listJobsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getQueuePosition(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/routing/jobs/{jobId}/position") @ExpectedResponses({ 200 }) @@ -344,7 +344,7 @@ Mono> getQueuePosition(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(HttpResponseException.class) Response getQueuePositionSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/routing/jobs/{jobId}/assignments/{assignmentId}:unassign") @ExpectedResponses({ 200 }) @@ -354,7 +354,7 @@ Response getQueuePositionSync(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> unassignJob(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, - @PathParam("assignmentId") String assignmentId, @HeaderParam("accept") String accept, + @PathParam("assignmentId") String assignmentId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/routing/jobs/{jobId}/assignments/{assignmentId}:unassign") @@ -365,7 +365,7 @@ Mono> unassignJob(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response unassignJobSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, - @PathParam("assignmentId") String assignmentId, @HeaderParam("accept") String accept, + @PathParam("assignmentId") String assignmentId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/routing/workers/{workerId}/offers/{offerId}:accept") @@ -376,7 +376,7 @@ Response unassignJobSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> acceptJobOffer(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("workerId") String workerId, - @PathParam("offerId") String offerId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("offerId") String offerId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/routing/workers/{workerId}/offers/{offerId}:accept") @@ -387,7 +387,7 @@ Mono> acceptJobOffer(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(HttpResponseException.class) Response acceptJobOfferSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("workerId") String workerId, - @PathParam("offerId") String offerId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("offerId") String offerId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/routing/workers/{workerId}/offers/{offerId}:decline") @@ -398,7 +398,7 @@ Response acceptJobOfferSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> declineJobOffer(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("workerId") String workerId, - @PathParam("offerId") String offerId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("offerId") String offerId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/routing/workers/{workerId}/offers/{offerId}:decline") @@ -409,7 +409,7 @@ Mono> declineJobOffer(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(HttpResponseException.class) Response declineJobOfferSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("workerId") String workerId, - @PathParam("offerId") String offerId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("offerId") String offerId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/routing/queues/{queueId}/statistics") @@ -420,7 +420,7 @@ Response declineJobOfferSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getQueueStatistics(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("queueId") String queueId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/routing/queues/{queueId}/statistics") @ExpectedResponses({ 200 }) @@ -430,7 +430,7 @@ Mono> getQueueStatistics(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(HttpResponseException.class) Response getQueueStatisticsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("queueId") String queueId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Patch("/routing/workers/{workerId}") @ExpectedResponses({ 200, 201 }) @@ -440,7 +440,7 @@ Response getQueueStatisticsSync(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> upsertWorker(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("workerId") String workerId, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -452,7 +452,7 @@ Mono> upsertWorker(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response upsertWorkerSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("workerId") String workerId, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -464,7 +464,7 @@ Response upsertWorkerSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getWorker(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("workerId") String workerId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/routing/workers/{workerId}") @ExpectedResponses({ 200 }) @@ -474,7 +474,7 @@ Mono> getWorker(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response getWorkerSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("workerId") String workerId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/routing/workers/{workerId}") @ExpectedResponses({ 204 }) @@ -484,7 +484,7 @@ Response getWorkerSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteWorker(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("workerId") String workerId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/routing/workers/{workerId}") @ExpectedResponses({ 204 }) @@ -494,7 +494,7 @@ Mono> deleteWorker(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteWorkerSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("workerId") String workerId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/routing/workers") @ExpectedResponses({ 200 }) @@ -503,7 +503,7 @@ Response deleteWorkerSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWorkers(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/routing/workers") @@ -513,7 +513,7 @@ Mono> listWorkers(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWorkersSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -523,7 +523,7 @@ Response listWorkersSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listJobsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -533,7 +533,7 @@ Mono> listJobsNext(@PathParam(value = "nextLink", encoded = @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listJobsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -543,7 +543,7 @@ Response listJobsNextSync(@PathParam(value = "nextLink", encoded = t @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWorkersNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -553,7 +553,7 @@ Mono> listWorkersNext(@PathParam(value = "nextLink", encode @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWorkersNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/resources/META-INF/azure-communication-jobrouter_apiview_properties.json b/sdk/communication/azure-communication-jobrouter/src/main/resources/META-INF/azure-communication-jobrouter_apiview_properties.json index 976918b77eeb..7ec09f388109 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/resources/META-INF/azure-communication-jobrouter_apiview_properties.json +++ b/sdk/communication/azure-communication-jobrouter/src/main/resources/META-INF/azure-communication-jobrouter_apiview_properties.json @@ -1,7 +1,7 @@ { "flavor": "azure", "CrossLanguageDefinitionId": { - "com.azure.communication.jobrouter.JobRouterAdministrationAsyncClient": "AzureCommunicationRoutingService.JobRouterAdministrationClient", + "com.azure.communication.jobrouter.JobRouterAdministrationAsyncClient": "ClientForAcsJobRouter.JobRouterAdministrationRestClient", "com.azure.communication.jobrouter.JobRouterAdministrationAsyncClient.deleteClassificationPolicy": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.deleteClassificationPolicy", "com.azure.communication.jobrouter.JobRouterAdministrationAsyncClient.deleteClassificationPolicyWithResponse": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.deleteClassificationPolicy", "com.azure.communication.jobrouter.JobRouterAdministrationAsyncClient.deleteDistributionPolicy": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.deleteDistributionPolicy", @@ -30,7 +30,7 @@ "com.azure.communication.jobrouter.JobRouterAdministrationAsyncClient.upsertExceptionPolicyWithResponse": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.upsertExceptionPolicy", "com.azure.communication.jobrouter.JobRouterAdministrationAsyncClient.upsertQueue": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.upsertQueue", "com.azure.communication.jobrouter.JobRouterAdministrationAsyncClient.upsertQueueWithResponse": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.upsertQueue", - "com.azure.communication.jobrouter.JobRouterAdministrationClient": "AzureCommunicationRoutingService.JobRouterAdministrationClient", + "com.azure.communication.jobrouter.JobRouterAdministrationClient": "ClientForAcsJobRouter.JobRouterAdministrationRestClient", "com.azure.communication.jobrouter.JobRouterAdministrationClient.deleteClassificationPolicy": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.deleteClassificationPolicy", "com.azure.communication.jobrouter.JobRouterAdministrationClient.deleteClassificationPolicyWithResponse": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.deleteClassificationPolicy", "com.azure.communication.jobrouter.JobRouterAdministrationClient.deleteDistributionPolicy": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.deleteDistributionPolicy", @@ -59,8 +59,8 @@ "com.azure.communication.jobrouter.JobRouterAdministrationClient.upsertExceptionPolicyWithResponse": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.upsertExceptionPolicy", "com.azure.communication.jobrouter.JobRouterAdministrationClient.upsertQueue": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.upsertQueue", "com.azure.communication.jobrouter.JobRouterAdministrationClient.upsertQueueWithResponse": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.upsertQueue", - "com.azure.communication.jobrouter.JobRouterAdministrationClientBuilder": "AzureCommunicationRoutingService.JobRouterAdministrationClient", - "com.azure.communication.jobrouter.JobRouterAsyncClient": "AzureCommunicationRoutingService.JobRouterClient", + "com.azure.communication.jobrouter.JobRouterAdministrationClientBuilder": "ClientForAcsJobRouter.JobRouterAdministrationRestClient", + "com.azure.communication.jobrouter.JobRouterAsyncClient": "ClientForAcsJobRouter.JobRouterRestClient", "com.azure.communication.jobrouter.JobRouterAsyncClient.acceptJobOffer": "ClientForAcsJobRouter.JobRouterRestClient.accept", "com.azure.communication.jobrouter.JobRouterAsyncClient.acceptJobOfferWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.accept", "com.azure.communication.jobrouter.JobRouterAsyncClient.cancelJob": "ClientForAcsJobRouter.JobRouterRestClient.cancel", @@ -93,7 +93,7 @@ "com.azure.communication.jobrouter.JobRouterAsyncClient.upsertJobWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.upsertJob", "com.azure.communication.jobrouter.JobRouterAsyncClient.upsertWorker": "ClientForAcsJobRouter.JobRouterRestClient.upsertWorker", "com.azure.communication.jobrouter.JobRouterAsyncClient.upsertWorkerWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.upsertWorker", - "com.azure.communication.jobrouter.JobRouterClient": "AzureCommunicationRoutingService.JobRouterClient", + "com.azure.communication.jobrouter.JobRouterClient": "ClientForAcsJobRouter.JobRouterRestClient", "com.azure.communication.jobrouter.JobRouterClient.acceptJobOffer": "ClientForAcsJobRouter.JobRouterRestClient.accept", "com.azure.communication.jobrouter.JobRouterClient.acceptJobOfferWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.accept", "com.azure.communication.jobrouter.JobRouterClient.cancelJob": "ClientForAcsJobRouter.JobRouterRestClient.cancel", @@ -126,7 +126,7 @@ "com.azure.communication.jobrouter.JobRouterClient.upsertJobWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.upsertJob", "com.azure.communication.jobrouter.JobRouterClient.upsertWorker": "ClientForAcsJobRouter.JobRouterRestClient.upsertWorker", "com.azure.communication.jobrouter.JobRouterClient.upsertWorkerWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.upsertWorker", - "com.azure.communication.jobrouter.JobRouterClientBuilder": "AzureCommunicationRoutingService.JobRouterClient", + "com.azure.communication.jobrouter.JobRouterClientBuilder": "ClientForAcsJobRouter.JobRouterRestClient", "com.azure.communication.jobrouter.implementation.models.CancelJobResultInternal": "AzureCommunicationRoutingService.CancelJobResult", "com.azure.communication.jobrouter.implementation.models.CloseJobResultInternal": "AzureCommunicationRoutingService.CloseJobResult", "com.azure.communication.jobrouter.implementation.models.CompleteJobResultInternal": "AzureCommunicationRoutingService.CompleteJobResult", diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/MessageTemplateClientImpl.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/MessageTemplateClientImpl.java index 15d5054b68e5..43b56ec06338 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/MessageTemplateClientImpl.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/MessageTemplateClientImpl.java @@ -163,7 +163,7 @@ public interface MessageTemplateClientService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listTemplates(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("channelId") String channelId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/messages/channels/{channelId}/templates") @ExpectedResponses({ 200 }) @@ -173,7 +173,7 @@ Mono> listTemplates(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response listTemplatesSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("channelId") String channelId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -182,7 +182,7 @@ Response listTemplatesSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listTemplatesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -192,7 +192,7 @@ Mono> listTemplatesNext(@PathParam(value = "nextLink", enco @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listTemplatesNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -388,6 +388,8 @@ public PagedIterable listTemplates(String channelId, RequestOptions } /** + * List all templates for given Azure Communication Services channel + * * Get the next page of items. *

Response Body Schema

* @@ -421,6 +423,8 @@ private Mono> listTemplatesNextSinglePageAsync(String } /** + * List all templates for given Azure Communication Services channel + * * Get the next page of items. *

Response Body Schema

* diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/NotificationMessagesClientImpl.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/NotificationMessagesClientImpl.java index 7e9694dad8a9..5d6efec0ff7a 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/NotificationMessagesClientImpl.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/NotificationMessagesClientImpl.java @@ -160,9 +160,9 @@ public interface NotificationMessagesClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> send(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData notificationContent, RequestOptions requestOptions, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData notificationContent, + RequestOptions requestOptions, Context context); @Post("/messages/notifications:send") @ExpectedResponses({ 202 }) @@ -171,9 +171,9 @@ Mono> send(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response sendSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData notificationContent, RequestOptions requestOptions, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData notificationContent, + RequestOptions requestOptions, Context context); @Get("/messages/streams/{id}") @ExpectedResponses({ 200 }) @@ -183,7 +183,7 @@ Response sendSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> downloadMedia(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("id") String mediaId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/messages/streams/{id}") @ExpectedResponses({ 200 }) @@ -193,7 +193,7 @@ Mono> downloadMedia(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response downloadMediaSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("id") String mediaId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -244,6 +244,7 @@ Response downloadMediaSync(@HostParam("endpoint") String endpoint, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData notificationContent, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { @@ -260,7 +261,7 @@ public Mono> sendWithResponseAsync(BinaryData notificationC } }); return FluxUtil.withContext(context -> service.send(this.getEndpoint(), this.getServiceVersion().getVersion(), - accept, notificationContent, requestOptionsLocal, context)); + contentType, accept, notificationContent, requestOptionsLocal, context)); } /** @@ -309,6 +310,7 @@ public Mono> sendWithResponseAsync(BinaryData notificationC */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData notificationContent, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { @@ -324,8 +326,8 @@ public Response sendWithResponse(BinaryData notificationContent, Req DateTimeRfc1123.toRfc1123String(OffsetDateTime.now())); } }); - return service.sendSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, notificationContent, - requestOptionsLocal, Context.NONE); + return service.sendSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, accept, + notificationContent, requestOptionsLocal, Context.NONE); } /** @@ -346,7 +348,7 @@ public Response sendWithResponse(BinaryData notificationContent, Req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> downloadMediaWithResponseAsync(String mediaId, RequestOptions requestOptions) { - final String accept = "application/octet-stream, application/json"; + final String accept = "application/octet-stream"; return FluxUtil.withContext(context -> service.downloadMedia(this.getEndpoint(), this.getServiceVersion().getVersion(), mediaId, accept, requestOptions, context)); } @@ -369,7 +371,7 @@ public Mono> downloadMediaWithResponseAsync(String mediaId, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response downloadMediaWithResponse(String mediaId, RequestOptions requestOptions) { - final String accept = "application/octet-stream, application/json"; + final String accept = "application/octet-stream"; return service.downloadMediaSync(this.getEndpoint(), this.getServiceVersion().getVersion(), mediaId, accept, requestOptions, Context.NONE); } diff --git a/sdk/communication/azure-communication-messages/src/main/resources/META-INF/azure-communication-messages_apiview_properties.json b/sdk/communication/azure-communication-messages/src/main/resources/META-INF/azure-communication-messages_apiview_properties.json index 341dea4534fb..d1daa4831af3 100644 --- a/sdk/communication/azure-communication-messages/src/main/resources/META-INF/azure-communication-messages_apiview_properties.json +++ b/sdk/communication/azure-communication-messages/src/main/resources/META-INF/azure-communication-messages_apiview_properties.json @@ -1,22 +1,22 @@ { "flavor": "azure", "CrossLanguageDefinitionId": { - "com.azure.communication.messages.MessageTemplateAsyncClient": "Azure.Communication.MessagesService.MessageTemplateClient", + "com.azure.communication.messages.MessageTemplateAsyncClient": "ClientForAcsMessages.MessageTemplateClient", "com.azure.communication.messages.MessageTemplateAsyncClient.listTemplates": "Azure.Communication.MessagesService.MessageTemplateClient.listTemplates", - "com.azure.communication.messages.MessageTemplateClient": "Azure.Communication.MessagesService.MessageTemplateClient", + "com.azure.communication.messages.MessageTemplateClient": "ClientForAcsMessages.MessageTemplateClient", "com.azure.communication.messages.MessageTemplateClient.listTemplates": "Azure.Communication.MessagesService.MessageTemplateClient.listTemplates", - "com.azure.communication.messages.MessageTemplateClientBuilder": "Azure.Communication.MessagesService.MessageTemplateClient", - "com.azure.communication.messages.NotificationMessagesAsyncClient": "Azure.Communication.MessagesService.NotificationMessagesClient", + "com.azure.communication.messages.MessageTemplateClientBuilder": "ClientForAcsMessages.MessageTemplateClient", + "com.azure.communication.messages.NotificationMessagesAsyncClient": "ClientForAcsMessages.NotificationMessagesClient", "com.azure.communication.messages.NotificationMessagesAsyncClient.downloadMedia": "ClientForAcsMessages.NotificationMessagesClient.downloadMedia", "com.azure.communication.messages.NotificationMessagesAsyncClient.downloadMediaWithResponse": "ClientForAcsMessages.NotificationMessagesClient.downloadMedia", "com.azure.communication.messages.NotificationMessagesAsyncClient.send": "Azure.Communication.MessagesService.NotificationMessagesClient.send", "com.azure.communication.messages.NotificationMessagesAsyncClient.sendWithResponse": "Azure.Communication.MessagesService.NotificationMessagesClient.send", - "com.azure.communication.messages.NotificationMessagesClient": "Azure.Communication.MessagesService.NotificationMessagesClient", + "com.azure.communication.messages.NotificationMessagesClient": "ClientForAcsMessages.NotificationMessagesClient", "com.azure.communication.messages.NotificationMessagesClient.downloadMedia": "ClientForAcsMessages.NotificationMessagesClient.downloadMedia", "com.azure.communication.messages.NotificationMessagesClient.downloadMediaWithResponse": "ClientForAcsMessages.NotificationMessagesClient.downloadMedia", "com.azure.communication.messages.NotificationMessagesClient.send": "Azure.Communication.MessagesService.NotificationMessagesClient.send", "com.azure.communication.messages.NotificationMessagesClient.sendWithResponse": "Azure.Communication.MessagesService.NotificationMessagesClient.send", - "com.azure.communication.messages.NotificationMessagesClientBuilder": "Azure.Communication.MessagesService.NotificationMessagesClient", + "com.azure.communication.messages.NotificationMessagesClientBuilder": "ClientForAcsMessages.NotificationMessagesClient", "com.azure.communication.messages.models.CommunicationMessageKind": "Azure.Communication.MessagesService.CommunicationMessageKind", "com.azure.communication.messages.models.CommunicationMessagesChannel": "Azure.Communication.MessagesService.CommunicationMessagesChannel", "com.azure.communication.messages.models.MediaNotificationContent": "Azure.Communication.MessagesService.MediaNotificationContent", diff --git a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/fluent/AzureFleetClient.java b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/fluent/AzureFleetClient.java index fe07fb794c18..800fc3e1be1a 100644 --- a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/fluent/AzureFleetClient.java +++ b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/fluent/AzureFleetClient.java @@ -12,7 +12,7 @@ */ public interface AzureFleetClient { /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ diff --git a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/implementation/AzureFleetClientBuilder.java b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/implementation/AzureFleetClientBuilder.java index 533a8e59a3c8..9ae3496b06a8 100644 --- a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/implementation/AzureFleetClientBuilder.java +++ b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/implementation/AzureFleetClientBuilder.java @@ -20,12 +20,12 @@ @ServiceClientBuilder(serviceClients = { AzureFleetClientImpl.class }) public final class AzureFleetClientBuilder { /* - * Server parameter + * Service host */ private String endpoint; /** - * Sets Server parameter. + * Sets Service host. * * @param endpoint the endpoint value. * @return the AzureFleetClientBuilder. @@ -121,6 +121,7 @@ public AzureFleetClientBuilder serializerAdapter(SerializerAdapter serializerAda * @return an instance of AzureFleetClientImpl. */ public AzureFleetClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; HttpPipeline localPipeline = (pipeline != null) ? pipeline @@ -131,7 +132,7 @@ public AzureFleetClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); AzureFleetClientImpl client = new AzureFleetClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.endpoint, this.subscriptionId); + localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/implementation/AzureFleetClientImpl.java b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/implementation/AzureFleetClientImpl.java index 1c6069e31897..8c9bb0b0e39a 100644 --- a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/implementation/AzureFleetClientImpl.java +++ b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/implementation/AzureFleetClientImpl.java @@ -41,12 +41,12 @@ @ServiceClient(builder = AzureFleetClientBuilder.class) public final class AzureFleetClientImpl implements AzureFleetClient { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -159,7 +159,7 @@ public FleetsClient getFleets() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ AzureFleetClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, diff --git a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/implementation/FleetsClientImpl.java b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/implementation/FleetsClientImpl.java index c747796fdffd..fbdf31fcec25 100644 --- a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/implementation/FleetsClientImpl.java +++ b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/implementation/FleetsClientImpl.java @@ -80,26 +80,25 @@ public interface FleetsService { Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, - @HeaderParam("accept") String accept, @BodyParam("application/json") FleetInner resource, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") FleetInner resource, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, - @HeaderParam("accept") String accept, @BodyParam("application/json") FleetUpdate properties, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") FleetUpdate properties, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName}") @@ -108,7 +107,7 @@ Mono>> update(@HostParam("endpoint") String endpoint, Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets") @@ -116,7 +115,7 @@ Mono>> delete(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -125,7 +124,7 @@ Mono> listByResourceGroup(@HostParam("endpoint") Strin @UnexpectedResponseExceptionType(ManagementException.class) Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{name}/virtualMachineScaleSets") @@ -135,7 +134,7 @@ Mono> listVirtualMachineScaleSets( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -143,7 +142,7 @@ Mono> listVirtualMachineScaleSets( @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -151,7 +150,7 @@ Mono> listByResourceGroupNext( @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -159,7 +158,7 @@ Mono> listBySubscriptionNext( @UnexpectedResponseExceptionType(ManagementException.class) Mono> listVirtualMachineScaleSetsNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); } /** @@ -313,10 +312,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, fleetName, accept, resource, context)) + this.client.getSubscriptionId(), resourceGroupName, fleetName, contentType, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -355,10 +355,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, fleetName, accept, resource, context); + this.client.getSubscriptionId(), resourceGroupName, fleetName, contentType, accept, resource, context); } /** @@ -540,10 +541,10 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, fleetName, accept, properties, context)) + return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, contentType, accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -582,10 +583,11 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, fleetName, accept, properties, context); + resourceGroupName, fleetName, contentType, accept, properties, context); } /** @@ -1315,6 +1317,8 @@ public PagedIterable listVirtualMachineScaleSets(St } /** + * List Fleet resources by resource group + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1343,6 +1347,8 @@ private Mono> listByResourceGroupNextSinglePageAsync(S } /** + * List Fleet resources by resource group + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1370,6 +1376,8 @@ private Mono> listByResourceGroupNextSinglePageAsync(S } /** + * List Fleet resources by subscription ID + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1398,6 +1406,8 @@ private Mono> listBySubscriptionNextSinglePageAsync(St } /** + * List Fleet resources by subscription ID + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1425,6 +1435,8 @@ private Mono> listBySubscriptionNextSinglePageAsync(St } /** + * List VirtualMachineScaleSet resources by Fleet + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1453,6 +1465,8 @@ private Mono> listBySubscriptionNextSinglePageAsync(St } /** + * List VirtualMachineScaleSet resources by Fleet + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/implementation/OperationsClientImpl.java b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/implementation/OperationsClientImpl.java index 3d80ee86d336..2b20395eb04f 100644 --- a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/implementation/OperationsClientImpl.java +++ b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/implementation/OperationsClientImpl.java @@ -67,14 +67,14 @@ public interface OperationsService { @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list(@HostParam("endpoint") String endpoint, - @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" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -181,6 +181,8 @@ public PagedIterable list(Context context) { } /** + * List the operations for the provider + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -207,6 +209,8 @@ private Mono> listNextSinglePageAsync(String nextL } /** + * List the operations for the provider + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistAsyncClient.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistAsyncClient.java index 171acc42fc9c..bffb9ab343d6 100644 --- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistAsyncClient.java +++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistAsyncClient.java @@ -174,7 +174,9 @@ public Mono> deleteTextBlocklistWithResponse(String name, Request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return text Blocklist along with {@link Response} on successful completion of {@link Mono}. + * @return text Blocklist By blocklistName + * + * Returns text blocklist details along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -203,7 +205,9 @@ public Mono> getTextBlocklistWithResponse(String name, Requ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return blocklistItem by blocklistName and blocklistItemId from a text blocklist along with {@link Response} on + * @return blocklistItem By blocklistName And blocklistItemId + * + * Get blocklistItem by blocklistName and blocklistItemId from a text blocklist along with {@link Response} on * successful completion of {@link Mono}. */ @Generated @@ -242,7 +246,9 @@ public Mono> getTextBlocklistItemWithResponse(String name, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all blocklistItems in a text blocklist as paginated response with {@link PagedFlux}. + * @return all BlocklistItems By blocklistName + * + * Get all blocklistItems in a text blocklist as paginated response with {@link PagedFlux}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) @@ -268,7 +274,9 @@ public PagedFlux listTextBlocklistItems(String name, RequestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all text blocklists details as paginated response with {@link PagedFlux}. + * @return all Text Blocklists + * + * Get all text blocklists details as paginated response with {@link PagedFlux}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) @@ -367,7 +375,9 @@ public Mono deleteTextBlocklist(String name) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return text Blocklist on successful completion of {@link Mono}. + * @return text Blocklist By blocklistName + * + * Returns text blocklist details on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -391,7 +401,9 @@ public Mono getTextBlocklist(String name) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return blocklistItem by blocklistName and blocklistItemId from a text blocklist on successful completion of + * @return blocklistItem By blocklistName And blocklistItemId + * + * Get blocklistItem by blocklistName and blocklistItemId from a text blocklist on successful completion of * {@link Mono}. */ @Generated @@ -417,7 +429,9 @@ public Mono getTextBlocklistItem(String name, String blocklis * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all blocklistItems in a text blocklist as paginated response with {@link PagedFlux}. + * @return all BlocklistItems By blocklistName + * + * Get all blocklistItems in a text blocklist as paginated response with {@link PagedFlux}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) @@ -457,7 +471,9 @@ public PagedFlux listTextBlocklistItems(String name, Integer * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all blocklistItems in a text blocklist as paginated response with {@link PagedFlux}. + * @return all BlocklistItems By blocklistName + * + * Get all blocklistItems in a text blocklist as paginated response with {@link PagedFlux}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) @@ -489,7 +505,9 @@ public PagedFlux listTextBlocklistItems(String name) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all text blocklists details as paginated response with {@link PagedFlux}. + * @return all Text Blocklists + * + * Get all text blocklists details as paginated response with {@link PagedFlux}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistClient.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistClient.java index 64415b69b0ea..77fdfb75afb1 100644 --- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistClient.java +++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistClient.java @@ -167,7 +167,9 @@ public Response deleteTextBlocklistWithResponse(String name, RequestOption * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return text Blocklist along with {@link Response}. + * @return text Blocklist By blocklistName + * + * Returns text blocklist details along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -196,7 +198,9 @@ public Response getTextBlocklistWithResponse(String name, RequestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return blocklistItem by blocklistName and blocklistItemId from a text blocklist along with {@link Response}. + * @return blocklistItem By blocklistName And blocklistItemId + * + * Get blocklistItem by blocklistName and blocklistItemId from a text blocklist along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -234,7 +238,9 @@ public Response getTextBlocklistItemWithResponse(String name, String * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all blocklistItems in a text blocklist as paginated response with {@link PagedIterable}. + * @return all BlocklistItems By blocklistName + * + * Get all blocklistItems in a text blocklist as paginated response with {@link PagedIterable}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) @@ -260,7 +266,9 @@ public PagedIterable listTextBlocklistItems(String name, RequestOpti * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all text blocklists details as paginated response with {@link PagedIterable}. + * @return all Text Blocklists + * + * Get all text blocklists details as paginated response with {@link PagedIterable}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) @@ -357,7 +365,9 @@ public void deleteTextBlocklist(String name) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return text Blocklist. + * @return text Blocklist By blocklistName + * + * Returns text blocklist details. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -380,7 +390,9 @@ public TextBlocklist getTextBlocklist(String name) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return blocklistItem by blocklistName and blocklistItemId from a text blocklist. + * @return blocklistItem By blocklistName And blocklistItemId + * + * Get blocklistItem by blocklistName and blocklistItemId from a text blocklist. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -405,7 +417,9 @@ public TextBlocklistItem getTextBlocklistItem(String name, String blocklistItemI * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all blocklistItems in a text blocklist as paginated response with {@link PagedIterable}. + * @return all BlocklistItems By blocklistName + * + * Get all blocklistItems in a text blocklist as paginated response with {@link PagedIterable}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) @@ -434,7 +448,9 @@ public PagedIterable listTextBlocklistItems(String name, Inte * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all blocklistItems in a text blocklist as paginated response with {@link PagedIterable}. + * @return all BlocklistItems By blocklistName + * + * Get all blocklistItems in a text blocklist as paginated response with {@link PagedIterable}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) @@ -455,7 +471,9 @@ public PagedIterable listTextBlocklistItems(String name) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all text blocklists details as paginated response with {@link PagedIterable}. + * @return all Text Blocklists + * + * Get all text blocklists details as paginated response with {@link PagedIterable}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/BlocklistClientImpl.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/BlocklistClientImpl.java index 5f14a7e480c3..34909edb4416 100644 --- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/BlocklistClientImpl.java +++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/BlocklistClientImpl.java @@ -170,8 +170,8 @@ public interface BlocklistClientService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> addOrUpdateBlocklistItems(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("blocklistName") String name, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData options, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData options, RequestOptions requestOptions, Context context); @Post("/text/blocklists/{blocklistName}:addOrUpdateBlocklistItems") @ExpectedResponses({ 200 }) @@ -181,8 +181,8 @@ Mono> addOrUpdateBlocklistItems(@HostParam("endpoint") Stri @UnexpectedResponseExceptionType(HttpResponseException.class) Response addOrUpdateBlocklistItemsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("blocklistName") String name, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData options, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData options, RequestOptions requestOptions, Context context); @Patch("/text/blocklists/{blocklistName}") @ExpectedResponses({ 200, 201 }) @@ -192,7 +192,7 @@ Response addOrUpdateBlocklistItemsSync(@HostParam("endpoint") String @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrUpdateTextBlocklist(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("blocklistName") String name, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData options, RequestOptions requestOptions, Context context); @@ -204,7 +204,7 @@ Mono> createOrUpdateTextBlocklist(@HostParam("endpoint") St @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrUpdateTextBlocklistSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("blocklistName") String name, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData options, RequestOptions requestOptions, Context context); @@ -216,7 +216,7 @@ Response createOrUpdateTextBlocklistSync(@HostParam("endpoint") Stri @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteTextBlocklist(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("blocklistName") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/text/blocklists/{blocklistName}") @ExpectedResponses({ 204 }) @@ -226,7 +226,7 @@ Mono> deleteTextBlocklist(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteTextBlocklistSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("blocklistName") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/text/blocklists/{blocklistName}") @ExpectedResponses({ 200 }) @@ -236,7 +236,7 @@ Response deleteTextBlocklistSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getTextBlocklist(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("blocklistName") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/text/blocklists/{blocklistName}") @ExpectedResponses({ 200 }) @@ -246,7 +246,7 @@ Mono> getTextBlocklist(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(HttpResponseException.class) Response getTextBlocklistSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("blocklistName") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/text/blocklists/{blocklistName}/blocklistItems/{blocklistItemId}") @ExpectedResponses({ 200 }) @@ -256,7 +256,7 @@ Response getTextBlocklistSync(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getTextBlocklistItem(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("blocklistName") String name, - @PathParam("blocklistItemId") String blocklistItemId, @HeaderParam("accept") String accept, + @PathParam("blocklistItemId") String blocklistItemId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/text/blocklists/{blocklistName}/blocklistItems/{blocklistItemId}") @@ -267,7 +267,7 @@ Mono> getTextBlocklistItem(@HostParam("endpoint") String en @UnexpectedResponseExceptionType(HttpResponseException.class) Response getTextBlocklistItemSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("blocklistName") String name, - @PathParam("blocklistItemId") String blocklistItemId, @HeaderParam("accept") String accept, + @PathParam("blocklistItemId") String blocklistItemId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/text/blocklists/{blocklistName}/blocklistItems") @@ -278,7 +278,7 @@ Response getTextBlocklistItemSync(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listTextBlocklistItems(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("blocklistName") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/text/blocklists/{blocklistName}/blocklistItems") @ExpectedResponses({ 200 }) @@ -288,7 +288,7 @@ Mono> listTextBlocklistItems(@HostParam("endpoint") String @UnexpectedResponseExceptionType(HttpResponseException.class) Response listTextBlocklistItemsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("blocklistName") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/text/blocklists") @ExpectedResponses({ 200 }) @@ -297,7 +297,7 @@ Response listTextBlocklistItemsSync(@HostParam("endpoint") String en @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listTextBlocklists(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/text/blocklists") @@ -307,7 +307,7 @@ Mono> listTextBlocklists(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listTextBlocklistsSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/text/blocklists/{blocklistName}:removeBlocklistItems") @@ -318,8 +318,8 @@ Response listTextBlocklistsSync(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> removeBlocklistItems(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("blocklistName") String name, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData options, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData options, RequestOptions requestOptions, Context context); @Post("/text/blocklists/{blocklistName}:removeBlocklistItems") @ExpectedResponses({ 204 }) @@ -329,8 +329,8 @@ Mono> removeBlocklistItems(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(HttpResponseException.class) Response removeBlocklistItemsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("blocklistName") String name, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData options, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData options, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -340,7 +340,7 @@ Response removeBlocklistItemsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listTextBlocklistItemsNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -350,7 +350,7 @@ Mono> listTextBlocklistItemsNext( @UnexpectedResponseExceptionType(HttpResponseException.class) Response listTextBlocklistItemsNextSync( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -360,7 +360,7 @@ Response listTextBlocklistItemsNextSync( @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listTextBlocklistsNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -369,7 +369,7 @@ Mono> listTextBlocklistsNext( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listTextBlocklistsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -419,9 +419,10 @@ Response listTextBlocklistsNextSync(@PathParam(value = "nextLink", e @ServiceMethod(returns = ReturnType.SINGLE) public Mono> addOrUpdateBlocklistItemsWithResponseAsync(String name, BinaryData options, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.addOrUpdateBlocklistItems(this.getEndpoint(), - this.getServiceVersion().getVersion(), name, accept, options, requestOptions, context)); + this.getServiceVersion().getVersion(), name, contentType, accept, options, requestOptions, context)); } /** @@ -469,9 +470,10 @@ public Mono> addOrUpdateBlocklistItemsWithResponseAsync(Str @ServiceMethod(returns = ReturnType.SINGLE) public Response addOrUpdateBlocklistItemsWithResponse(String name, BinaryData options, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.addOrUpdateBlocklistItemsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), name, - accept, options, requestOptions, Context.NONE); + contentType, accept, options, requestOptions, Context.NONE); } /** @@ -613,7 +615,9 @@ public Response deleteTextBlocklistWithResponse(String name, RequestOption * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return text Blocklist along with {@link Response} on successful completion of {@link Mono}. + * @return text Blocklist By blocklistName + * + * Returns text blocklist details along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getTextBlocklistWithResponseAsync(String name, RequestOptions requestOptions) { @@ -641,7 +645,9 @@ public Mono> getTextBlocklistWithResponseAsync(String name, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return text Blocklist along with {@link Response}. + * @return text Blocklist By blocklistName + * + * Returns text blocklist details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getTextBlocklistWithResponse(String name, RequestOptions requestOptions) { @@ -671,7 +677,9 @@ public Response getTextBlocklistWithResponse(String name, RequestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return blocklistItem by blocklistName and blocklistItemId from a text blocklist along with {@link Response} on + * @return blocklistItem By blocklistName And blocklistItemId + * + * Get blocklistItem by blocklistName and blocklistItemId from a text blocklist along with {@link Response} on * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -703,7 +711,9 @@ public Mono> getTextBlocklistItemWithResponseAsync(String n * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return blocklistItem by blocklistName and blocklistItemId from a text blocklist along with {@link Response}. + * @return blocklistItem By blocklistName And blocklistItemId + * + * Get blocklistItem by blocklistName and blocklistItemId from a text blocklist along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getTextBlocklistItemWithResponse(String name, String blocklistItemId, @@ -742,7 +752,9 @@ public Response getTextBlocklistItemWithResponse(String name, String * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all blocklistItems in a text blocklist along with {@link PagedResponse} on successful completion of + * @return all BlocklistItems By blocklistName + * + * Get all blocklistItems in a text blocklist along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -785,7 +797,9 @@ private Mono> listTextBlocklistItemsSinglePageAsync(St * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all blocklistItems in a text blocklist as paginated response with {@link PagedFlux}. + * @return all BlocklistItems By blocklistName + * + * Get all blocklistItems in a text blocklist as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listTextBlocklistItemsAsync(String name, RequestOptions requestOptions) { @@ -845,7 +859,9 @@ public PagedFlux listTextBlocklistItemsAsync(String name, RequestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all blocklistItems in a text blocklist along with {@link PagedResponse}. + * @return all BlocklistItems By blocklistName + * + * Get all blocklistItems in a text blocklist along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listTextBlocklistItemsSinglePage(String name, RequestOptions requestOptions) { @@ -885,7 +901,9 @@ private PagedResponse listTextBlocklistItemsSinglePage(String name, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all blocklistItems in a text blocklist as paginated response with {@link PagedIterable}. + * @return all BlocklistItems By blocklistName + * + * Get all blocklistItems in a text blocklist as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listTextBlocklistItems(String name, RequestOptions requestOptions) { @@ -934,7 +952,9 @@ public PagedIterable listTextBlocklistItems(String name, RequestOpti * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all text blocklists details along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all Text Blocklists + * + * Get all text blocklists details along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listTextBlocklistsSinglePageAsync(RequestOptions requestOptions) { @@ -964,7 +984,9 @@ private Mono> listTextBlocklistsSinglePageAsync(Reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all text blocklists details as paginated response with {@link PagedFlux}. + * @return all Text Blocklists + * + * Get all text blocklists details as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listTextBlocklistsAsync(RequestOptions requestOptions) { @@ -993,7 +1015,9 @@ public PagedFlux listTextBlocklistsAsync(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all text blocklists details along with {@link PagedResponse}. + * @return all Text Blocklists + * + * Get all text blocklists details along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listTextBlocklistsSinglePage(RequestOptions requestOptions) { @@ -1022,7 +1046,9 @@ private PagedResponse listTextBlocklistsSinglePage(RequestOptions re * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all text blocklists details as paginated response with {@link PagedIterable}. + * @return all Text Blocklists + * + * Get all text blocklists details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listTextBlocklists(RequestOptions requestOptions) { @@ -1059,9 +1085,10 @@ public PagedIterable listTextBlocklists(RequestOptions requestOption @ServiceMethod(returns = ReturnType.SINGLE) public Mono> removeBlocklistItemsWithResponseAsync(String name, BinaryData options, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.removeBlocklistItems(this.getEndpoint(), - this.getServiceVersion().getVersion(), name, accept, options, requestOptions, context)); + this.getServiceVersion().getVersion(), name, contentType, accept, options, requestOptions, context)); } /** @@ -1090,9 +1117,10 @@ public Mono> removeBlocklistItemsWithResponseAsync(String name, B @ServiceMethod(returns = ReturnType.SINGLE) public Response removeBlocklistItemsWithResponse(String name, BinaryData options, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.removeBlocklistItemsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), name, accept, - options, requestOptions, Context.NONE); + return service.removeBlocklistItemsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), name, + contentType, accept, options, requestOptions, Context.NONE); } /** diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/ContentSafetyClientImpl.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/ContentSafetyClientImpl.java index af66d0d512d2..86b5c9f86445 100644 --- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/ContentSafetyClientImpl.java +++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/ContentSafetyClientImpl.java @@ -159,8 +159,9 @@ public interface ContentSafetyClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> analyzeImage(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData options, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData options, + RequestOptions requestOptions, Context context); @Post("/image:analyze") @ExpectedResponses({ 200 }) @@ -169,8 +170,9 @@ Mono> analyzeImage(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response analyzeImageSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData options, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData options, + RequestOptions requestOptions, Context context); @Post("/text:analyze") @ExpectedResponses({ 200 }) @@ -179,8 +181,9 @@ Response analyzeImageSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> analyzeText(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData options, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData options, + RequestOptions requestOptions, Context context); @Post("/text:analyze") @ExpectedResponses({ 200 }) @@ -189,8 +192,9 @@ Mono> analyzeText(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response analyzeTextSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData options, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData options, + RequestOptions requestOptions, Context context); } /** @@ -236,9 +240,10 @@ Response analyzeTextSync(@HostParam("endpoint") String endpoint, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> analyzeImageWithResponseAsync(BinaryData options, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.analyzeImage(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, options, requestOptions, context)); + this.getServiceVersion().getVersion(), contentType, accept, options, requestOptions, context)); } /** @@ -284,9 +289,10 @@ public Mono> analyzeImageWithResponseAsync(BinaryData optio */ @ServiceMethod(returns = ReturnType.SINGLE) public Response analyzeImageWithResponse(BinaryData options, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.analyzeImageSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, options, - requestOptions, Context.NONE); + return service.analyzeImageSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, accept, + options, requestOptions, Context.NONE); } /** @@ -340,9 +346,10 @@ public Response analyzeImageWithResponse(BinaryData options, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> analyzeTextWithResponseAsync(BinaryData options, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.analyzeText(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, options, requestOptions, context)); + this.getServiceVersion().getVersion(), contentType, accept, options, requestOptions, context)); } /** @@ -396,8 +403,9 @@ public Mono> analyzeTextWithResponseAsync(BinaryData option */ @ServiceMethod(returns = ReturnType.SINGLE) public Response analyzeTextWithResponse(BinaryData options, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.analyzeTextSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, options, - requestOptions, Context.NONE); + return service.analyzeTextSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, accept, + options, requestOptions, Context.NONE); } } diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/resources/META-INF/azure-ai-contentsafety_apiview_properties.json b/sdk/contentsafety/azure-ai-contentsafety/src/main/resources/META-INF/azure-ai-contentsafety_apiview_properties.json index 7fb8bfb766d4..1c762b068246 100644 --- a/sdk/contentsafety/azure-ai-contentsafety/src/main/resources/META-INF/azure-ai-contentsafety_apiview_properties.json +++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/resources/META-INF/azure-ai-contentsafety_apiview_properties.json @@ -1,7 +1,7 @@ { "flavor": "azure", "CrossLanguageDefinitionId": { - "com.azure.ai.contentsafety.BlocklistAsyncClient": "ContentSafety.BlocklistClient", + "com.azure.ai.contentsafety.BlocklistAsyncClient": "Customizations.BlocklistClient", "com.azure.ai.contentsafety.BlocklistAsyncClient.addOrUpdateBlocklistItems": "Customizations.BlocklistClient.addOrUpdateBlocklistItems", "com.azure.ai.contentsafety.BlocklistAsyncClient.addOrUpdateBlocklistItemsWithResponse": "Customizations.BlocklistClient.addOrUpdateBlocklistItems", "com.azure.ai.contentsafety.BlocklistAsyncClient.createOrUpdateTextBlocklist": "Customizations.BlocklistClient.createOrUpdateTextBlocklist", @@ -16,7 +16,7 @@ "com.azure.ai.contentsafety.BlocklistAsyncClient.listTextBlocklists": "Customizations.BlocklistClient.listTextBlocklists", "com.azure.ai.contentsafety.BlocklistAsyncClient.removeBlocklistItems": "Customizations.BlocklistClient.removeBlocklistItems", "com.azure.ai.contentsafety.BlocklistAsyncClient.removeBlocklistItemsWithResponse": "Customizations.BlocklistClient.removeBlocklistItems", - "com.azure.ai.contentsafety.BlocklistClient": "ContentSafety.BlocklistClient", + "com.azure.ai.contentsafety.BlocklistClient": "Customizations.BlocklistClient", "com.azure.ai.contentsafety.BlocklistClient.addOrUpdateBlocklistItems": "Customizations.BlocklistClient.addOrUpdateBlocklistItems", "com.azure.ai.contentsafety.BlocklistClient.addOrUpdateBlocklistItemsWithResponse": "Customizations.BlocklistClient.addOrUpdateBlocklistItems", "com.azure.ai.contentsafety.BlocklistClient.createOrUpdateTextBlocklist": "Customizations.BlocklistClient.createOrUpdateTextBlocklist", @@ -31,18 +31,18 @@ "com.azure.ai.contentsafety.BlocklistClient.listTextBlocklists": "Customizations.BlocklistClient.listTextBlocklists", "com.azure.ai.contentsafety.BlocklistClient.removeBlocklistItems": "Customizations.BlocklistClient.removeBlocklistItems", "com.azure.ai.contentsafety.BlocklistClient.removeBlocklistItemsWithResponse": "Customizations.BlocklistClient.removeBlocklistItems", - "com.azure.ai.contentsafety.BlocklistClientBuilder": "ContentSafety.BlocklistClient", - "com.azure.ai.contentsafety.ContentSafetyAsyncClient": "ContentSafety.ContentSafetyClient", + "com.azure.ai.contentsafety.BlocklistClientBuilder": "Customizations.BlocklistClient", + "com.azure.ai.contentsafety.ContentSafetyAsyncClient": "Customizations.ContentSafetyClient", "com.azure.ai.contentsafety.ContentSafetyAsyncClient.analyzeImage": "Customizations.ContentSafetyClient.analyzeImage", "com.azure.ai.contentsafety.ContentSafetyAsyncClient.analyzeImageWithResponse": "Customizations.ContentSafetyClient.analyzeImage", "com.azure.ai.contentsafety.ContentSafetyAsyncClient.analyzeText": "Customizations.ContentSafetyClient.analyzeText", "com.azure.ai.contentsafety.ContentSafetyAsyncClient.analyzeTextWithResponse": "Customizations.ContentSafetyClient.analyzeText", - "com.azure.ai.contentsafety.ContentSafetyClient": "ContentSafety.ContentSafetyClient", + "com.azure.ai.contentsafety.ContentSafetyClient": "Customizations.ContentSafetyClient", "com.azure.ai.contentsafety.ContentSafetyClient.analyzeImage": "Customizations.ContentSafetyClient.analyzeImage", "com.azure.ai.contentsafety.ContentSafetyClient.analyzeImageWithResponse": "Customizations.ContentSafetyClient.analyzeImage", "com.azure.ai.contentsafety.ContentSafetyClient.analyzeText": "Customizations.ContentSafetyClient.analyzeText", "com.azure.ai.contentsafety.ContentSafetyClient.analyzeTextWithResponse": "Customizations.ContentSafetyClient.analyzeText", - "com.azure.ai.contentsafety.ContentSafetyClientBuilder": "ContentSafety.ContentSafetyClient", + "com.azure.ai.contentsafety.ContentSafetyClientBuilder": "Customizations.ContentSafetyClient", "com.azure.ai.contentsafety.models.AddOrUpdateTextBlocklistItemsOptions": "ContentSafety.AddOrUpdateTextBlocklistItemsOptions", "com.azure.ai.contentsafety.models.AddOrUpdateTextBlocklistItemsResult": "ContentSafety.AddOrUpdateTextBlocklistItemsResult", "com.azure.ai.contentsafety.models.AnalyzeImageOptions": "ContentSafety.AnalyzeImageOptions", diff --git a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/implementation/DeploymentEnvironmentsClientImpl.java b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/implementation/DeploymentEnvironmentsClientImpl.java index 8cc507ab0850..6cd1af37651f 100644 --- a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/implementation/DeploymentEnvironmentsClientImpl.java +++ b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/implementation/DeploymentEnvironmentsClientImpl.java @@ -174,7 +174,7 @@ public interface DeploymentEnvironmentsClientService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listAllEnvironments(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/environments") @ExpectedResponses({ 200 }) @@ -184,7 +184,7 @@ Mono> listAllEnvironments(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(HttpResponseException.class) Response listAllEnvironmentsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/users/{userId}/environments") @ExpectedResponses({ 200 }) @@ -194,7 +194,7 @@ Response listAllEnvironmentsSync(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listEnvironments(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, - @PathParam("userId") String userId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("userId") String userId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/users/{userId}/environments") @@ -205,7 +205,7 @@ Mono> listEnvironments(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(HttpResponseException.class) Response listEnvironmentsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, - @PathParam("userId") String userId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("userId") String userId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/users/{userId}/environments/{environmentName}") @@ -217,7 +217,7 @@ Response listEnvironmentsSync(@HostParam("endpoint") String endpoint Mono> getEnvironment(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("userId") String userId, @PathParam("environmentName") String environmentName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/users/{userId}/environments/{environmentName}") @ExpectedResponses({ 200 }) @@ -228,7 +228,7 @@ Mono> getEnvironment(@HostParam("endpoint") String endpoint Response getEnvironmentSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("userId") String userId, @PathParam("environmentName") String environmentName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/projects/{projectName}/users/{userId}/environments/{environmentName}") @ExpectedResponses({ 201 }) @@ -239,8 +239,8 @@ Response getEnvironmentSync(@HostParam("endpoint") String endpoint, Mono> createOrUpdateEnvironment(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("userId") String userId, @PathParam("environmentName") String environmentName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/projects/{projectName}/users/{userId}/environments/{environmentName}") @ExpectedResponses({ 201 }) @@ -251,8 +251,8 @@ Mono> createOrUpdateEnvironment(@HostParam("endpoint") Stri Response createOrUpdateEnvironmentSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("userId") String userId, @PathParam("environmentName") String environmentName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Delete("/projects/{projectName}/users/{userId}/environments/{environmentName}") @ExpectedResponses({ 202, 204 }) @@ -263,7 +263,7 @@ Response createOrUpdateEnvironmentSync(@HostParam("endpoint") String Mono> deleteEnvironment(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("userId") String userId, @PathParam("environmentName") String environmentName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/projects/{projectName}/users/{userId}/environments/{environmentName}") @ExpectedResponses({ 202, 204 }) @@ -274,7 +274,7 @@ Mono> deleteEnvironment(@HostParam("endpoint") String endpo Response deleteEnvironmentSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("userId") String userId, @PathParam("environmentName") String environmentName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/catalogs") @ExpectedResponses({ 200 }) @@ -284,7 +284,7 @@ Response deleteEnvironmentSync(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listCatalogs(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/catalogs") @ExpectedResponses({ 200 }) @@ -294,7 +294,7 @@ Mono> listCatalogs(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response listCatalogsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/catalogs/{catalogName}") @ExpectedResponses({ 200 }) @@ -304,7 +304,7 @@ Response listCatalogsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getCatalog(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, - @PathParam("catalogName") String catalogName, @HeaderParam("accept") String accept, + @PathParam("catalogName") String catalogName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/catalogs/{catalogName}") @@ -315,7 +315,7 @@ Mono> getCatalog(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response getCatalogSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, - @PathParam("catalogName") String catalogName, @HeaderParam("accept") String accept, + @PathParam("catalogName") String catalogName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/environmentDefinitions") @@ -326,7 +326,7 @@ Response getCatalogSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listEnvironmentDefinitions(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/environmentDefinitions") @ExpectedResponses({ 200 }) @@ -336,7 +336,7 @@ Mono> listEnvironmentDefinitions(@HostParam("endpoint") Str @UnexpectedResponseExceptionType(HttpResponseException.class) Response listEnvironmentDefinitionsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/catalogs/{catalogName}/environmentDefinitions") @ExpectedResponses({ 200 }) @@ -346,7 +346,7 @@ Response listEnvironmentDefinitionsSync(@HostParam("endpoint") Strin @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listEnvironmentDefinitionsByCatalog(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, - @PathParam("catalogName") String catalogName, @HeaderParam("accept") String accept, + @PathParam("catalogName") String catalogName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/catalogs/{catalogName}/environmentDefinitions") @@ -357,7 +357,7 @@ Mono> listEnvironmentDefinitionsByCatalog(@HostParam("endpo @UnexpectedResponseExceptionType(HttpResponseException.class) Response listEnvironmentDefinitionsByCatalogSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, - @PathParam("catalogName") String catalogName, @HeaderParam("accept") String accept, + @PathParam("catalogName") String catalogName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/catalogs/{catalogName}/environmentDefinitions/{definitionName}") @@ -369,7 +369,7 @@ Response listEnvironmentDefinitionsByCatalogSync(@HostParam("endpoin Mono> getEnvironmentDefinition(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("catalogName") String catalogName, @PathParam("definitionName") String definitionName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/catalogs/{catalogName}/environmentDefinitions/{definitionName}") @ExpectedResponses({ 200 }) @@ -380,7 +380,7 @@ Mono> getEnvironmentDefinition(@HostParam("endpoint") Strin Response getEnvironmentDefinitionSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("catalogName") String catalogName, @PathParam("definitionName") String definitionName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/environmentTypes") @ExpectedResponses({ 200 }) @@ -390,7 +390,7 @@ Response getEnvironmentDefinitionSync(@HostParam("endpoint") String @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listEnvironmentTypes(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/environmentTypes") @ExpectedResponses({ 200 }) @@ -400,7 +400,7 @@ Mono> listEnvironmentTypes(@HostParam("endpoint") String en @UnexpectedResponseExceptionType(HttpResponseException.class) Response listEnvironmentTypesSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -410,7 +410,7 @@ Response listEnvironmentTypesSync(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listAllEnvironmentsNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -419,7 +419,7 @@ Mono> listAllEnvironmentsNext( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listAllEnvironmentsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -429,7 +429,7 @@ Response listAllEnvironmentsNextSync(@PathParam(value = "nextLink", @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listEnvironmentsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -439,7 +439,7 @@ Mono> listEnvironmentsNext(@PathParam(value = "nextLink", e @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listEnvironmentsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -449,7 +449,7 @@ Response listEnvironmentsNextSync(@PathParam(value = "nextLink", enc @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listCatalogsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -459,7 +459,7 @@ Mono> listCatalogsNext(@PathParam(value = "nextLink", encod @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listCatalogsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -470,7 +470,7 @@ Response listCatalogsNextSync(@PathParam(value = "nextLink", encoded @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listEnvironmentDefinitionsNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -480,7 +480,7 @@ Mono> listEnvironmentDefinitionsNext( @UnexpectedResponseExceptionType(HttpResponseException.class) Response listEnvironmentDefinitionsNextSync( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -490,7 +490,7 @@ Response listEnvironmentDefinitionsNextSync( @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listEnvironmentDefinitionsByCatalogNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -500,7 +500,7 @@ Mono> listEnvironmentDefinitionsByCatalogNext( @UnexpectedResponseExceptionType(HttpResponseException.class) Response listEnvironmentDefinitionsByCatalogNextSync( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -510,7 +510,7 @@ Response listEnvironmentDefinitionsByCatalogNextSync( @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listEnvironmentTypesNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -520,7 +520,7 @@ Mono> listEnvironmentTypesNext( @UnexpectedResponseExceptionType(HttpResponseException.class) Response listEnvironmentTypesNextSync( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -1100,10 +1100,11 @@ public Response getEnvironmentWithResponse(String projectName, Strin @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateEnvironmentWithResponseAsync(String projectName, String userId, String environmentName, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext( context -> service.createOrUpdateEnvironment(this.getEndpoint(), this.getServiceVersion().getVersion(), - projectName, userId, environmentName, accept, body, requestOptions, context)); + projectName, userId, environmentName, contentType, accept, body, requestOptions, context)); } /** @@ -1181,9 +1182,10 @@ private Mono> createOrUpdateEnvironmentWithResponseAsync(St @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateEnvironmentWithResponse(String projectName, String userId, String environmentName, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.createOrUpdateEnvironmentSync(this.getEndpoint(), this.getServiceVersion().getVersion(), - projectName, userId, environmentName, accept, body, requestOptions, Context.NONE); + projectName, userId, environmentName, contentType, accept, body, requestOptions, Context.NONE); } /** @@ -2617,6 +2619,8 @@ public PagedIterable listEnvironmentTypes(String projectName, Reques } /** + * Lists the environments for a project. + * * Get the next page of items. *

Response Body Schema

* @@ -2667,6 +2671,8 @@ private Mono> listAllEnvironmentsNextSinglePageAsync(S } /** + * Lists the environments for a project. + * * Get the next page of items. *

Response Body Schema

* @@ -2716,6 +2722,8 @@ private PagedResponse listAllEnvironmentsNextSinglePage(String nextL } /** + * Lists the environments for a project and user. + * * Get the next page of items. *

Response Body Schema

* @@ -2767,6 +2775,8 @@ private Mono> listEnvironmentsNextSinglePageAsync(Stri } /** + * Lists the environments for a project and user. + * * Get the next page of items. *

Response Body Schema

* @@ -2815,6 +2825,8 @@ private PagedResponse listEnvironmentsNextSinglePage(String nextLink } /** + * Lists all of the catalogs available for a project. + * * Get the next page of items. *

Response Body Schema

* @@ -2845,6 +2857,8 @@ private Mono> listCatalogsNextSinglePageAsync(String n } /** + * Lists all of the catalogs available for a project. + * * Get the next page of items. *

Response Body Schema

* @@ -2872,6 +2886,8 @@ private PagedResponse listCatalogsNextSinglePage(String nextLink, Re } /** + * Lists all environment definitions available for a project. + * * Get the next page of items. *

Response Body Schema

* @@ -2921,6 +2937,8 @@ private Mono> listEnvironmentDefinitionsNextSinglePage } /** + * Lists all environment definitions available for a project. + * * Get the next page of items. *

Response Body Schema

* @@ -2968,6 +2986,8 @@ private PagedResponse listEnvironmentDefinitionsNextSinglePage(Strin } /** + * Lists all environment definitions available within a catalog. + * * Get the next page of items. *

Response Body Schema

* @@ -3017,6 +3037,8 @@ private Mono> listEnvironmentDefinitionsByCatalogNextS } /** + * Lists all environment definitions available within a catalog. + * * Get the next page of items. *

Response Body Schema

* @@ -3064,6 +3086,8 @@ private PagedResponse listEnvironmentDefinitionsByCatalogNextSingleP } /** + * Lists all environment types configured for a project. + * * Get the next page of items. *

Response Body Schema

* @@ -3095,6 +3119,8 @@ private Mono> listEnvironmentTypesNextSinglePageAsync( } /** + * Lists all environment types configured for a project. + * * Get the next page of items. *

Response Body Schema

* diff --git a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/implementation/DevBoxesClientImpl.java b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/implementation/DevBoxesClientImpl.java index f1e8865ff014..e3e9a7455a03 100644 --- a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/implementation/DevBoxesClientImpl.java +++ b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/implementation/DevBoxesClientImpl.java @@ -173,7 +173,7 @@ public interface DevBoxesClientService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listPools(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/pools") @ExpectedResponses({ 200 }) @@ -183,7 +183,7 @@ Mono> listPools(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response listPoolsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/pools/{poolName}") @ExpectedResponses({ 200 }) @@ -193,7 +193,7 @@ Response listPoolsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getPool(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, - @PathParam("poolName") String poolName, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("poolName") String poolName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/pools/{poolName}") @@ -204,7 +204,7 @@ Mono> getPool(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response getPoolSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, - @PathParam("poolName") String poolName, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("poolName") String poolName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/pools/{poolName}/schedules") @@ -215,7 +215,7 @@ Response getPoolSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listSchedules(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, - @PathParam("poolName") String poolName, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("poolName") String poolName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/pools/{poolName}/schedules") @@ -226,7 +226,7 @@ Mono> listSchedules(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response listSchedulesSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, - @PathParam("poolName") String poolName, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("poolName") String poolName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}") @@ -238,7 +238,7 @@ Response listSchedulesSync(@HostParam("endpoint") String endpoint, Mono> getSchedule(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("poolName") String poolName, @PathParam("scheduleName") String scheduleName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}") @ExpectedResponses({ 200 }) @@ -249,7 +249,7 @@ Mono> getSchedule(@HostParam("endpoint") String endpoint, Response getScheduleSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("poolName") String poolName, @PathParam("scheduleName") String scheduleName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/devboxes") @ExpectedResponses({ 200 }) @@ -258,7 +258,7 @@ Response getScheduleSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listAllDevBoxes(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/devboxes") @@ -268,7 +268,7 @@ Mono> listAllDevBoxes(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listAllDevBoxesSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/users/{userId}/devboxes") @@ -279,7 +279,7 @@ Response listAllDevBoxesSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listAllDevBoxesByUser(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("userId") String userId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/users/{userId}/devboxes") @ExpectedResponses({ 200 }) @@ -289,7 +289,7 @@ Mono> listAllDevBoxesByUser(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(HttpResponseException.class) Response listAllDevBoxesByUserSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("userId") String userId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/users/{userId}/devboxes") @ExpectedResponses({ 200 }) @@ -299,7 +299,7 @@ Response listAllDevBoxesByUserSync(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listDevBoxes(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, - @PathParam("userId") String userId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("userId") String userId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/users/{userId}/devboxes") @@ -310,7 +310,7 @@ Mono> listDevBoxes(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response listDevBoxesSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, - @PathParam("userId") String userId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("userId") String userId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/users/{userId}/devboxes/{devBoxName}") @@ -322,7 +322,7 @@ Response listDevBoxesSync(@HostParam("endpoint") String endpoint, Mono> getDevBox(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("userId") String userId, @PathParam("devBoxName") String devBoxName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/users/{userId}/devboxes/{devBoxName}") @ExpectedResponses({ 200 }) @@ -333,7 +333,7 @@ Mono> getDevBox(@HostParam("endpoint") String endpoint, Response getDevBoxSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("userId") String userId, @PathParam("devBoxName") String devBoxName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/projects/{projectName}/users/{userId}/devboxes/{devBoxName}") @ExpectedResponses({ 200, 201 }) @@ -344,8 +344,8 @@ Response getDevBoxSync(@HostParam("endpoint") String endpoint, Mono> createDevBox(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("userId") String userId, @PathParam("devBoxName") String devBoxName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/projects/{projectName}/users/{userId}/devboxes/{devBoxName}") @ExpectedResponses({ 200, 201 }) @@ -356,8 +356,8 @@ Mono> createDevBox(@HostParam("endpoint") String endpoint, Response createDevBoxSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("userId") String userId, @PathParam("devBoxName") String devBoxName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Delete("/projects/{projectName}/users/{userId}/devboxes/{devBoxName}") @ExpectedResponses({ 202, 204 }) @@ -368,7 +368,7 @@ Response createDevBoxSync(@HostParam("endpoint") String endpoint, Mono> deleteDevBox(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("userId") String userId, @PathParam("devBoxName") String devBoxName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/projects/{projectName}/users/{userId}/devboxes/{devBoxName}") @ExpectedResponses({ 202, 204 }) @@ -379,7 +379,7 @@ Mono> deleteDevBox(@HostParam("endpoint") String endpoint, Response deleteDevBoxSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("userId") String userId, @PathParam("devBoxName") String devBoxName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/projects/{projectName}/users/{userId}/devboxes/{devBoxName}:start") @ExpectedResponses({ 202 }) @@ -390,7 +390,7 @@ Response deleteDevBoxSync(@HostParam("endpoint") String endpoint, Mono> startDevBox(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("userId") String userId, @PathParam("devBoxName") String devBoxName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/projects/{projectName}/users/{userId}/devboxes/{devBoxName}:start") @ExpectedResponses({ 202 }) @@ -401,7 +401,7 @@ Mono> startDevBox(@HostParam("endpoint") String endpoint, Response startDevBoxSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("userId") String userId, @PathParam("devBoxName") String devBoxName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/projects/{projectName}/users/{userId}/devboxes/{devBoxName}:stop") @ExpectedResponses({ 202 }) @@ -412,7 +412,7 @@ Response startDevBoxSync(@HostParam("endpoint") String endpoint, Mono> stopDevBox(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("userId") String userId, @PathParam("devBoxName") String devBoxName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/projects/{projectName}/users/{userId}/devboxes/{devBoxName}:stop") @ExpectedResponses({ 202 }) @@ -423,7 +423,7 @@ Mono> stopDevBox(@HostParam("endpoint") String endpoint, Response stopDevBoxSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("userId") String userId, @PathParam("devBoxName") String devBoxName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/projects/{projectName}/users/{userId}/devboxes/{devBoxName}:restart") @ExpectedResponses({ 202 }) @@ -434,7 +434,7 @@ Response stopDevBoxSync(@HostParam("endpoint") String endpoint, Mono> restartDevBox(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("userId") String userId, @PathParam("devBoxName") String devBoxName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/projects/{projectName}/users/{userId}/devboxes/{devBoxName}:restart") @ExpectedResponses({ 202 }) @@ -445,7 +445,7 @@ Mono> restartDevBox(@HostParam("endpoint") String endpoint, Response restartDevBoxSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("userId") String userId, @PathParam("devBoxName") String devBoxName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/users/{userId}/devboxes/{devBoxName}/remoteConnection") @ExpectedResponses({ 200 }) @@ -456,7 +456,7 @@ Response restartDevBoxSync(@HostParam("endpoint") String endpoint, Mono> getRemoteConnection(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("userId") String userId, @PathParam("devBoxName") String devBoxName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/users/{userId}/devboxes/{devBoxName}/remoteConnection") @ExpectedResponses({ 200 }) @@ -467,7 +467,7 @@ Mono> getRemoteConnection(@HostParam("endpoint") String end Response getRemoteConnectionSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("userId") String userId, @PathParam("devBoxName") String devBoxName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/users/{userId}/devboxes/{devBoxName}/actions") @ExpectedResponses({ 200 }) @@ -478,7 +478,7 @@ Response getRemoteConnectionSync(@HostParam("endpoint") String endpo Mono> listDevBoxActions(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("userId") String userId, @PathParam("devBoxName") String devBoxName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/users/{userId}/devboxes/{devBoxName}/actions") @ExpectedResponses({ 200 }) @@ -489,7 +489,7 @@ Mono> listDevBoxActions(@HostParam("endpoint") String endpo Response listDevBoxActionsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("userId") String userId, @PathParam("devBoxName") String devBoxName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/users/{userId}/devboxes/{devBoxName}/actions/{actionName}") @ExpectedResponses({ 200 }) @@ -500,7 +500,7 @@ Response listDevBoxActionsSync(@HostParam("endpoint") String endpoin Mono> getDevBoxAction(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("userId") String userId, @PathParam("devBoxName") String devBoxName, - @PathParam("actionName") String actionName, @HeaderParam("accept") String accept, + @PathParam("actionName") String actionName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}/users/{userId}/devboxes/{devBoxName}/actions/{actionName}") @@ -512,7 +512,7 @@ Mono> getDevBoxAction(@HostParam("endpoint") String endpoin Response getDevBoxActionSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("userId") String userId, @PathParam("devBoxName") String devBoxName, - @PathParam("actionName") String actionName, @HeaderParam("accept") String accept, + @PathParam("actionName") String actionName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/projects/{projectName}/users/{userId}/devboxes/{devBoxName}/actions/{actionName}:skip") @@ -524,7 +524,7 @@ Response getDevBoxActionSync(@HostParam("endpoint") String endpoint, Mono> skipAction(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("userId") String userId, @PathParam("devBoxName") String devBoxName, - @PathParam("actionName") String actionName, @HeaderParam("accept") String accept, + @PathParam("actionName") String actionName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/projects/{projectName}/users/{userId}/devboxes/{devBoxName}/actions/{actionName}:skip") @@ -536,7 +536,7 @@ Mono> skipAction(@HostParam("endpoint") String endpoint, Response skipActionSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("userId") String userId, @PathParam("devBoxName") String devBoxName, - @PathParam("actionName") String actionName, @HeaderParam("accept") String accept, + @PathParam("actionName") String actionName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/projects/{projectName}/users/{userId}/devboxes/{devBoxName}/actions/{actionName}:delay") @@ -549,7 +549,7 @@ Mono> delayAction(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("userId") String userId, @PathParam("devBoxName") String devBoxName, @PathParam("actionName") String actionName, @QueryParam("until") OffsetDateTime delayUntil, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/projects/{projectName}/users/{userId}/devboxes/{devBoxName}/actions/{actionName}:delay") @ExpectedResponses({ 200 }) @@ -561,7 +561,7 @@ Response delayActionSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("userId") String userId, @PathParam("devBoxName") String devBoxName, @PathParam("actionName") String actionName, @QueryParam("until") OffsetDateTime delayUntil, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/projects/{projectName}/users/{userId}/devboxes/{devBoxName}/actions:delay") @ExpectedResponses({ 200 }) @@ -572,7 +572,7 @@ Response delayActionSync(@HostParam("endpoint") String endpoint, Mono> delayAllActions(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("userId") String userId, @PathParam("devBoxName") String devBoxName, - @QueryParam("until") OffsetDateTime delayUntil, @HeaderParam("accept") String accept, + @QueryParam("until") OffsetDateTime delayUntil, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/projects/{projectName}/users/{userId}/devboxes/{devBoxName}/actions:delay") @@ -584,7 +584,7 @@ Mono> delayAllActions(@HostParam("endpoint") String endpoin Response delayAllActionsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, @PathParam("userId") String userId, @PathParam("devBoxName") String devBoxName, - @QueryParam("until") OffsetDateTime delayUntil, @HeaderParam("accept") String accept, + @QueryParam("until") OffsetDateTime delayUntil, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -594,7 +594,7 @@ Response delayAllActionsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listPoolsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -604,7 +604,7 @@ Mono> listPoolsNext(@PathParam(value = "nextLink", encoded @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listPoolsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -614,7 +614,7 @@ Response listPoolsNextSync(@PathParam(value = "nextLink", encoded = @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listSchedulesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -624,7 +624,7 @@ Mono> listSchedulesNext(@PathParam(value = "nextLink", enco @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listSchedulesNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -634,7 +634,7 @@ Response listSchedulesNextSync(@PathParam(value = "nextLink", encode @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listAllDevBoxesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -644,7 +644,7 @@ Mono> listAllDevBoxesNext(@PathParam(value = "nextLink", en @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listAllDevBoxesNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -655,7 +655,7 @@ Response listAllDevBoxesNextSync(@PathParam(value = "nextLink", enco @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listAllDevBoxesByUserNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -665,7 +665,7 @@ Mono> listAllDevBoxesByUserNext( @UnexpectedResponseExceptionType(HttpResponseException.class) Response listAllDevBoxesByUserNextSync( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -674,7 +674,7 @@ Response listAllDevBoxesByUserNextSync( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listDevBoxesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -684,7 +684,7 @@ Mono> listDevBoxesNext(@PathParam(value = "nextLink", encod @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listDevBoxesNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -694,7 +694,7 @@ Response listDevBoxesNextSync(@PathParam(value = "nextLink", encoded @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listDevBoxActionsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -704,7 +704,7 @@ Mono> listDevBoxActionsNext(@PathParam(value = "nextLink", @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listDevBoxActionsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -714,7 +714,7 @@ Response listDevBoxActionsNextSync(@PathParam(value = "nextLink", en @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> delayAllActionsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -724,7 +724,7 @@ Mono> delayAllActionsNext(@PathParam(value = "nextLink", en @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response delayAllActionsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -2335,10 +2335,11 @@ public Response getDevBoxWithResponse(String projectName, String use @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createDevBoxWithResponseAsync(String projectName, String userId, String devBoxName, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createDevBox(this.getEndpoint(), this.getServiceVersion().getVersion(), - projectName, userId, devBoxName, accept, body, requestOptions, context)); + projectName, userId, devBoxName, contentType, accept, body, requestOptions, context)); } /** @@ -2457,9 +2458,10 @@ private Mono> createDevBoxWithResponseAsync(String projectN @ServiceMethod(returns = ReturnType.SINGLE) private Response createDevBoxWithResponse(String projectName, String userId, String devBoxName, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.createDevBoxSync(this.getEndpoint(), this.getServiceVersion().getVersion(), projectName, userId, - devBoxName, accept, body, requestOptions, Context.NONE); + devBoxName, contentType, accept, body, requestOptions, Context.NONE); } /** @@ -4893,6 +4895,8 @@ public PagedIterable delayAllActions(String projectName, String user } /** + * Lists available pools. + * * Get the next page of items. *

Response Body Schema

* @@ -4948,6 +4952,8 @@ private Mono> listPoolsNextSinglePageAsync(String next } /** + * Lists available pools. + * * Get the next page of items. *

Response Body Schema

* @@ -5001,6 +5007,8 @@ private PagedResponse listPoolsNextSinglePage(String nextLink, Reque } /** + * Lists all schedules within a pool that are configured by your project administrator. + * * Get the next page of items. *

Response Body Schema

* @@ -5035,6 +5043,8 @@ private Mono> listSchedulesNextSinglePageAsync(String } /** + * Lists all schedules within a pool that are configured by your project administrator. + * * Get the next page of items. *

Response Body Schema

* @@ -5066,6 +5076,8 @@ private PagedResponse listSchedulesNextSinglePage(String nextLink, R } /** + * Lists Dev Boxes that the caller has access to in the DevCenter. + * * Get the next page of items. *

Response Body Schema

* @@ -5137,6 +5149,8 @@ private Mono> listAllDevBoxesNextSinglePageAsync(Strin } /** + * Lists Dev Boxes that the caller has access to in the DevCenter. + * * Get the next page of items. *

Response Body Schema

* @@ -5205,6 +5219,8 @@ private PagedResponse listAllDevBoxesNextSinglePage(String nextLink, } /** + * Lists Dev Boxes in the Dev Center for a particular user. + * * Get the next page of items. *

Response Body Schema

* @@ -5275,6 +5291,8 @@ private Mono> listAllDevBoxesByUserNextSinglePageAsync } /** + * Lists Dev Boxes in the Dev Center for a particular user. + * * Get the next page of items. *

Response Body Schema

* @@ -5344,6 +5362,8 @@ private PagedResponse listAllDevBoxesByUserNextSinglePage(String nex } /** + * Lists Dev Boxes in the project for a particular user. + * * Get the next page of items. *

Response Body Schema

* @@ -5415,6 +5435,8 @@ private Mono> listDevBoxesNextSinglePageAsync(String n } /** + * Lists Dev Boxes in the project for a particular user. + * * Get the next page of items. *

Response Body Schema

* @@ -5483,6 +5505,8 @@ private PagedResponse listDevBoxesNextSinglePage(String nextLink, Re } /** + * Lists actions on a Dev Box. + * * Get the next page of items. *

Response Body Schema

* @@ -5519,6 +5543,8 @@ private Mono> listDevBoxActionsNextSinglePageAsync(Str } /** + * Lists actions on a Dev Box. + * * Get the next page of items. *

Response Body Schema

* @@ -5552,6 +5578,8 @@ private PagedResponse listDevBoxActionsNextSinglePage(String nextLin } /** + * Delays all actions. + * * Get the next page of items. *

Response Body Schema

* @@ -5604,6 +5632,8 @@ private Mono> delayAllActionsNextSinglePageAsync(Strin } /** + * Delays all actions. + * * Get the next page of items. *

Response Body Schema

* diff --git a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/implementation/DevCenterClientImpl.java b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/implementation/DevCenterClientImpl.java index 0b4ec1fb57b8..186d207bceb4 100644 --- a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/implementation/DevCenterClientImpl.java +++ b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/implementation/DevCenterClientImpl.java @@ -159,7 +159,7 @@ public interface DevCenterClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listProjects(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects") @@ -169,7 +169,7 @@ Mono> listProjects(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listProjectsSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}") @@ -180,7 +180,7 @@ Response listProjectsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getProject(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/projects/{projectName}") @ExpectedResponses({ 200 }) @@ -190,7 +190,7 @@ Mono> getProject(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response getProjectSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -199,7 +199,7 @@ Response getProjectSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listProjectsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -209,7 +209,7 @@ Mono> listProjectsNext(@PathParam(value = "nextLink", encod @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listProjectsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -382,6 +382,8 @@ public Response getProjectWithResponse(String projectName, RequestOp } /** + * Lists all projects. + * * Get the next page of items. *

Response Body Schema

* @@ -414,6 +416,8 @@ private Mono> listProjectsNextSinglePageAsync(String n } /** + * Lists all projects. + * * Get the next page of items. *

Response Body Schema

* diff --git a/sdk/devcenter/azure-developer-devcenter/src/main/resources/META-INF/azure-developer-devcenter_apiview_properties.json b/sdk/devcenter/azure-developer-devcenter/src/main/resources/META-INF/azure-developer-devcenter_apiview_properties.json index 113fa66daf42..4e834e262204 100644 --- a/sdk/devcenter/azure-developer-devcenter/src/main/resources/META-INF/azure-developer-devcenter_apiview_properties.json +++ b/sdk/devcenter/azure-developer-devcenter/src/main/resources/META-INF/azure-developer-devcenter_apiview_properties.json @@ -1,7 +1,7 @@ { "flavor": "azure", "CrossLanguageDefinitionId": { - "com.azure.developer.devcenter.DeploymentEnvironmentsAsyncClient": "DevCenterService.DeploymentEnvironmentsClient", + "com.azure.developer.devcenter.DeploymentEnvironmentsAsyncClient": "SdkCustomizations.EnvironmentClientOperations", "com.azure.developer.devcenter.DeploymentEnvironmentsAsyncClient.beginCreateOrUpdateEnvironment": "SdkCustomizations.EnvironmentClientOperations.createOrUpdateEnvironment", "com.azure.developer.devcenter.DeploymentEnvironmentsAsyncClient.beginCreateOrUpdateEnvironmentWithModel": "SdkCustomizations.EnvironmentClientOperations.createOrUpdateEnvironment", "com.azure.developer.devcenter.DeploymentEnvironmentsAsyncClient.beginDeleteEnvironment": "SdkCustomizations.EnvironmentClientOperations.deleteEnvironment", @@ -18,7 +18,7 @@ "com.azure.developer.devcenter.DeploymentEnvironmentsAsyncClient.listEnvironmentDefinitionsByCatalog": "SdkCustomizations.EnvironmentClientOperations.listEnvironmentDefinitionsByCatalog", "com.azure.developer.devcenter.DeploymentEnvironmentsAsyncClient.listEnvironmentTypes": "SdkCustomizations.EnvironmentClientOperations.listEnvironmentTypes", "com.azure.developer.devcenter.DeploymentEnvironmentsAsyncClient.listEnvironments": "SdkCustomizations.EnvironmentClientOperations.listEnvironments", - "com.azure.developer.devcenter.DeploymentEnvironmentsClient": "DevCenterService.DeploymentEnvironmentsClient", + "com.azure.developer.devcenter.DeploymentEnvironmentsClient": "SdkCustomizations.EnvironmentClientOperations", "com.azure.developer.devcenter.DeploymentEnvironmentsClient.beginCreateOrUpdateEnvironment": "SdkCustomizations.EnvironmentClientOperations.createOrUpdateEnvironment", "com.azure.developer.devcenter.DeploymentEnvironmentsClient.beginCreateOrUpdateEnvironmentWithModel": "SdkCustomizations.EnvironmentClientOperations.createOrUpdateEnvironment", "com.azure.developer.devcenter.DeploymentEnvironmentsClient.beginDeleteEnvironment": "SdkCustomizations.EnvironmentClientOperations.deleteEnvironment", @@ -35,8 +35,8 @@ "com.azure.developer.devcenter.DeploymentEnvironmentsClient.listEnvironmentDefinitionsByCatalog": "SdkCustomizations.EnvironmentClientOperations.listEnvironmentDefinitionsByCatalog", "com.azure.developer.devcenter.DeploymentEnvironmentsClient.listEnvironmentTypes": "SdkCustomizations.EnvironmentClientOperations.listEnvironmentTypes", "com.azure.developer.devcenter.DeploymentEnvironmentsClient.listEnvironments": "SdkCustomizations.EnvironmentClientOperations.listEnvironments", - "com.azure.developer.devcenter.DeploymentEnvironmentsClientBuilder": "DevCenterService.DeploymentEnvironmentsClient", - "com.azure.developer.devcenter.DevBoxesAsyncClient": "DevCenterService.DevBoxesClient", + "com.azure.developer.devcenter.DeploymentEnvironmentsClientBuilder": "SdkCustomizations.EnvironmentClientOperations", + "com.azure.developer.devcenter.DevBoxesAsyncClient": "SdkCustomizations.DevBoxesClientOperations", "com.azure.developer.devcenter.DevBoxesAsyncClient.beginCreateDevBox": "SdkCustomizations.DevBoxesClientOperations.createDevBox", "com.azure.developer.devcenter.DevBoxesAsyncClient.beginCreateDevBoxWithModel": "SdkCustomizations.DevBoxesClientOperations.createDevBox", "com.azure.developer.devcenter.DevBoxesAsyncClient.beginDeleteDevBox": "SdkCustomizations.DevBoxesClientOperations.deleteDevBox", @@ -68,7 +68,7 @@ "com.azure.developer.devcenter.DevBoxesAsyncClient.listSchedules": "SdkCustomizations.DevBoxesClientOperations.listSchedules", "com.azure.developer.devcenter.DevBoxesAsyncClient.skipAction": "SdkCustomizations.DevBoxesClientOperations.skipAction", "com.azure.developer.devcenter.DevBoxesAsyncClient.skipActionWithResponse": "SdkCustomizations.DevBoxesClientOperations.skipAction", - "com.azure.developer.devcenter.DevBoxesClient": "DevCenterService.DevBoxesClient", + "com.azure.developer.devcenter.DevBoxesClient": "SdkCustomizations.DevBoxesClientOperations", "com.azure.developer.devcenter.DevBoxesClient.beginCreateDevBox": "SdkCustomizations.DevBoxesClientOperations.createDevBox", "com.azure.developer.devcenter.DevBoxesClient.beginCreateDevBoxWithModel": "SdkCustomizations.DevBoxesClientOperations.createDevBox", "com.azure.developer.devcenter.DevBoxesClient.beginDeleteDevBox": "SdkCustomizations.DevBoxesClientOperations.deleteDevBox", @@ -100,16 +100,16 @@ "com.azure.developer.devcenter.DevBoxesClient.listSchedules": "SdkCustomizations.DevBoxesClientOperations.listSchedules", "com.azure.developer.devcenter.DevBoxesClient.skipAction": "SdkCustomizations.DevBoxesClientOperations.skipAction", "com.azure.developer.devcenter.DevBoxesClient.skipActionWithResponse": "SdkCustomizations.DevBoxesClientOperations.skipAction", - "com.azure.developer.devcenter.DevBoxesClientBuilder": "DevCenterService.DevBoxesClient", - "com.azure.developer.devcenter.DevCenterAsyncClient": "DevCenterService.DevCenterClient", + "com.azure.developer.devcenter.DevBoxesClientBuilder": "SdkCustomizations.DevBoxesClientOperations", + "com.azure.developer.devcenter.DevCenterAsyncClient": "SdkCustomizations.DevCenterClientOperations", "com.azure.developer.devcenter.DevCenterAsyncClient.getProject": "SdkCustomizations.DevCenterClientOperations.getProject", "com.azure.developer.devcenter.DevCenterAsyncClient.getProjectWithResponse": "SdkCustomizations.DevCenterClientOperations.getProject", "com.azure.developer.devcenter.DevCenterAsyncClient.listProjects": "SdkCustomizations.DevCenterClientOperations.listProjects", - "com.azure.developer.devcenter.DevCenterClient": "DevCenterService.DevCenterClient", + "com.azure.developer.devcenter.DevCenterClient": "SdkCustomizations.DevCenterClientOperations", "com.azure.developer.devcenter.DevCenterClient.getProject": "SdkCustomizations.DevCenterClientOperations.getProject", "com.azure.developer.devcenter.DevCenterClient.getProjectWithResponse": "SdkCustomizations.DevCenterClientOperations.getProject", "com.azure.developer.devcenter.DevCenterClient.listProjects": "SdkCustomizations.DevCenterClientOperations.listProjects", - "com.azure.developer.devcenter.DevCenterClientBuilder": "DevCenterService.DevCenterClient", + "com.azure.developer.devcenter.DevCenterClientBuilder": "SdkCustomizations.DevCenterClientOperations", "com.azure.developer.devcenter.models.DevBox": "DevCenterService.DevBox", "com.azure.developer.devcenter.models.DevBoxAction": "DevCenterService.DevBoxAction", "com.azure.developer.devcenter.models.DevBoxActionDelayResult": "DevCenterService.DevBoxActionDelayResult", diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/DeviceRegistryClient.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/DeviceRegistryClient.java index dcfc89a7db74..e2bfee52a58b 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/DeviceRegistryClient.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/DeviceRegistryClient.java @@ -12,7 +12,7 @@ */ public interface DeviceRegistryClient { /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/AssetEndpointProfilesClientImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/AssetEndpointProfilesClientImpl.java index 05b44060a32f..862608beb075 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/AssetEndpointProfilesClientImpl.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/AssetEndpointProfilesClientImpl.java @@ -80,9 +80,8 @@ Mono> getByResourceGroup(@HostParam("endpoin @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("assetEndpointProfileName") String assetEndpointProfileName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) @@ -90,10 +89,9 @@ Mono>> createOrReplace(@HostParam("endpoint") String e @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("assetEndpointProfileName") String assetEndpointProfileName, - @HeaderParam("accept") String accept, @BodyParam("application/json") AssetEndpointProfileInner resource, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AssetEndpointProfileInner resource, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) @@ -101,8 +99,8 @@ Mono>> update(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("assetEndpointProfileName") String assetEndpointProfileName, - @HeaderParam("accept") String accept, @BodyParam("application/json") AssetEndpointProfileUpdate properties, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AssetEndpointProfileUpdate properties, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}") @@ -112,7 +110,7 @@ Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("assetEndpointProfileName") String assetEndpointProfileName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles") @@ -120,7 +118,7 @@ Mono>> delete(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -129,7 +127,7 @@ Mono> listByResourceGroup(@HostParam("e @UnexpectedResponseExceptionType(ManagementException.class) Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -137,7 +135,7 @@ Mono> list(@HostParam("endpoint") Strin @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -145,7 +143,7 @@ Mono> listByResourceGroupNext( @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); } /** @@ -304,11 +302,12 @@ private Mono>> createOrReplaceWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, assetEndpointProfileName, accept, resource, - context)) + this.client.getSubscriptionId(), resourceGroupName, assetEndpointProfileName, contentType, accept, + resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -348,10 +347,12 @@ private Mono>> createOrReplaceWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, assetEndpointProfileName, accept, resource, context); + this.client.getSubscriptionId(), resourceGroupName, assetEndpointProfileName, contentType, accept, resource, + context); } /** @@ -542,9 +543,12 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, assetEndpointProfileName, accept, properties, context)) + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, assetEndpointProfileName, contentType, accept, + properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -584,10 +588,11 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, assetEndpointProfileName, accept, properties, context); + resourceGroupName, assetEndpointProfileName, contentType, accept, properties, context); } /** @@ -1187,6 +1192,8 @@ public PagedIterable list(Context context) { } /** + * List AssetEndpointProfile resources by resource group + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1215,6 +1222,8 @@ private Mono> listByResourceGroupNextSi } /** + * List AssetEndpointProfile resources by resource group + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1243,6 +1252,8 @@ private Mono> listByResourceGroupNextSi } /** + * List AssetEndpointProfile resources by subscription ID + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1271,6 +1282,8 @@ private Mono> listBySubscriptionNextSin } /** + * List AssetEndpointProfile resources by subscription ID + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/AssetsClientImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/AssetsClientImpl.java index dbbfc57a37cf..0e74559319ee 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/AssetsClientImpl.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/AssetsClientImpl.java @@ -78,26 +78,25 @@ public interface AssetsService { Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("assetName") String assetName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrReplace(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("assetName") String assetName, - @HeaderParam("accept") String accept, @BodyParam("application/json") AssetInner resource, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AssetInner resource, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("assetName") String assetName, - @HeaderParam("accept") String accept, @BodyParam("application/json") AssetUpdate properties, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AssetUpdate properties, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}") @@ -106,7 +105,7 @@ Mono>> update(@HostParam("endpoint") String endpoint, Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("assetName") String assetName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets") @@ -114,7 +113,7 @@ Mono>> delete(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -123,7 +122,7 @@ Mono> listByResourceGroup(@HostParam("endpoint") Strin @UnexpectedResponseExceptionType(ManagementException.class) Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -131,7 +130,7 @@ Mono> list(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -139,7 +138,7 @@ Mono> listByResourceGroupNext( @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); } /** @@ -293,10 +292,11 @@ private Mono>> createOrReplaceWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, assetName, accept, resource, context)) + this.client.getSubscriptionId(), resourceGroupName, assetName, contentType, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -335,10 +335,11 @@ private Mono>> createOrReplaceWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, assetName, accept, resource, context); + this.client.getSubscriptionId(), resourceGroupName, assetName, contentType, accept, resource, context); } /** @@ -522,10 +523,10 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, assetName, accept, properties, context)) + return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, assetName, contentType, accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -564,10 +565,11 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, assetName, accept, properties, context); + resourceGroupName, assetName, contentType, accept, properties, context); } /** @@ -1152,6 +1154,8 @@ public PagedIterable list(Context context) { } /** + * List Asset resources by resource group + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1180,6 +1184,8 @@ private Mono> listByResourceGroupNextSinglePageAsync(S } /** + * List Asset resources by resource group + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1207,6 +1213,8 @@ private Mono> listByResourceGroupNextSinglePageAsync(S } /** + * List Asset resources by subscription ID + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1235,6 +1243,8 @@ private Mono> listBySubscriptionNextSinglePageAsync(St } /** + * List Asset resources by subscription ID + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/DeviceRegistryClientBuilder.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/DeviceRegistryClientBuilder.java index 5cd488347c62..54d34610039a 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/DeviceRegistryClientBuilder.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/DeviceRegistryClientBuilder.java @@ -20,12 +20,12 @@ @ServiceClientBuilder(serviceClients = { DeviceRegistryClientImpl.class }) public final class DeviceRegistryClientBuilder { /* - * Server parameter + * Service host */ private String endpoint; /** - * Sets Server parameter. + * Sets Service host. * * @param endpoint the endpoint value. * @return the DeviceRegistryClientBuilder. @@ -121,6 +121,7 @@ public DeviceRegistryClientBuilder serializerAdapter(SerializerAdapter serialize * @return an instance of DeviceRegistryClientImpl. */ public DeviceRegistryClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; HttpPipeline localPipeline = (pipeline != null) ? pipeline @@ -131,7 +132,7 @@ public DeviceRegistryClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); DeviceRegistryClientImpl client = new DeviceRegistryClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.endpoint, this.subscriptionId); + localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/DeviceRegistryClientImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/DeviceRegistryClientImpl.java index 5f385ff9d223..1debc96b5ea7 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/DeviceRegistryClientImpl.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/DeviceRegistryClientImpl.java @@ -43,12 +43,12 @@ @ServiceClient(builder = DeviceRegistryClientBuilder.class) public final class DeviceRegistryClientImpl implements DeviceRegistryClient { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -189,7 +189,7 @@ public AssetEndpointProfilesClient getAssetEndpointProfiles() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ DeviceRegistryClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/OperationStatusClientImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/OperationStatusClientImpl.java index 5caeae315aca..43559249df70 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/OperationStatusClientImpl.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/OperationStatusClientImpl.java @@ -64,7 +64,7 @@ public interface OperationStatusService { Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @PathParam("operationId") String operationId, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); } /** diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/OperationsClientImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/OperationsClientImpl.java index b0bb756e6eb2..f97cb8518aee 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/OperationsClientImpl.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/OperationsClientImpl.java @@ -67,14 +67,14 @@ public interface OperationsService { @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list(@HostParam("endpoint") String endpoint, - @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" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -181,6 +181,8 @@ public PagedIterable list(Context context) { } /** + * List the operations for the provider + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -207,6 +209,8 @@ private Mono> listNextSinglePageAsync(String nextL } /** + * List the operations for the provider + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/fluent/DevOpsInfrastructureClient.java b/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/fluent/DevOpsInfrastructureClient.java index df3dc0a5b961..057f48292c48 100644 --- a/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/fluent/DevOpsInfrastructureClient.java +++ b/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/fluent/DevOpsInfrastructureClient.java @@ -12,7 +12,7 @@ */ public interface DevOpsInfrastructureClient { /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ diff --git a/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/DevOpsInfrastructureClientBuilder.java b/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/DevOpsInfrastructureClientBuilder.java index 022153a89b86..5e9aa51e154f 100644 --- a/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/DevOpsInfrastructureClientBuilder.java +++ b/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/DevOpsInfrastructureClientBuilder.java @@ -20,12 +20,12 @@ @ServiceClientBuilder(serviceClients = { DevOpsInfrastructureClientImpl.class }) public final class DevOpsInfrastructureClientBuilder { /* - * Server parameter + * Service host */ private String endpoint; /** - * Sets Server parameter. + * Sets Service host. * * @param endpoint the endpoint value. * @return the DevOpsInfrastructureClientBuilder. @@ -121,6 +121,7 @@ public DevOpsInfrastructureClientBuilder serializerAdapter(SerializerAdapter ser * @return an instance of DevOpsInfrastructureClientImpl. */ public DevOpsInfrastructureClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; HttpPipeline localPipeline = (pipeline != null) ? pipeline @@ -131,7 +132,7 @@ public DevOpsInfrastructureClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); DevOpsInfrastructureClientImpl client = new DevOpsInfrastructureClientImpl(localPipeline, - localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.endpoint, this.subscriptionId); + localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/DevOpsInfrastructureClientImpl.java b/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/DevOpsInfrastructureClientImpl.java index 43ca37f41eea..60a6302b37c4 100644 --- a/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/DevOpsInfrastructureClientImpl.java +++ b/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/DevOpsInfrastructureClientImpl.java @@ -45,12 +45,12 @@ @ServiceClient(builder = DevOpsInfrastructureClientBuilder.class) public final class DevOpsInfrastructureClientImpl implements DevOpsInfrastructureClient { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -219,7 +219,7 @@ public ImageVersionsClient getImageVersions() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ DevOpsInfrastructureClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, diff --git a/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/ImageVersionsClientImpl.java b/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/ImageVersionsClientImpl.java index 59e7fb045d33..a7d13d9f12a9 100644 --- a/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/ImageVersionsClientImpl.java +++ b/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/ImageVersionsClientImpl.java @@ -69,7 +69,7 @@ public interface ImageVersionsService { Mono> listByImage(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("imageName") String imageName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -77,7 +77,7 @@ Mono> listByImage(@HostParam("endpoint") String @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByImageNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); } /** @@ -222,6 +222,8 @@ public PagedIterable listByImage(String resourceGroupName, St } /** + * List ImageVersion resources by Image + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -249,6 +251,8 @@ private Mono> listByImageNextSinglePageAsync(St } /** + * List ImageVersion resources by Image + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/OperationsClientImpl.java b/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/OperationsClientImpl.java index 6dc0dcf314e4..bf40b9a9c7bd 100644 --- a/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/OperationsClientImpl.java +++ b/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/OperationsClientImpl.java @@ -67,14 +67,14 @@ public interface OperationsService { @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list(@HostParam("endpoint") String endpoint, - @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" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -181,6 +181,8 @@ public PagedIterable list(Context context) { } /** + * List the operations for the provider + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -207,6 +209,8 @@ private Mono> listNextSinglePageAsync(String nextL } /** + * List the operations for the provider + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/PoolsClientImpl.java b/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/PoolsClientImpl.java index 3a91b8a9f7c3..71bfe980f2be 100644 --- a/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/PoolsClientImpl.java +++ b/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/PoolsClientImpl.java @@ -78,26 +78,25 @@ public interface PoolsService { Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("poolName") String poolName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("poolName") String poolName, - @HeaderParam("accept") String accept, @BodyParam("application/json") PoolInner resource, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PoolInner resource, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("poolName") String poolName, - @HeaderParam("accept") String accept, @BodyParam("application/json") PoolUpdate properties, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PoolUpdate properties, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}") @@ -106,7 +105,7 @@ Mono>> update(@HostParam("endpoint") String endpoint, Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("poolName") String poolName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools") @@ -114,7 +113,7 @@ Mono>> delete(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -123,7 +122,7 @@ Mono> listByResourceGroup(@HostParam("endpoint") String @UnexpectedResponseExceptionType(ManagementException.class) Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -131,7 +130,7 @@ Mono> list(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -139,7 +138,7 @@ Mono> listByResourceGroupNext( @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); } /** @@ -294,10 +293,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, poolName, accept, resource, context)) + this.client.getSubscriptionId(), resourceGroupName, poolName, contentType, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -337,10 +337,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, poolName, accept, resource, context); + this.client.getSubscriptionId(), resourceGroupName, poolName, contentType, accept, resource, context); } /** @@ -529,10 +530,11 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, poolName, accept, properties, context)) + this.client.getSubscriptionId(), resourceGroupName, poolName, contentType, accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -572,10 +574,11 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, poolName, accept, properties, context); + resourceGroupName, poolName, contentType, accept, properties, context); } /** @@ -1166,6 +1169,8 @@ public PagedIterable list(Context context) { } /** + * List Pool resources by resource group + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1194,6 +1199,8 @@ private Mono> listByResourceGroupNextSinglePageAsync(St } /** + * List Pool resources by resource group + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1221,6 +1228,8 @@ private Mono> listByResourceGroupNextSinglePageAsync(St } /** + * List Pool resources by subscription ID + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1249,6 +1258,8 @@ private Mono> listBySubscriptionNextSinglePageAsync(Str } /** + * List Pool resources by subscription ID + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/ResourceDetailsClientImpl.java b/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/ResourceDetailsClientImpl.java index f372a06fadd7..470940cc24ad 100644 --- a/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/ResourceDetailsClientImpl.java +++ b/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/ResourceDetailsClientImpl.java @@ -69,7 +69,7 @@ public interface ResourceDetailsService { Mono> listByPool(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("poolName") String poolName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -77,7 +77,7 @@ Mono> listByPool(@HostParam("endpoint" @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByPoolNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); } /** @@ -224,6 +224,8 @@ public PagedIterable listByPool(String resourceGroup } /** + * List ResourceDetailsObject resources by Pool + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -251,6 +253,8 @@ private Mono> listByPoolNextSinglePage } /** + * List ResourceDetailsObject resources by Pool + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/SkusClientImpl.java b/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/SkusClientImpl.java index 9a3ae6d2d859..8b27ae87381b 100644 --- a/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/SkusClientImpl.java +++ b/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/SkusClientImpl.java @@ -67,7 +67,7 @@ public interface SkusService { @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByLocation(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("locationName") String locationName, @HeaderParam("accept") String accept, Context context); + @PathParam("locationName") String locationName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -75,7 +75,7 @@ Mono> listByLocation(@HostParam("endpoint") Stri @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByLocationNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); } /** @@ -204,6 +204,8 @@ public PagedIterable listByLocation(String locationName, Conte } /** + * List ResourceSku resources by subscription ID + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -231,6 +233,8 @@ private Mono> listByLocationNextSinglePageAsync( } /** + * List ResourceSku resources by subscription ID + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/SubscriptionUsagesClientImpl.java b/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/SubscriptionUsagesClientImpl.java index 74c3e39f5d0a..d8a6ed0fba19 100644 --- a/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/SubscriptionUsagesClientImpl.java +++ b/sdk/devopsinfrastructure/azure-resourcemanager-devopsinfrastructure/src/main/java/com/azure/resourcemanager/devopsinfrastructure/implementation/SubscriptionUsagesClientImpl.java @@ -68,14 +68,14 @@ public interface SubscriptionUsagesService { @UnexpectedResponseExceptionType(ManagementException.class) Mono> usages(@HostParam("endpoint") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, - @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" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> usagesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -203,6 +203,8 @@ public PagedIterable usages(String location, Context context) { } /** + * List Quota resources by subscription ID + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -229,6 +231,8 @@ private Mono> usagesNextSinglePageAsync(String nextLin } /** + * List Quota resources by subscription ID + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/sdk/documentintelligence/azure-ai-documentintelligence/assets.json b/sdk/documentintelligence/azure-ai-documentintelligence/assets.json index 039b7e35f674..f54124562677 100644 --- a/sdk/documentintelligence/azure-ai-documentintelligence/assets.json +++ b/sdk/documentintelligence/azure-ai-documentintelligence/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/documentintelligence/azure-ai-documentintelligence", - "Tag": "java/documentintelligence/azure-ai-documentintelligence_32bf8db3b0" + "Tag": "java/documentintelligence/azure-ai-documentintelligence_f9f065f444" } diff --git a/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/DocumentIntelligenceAsyncClient.java b/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/DocumentIntelligenceAsyncClient.java index dd2626ce1083..9094d010e167 100644 --- a/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/DocumentIntelligenceAsyncClient.java +++ b/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/DocumentIntelligenceAsyncClient.java @@ -76,6 +76,14 @@ public final class DocumentIntelligenceAsyncClient { * the form of "," separated string. * * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -122,6 +130,14 @@ public PollerFlux beginAnalyzeDocument(String modelId, R
      * the form of "," separated string.
      * 
      * You can add these to a request with {@link RequestOptions#addQueryParam}
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
diff --git a/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/DocumentIntelligenceClient.java b/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/DocumentIntelligenceClient.java
index ad7132ec6587..734b968a24ee 100644
--- a/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/DocumentIntelligenceClient.java
+++ b/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/DocumentIntelligenceClient.java
@@ -74,6 +74,14 @@ public final class DocumentIntelligenceClient {
      * the form of "," separated string.
      * 
      * You can add these to a request with {@link RequestOptions#addQueryParam}
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -120,6 +128,14 @@ public SyncPoller beginAnalyzeDocument(String modelId, R
      * the form of "," separated string.
      * 
      * You can add these to a request with {@link RequestOptions#addQueryParam}
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
diff --git a/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/implementation/DocumentIntelligenceAdministrationClientImpl.java b/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/implementation/DocumentIntelligenceAdministrationClientImpl.java
index 51a9882a1cfb..434f8156d34a 100644
--- a/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/implementation/DocumentIntelligenceAdministrationClientImpl.java
+++ b/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/implementation/DocumentIntelligenceAdministrationClientImpl.java
@@ -177,8 +177,9 @@ public interface DocumentIntelligenceAdministrationClientService {
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> buildDocumentModel(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
-            @BodyParam("application/json") BinaryData buildRequest, RequestOptions requestOptions, Context context);
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
+            @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData buildRequest,
+            RequestOptions requestOptions, Context context);
 
         @Post("/documentModels:build")
         @ExpectedResponses({ 202 })
@@ -187,8 +188,9 @@ Mono> buildDocumentModel(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response buildDocumentModelSync(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
-            @BodyParam("application/json") BinaryData buildRequest, RequestOptions requestOptions, Context context);
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
+            @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData buildRequest,
+            RequestOptions requestOptions, Context context);
 
         @Post("/documentModels:compose")
         @ExpectedResponses({ 202 })
@@ -197,8 +199,9 @@ Response buildDocumentModelSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> composeModel(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
-            @BodyParam("application/json") BinaryData composeRequest, RequestOptions requestOptions, Context context);
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
+            @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData composeRequest,
+            RequestOptions requestOptions, Context context);
 
         @Post("/documentModels:compose")
         @ExpectedResponses({ 202 })
@@ -207,8 +210,9 @@ Mono> composeModel(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response composeModelSync(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
-            @BodyParam("application/json") BinaryData composeRequest, RequestOptions requestOptions, Context context);
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
+            @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData composeRequest,
+            RequestOptions requestOptions, Context context);
 
         @Post("/documentModels:authorizeCopy")
         @ExpectedResponses({ 200 })
@@ -217,9 +221,9 @@ Response composeModelSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> authorizeModelCopy(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
-            @BodyParam("application/json") BinaryData authorizeCopyRequest, RequestOptions requestOptions,
-            Context context);
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
+            @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData authorizeCopyRequest,
+            RequestOptions requestOptions, Context context);
 
         @Post("/documentModels:authorizeCopy")
         @ExpectedResponses({ 200 })
@@ -228,9 +232,9 @@ Mono> authorizeModelCopy(@HostParam("endpoint") String endp
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response authorizeModelCopySync(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
-            @BodyParam("application/json") BinaryData authorizeCopyRequest, RequestOptions requestOptions,
-            Context context);
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
+            @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData authorizeCopyRequest,
+            RequestOptions requestOptions, Context context);
 
         @Post("/documentModels/{modelId}:copyTo")
         @ExpectedResponses({ 202 })
@@ -240,8 +244,8 @@ Response authorizeModelCopySync(@HostParam("endpoint") String endpoi
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> copyModelTo(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId,
-            @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData copyToRequest,
-            RequestOptions requestOptions, Context context);
+            @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+            @BodyParam("application/json") BinaryData copyToRequest, RequestOptions requestOptions, Context context);
 
         @Post("/documentModels/{modelId}:copyTo")
         @ExpectedResponses({ 202 })
@@ -251,8 +255,8 @@ Mono> copyModelTo(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response copyModelToSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId,
-            @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData copyToRequest,
-            RequestOptions requestOptions, Context context);
+            @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+            @BodyParam("application/json") BinaryData copyToRequest, RequestOptions requestOptions, Context context);
 
         @Get("/documentModels/{modelId}")
         @ExpectedResponses({ 200 })
@@ -262,7 +266,7 @@ Response copyModelToSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getModel(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/documentModels/{modelId}")
         @ExpectedResponses({ 200 })
@@ -272,7 +276,7 @@ Mono> getModel(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response getModelSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/documentModels")
         @ExpectedResponses({ 200 })
@@ -281,7 +285,7 @@ Response getModelSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listModels(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Get("/documentModels")
@@ -291,7 +295,7 @@ Mono> listModels(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listModelsSync(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Delete("/documentModels/{modelId}")
@@ -302,7 +306,7 @@ Response listModelsSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> deleteModel(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Delete("/documentModels/{modelId}")
         @ExpectedResponses({ 204 })
@@ -312,7 +316,7 @@ Mono> deleteModel(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response deleteModelSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/info")
         @ExpectedResponses({ 200 })
@@ -321,7 +325,7 @@ Response deleteModelSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getResourceInfo(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Get("/info")
@@ -331,7 +335,7 @@ Mono> getResourceInfo(@HostParam("endpoint") String endpoin
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response getResourceInfoSync(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Get("/operations/{operationId}")
@@ -342,7 +346,7 @@ Response getResourceInfoSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getOperation(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("operationId") String operationId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/operations/{operationId}")
         @ExpectedResponses({ 200 })
@@ -352,7 +356,7 @@ Mono> getOperation(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response getOperationSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("operationId") String operationId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/operations")
         @ExpectedResponses({ 200 })
@@ -361,7 +365,7 @@ Response getOperationSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listOperations(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Get("/operations")
@@ -371,7 +375,7 @@ Mono> listOperations(@HostParam("endpoint") String endpoint
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listOperationsSync(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Post("/documentClassifiers:build")
@@ -381,8 +385,9 @@ Response listOperationsSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> buildClassifier(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
-            @BodyParam("application/json") BinaryData buildRequest, RequestOptions requestOptions, Context context);
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
+            @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData buildRequest,
+            RequestOptions requestOptions, Context context);
 
         @Post("/documentClassifiers:build")
         @ExpectedResponses({ 202 })
@@ -391,8 +396,9 @@ Mono> buildClassifier(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response buildClassifierSync(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
-            @BodyParam("application/json") BinaryData buildRequest, RequestOptions requestOptions, Context context);
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
+            @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData buildRequest,
+            RequestOptions requestOptions, Context context);
 
         @Post("/documentClassifiers:authorizeCopy")
         @ExpectedResponses({ 200 })
@@ -401,9 +407,9 @@ Response buildClassifierSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> authorizeClassifierCopy(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
-            @BodyParam("application/json") BinaryData authorizeCopyRequest, RequestOptions requestOptions,
-            Context context);
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
+            @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData authorizeCopyRequest,
+            RequestOptions requestOptions, Context context);
 
         @Post("/documentClassifiers:authorizeCopy")
         @ExpectedResponses({ 200 })
@@ -412,9 +418,9 @@ Mono> authorizeClassifierCopy(@HostParam("endpoint") String
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response authorizeClassifierCopySync(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
-            @BodyParam("application/json") BinaryData authorizeCopyRequest, RequestOptions requestOptions,
-            Context context);
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
+            @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData authorizeCopyRequest,
+            RequestOptions requestOptions, Context context);
 
         @Post("/documentClassifiers/{classifierId}:copyTo")
         @ExpectedResponses({ 202 })
@@ -424,8 +430,8 @@ Response authorizeClassifierCopySync(@HostParam("endpoint") String e
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> copyClassifierTo(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("classifierId") String classifierId,
-            @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData copyToRequest,
-            RequestOptions requestOptions, Context context);
+            @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+            @BodyParam("application/json") BinaryData copyToRequest, RequestOptions requestOptions, Context context);
 
         @Post("/documentClassifiers/{classifierId}:copyTo")
         @ExpectedResponses({ 202 })
@@ -435,8 +441,8 @@ Mono> copyClassifierTo(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response copyClassifierToSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("classifierId") String classifierId,
-            @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData copyToRequest,
-            RequestOptions requestOptions, Context context);
+            @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+            @BodyParam("application/json") BinaryData copyToRequest, RequestOptions requestOptions, Context context);
 
         @Get("/documentClassifiers/{classifierId}")
         @ExpectedResponses({ 200 })
@@ -446,7 +452,7 @@ Response copyClassifierToSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getClassifier(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("classifierId") String classifierId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/documentClassifiers/{classifierId}")
         @ExpectedResponses({ 200 })
@@ -456,7 +462,7 @@ Mono> getClassifier(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response getClassifierSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("classifierId") String classifierId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/documentClassifiers")
         @ExpectedResponses({ 200 })
@@ -465,7 +471,7 @@ Response getClassifierSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listClassifiers(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Get("/documentClassifiers")
@@ -475,7 +481,7 @@ Mono> listClassifiers(@HostParam("endpoint") String endpoin
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listClassifiersSync(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Delete("/documentClassifiers/{classifierId}")
@@ -486,7 +492,7 @@ Response listClassifiersSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> deleteClassifier(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("classifierId") String classifierId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Delete("/documentClassifiers/{classifierId}")
         @ExpectedResponses({ 204 })
@@ -496,7 +502,7 @@ Mono> deleteClassifier(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response deleteClassifierSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("classifierId") String classifierId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("{nextLink}")
         @ExpectedResponses({ 200 })
@@ -505,7 +511,7 @@ Response deleteClassifierSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listModelsNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
-            @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("{nextLink}")
@@ -515,7 +521,7 @@ Mono> listModelsNext(@PathParam(value = "nextLink", encoded
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listModelsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
-            @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("{nextLink}")
@@ -525,7 +531,7 @@ Response listModelsNextSync(@PathParam(value = "nextLink", encoded =
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listOperationsNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
-            @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("{nextLink}")
@@ -535,7 +541,7 @@ Mono> listOperationsNext(@PathParam(value = "nextLink", enc
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listOperationsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
-            @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("{nextLink}")
@@ -545,7 +551,7 @@ Response listOperationsNextSync(@PathParam(value = "nextLink", encod
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listClassifiersNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
-            @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("{nextLink}")
@@ -555,7 +561,7 @@ Mono> listClassifiersNext(@PathParam(value = "nextLink", en
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listClassifiersNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
-            @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
     }
 
@@ -595,9 +601,10 @@ Response listClassifiersNextSync(@PathParam(value = "nextLink", enco
     @ServiceMethod(returns = ReturnType.SINGLE)
     private Mono> buildDocumentModelWithResponseAsync(BinaryData buildRequest,
         RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
         return FluxUtil.withContext(context -> service.buildDocumentModel(this.getEndpoint(),
-            this.getServiceVersion().getVersion(), accept, buildRequest, requestOptions, context));
+            this.getServiceVersion().getVersion(), contentType, accept, buildRequest, requestOptions, context));
     }
 
     /**
@@ -635,9 +642,10 @@ private Mono> buildDocumentModelWithResponseAsync(BinaryData buil
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     private Response buildDocumentModelWithResponse(BinaryData buildRequest, RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
-        return service.buildDocumentModelSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept,
-            buildRequest, requestOptions, Context.NONE);
+        return service.buildDocumentModelSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType,
+            accept, buildRequest, requestOptions, Context.NONE);
     }
 
     /**
@@ -894,9 +902,10 @@ public SyncPoller beginBuildDocumentModel(BinaryData bui
     @ServiceMethod(returns = ReturnType.SINGLE)
     private Mono> composeModelWithResponseAsync(BinaryData composeRequest,
         RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
         return FluxUtil.withContext(context -> service.composeModel(this.getEndpoint(),
-            this.getServiceVersion().getVersion(), accept, composeRequest, requestOptions, context));
+            this.getServiceVersion().getVersion(), contentType, accept, composeRequest, requestOptions, context));
     }
 
     /**
@@ -954,8 +963,9 @@ private Mono> composeModelWithResponseAsync(BinaryData composeReq
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     private Response composeModelWithResponse(BinaryData composeRequest, RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
-        return service.composeModelSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept,
+        return service.composeModelSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, accept,
             composeRequest, requestOptions, Context.NONE);
     }
 
@@ -1277,9 +1287,10 @@ public SyncPoller beginComposeModel(BinaryData composeRe
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> authorizeModelCopyWithResponseAsync(BinaryData authorizeCopyRequest,
         RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
         return FluxUtil.withContext(context -> service.authorizeModelCopy(this.getEndpoint(),
-            this.getServiceVersion().getVersion(), accept, authorizeCopyRequest, requestOptions, context));
+            this.getServiceVersion().getVersion(), contentType, accept, authorizeCopyRequest, requestOptions, context));
     }
 
     /**
@@ -1322,9 +1333,10 @@ public Mono> authorizeModelCopyWithResponseAsync(BinaryData
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response authorizeModelCopyWithResponse(BinaryData authorizeCopyRequest,
         RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
-        return service.authorizeModelCopySync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept,
-            authorizeCopyRequest, requestOptions, Context.NONE);
+        return service.authorizeModelCopySync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType,
+            accept, authorizeCopyRequest, requestOptions, Context.NONE);
     }
 
     /**
@@ -1354,9 +1366,11 @@ public Response authorizeModelCopyWithResponse(BinaryData authorizeC
     @ServiceMethod(returns = ReturnType.SINGLE)
     private Mono> copyModelToWithResponseAsync(String modelId, BinaryData copyToRequest,
         RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.copyModelTo(this.getEndpoint(),
-            this.getServiceVersion().getVersion(), modelId, accept, copyToRequest, requestOptions, context));
+        return FluxUtil
+            .withContext(context -> service.copyModelTo(this.getEndpoint(), this.getServiceVersion().getVersion(),
+                modelId, contentType, accept, copyToRequest, requestOptions, context));
     }
 
     /**
@@ -1386,9 +1400,10 @@ private Mono> copyModelToWithResponseAsync(String modelId, Binary
     @ServiceMethod(returns = ReturnType.SINGLE)
     private Response copyModelToWithResponse(String modelId, BinaryData copyToRequest,
         RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
-        return service.copyModelToSync(this.getEndpoint(), this.getServiceVersion().getVersion(), modelId, accept,
-            copyToRequest, requestOptions, Context.NONE);
+        return service.copyModelToSync(this.getEndpoint(), this.getServiceVersion().getVersion(), modelId, contentType,
+            accept, copyToRequest, requestOptions, Context.NONE);
     }
 
     /**
@@ -2461,9 +2476,10 @@ public PagedIterable listOperations(RequestOptions requestOptions) {
     @ServiceMethod(returns = ReturnType.SINGLE)
     private Mono> buildClassifierWithResponseAsync(BinaryData buildRequest,
         RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
         return FluxUtil.withContext(context -> service.buildClassifier(this.getEndpoint(),
-            this.getServiceVersion().getVersion(), accept, buildRequest, requestOptions, context));
+            this.getServiceVersion().getVersion(), contentType, accept, buildRequest, requestOptions, context));
     }
 
     /**
@@ -2502,9 +2518,10 @@ private Mono> buildClassifierWithResponseAsync(BinaryData buildRe
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     private Response buildClassifierWithResponse(BinaryData buildRequest, RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
-        return service.buildClassifierSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept,
-            buildRequest, requestOptions, Context.NONE);
+        return service.buildClassifierSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType,
+            accept, buildRequest, requestOptions, Context.NONE);
     }
 
     /**
@@ -2749,9 +2766,10 @@ public SyncPoller beginBuildClassifier(BinaryData buildR
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> authorizeClassifierCopyWithResponseAsync(BinaryData authorizeCopyRequest,
         RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
         return FluxUtil.withContext(context -> service.authorizeClassifierCopy(this.getEndpoint(),
-            this.getServiceVersion().getVersion(), accept, authorizeCopyRequest, requestOptions, context));
+            this.getServiceVersion().getVersion(), contentType, accept, authorizeCopyRequest, requestOptions, context));
     }
 
     /**
@@ -2794,9 +2812,10 @@ public Mono> authorizeClassifierCopyWithResponseAsync(Binar
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response authorizeClassifierCopyWithResponse(BinaryData authorizeCopyRequest,
         RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
-        return service.authorizeClassifierCopySync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept,
-            authorizeCopyRequest, requestOptions, Context.NONE);
+        return service.authorizeClassifierCopySync(this.getEndpoint(), this.getServiceVersion().getVersion(),
+            contentType, accept, authorizeCopyRequest, requestOptions, Context.NONE);
     }
 
     /**
@@ -2826,9 +2845,11 @@ public Response authorizeClassifierCopyWithResponse(BinaryData autho
     @ServiceMethod(returns = ReturnType.SINGLE)
     private Mono> copyClassifierToWithResponseAsync(String classifierId, BinaryData copyToRequest,
         RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.copyClassifierTo(this.getEndpoint(),
-            this.getServiceVersion().getVersion(), classifierId, accept, copyToRequest, requestOptions, context));
+        return FluxUtil
+            .withContext(context -> service.copyClassifierTo(this.getEndpoint(), this.getServiceVersion().getVersion(),
+                classifierId, contentType, accept, copyToRequest, requestOptions, context));
     }
 
     /**
@@ -2858,9 +2879,10 @@ private Mono> copyClassifierToWithResponseAsync(String classifier
     @ServiceMethod(returns = ReturnType.SINGLE)
     private Response copyClassifierToWithResponse(String classifierId, BinaryData copyToRequest,
         RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
         return service.copyClassifierToSync(this.getEndpoint(), this.getServiceVersion().getVersion(), classifierId,
-            accept, copyToRequest, requestOptions, Context.NONE);
+            contentType, accept, copyToRequest, requestOptions, Context.NONE);
     }
 
     /**
@@ -3371,6 +3393,8 @@ public Response deleteClassifierWithResponse(String classifierId, RequestO
     }
 
     /**
+     * List all document models
+     * 
      * Get the next page of items.
      * 

Response Body Schema

* @@ -3456,6 +3480,8 @@ private Mono> listModelsNextSinglePageAsync(String nex } /** + * List all document models + * * Get the next page of items. *

Response Body Schema

* @@ -3538,6 +3564,8 @@ private PagedResponse listModelsNextSinglePage(String nextLink, Requ } /** + * Lists all operations. + * * Get the next page of items. *

Response Body Schema

* @@ -3591,6 +3619,8 @@ private Mono> listOperationsNextSinglePageAsync(String } /** + * Lists all operations. + * * Get the next page of items. *

Response Body Schema

* @@ -3641,6 +3671,8 @@ private PagedResponse listOperationsNextSinglePage(String nextLink, } /** + * List all document classifiers. + * * Get the next page of items. *

Response Body Schema

* @@ -3696,6 +3728,8 @@ private Mono> listClassifiersNextSinglePageAsync(Strin } /** + * List all document classifiers. + * * Get the next page of items. *

Response Body Schema

* diff --git a/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/implementation/DocumentIntelligenceClientImpl.java b/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/implementation/DocumentIntelligenceClientImpl.java index 66455c2f2ca5..e04f9877204e 100644 --- a/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/implementation/DocumentIntelligenceClientImpl.java +++ b/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/implementation/DocumentIntelligenceClientImpl.java @@ -167,8 +167,7 @@ public interface DocumentIntelligenceClientService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> analyzeDocument(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/documentModels/{modelId}:analyze") @ExpectedResponses({ 202 }) @@ -178,8 +177,7 @@ Mono> analyzeDocument(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response analyzeDocumentSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/documentModels/{modelId}:analyzeBatch") @ExpectedResponses({ 202 }) @@ -189,8 +187,7 @@ Response analyzeDocumentSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> analyzeBatchDocuments(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/documentModels/{modelId}:analyzeBatch") @ExpectedResponses({ 202 }) @@ -200,8 +197,7 @@ Mono> analyzeBatchDocuments(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(HttpResponseException.class) Response analyzeBatchDocumentsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/documentModels/{modelId}/analyzeResults/{resultId}/pdf") @ExpectedResponses({ 200 }) @@ -211,7 +207,7 @@ Response analyzeBatchDocumentsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getAnalyzeResultPdf(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, - @PathParam("resultId") String resultId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("resultId") String resultId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/documentModels/{modelId}/analyzeResults/{resultId}/pdf") @@ -222,7 +218,7 @@ Mono> getAnalyzeResultPdf(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(HttpResponseException.class) Response getAnalyzeResultPdfSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, - @PathParam("resultId") String resultId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("resultId") String resultId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/documentModels/{modelId}/analyzeResults/{resultId}/figures/{figureId}") @@ -234,7 +230,7 @@ Response getAnalyzeResultPdfSync(@HostParam("endpoint") String endpo Mono> getAnalyzeResultFigure(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, @PathParam("resultId") String resultId, @PathParam("figureId") String figureId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/documentModels/{modelId}/analyzeResults/{resultId}/figures/{figureId}") @ExpectedResponses({ 200 }) @@ -245,7 +241,7 @@ Mono> getAnalyzeResultFigure(@HostParam("endpoint") String Response getAnalyzeResultFigureSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, @PathParam("resultId") String resultId, @PathParam("figureId") String figureId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/documentClassifiers/{classifierId}:analyze") @ExpectedResponses({ 202 }) @@ -255,7 +251,7 @@ Response getAnalyzeResultFigureSync(@HostParam("endpoint") String en @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> classifyDocument(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("classifierId") String classifierId, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData classifyRequest, RequestOptions requestOptions, Context context); @Post("/documentClassifiers/{classifierId}:analyze") @@ -266,7 +262,7 @@ Mono> classifyDocument(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response classifyDocumentSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("classifierId") String classifierId, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData classifyRequest, RequestOptions requestOptions, Context context); } @@ -293,6 +289,14 @@ Response classifyDocumentSync(@HostParam("endpoint") String endpoint, * the form of "," separated string. * * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -312,7 +316,6 @@ Response classifyDocumentSync(@HostParam("endpoint") String endpoint,
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     private Mono> analyzeDocumentWithResponseAsync(String modelId, RequestOptions requestOptions) {
-        final String contentType = "application/json";
         final String accept = "application/json";
         RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
         requestOptionsLocal.addRequestCallback(requestLocal -> {
@@ -321,7 +324,7 @@ private Mono> analyzeDocumentWithResponseAsync(String modelId, Re
             }
         });
         return FluxUtil.withContext(context -> service.analyzeDocument(this.getEndpoint(),
-            this.getServiceVersion().getVersion(), modelId, contentType, accept, requestOptionsLocal, context));
+            this.getServiceVersion().getVersion(), modelId, accept, requestOptionsLocal, context));
     }
 
     /**
@@ -347,6 +350,14 @@ private Mono> analyzeDocumentWithResponseAsync(String modelId, Re
      * the form of "," separated string.
      * 
      * You can add these to a request with {@link RequestOptions#addQueryParam}
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -366,7 +377,6 @@ private Mono> analyzeDocumentWithResponseAsync(String modelId, Re
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     private Response analyzeDocumentWithResponse(String modelId, RequestOptions requestOptions) {
-        final String contentType = "application/json";
         final String accept = "application/json";
         RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
         requestOptionsLocal.addRequestCallback(requestLocal -> {
@@ -374,8 +384,8 @@ private Response analyzeDocumentWithResponse(String modelId, RequestOption
                 requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json");
             }
         });
-        return service.analyzeDocumentSync(this.getEndpoint(), this.getServiceVersion().getVersion(), modelId,
-            contentType, accept, requestOptionsLocal, Context.NONE);
+        return service.analyzeDocumentSync(this.getEndpoint(), this.getServiceVersion().getVersion(), modelId, accept,
+            requestOptionsLocal, Context.NONE);
     }
 
     /**
@@ -401,6 +411,14 @@ private Response analyzeDocumentWithResponse(String modelId, RequestOption
      * the form of "," separated string.
      * 
      * You can add these to a request with {@link RequestOptions#addQueryParam}
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -456,6 +474,14 @@ public PollerFlux beginAnalyzeDocumentAsync(String model
      * the form of "," separated string.
      * 
      * You can add these to a request with {@link RequestOptions#addQueryParam}
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -511,6 +537,14 @@ public SyncPoller beginAnalyzeDocument(String modelId, R
      * the form of "," separated string.
      * 
      * You can add these to a request with {@link RequestOptions#addQueryParam}
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -568,6 +602,14 @@ public PollerFlux beginAnalyzeDocumentWit
      * the form of "," separated string.
      * 
      * You can add these to a request with {@link RequestOptions#addQueryParam}
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -625,6 +667,14 @@ public SyncPoller beginAnalyzeDocumentWit
      * the form of "," separated string.
      * 
      * You can add these to a request with {@link RequestOptions#addQueryParam}
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -653,7 +703,6 @@ public SyncPoller beginAnalyzeDocumentWit
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     private Mono> analyzeBatchDocumentsWithResponseAsync(String modelId, RequestOptions requestOptions) {
-        final String contentType = "application/json";
         final String accept = "application/json";
         RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
         requestOptionsLocal.addRequestCallback(requestLocal -> {
@@ -662,7 +711,7 @@ private Mono> analyzeBatchDocumentsWithResponseAsync(String model
             }
         });
         return FluxUtil.withContext(context -> service.analyzeBatchDocuments(this.getEndpoint(),
-            this.getServiceVersion().getVersion(), modelId, contentType, accept, requestOptionsLocal, context));
+            this.getServiceVersion().getVersion(), modelId, accept, requestOptionsLocal, context));
     }
 
     /**
@@ -688,6 +737,14 @@ private Mono> analyzeBatchDocumentsWithResponseAsync(String model
      * the form of "," separated string.
      * 
      * You can add these to a request with {@link RequestOptions#addQueryParam}
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -716,7 +773,6 @@ private Mono> analyzeBatchDocumentsWithResponseAsync(String model
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     private Response analyzeBatchDocumentsWithResponse(String modelId, RequestOptions requestOptions) {
-        final String contentType = "application/json";
         final String accept = "application/json";
         RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
         requestOptionsLocal.addRequestCallback(requestLocal -> {
@@ -725,7 +781,7 @@ private Response analyzeBatchDocumentsWithResponse(String modelId, Request
             }
         });
         return service.analyzeBatchDocumentsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), modelId,
-            contentType, accept, requestOptionsLocal, Context.NONE);
+            accept, requestOptionsLocal, Context.NONE);
     }
 
     /**
@@ -751,6 +807,14 @@ private Response analyzeBatchDocumentsWithResponse(String modelId, Request
      * the form of "," separated string.
      * 
      * You can add these to a request with {@link RequestOptions#addQueryParam}
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -816,6 +880,14 @@ public PollerFlux beginAnalyzeBatchDocumentsAsync(String
      * the form of "," separated string.
      * 
      * You can add these to a request with {@link RequestOptions#addQueryParam}
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -881,6 +953,14 @@ public SyncPoller beginAnalyzeBatchDocuments(String mode
      * the form of "," separated string.
      * 
      * You can add these to a request with {@link RequestOptions#addQueryParam}
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -947,6 +1027,14 @@ public SyncPoller beginAnalyzeBatchDocuments(String mode
      * the form of "," separated string.
      * 
      * You can add these to a request with {@link RequestOptions#addQueryParam}
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -1011,7 +1099,7 @@ public SyncPoller beginAnalyzeBatchDocuments(String mode
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> getAnalyzeResultPdfWithResponseAsync(String modelId, String resultId,
         RequestOptions requestOptions) {
-        final String accept = "application/pdf, application/json";
+        final String accept = "application/pdf";
         return FluxUtil.withContext(context -> service.getAnalyzeResultPdf(this.getEndpoint(),
             this.getServiceVersion().getVersion(), modelId, resultId, accept, requestOptions, context));
     }
@@ -1036,7 +1124,7 @@ public Mono> getAnalyzeResultPdfWithResponseAsync(String mo
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response getAnalyzeResultPdfWithResponse(String modelId, String resultId,
         RequestOptions requestOptions) {
-        final String accept = "application/pdf, application/json";
+        final String accept = "application/pdf";
         return service.getAnalyzeResultPdfSync(this.getEndpoint(), this.getServiceVersion().getVersion(), modelId,
             resultId, accept, requestOptions, Context.NONE);
     }
@@ -1063,7 +1151,7 @@ public Response getAnalyzeResultPdfWithResponse(String modelId, Stri
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> getAnalyzeResultFigureWithResponseAsync(String modelId, String resultId,
         String figureId, RequestOptions requestOptions) {
-        final String accept = "image/png, application/json";
+        final String accept = "image/png";
         return FluxUtil.withContext(context -> service.getAnalyzeResultFigure(this.getEndpoint(),
             this.getServiceVersion().getVersion(), modelId, resultId, figureId, accept, requestOptions, context));
     }
@@ -1089,7 +1177,7 @@ public Mono> getAnalyzeResultFigureWithResponseAsync(String
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response getAnalyzeResultFigureWithResponse(String modelId, String resultId, String figureId,
         RequestOptions requestOptions) {
-        final String accept = "image/png, application/json";
+        final String accept = "image/png";
         return service.getAnalyzeResultFigureSync(this.getEndpoint(), this.getServiceVersion().getVersion(), modelId,
             resultId, figureId, accept, requestOptions, Context.NONE);
     }
diff --git a/sdk/documentintelligence/azure-ai-documentintelligence/src/main/resources/META-INF/azure-ai-documentintelligence_apiview_properties.json b/sdk/documentintelligence/azure-ai-documentintelligence/src/main/resources/META-INF/azure-ai-documentintelligence_apiview_properties.json
index e56c45aa3777..c6e56a5006f6 100644
--- a/sdk/documentintelligence/azure-ai-documentintelligence/src/main/resources/META-INF/azure-ai-documentintelligence_apiview_properties.json
+++ b/sdk/documentintelligence/azure-ai-documentintelligence/src/main/resources/META-INF/azure-ai-documentintelligence_apiview_properties.json
@@ -1,7 +1,7 @@
 {
   "flavor": "azure", 
   "CrossLanguageDefinitionId": {
-    "com.azure.ai.documentintelligence.DocumentIntelligenceAdministrationAsyncClient": "DocumentIntelligence.DocumentIntelligenceAdministrationClient",
+    "com.azure.ai.documentintelligence.DocumentIntelligenceAdministrationAsyncClient": "ClientCustomizations.DocumentIntelligenceAdministrationClient",
     "com.azure.ai.documentintelligence.DocumentIntelligenceAdministrationAsyncClient.authorizeClassifierCopy": "ClientCustomizations.DocumentIntelligenceAdministrationClient.authorizeClassifierCopy",
     "com.azure.ai.documentintelligence.DocumentIntelligenceAdministrationAsyncClient.authorizeClassifierCopyWithResponse": "ClientCustomizations.DocumentIntelligenceAdministrationClient.authorizeClassifierCopy",
     "com.azure.ai.documentintelligence.DocumentIntelligenceAdministrationAsyncClient.authorizeModelCopy": "ClientCustomizations.DocumentIntelligenceAdministrationClient.authorizeModelCopy",
@@ -31,7 +31,7 @@
     "com.azure.ai.documentintelligence.DocumentIntelligenceAdministrationAsyncClient.listClassifiers": "ClientCustomizations.DocumentIntelligenceAdministrationClient.listClassifiers",
     "com.azure.ai.documentintelligence.DocumentIntelligenceAdministrationAsyncClient.listModels": "ClientCustomizations.DocumentIntelligenceAdministrationClient.listModels",
     "com.azure.ai.documentintelligence.DocumentIntelligenceAdministrationAsyncClient.listOperations": "ClientCustomizations.DocumentIntelligenceAdministrationClient.listOperations",
-    "com.azure.ai.documentintelligence.DocumentIntelligenceAdministrationClient": "DocumentIntelligence.DocumentIntelligenceAdministrationClient",
+    "com.azure.ai.documentintelligence.DocumentIntelligenceAdministrationClient": "ClientCustomizations.DocumentIntelligenceAdministrationClient",
     "com.azure.ai.documentintelligence.DocumentIntelligenceAdministrationClient.authorizeClassifierCopy": "ClientCustomizations.DocumentIntelligenceAdministrationClient.authorizeClassifierCopy",
     "com.azure.ai.documentintelligence.DocumentIntelligenceAdministrationClient.authorizeClassifierCopyWithResponse": "ClientCustomizations.DocumentIntelligenceAdministrationClient.authorizeClassifierCopy",
     "com.azure.ai.documentintelligence.DocumentIntelligenceAdministrationClient.authorizeModelCopy": "ClientCustomizations.DocumentIntelligenceAdministrationClient.authorizeModelCopy",
@@ -61,8 +61,8 @@
     "com.azure.ai.documentintelligence.DocumentIntelligenceAdministrationClient.listClassifiers": "ClientCustomizations.DocumentIntelligenceAdministrationClient.listClassifiers",
     "com.azure.ai.documentintelligence.DocumentIntelligenceAdministrationClient.listModels": "ClientCustomizations.DocumentIntelligenceAdministrationClient.listModels",
     "com.azure.ai.documentintelligence.DocumentIntelligenceAdministrationClient.listOperations": "ClientCustomizations.DocumentIntelligenceAdministrationClient.listOperations",
-    "com.azure.ai.documentintelligence.DocumentIntelligenceAdministrationClientBuilder": "DocumentIntelligence.DocumentIntelligenceAdministrationClient",
-    "com.azure.ai.documentintelligence.DocumentIntelligenceAsyncClient": "DocumentIntelligence.DocumentIntelligenceClient",
+    "com.azure.ai.documentintelligence.DocumentIntelligenceAdministrationClientBuilder": "ClientCustomizations.DocumentIntelligenceAdministrationClient",
+    "com.azure.ai.documentintelligence.DocumentIntelligenceAsyncClient": "ClientCustomizations.DocumentIntelligenceClient",
     "com.azure.ai.documentintelligence.DocumentIntelligenceAsyncClient.beginAnalyzeBatchDocuments": "ClientCustomizations.DocumentIntelligenceClient.analyzeBatchDocuments",
     "com.azure.ai.documentintelligence.DocumentIntelligenceAsyncClient.beginAnalyzeBatchDocumentsWithModel": "ClientCustomizations.DocumentIntelligenceClient.analyzeBatchDocuments",
     "com.azure.ai.documentintelligence.DocumentIntelligenceAsyncClient.beginAnalyzeDocument": "ClientCustomizations.DocumentIntelligenceClient.analyzeDocument",
@@ -73,7 +73,7 @@
     "com.azure.ai.documentintelligence.DocumentIntelligenceAsyncClient.getAnalyzeResultFigureWithResponse": "ClientCustomizations.DocumentIntelligenceClient.getAnalyzeResultFigure",
     "com.azure.ai.documentintelligence.DocumentIntelligenceAsyncClient.getAnalyzeResultPdf": "ClientCustomizations.DocumentIntelligenceClient.getAnalyzeResultPdf",
     "com.azure.ai.documentintelligence.DocumentIntelligenceAsyncClient.getAnalyzeResultPdfWithResponse": "ClientCustomizations.DocumentIntelligenceClient.getAnalyzeResultPdf",
-    "com.azure.ai.documentintelligence.DocumentIntelligenceClient": "DocumentIntelligence.DocumentIntelligenceClient",
+    "com.azure.ai.documentintelligence.DocumentIntelligenceClient": "ClientCustomizations.DocumentIntelligenceClient",
     "com.azure.ai.documentintelligence.DocumentIntelligenceClient.beginAnalyzeBatchDocuments": "ClientCustomizations.DocumentIntelligenceClient.analyzeBatchDocuments",
     "com.azure.ai.documentintelligence.DocumentIntelligenceClient.beginAnalyzeBatchDocumentsWithModel": "ClientCustomizations.DocumentIntelligenceClient.analyzeBatchDocuments",
     "com.azure.ai.documentintelligence.DocumentIntelligenceClient.beginAnalyzeDocument": "ClientCustomizations.DocumentIntelligenceClient.analyzeDocument",
@@ -84,7 +84,7 @@
     "com.azure.ai.documentintelligence.DocumentIntelligenceClient.getAnalyzeResultFigureWithResponse": "ClientCustomizations.DocumentIntelligenceClient.getAnalyzeResultFigure",
     "com.azure.ai.documentintelligence.DocumentIntelligenceClient.getAnalyzeResultPdf": "ClientCustomizations.DocumentIntelligenceClient.getAnalyzeResultPdf",
     "com.azure.ai.documentintelligence.DocumentIntelligenceClient.getAnalyzeResultPdfWithResponse": "ClientCustomizations.DocumentIntelligenceClient.getAnalyzeResultPdf",
-    "com.azure.ai.documentintelligence.DocumentIntelligenceClientBuilder": "DocumentIntelligence.DocumentIntelligenceClient",
+    "com.azure.ai.documentintelligence.DocumentIntelligenceClientBuilder": "ClientCustomizations.DocumentIntelligenceClient",
     "com.azure.ai.documentintelligence.models.AddressValue": "DocumentIntelligence.AddressValue",
     "com.azure.ai.documentintelligence.models.AnalyzeBatchDocumentsRequest": "DocumentIntelligence.AnalyzeBatchDocumentsRequest",
     "com.azure.ai.documentintelligence.models.AnalyzeBatchOperationDetail": "DocumentIntelligence.AnalyzeBatchOperationDetail",
diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/EasmClientImpl.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/EasmClientImpl.java
index f37991d698d7..55a2dcee6f6b 100644
--- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/EasmClientImpl.java
+++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/EasmClientImpl.java
@@ -168,7 +168,7 @@ public interface EasmClientService {
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listAssetResource(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Get("/assets")
@@ -178,7 +178,7 @@ Mono> listAssetResource(@HostParam("endpoint") String endpo
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listAssetResourceSync(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Post("/assets")
@@ -189,8 +189,8 @@ Response listAssetResourceSync(@HostParam("endpoint") String endpoin
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> updateAssets(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @QueryParam("filter") String filter,
-            @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body,
-            RequestOptions requestOptions, Context context);
+            @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+            @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context);
 
         @Post("/assets")
         @ExpectedResponses({ 200 })
@@ -200,8 +200,8 @@ Mono> updateAssets(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response updateAssetsSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @QueryParam("filter") String filter,
-            @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body,
-            RequestOptions requestOptions, Context context);
+            @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+            @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context);
 
         @Get("/assets/{assetId}")
         @ExpectedResponses({ 200 })
@@ -211,7 +211,7 @@ Response updateAssetsSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getAssetResource(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("assetId") String assetId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/assets/{assetId}")
         @ExpectedResponses({ 200 })
@@ -221,7 +221,7 @@ Mono> getAssetResource(@HostParam("endpoint") String endpoi
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response getAssetResourceSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("assetId") String assetId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/dataConnections")
         @ExpectedResponses({ 200 })
@@ -230,7 +230,7 @@ Response getAssetResourceSync(@HostParam("endpoint") String endpoint
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listDataConnection(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Get("/dataConnections")
@@ -240,7 +240,7 @@ Mono> listDataConnection(@HostParam("endpoint") String endp
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listDataConnectionSync(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Post("/dataConnections:validate")
@@ -250,8 +250,9 @@ Response listDataConnectionSync(@HostParam("endpoint") String endpoi
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> validateDataConnection(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
-            @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context);
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
+            @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body,
+            RequestOptions requestOptions, Context context);
 
         @Post("/dataConnections:validate")
         @ExpectedResponses({ 200 })
@@ -260,8 +261,9 @@ Mono> validateDataConnection(@HostParam("endpoint") String
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response validateDataConnectionSync(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
-            @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context);
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
+            @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body,
+            RequestOptions requestOptions, Context context);
 
         @Get("/dataConnections/{dataConnectionName}")
         @ExpectedResponses({ 200 })
@@ -271,7 +273,7 @@ Response validateDataConnectionSync(@HostParam("endpoint") String en
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getDataConnection(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("dataConnectionName") String dataConnectionName,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/dataConnections/{dataConnectionName}")
         @ExpectedResponses({ 200 })
@@ -281,7 +283,7 @@ Mono> getDataConnection(@HostParam("endpoint") String endpo
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response getDataConnectionSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("dataConnectionName") String dataConnectionName,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Put("/dataConnections/{dataConnectionName}")
         @ExpectedResponses({ 200 })
@@ -291,8 +293,8 @@ Response getDataConnectionSync(@HostParam("endpoint") String endpoin
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> createOrReplaceDataConnection(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("dataConnectionName") String dataConnectionName,
-            @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body,
-            RequestOptions requestOptions, Context context);
+            @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+            @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context);
 
         @Put("/dataConnections/{dataConnectionName}")
         @ExpectedResponses({ 200 })
@@ -302,8 +304,8 @@ Mono> createOrReplaceDataConnection(@HostParam("endpoint")
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response createOrReplaceDataConnectionSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("dataConnectionName") String dataConnectionName,
-            @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body,
-            RequestOptions requestOptions, Context context);
+            @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+            @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context);
 
         @Delete("/dataConnections/{dataConnectionName}")
         @ExpectedResponses({ 204 })
@@ -313,7 +315,7 @@ Response createOrReplaceDataConnectionSync(@HostParam("endpoint") St
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> deleteDataConnection(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("dataConnectionName") String dataConnectionName,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Delete("/dataConnections/{dataConnectionName}")
         @ExpectedResponses({ 204 })
@@ -323,7 +325,7 @@ Mono> deleteDataConnection(@HostParam("endpoint") String endpoint
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response deleteDataConnectionSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("dataConnectionName") String dataConnectionName,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/discoGroups")
         @ExpectedResponses({ 200 })
@@ -332,7 +334,7 @@ Response deleteDataConnectionSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listDiscoGroup(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Get("/discoGroups")
@@ -342,7 +344,7 @@ Mono> listDiscoGroup(@HostParam("endpoint") String endpoint
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listDiscoGroupSync(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Post("/discoGroups:validate")
@@ -352,8 +354,9 @@ Response listDiscoGroupSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> validateDiscoGroup(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
-            @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context);
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
+            @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body,
+            RequestOptions requestOptions, Context context);
 
         @Post("/discoGroups:validate")
         @ExpectedResponses({ 200 })
@@ -362,8 +365,9 @@ Mono> validateDiscoGroup(@HostParam("endpoint") String endp
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response validateDiscoGroupSync(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
-            @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context);
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
+            @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body,
+            RequestOptions requestOptions, Context context);
 
         @Get("/discoGroups/{groupName}")
         @ExpectedResponses({ 200 })
@@ -373,7 +377,7 @@ Response validateDiscoGroupSync(@HostParam("endpoint") String endpoi
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getDiscoGroup(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("groupName") String groupName,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/discoGroups/{groupName}")
         @ExpectedResponses({ 200 })
@@ -383,7 +387,7 @@ Mono> getDiscoGroup(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response getDiscoGroupSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("groupName") String groupName,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Put("/discoGroups/{groupName}")
         @ExpectedResponses({ 200 })
@@ -393,8 +397,8 @@ Response getDiscoGroupSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> createOrReplaceDiscoGroup(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("groupName") String groupName,
-            @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body,
-            RequestOptions requestOptions, Context context);
+            @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+            @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context);
 
         @Put("/discoGroups/{groupName}")
         @ExpectedResponses({ 200 })
@@ -404,8 +408,8 @@ Mono> createOrReplaceDiscoGroup(@HostParam("endpoint") Stri
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response createOrReplaceDiscoGroupSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("groupName") String groupName,
-            @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body,
-            RequestOptions requestOptions, Context context);
+            @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+            @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context);
 
         @Post("/discoGroups/{groupName}:run")
         @ExpectedResponses({ 204 })
@@ -415,7 +419,7 @@ Response createOrReplaceDiscoGroupSync(@HostParam("endpoint") String
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> runDiscoGroup(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("groupName") String groupName,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Post("/discoGroups/{groupName}:run")
         @ExpectedResponses({ 204 })
@@ -425,7 +429,7 @@ Mono> runDiscoGroup(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response runDiscoGroupSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("groupName") String groupName,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/discoGroups/{groupName}/runs")
         @ExpectedResponses({ 200 })
@@ -435,7 +439,7 @@ Response runDiscoGroupSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listRuns(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("groupName") String groupName,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/discoGroups/{groupName}/runs")
         @ExpectedResponses({ 200 })
@@ -445,7 +449,7 @@ Mono> listRuns(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listRunsSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("groupName") String groupName,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/discoTemplates")
         @ExpectedResponses({ 200 })
@@ -454,7 +458,7 @@ Response listRunsSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listDiscoTemplate(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Get("/discoTemplates")
@@ -464,7 +468,7 @@ Mono> listDiscoTemplate(@HostParam("endpoint") String endpo
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listDiscoTemplateSync(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Get("/discoTemplates/{templateId}")
@@ -475,7 +479,7 @@ Response listDiscoTemplateSync(@HostParam("endpoint") String endpoin
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getDiscoTemplate(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("templateId") String templateId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/discoTemplates/{templateId}")
         @ExpectedResponses({ 200 })
@@ -485,7 +489,7 @@ Mono> getDiscoTemplate(@HostParam("endpoint") String endpoi
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response getDiscoTemplateSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("templateId") String templateId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Post("/reports/assets:getBillable")
         @ExpectedResponses({ 200 })
@@ -494,7 +498,7 @@ Response getDiscoTemplateSync(@HostParam("endpoint") String endpoint
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getBillable(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Post("/reports/assets:getBillable")
@@ -504,7 +508,7 @@ Mono> getBillable(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response getBillableSync(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Post("/reports/assets:getSnapshot")
@@ -514,8 +518,9 @@ Response getBillableSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getSnapshot(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
-            @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context);
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
+            @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body,
+            RequestOptions requestOptions, Context context);
 
         @Post("/reports/assets:getSnapshot")
         @ExpectedResponses({ 200 })
@@ -524,8 +529,9 @@ Mono> getSnapshot(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response getSnapshotSync(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
-            @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context);
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
+            @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body,
+            RequestOptions requestOptions, Context context);
 
         @Post("/reports/assets:getSummary")
         @ExpectedResponses({ 200 })
@@ -534,8 +540,9 @@ Response getSnapshotSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getSummary(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
-            @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context);
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
+            @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body,
+            RequestOptions requestOptions, Context context);
 
         @Post("/reports/assets:getSummary")
         @ExpectedResponses({ 200 })
@@ -544,8 +551,9 @@ Mono> getSummary(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response getSummarySync(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
-            @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context);
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
+            @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body,
+            RequestOptions requestOptions, Context context);
 
         @Get("/savedFilters")
         @ExpectedResponses({ 200 })
@@ -554,7 +562,7 @@ Response getSummarySync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listSavedFilter(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Get("/savedFilters")
@@ -564,7 +572,7 @@ Mono> listSavedFilter(@HostParam("endpoint") String endpoin
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listSavedFilterSync(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Get("/savedFilters/{filterName}")
@@ -575,7 +583,7 @@ Response listSavedFilterSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getSavedFilter(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("filterName") String filterName,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/savedFilters/{filterName}")
         @ExpectedResponses({ 200 })
@@ -585,7 +593,7 @@ Mono> getSavedFilter(@HostParam("endpoint") String endpoint
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response getSavedFilterSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("filterName") String filterName,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Put("/savedFilters/{filterName}")
         @ExpectedResponses({ 200 })
@@ -595,8 +603,8 @@ Response getSavedFilterSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> createOrReplaceSavedFilter(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("filterName") String filterName,
-            @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body,
-            RequestOptions requestOptions, Context context);
+            @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+            @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context);
 
         @Put("/savedFilters/{filterName}")
         @ExpectedResponses({ 200 })
@@ -606,8 +614,8 @@ Mono> createOrReplaceSavedFilter(@HostParam("endpoint") Str
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response createOrReplaceSavedFilterSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("filterName") String filterName,
-            @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body,
-            RequestOptions requestOptions, Context context);
+            @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+            @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context);
 
         @Delete("/savedFilters/{filterName}")
         @ExpectedResponses({ 204 })
@@ -617,7 +625,7 @@ Response createOrReplaceSavedFilterSync(@HostParam("endpoint") Strin
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> deleteSavedFilter(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("filterName") String filterName,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Delete("/savedFilters/{filterName}")
         @ExpectedResponses({ 204 })
@@ -627,7 +635,7 @@ Mono> deleteSavedFilter(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response deleteSavedFilterSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("filterName") String filterName,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/tasks")
         @ExpectedResponses({ 200 })
@@ -636,7 +644,7 @@ Response deleteSavedFilterSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listTask(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Get("/tasks")
@@ -646,7 +654,7 @@ Mono> listTask(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listTaskSync(@HostParam("endpoint") String endpoint,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
         @Get("/tasks/{taskId}")
@@ -657,7 +665,7 @@ Response listTaskSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getTask(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("taskId") String taskId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/tasks/{taskId}")
         @ExpectedResponses({ 200 })
@@ -667,7 +675,7 @@ Mono> getTask(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response getTaskSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("taskId") String taskId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Post("/tasks/{taskId}:cancel")
         @ExpectedResponses({ 200 })
@@ -677,7 +685,7 @@ Response getTaskSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> cancelTask(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("taskId") String taskId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Post("/tasks/{taskId}:cancel")
         @ExpectedResponses({ 200 })
@@ -687,7 +695,7 @@ Mono> cancelTask(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response cancelTaskSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("taskId") String taskId,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("{nextLink}")
         @ExpectedResponses({ 200 })
@@ -696,7 +704,7 @@ Response cancelTaskSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listAssetResourceNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
-            @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("{nextLink}")
@@ -706,7 +714,7 @@ Mono> listAssetResourceNext(@PathParam(value = "nextLink",
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listAssetResourceNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
-            @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("{nextLink}")
@@ -717,7 +725,7 @@ Response listAssetResourceNextSync(@PathParam(value = "nextLink", en
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listDataConnectionNext(
             @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("{nextLink}")
         @ExpectedResponses({ 200 })
@@ -726,7 +734,7 @@ Mono> listDataConnectionNext(
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listDataConnectionNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
-            @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("{nextLink}")
@@ -736,7 +744,7 @@ Response listDataConnectionNextSync(@PathParam(value = "nextLink", e
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listDiscoGroupNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
-            @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("{nextLink}")
@@ -746,7 +754,7 @@ Mono> listDiscoGroupNext(@PathParam(value = "nextLink", enc
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listDiscoGroupNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
-            @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("{nextLink}")
@@ -756,7 +764,7 @@ Response listDiscoGroupNextSync(@PathParam(value = "nextLink", encod
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listRunsNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
-            @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("{nextLink}")
@@ -766,7 +774,7 @@ Mono> listRunsNext(@PathParam(value = "nextLink", encoded =
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listRunsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
-            @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("{nextLink}")
@@ -776,7 +784,7 @@ Response listRunsNextSync(@PathParam(value = "nextLink", encoded = t
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listDiscoTemplateNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
-            @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("{nextLink}")
@@ -786,7 +794,7 @@ Mono> listDiscoTemplateNext(@PathParam(value = "nextLink",
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listDiscoTemplateNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
-            @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("{nextLink}")
@@ -796,7 +804,7 @@ Response listDiscoTemplateNextSync(@PathParam(value = "nextLink", en
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listSavedFilterNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
-            @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("{nextLink}")
@@ -806,7 +814,7 @@ Mono> listSavedFilterNext(@PathParam(value = "nextLink", en
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listSavedFilterNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
-            @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("{nextLink}")
@@ -816,7 +824,7 @@ Response listSavedFilterNextSync(@PathParam(value = "nextLink", enco
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listTaskNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
-            @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("{nextLink}")
@@ -826,7 +834,7 @@ Mono> listTaskNext(@PathParam(value = "nextLink", encoded =
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listTaskNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
-            @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions,
+            @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
     }
 
@@ -1164,9 +1172,10 @@ public PagedIterable listAssetResource(RequestOptions requestOptions
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> updateAssetsWithResponseAsync(String filter, BinaryData body,
         RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
         return FluxUtil.withContext(context -> service.updateAssets(this.getEndpoint(),
-            this.getServiceVersion().getVersion(), filter, accept, body, requestOptions, context));
+            this.getServiceVersion().getVersion(), filter, contentType, accept, body, requestOptions, context));
     }
 
     /**
@@ -1213,9 +1222,10 @@ public Mono> updateAssetsWithResponseAsync(String filter, B
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response updateAssetsWithResponse(String filter, BinaryData body,
         RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
-        return service.updateAssetsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), filter, accept, body,
-            requestOptions, Context.NONE);
+        return service.updateAssetsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), filter, contentType,
+            accept, body, requestOptions, Context.NONE);
     }
 
     /**
@@ -1582,9 +1592,10 @@ public PagedIterable listDataConnection(RequestOptions requestOption
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> validateDataConnectionWithResponseAsync(BinaryData body,
         RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
         return FluxUtil.withContext(context -> service.validateDataConnection(this.getEndpoint(),
-            this.getServiceVersion().getVersion(), accept, body, requestOptions, context));
+            this.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, context));
     }
 
     /**
@@ -1630,9 +1641,10 @@ public Mono> validateDataConnectionWithResponseAsync(Binary
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response validateDataConnectionWithResponse(BinaryData body, RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
-        return service.validateDataConnectionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept,
-            body, requestOptions, Context.NONE);
+        return service.validateDataConnectionSync(this.getEndpoint(), this.getServiceVersion().getVersion(),
+            contentType, accept, body, requestOptions, Context.NONE);
     }
 
     /**
@@ -1754,9 +1766,11 @@ public Response getDataConnectionWithResponse(String dataConnectionN
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> createOrReplaceDataConnectionWithResponseAsync(String dataConnectionName,
         BinaryData body, RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.createOrReplaceDataConnection(this.getEndpoint(),
-            this.getServiceVersion().getVersion(), dataConnectionName, accept, body, requestOptions, context));
+        return FluxUtil.withContext(
+            context -> service.createOrReplaceDataConnection(this.getEndpoint(), this.getServiceVersion().getVersion(),
+                dataConnectionName, contentType, accept, body, requestOptions, context));
     }
 
     /**
@@ -1804,9 +1818,10 @@ public Mono> createOrReplaceDataConnectionWithResponseAsync
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response createOrReplaceDataConnectionWithResponse(String dataConnectionName, BinaryData body,
         RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
         return service.createOrReplaceDataConnectionSync(this.getEndpoint(), this.getServiceVersion().getVersion(),
-            dataConnectionName, accept, body, requestOptions, Context.NONE);
+            dataConnectionName, contentType, accept, body, requestOptions, Context.NONE);
     }
 
     /**
@@ -2229,9 +2244,10 @@ public PagedIterable listDiscoGroup(RequestOptions requestOptions) {
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> validateDiscoGroupWithResponseAsync(BinaryData body,
         RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
         return FluxUtil.withContext(context -> service.validateDiscoGroup(this.getEndpoint(),
-            this.getServiceVersion().getVersion(), accept, body, requestOptions, context));
+            this.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, context));
     }
 
     /**
@@ -2289,9 +2305,10 @@ public Mono> validateDiscoGroupWithResponseAsync(BinaryData
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response validateDiscoGroupWithResponse(BinaryData body, RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
-        return service.validateDiscoGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, body,
-            requestOptions, Context.NONE);
+        return service.validateDiscoGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType,
+            accept, body, requestOptions, Context.NONE);
     }
 
     /**
@@ -2498,9 +2515,10 @@ public Response getDiscoGroupWithResponse(String groupName, RequestO
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> createOrReplaceDiscoGroupWithResponseAsync(String groupName, BinaryData body,
         RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
         return FluxUtil.withContext(context -> service.createOrReplaceDiscoGroup(this.getEndpoint(),
-            this.getServiceVersion().getVersion(), groupName, accept, body, requestOptions, context));
+            this.getServiceVersion().getVersion(), groupName, contentType, accept, body, requestOptions, context));
     }
 
     /**
@@ -2585,9 +2603,10 @@ public Mono> createOrReplaceDiscoGroupWithResponseAsync(Str
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response createOrReplaceDiscoGroupWithResponse(String groupName, BinaryData body,
         RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
         return service.createOrReplaceDiscoGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(),
-            groupName, accept, body, requestOptions, Context.NONE);
+            groupName, contentType, accept, body, requestOptions, Context.NONE);
     }
 
     /**
@@ -3349,9 +3368,10 @@ public Response getBillableWithResponse(RequestOptions requestOption
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> getSnapshotWithResponseAsync(BinaryData body, RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
         return FluxUtil.withContext(context -> service.getSnapshot(this.getEndpoint(),
-            this.getServiceVersion().getVersion(), accept, body, requestOptions, context));
+            this.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, context));
     }
 
     /**
@@ -3422,9 +3442,10 @@ public Mono> getSnapshotWithResponseAsync(BinaryData body,
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response getSnapshotWithResponse(BinaryData body, RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
-        return service.getSnapshotSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, body,
-            requestOptions, Context.NONE);
+        return service.getSnapshotSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, accept,
+            body, requestOptions, Context.NONE);
     }
 
     /**
@@ -3482,9 +3503,10 @@ public Response getSnapshotWithResponse(BinaryData body, RequestOpti
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> getSummaryWithResponseAsync(BinaryData body, RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
         return FluxUtil.withContext(context -> service.getSummary(this.getEndpoint(),
-            this.getServiceVersion().getVersion(), accept, body, requestOptions, context));
+            this.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, context));
     }
 
     /**
@@ -3541,9 +3563,10 @@ public Mono> getSummaryWithResponseAsync(BinaryData body, R
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response getSummaryWithResponse(BinaryData body, RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
-        return service.getSummarySync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, body,
-            requestOptions, Context.NONE);
+        return service.getSummarySync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, accept,
+            body, requestOptions, Context.NONE);
     }
 
     /**
@@ -3838,9 +3861,10 @@ public Response getSavedFilterWithResponse(String filterName, Reques
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> createOrReplaceSavedFilterWithResponseAsync(String filterName, BinaryData body,
         RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
         return FluxUtil.withContext(context -> service.createOrReplaceSavedFilter(this.getEndpoint(),
-            this.getServiceVersion().getVersion(), filterName, accept, body, requestOptions, context));
+            this.getServiceVersion().getVersion(), filterName, contentType, accept, body, requestOptions, context));
     }
 
     /**
@@ -3878,9 +3902,10 @@ public Mono> createOrReplaceSavedFilterWithResponseAsync(St
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response createOrReplaceSavedFilterWithResponse(String filterName, BinaryData body,
         RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
         return service.createOrReplaceSavedFilterSync(this.getEndpoint(), this.getServiceVersion().getVersion(),
-            filterName, accept, body, requestOptions, Context.NONE);
+            filterName, contentType, accept, body, requestOptions, Context.NONE);
     }
 
     /**
@@ -4281,6 +4306,8 @@ public Response cancelTaskWithResponse(String taskId, RequestOptions
     }
 
     /**
+     * Retrieve a list of assets for the provided search parameters.
+     * 
      * Get the next page of items.
      * 

Response Body Schema

* @@ -4334,6 +4361,8 @@ private Mono> listAssetResourceNextSinglePageAsync(Str } /** + * Retrieve a list of assets for the provided search parameters. + * * Get the next page of items. *

Response Body Schema

* @@ -4384,6 +4413,8 @@ private PagedResponse listAssetResourceNextSinglePage(String nextLin } /** + * Retrieve a list of data connections. + * * Get the next page of items. *

Response Body Schema

* @@ -4424,6 +4455,8 @@ private Mono> listDataConnectionNextSinglePageAsync(St } /** + * Retrieve a list of data connections. + * * Get the next page of items. *

Response Body Schema

* @@ -4462,6 +4495,8 @@ private PagedResponse listDataConnectionNextSinglePage(String nextLi } /** + * Retrieve a list of discovery group for the provided search parameters. + * * Get the next page of items. *

Response Body Schema

* @@ -4528,6 +4563,8 @@ private Mono> listDiscoGroupNextSinglePageAsync(String } /** + * Retrieve a list of discovery group for the provided search parameters. + * * Get the next page of items. *

Response Body Schema

* @@ -4591,6 +4628,8 @@ private PagedResponse listDiscoGroupNextSinglePage(String nextLink, } /** + * Retrieve a collection of discovery run results for a discovery group with a given groupName. + * * Get the next page of items. *

Response Body Schema

* @@ -4636,6 +4675,8 @@ private Mono> listRunsNextSinglePageAsync(String nextL } /** + * Retrieve a collection of discovery run results for a discovery group with a given groupName. + * * Get the next page of items. *

Response Body Schema

* @@ -4680,6 +4721,8 @@ private PagedResponse listRunsNextSinglePage(String nextLink, Reques } /** + * Retrieve a list of disco templates for the provided search parameters. + * * Get the next page of items. *

Response Body Schema

* @@ -4726,6 +4769,8 @@ private Mono> listDiscoTemplateNextSinglePageAsync(Str } /** + * Retrieve a list of disco templates for the provided search parameters. + * * Get the next page of items. *

Response Body Schema

* @@ -4769,6 +4814,8 @@ private PagedResponse listDiscoTemplateNextSinglePage(String nextLin } /** + * Retrieve a list of saved filters for the provided search parameters. + * * Get the next page of items. *

Response Body Schema

* @@ -4803,6 +4850,8 @@ private Mono> listSavedFilterNextSinglePageAsync(Strin } /** + * Retrieve a list of saved filters for the provided search parameters. + * * Get the next page of items. *

Response Body Schema

* @@ -4834,6 +4883,8 @@ private PagedResponse listSavedFilterNextSinglePage(String nextLink, } /** + * Retrieve a list of tasks for the provided search parameters. + * * Get the next page of items. *

Response Body Schema

* @@ -4871,6 +4922,8 @@ private Mono> listTaskNextSinglePageAsync(String nextL } /** + * Retrieve a list of tasks for the provided search parameters. + * * Get the next page of items. *

Response Body Schema

* diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/resources/META-INF/azure-analytics-defender-easm_apiview_properties.json b/sdk/easm/azure-analytics-defender-easm/src/main/resources/META-INF/azure-analytics-defender-easm_apiview_properties.json index 9c915ec53fa1..ab00eaa8e32f 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/resources/META-INF/azure-analytics-defender-easm_apiview_properties.json +++ b/sdk/easm/azure-analytics-defender-easm/src/main/resources/META-INF/azure-analytics-defender-easm_apiview_properties.json @@ -1,7 +1,7 @@ { "flavor": "azure", "CrossLanguageDefinitionId": { - "com.azure.analytics.defender.easm.EasmAsyncClient": "Easm.EasmClient", + "com.azure.analytics.defender.easm.EasmAsyncClient": "Customizations.EasmClient", "com.azure.analytics.defender.easm.EasmAsyncClient.cancelTask": "Customizations.EasmClient.cancelTask", "com.azure.analytics.defender.easm.EasmAsyncClient.cancelTaskWithResponse": "Customizations.EasmClient.cancelTask", "com.azure.analytics.defender.easm.EasmAsyncClient.createOrReplaceDataConnection": "Customizations.EasmClient.createOrReplaceDataConnection", @@ -47,7 +47,7 @@ "com.azure.analytics.defender.easm.EasmAsyncClient.validateDataConnectionWithResponse": "Customizations.EasmClient.validateDataConnection", "com.azure.analytics.defender.easm.EasmAsyncClient.validateDiscoGroup": "Customizations.EasmClient.validateDiscoGroup", "com.azure.analytics.defender.easm.EasmAsyncClient.validateDiscoGroupWithResponse": "Customizations.EasmClient.validateDiscoGroup", - "com.azure.analytics.defender.easm.EasmClient": "Easm.EasmClient", + "com.azure.analytics.defender.easm.EasmClient": "Customizations.EasmClient", "com.azure.analytics.defender.easm.EasmClient.cancelTask": "Customizations.EasmClient.cancelTask", "com.azure.analytics.defender.easm.EasmClient.cancelTaskWithResponse": "Customizations.EasmClient.cancelTask", "com.azure.analytics.defender.easm.EasmClient.createOrReplaceDataConnection": "Customizations.EasmClient.createOrReplaceDataConnection", @@ -93,7 +93,7 @@ "com.azure.analytics.defender.easm.EasmClient.validateDataConnectionWithResponse": "Customizations.EasmClient.validateDataConnection", "com.azure.analytics.defender.easm.EasmClient.validateDiscoGroup": "Customizations.EasmClient.validateDiscoGroup", "com.azure.analytics.defender.easm.EasmClient.validateDiscoGroupWithResponse": "Customizations.EasmClient.validateDiscoGroup", - "com.azure.analytics.defender.easm.EasmClientBuilder": "Easm.EasmClient", + "com.azure.analytics.defender.easm.EasmClientBuilder": "Customizations.EasmClient", "com.azure.analytics.defender.easm.models.AlexaDetails": "Easm.AlexaInfo", "com.azure.analytics.defender.easm.models.AsAsset": "Easm.AsAsset", "com.azure.analytics.defender.easm.models.AsAssetResource": "Easm.AsAssetResource", diff --git a/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/implementation/EventGridReceiverClientImpl.java b/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/implementation/EventGridReceiverClientImpl.java index cc885d562307..067b2fda5339 100644 --- a/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/implementation/EventGridReceiverClientImpl.java +++ b/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/implementation/EventGridReceiverClientImpl.java @@ -156,7 +156,7 @@ public interface EventGridReceiverClientService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> receive(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("topicName") String topicName, - @PathParam("eventSubscriptionName") String eventSubscriptionName, @HeaderParam("accept") String accept, + @PathParam("eventSubscriptionName") String eventSubscriptionName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive") @@ -167,7 +167,7 @@ Mono> receive(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response receiveSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("topicName") String topicName, - @PathParam("eventSubscriptionName") String eventSubscriptionName, @HeaderParam("accept") String accept, + @PathParam("eventSubscriptionName") String eventSubscriptionName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge") @@ -178,7 +178,8 @@ Response receiveSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> acknowledge(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("topicName") String topicName, - @PathParam("eventSubscriptionName") String eventSubscriptionName, @HeaderParam("accept") String accept, + @PathParam("eventSubscriptionName") String eventSubscriptionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData acknowledgeRequest, RequestOptions requestOptions, Context context); @@ -190,7 +191,8 @@ Mono> acknowledge(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response acknowledgeSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("topicName") String topicName, - @PathParam("eventSubscriptionName") String eventSubscriptionName, @HeaderParam("accept") String accept, + @PathParam("eventSubscriptionName") String eventSubscriptionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData acknowledgeRequest, RequestOptions requestOptions, Context context); @@ -202,7 +204,8 @@ Response acknowledgeSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> release(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("topicName") String topicName, - @PathParam("eventSubscriptionName") String eventSubscriptionName, @HeaderParam("accept") String accept, + @PathParam("eventSubscriptionName") String eventSubscriptionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData releaseRequest, RequestOptions requestOptions, Context context); @Post("/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release") @@ -213,7 +216,8 @@ Mono> release(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response releaseSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("topicName") String topicName, - @PathParam("eventSubscriptionName") String eventSubscriptionName, @HeaderParam("accept") String accept, + @PathParam("eventSubscriptionName") String eventSubscriptionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData releaseRequest, RequestOptions requestOptions, Context context); @Post("/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:reject") @@ -224,7 +228,8 @@ Response releaseSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> reject(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("topicName") String topicName, - @PathParam("eventSubscriptionName") String eventSubscriptionName, @HeaderParam("accept") String accept, + @PathParam("eventSubscriptionName") String eventSubscriptionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData rejectRequest, RequestOptions requestOptions, Context context); @Post("/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:reject") @@ -235,7 +240,8 @@ Mono> reject(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response rejectSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("topicName") String topicName, - @PathParam("eventSubscriptionName") String eventSubscriptionName, @HeaderParam("accept") String accept, + @PathParam("eventSubscriptionName") String eventSubscriptionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData rejectRequest, RequestOptions requestOptions, Context context); @Post("/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:renewLock") @@ -246,7 +252,8 @@ Response rejectSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renewLocks(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("topicName") String topicName, - @PathParam("eventSubscriptionName") String eventSubscriptionName, @HeaderParam("accept") String accept, + @PathParam("eventSubscriptionName") String eventSubscriptionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData renewLocksRequest, RequestOptions requestOptions, Context context); @@ -258,7 +265,8 @@ Mono> renewLocks(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response renewLocksSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("topicName") String topicName, - @PathParam("eventSubscriptionName") String eventSubscriptionName, @HeaderParam("accept") String accept, + @PathParam("eventSubscriptionName") String eventSubscriptionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData renewLocksRequest, RequestOptions requestOptions, Context context); } @@ -435,10 +443,11 @@ public Response receiveWithResponse(String topicName, String eventSu @ServiceMethod(returns = ReturnType.SINGLE) public Mono> acknowledgeWithResponseAsync(String topicName, String eventSubscriptionName, BinaryData acknowledgeRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.acknowledge(this.getEndpoint(), this.getServiceVersion().getVersion(), - topicName, eventSubscriptionName, accept, acknowledgeRequest, requestOptions, context)); + topicName, eventSubscriptionName, contentType, accept, acknowledgeRequest, requestOptions, context)); } /** @@ -495,9 +504,10 @@ public Mono> acknowledgeWithResponseAsync(String topicName, @ServiceMethod(returns = ReturnType.SINGLE) public Response acknowledgeWithResponse(String topicName, String eventSubscriptionName, BinaryData acknowledgeRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.acknowledgeSync(this.getEndpoint(), this.getServiceVersion().getVersion(), topicName, - eventSubscriptionName, accept, acknowledgeRequest, requestOptions, Context.NONE); + eventSubscriptionName, contentType, accept, acknowledgeRequest, requestOptions, Context.NONE); } /** @@ -562,10 +572,11 @@ public Response acknowledgeWithResponse(String topicName, String eve @ServiceMethod(returns = ReturnType.SINGLE) public Mono> releaseWithResponseAsync(String topicName, String eventSubscriptionName, BinaryData releaseRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.release(this.getEndpoint(), this.getServiceVersion().getVersion(), - topicName, eventSubscriptionName, accept, releaseRequest, requestOptions, context)); + topicName, eventSubscriptionName, contentType, accept, releaseRequest, requestOptions, context)); } /** @@ -630,9 +641,10 @@ public Mono> releaseWithResponseAsync(String topicName, Str @ServiceMethod(returns = ReturnType.SINGLE) public Response releaseWithResponse(String topicName, String eventSubscriptionName, BinaryData releaseRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.releaseSync(this.getEndpoint(), this.getServiceVersion().getVersion(), topicName, - eventSubscriptionName, accept, releaseRequest, requestOptions, Context.NONE); + eventSubscriptionName, contentType, accept, releaseRequest, requestOptions, Context.NONE); } /** @@ -689,9 +701,10 @@ public Response releaseWithResponse(String topicName, String eventSu @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rejectWithResponseAsync(String topicName, String eventSubscriptionName, BinaryData rejectRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.reject(this.getEndpoint(), this.getServiceVersion().getVersion(), - topicName, eventSubscriptionName, accept, rejectRequest, requestOptions, context)); + topicName, eventSubscriptionName, contentType, accept, rejectRequest, requestOptions, context)); } /** @@ -748,9 +761,10 @@ public Mono> rejectWithResponseAsync(String topicName, Stri @ServiceMethod(returns = ReturnType.SINGLE) public Response rejectWithResponse(String topicName, String eventSubscriptionName, BinaryData rejectRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.rejectSync(this.getEndpoint(), this.getServiceVersion().getVersion(), topicName, - eventSubscriptionName, accept, rejectRequest, requestOptions, Context.NONE); + eventSubscriptionName, contentType, accept, rejectRequest, requestOptions, Context.NONE); } /** @@ -808,10 +822,11 @@ public Response rejectWithResponse(String topicName, String eventSub @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renewLocksWithResponseAsync(String topicName, String eventSubscriptionName, BinaryData renewLocksRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.renewLocks(this.getEndpoint(), this.getServiceVersion().getVersion(), - topicName, eventSubscriptionName, accept, renewLocksRequest, requestOptions, context)); + topicName, eventSubscriptionName, contentType, accept, renewLocksRequest, requestOptions, context)); } /** @@ -868,8 +883,9 @@ public Mono> renewLocksWithResponseAsync(String topicName, @ServiceMethod(returns = ReturnType.SINGLE) public Response renewLocksWithResponse(String topicName, String eventSubscriptionName, BinaryData renewLocksRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.renewLocksSync(this.getEndpoint(), this.getServiceVersion().getVersion(), topicName, - eventSubscriptionName, accept, renewLocksRequest, requestOptions, Context.NONE); + eventSubscriptionName, contentType, accept, renewLocksRequest, requestOptions, Context.NONE); } } diff --git a/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/implementation/EventGridSenderClientImpl.java b/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/implementation/EventGridSenderClientImpl.java index 5b7bd7e58780..d0d1015d742d 100644 --- a/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/implementation/EventGridSenderClientImpl.java +++ b/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/implementation/EventGridSenderClientImpl.java @@ -156,7 +156,7 @@ public interface EventGridSenderClientService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> send(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("topicName") String topicName, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/cloudevents+json; charset=utf-8") BinaryData event, RequestOptions requestOptions, Context context); @@ -168,7 +168,7 @@ Mono> send(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response sendSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("topicName") String topicName, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/cloudevents+json; charset=utf-8") BinaryData event, RequestOptions requestOptions, Context context); @@ -180,7 +180,7 @@ Response sendSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> sendEvents(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("topicName") String topicName, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/cloudevents-batch+json; charset=utf-8") BinaryData events, RequestOptions requestOptions, Context context); @@ -192,7 +192,7 @@ Mono> sendEvents(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response sendEventsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("topicName") String topicName, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/cloudevents-batch+json; charset=utf-8") BinaryData events, RequestOptions requestOptions, Context context); } diff --git a/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/resources/META-INF/azure-messaging-eventgrid-namespaces_apiview_properties.json b/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/resources/META-INF/azure-messaging-eventgrid-namespaces_apiview_properties.json index 897960f94707..e028d898eccb 100644 --- a/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/resources/META-INF/azure-messaging-eventgrid-namespaces_apiview_properties.json +++ b/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/resources/META-INF/azure-messaging-eventgrid-namespaces_apiview_properties.json @@ -1,7 +1,7 @@ { "flavor": "azure", "CrossLanguageDefinitionId": { - "com.azure.messaging.eventgrid.namespaces.EventGridReceiverAsyncClient": "Microsoft.EventGrid.EventGridReceiverClient", + "com.azure.messaging.eventgrid.namespaces.EventGridReceiverAsyncClient": "Customizations.ClientReceiver2", "com.azure.messaging.eventgrid.namespaces.EventGridReceiverAsyncClient.acknowledge": "Customizations.ClientReceiver2.acknowledge", "com.azure.messaging.eventgrid.namespaces.EventGridReceiverAsyncClient.acknowledgeWithResponse": "Customizations.ClientReceiver2.acknowledge", "com.azure.messaging.eventgrid.namespaces.EventGridReceiverAsyncClient.receive": "Customizations.ClientReceiver2.receive", @@ -12,7 +12,7 @@ "com.azure.messaging.eventgrid.namespaces.EventGridReceiverAsyncClient.releaseWithResponse": "Customizations.ClientReceiver2.release", "com.azure.messaging.eventgrid.namespaces.EventGridReceiverAsyncClient.renewLocks": "Customizations.ClientReceiver2.renewLocks", "com.azure.messaging.eventgrid.namespaces.EventGridReceiverAsyncClient.renewLocksWithResponse": "Customizations.ClientReceiver2.renewLocks", - "com.azure.messaging.eventgrid.namespaces.EventGridReceiverClient": "Microsoft.EventGrid.EventGridReceiverClient", + "com.azure.messaging.eventgrid.namespaces.EventGridReceiverClient": "Customizations.ClientReceiver2", "com.azure.messaging.eventgrid.namespaces.EventGridReceiverClient.acknowledge": "Customizations.ClientReceiver2.acknowledge", "com.azure.messaging.eventgrid.namespaces.EventGridReceiverClient.acknowledgeWithResponse": "Customizations.ClientReceiver2.acknowledge", "com.azure.messaging.eventgrid.namespaces.EventGridReceiverClient.receive": "Customizations.ClientReceiver2.receive", @@ -23,18 +23,18 @@ "com.azure.messaging.eventgrid.namespaces.EventGridReceiverClient.releaseWithResponse": "Customizations.ClientReceiver2.release", "com.azure.messaging.eventgrid.namespaces.EventGridReceiverClient.renewLocks": "Customizations.ClientReceiver2.renewLocks", "com.azure.messaging.eventgrid.namespaces.EventGridReceiverClient.renewLocksWithResponse": "Customizations.ClientReceiver2.renewLocks", - "com.azure.messaging.eventgrid.namespaces.EventGridReceiverClientBuilder": "Microsoft.EventGrid.EventGridReceiverClient", - "com.azure.messaging.eventgrid.namespaces.EventGridSenderAsyncClient": "Microsoft.EventGrid.EventGridSenderClient", + "com.azure.messaging.eventgrid.namespaces.EventGridReceiverClientBuilder": "Customizations.ClientReceiver2", + "com.azure.messaging.eventgrid.namespaces.EventGridSenderAsyncClient": "Customizations.ClientSender2", "com.azure.messaging.eventgrid.namespaces.EventGridSenderAsyncClient.send": "Customizations.ClientSender2.send", "com.azure.messaging.eventgrid.namespaces.EventGridSenderAsyncClient.sendEvents": "Customizations.ClientSender2.sendEvents", "com.azure.messaging.eventgrid.namespaces.EventGridSenderAsyncClient.sendEventsWithResponse": "Customizations.ClientSender2.sendEvents", "com.azure.messaging.eventgrid.namespaces.EventGridSenderAsyncClient.sendWithResponse": "Customizations.ClientSender2.send", - "com.azure.messaging.eventgrid.namespaces.EventGridSenderClient": "Microsoft.EventGrid.EventGridSenderClient", + "com.azure.messaging.eventgrid.namespaces.EventGridSenderClient": "Customizations.ClientSender2", "com.azure.messaging.eventgrid.namespaces.EventGridSenderClient.send": "Customizations.ClientSender2.send", "com.azure.messaging.eventgrid.namespaces.EventGridSenderClient.sendEvents": "Customizations.ClientSender2.sendEvents", "com.azure.messaging.eventgrid.namespaces.EventGridSenderClient.sendEventsWithResponse": "Customizations.ClientSender2.sendEvents", "com.azure.messaging.eventgrid.namespaces.EventGridSenderClient.sendWithResponse": "Customizations.ClientSender2.send", - "com.azure.messaging.eventgrid.namespaces.EventGridSenderClientBuilder": "Microsoft.EventGrid.EventGridSenderClient", + "com.azure.messaging.eventgrid.namespaces.EventGridSenderClientBuilder": "Customizations.ClientSender2", "com.azure.messaging.eventgrid.namespaces.implementation.models.AcknowledgeRequest": "acknowledge.Request.anonymous", "com.azure.messaging.eventgrid.namespaces.implementation.models.PublishResult": "Microsoft.EventGrid.PublishResult", "com.azure.messaging.eventgrid.namespaces.implementation.models.RejectRequest": "reject.Request.anonymous", diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceAsyncClient.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceAsyncClient.java index 3e45ee6e7784..4d9e3f656f61 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceAsyncClient.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceAsyncClient.java @@ -779,8 +779,6 @@ Mono> detectImplWithResponse(BinaryData imageContent, Reque Mono> detectFromUrlImpl(DetectFromUrlImplOptions options) { // Generated convenience method for detectFromUrlImplWithResponse RequestOptions requestOptions = new RequestOptions(); - DetectFromUrlImplRequest detectFromUrlRequestObj = new DetectFromUrlImplRequest(options.getUrl()); - BinaryData detectFromUrlRequest = BinaryData.fromObject(detectFromUrlRequestObj); FaceDetectionModel detectionModel = options.getDetectionModel(); FaceRecognitionModel recognitionModel = options.getRecognitionModel(); Boolean returnFaceId = options.isReturnFaceId(); @@ -788,6 +786,8 @@ Mono> detectFromUrlImpl(DetectFromUrlImplOptions optio Boolean returnFaceLandmarks = options.isReturnFaceLandmarks(); Boolean returnRecognitionModel = options.isReturnRecognitionModel(); Integer faceIdTimeToLive = options.getFaceIdTimeToLive(); + DetectFromUrlImplRequest detectFromUrlRequestObj = new DetectFromUrlImplRequest(options.getUrl()); + BinaryData detectFromUrlRequest = BinaryData.fromObject(detectFromUrlRequestObj); if (detectionModel != null) { requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); } diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceClient.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceClient.java index edca171d9beb..b479cccfc2bc 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceClient.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceClient.java @@ -773,8 +773,6 @@ Response detectImplWithResponse(BinaryData imageContent, RequestOpti List detectFromUrlImpl(DetectFromUrlImplOptions options) { // Generated convenience method for detectFromUrlImplWithResponse RequestOptions requestOptions = new RequestOptions(); - DetectFromUrlImplRequest detectFromUrlRequestObj = new DetectFromUrlImplRequest(options.getUrl()); - BinaryData detectFromUrlRequest = BinaryData.fromObject(detectFromUrlRequestObj); FaceDetectionModel detectionModel = options.getDetectionModel(); FaceRecognitionModel recognitionModel = options.getRecognitionModel(); Boolean returnFaceId = options.isReturnFaceId(); @@ -782,6 +780,8 @@ List detectFromUrlImpl(DetectFromUrlImplOptions options) { Boolean returnFaceLandmarks = options.isReturnFaceLandmarks(); Boolean returnRecognitionModel = options.isReturnRecognitionModel(); Integer faceIdTimeToLive = options.getFaceIdTimeToLive(); + DetectFromUrlImplRequest detectFromUrlRequestObj = new DetectFromUrlImplRequest(options.getUrl()); + BinaryData detectFromUrlRequest = BinaryData.fromObject(detectFromUrlRequestObj); if (detectionModel != null) { requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); } diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceClientImpl.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceClientImpl.java index cb3b25c91072..59f5eaf17af4 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceClientImpl.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceClientImpl.java @@ -156,7 +156,7 @@ public interface FaceClientService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> detectFromUrlImpl(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData detectFromUrlRequest, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData detectFromUrlRequest, RequestOptions requestOptions, Context context); @Post("/detect") @@ -167,7 +167,7 @@ Mono> detectFromUrlImpl(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(HttpResponseException.class) Response detectFromUrlImplSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData detectFromUrlRequest, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData detectFromUrlRequest, RequestOptions requestOptions, Context context); @Post("/detect") @@ -178,7 +178,7 @@ Response detectFromUrlImplSync(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> detectImpl(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/octet-stream") BinaryData imageContent, + @HeaderParam("Accept") String accept, @BodyParam("application/octet-stream") BinaryData imageContent, RequestOptions requestOptions, Context context); @Post("/detect") @@ -189,7 +189,7 @@ Mono> detectImpl(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response detectImplSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/octet-stream") BinaryData imageContent, + @HeaderParam("Accept") String accept, @BodyParam("application/octet-stream") BinaryData imageContent, RequestOptions requestOptions, Context context); @Post("/findsimilars") @@ -199,9 +199,9 @@ Response detectImplSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> findSimilar(@HostParam("endpoint") String endpoint, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData findSimilarRequest, RequestOptions requestOptions, - Context context); + @HostParam("apiVersion") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData findSimilarRequest, + RequestOptions requestOptions, Context context); @Post("/findsimilars") @ExpectedResponses({ 200 }) @@ -210,9 +210,9 @@ Mono> findSimilar(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response findSimilarSync(@HostParam("endpoint") String endpoint, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData findSimilarRequest, RequestOptions requestOptions, - Context context); + @HostParam("apiVersion") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData findSimilarRequest, + RequestOptions requestOptions, Context context); @Post("/verify") @ExpectedResponses({ 200 }) @@ -221,9 +221,9 @@ Response findSimilarSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> verifyFaceToFace(@HostParam("endpoint") String endpoint, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData verifyFaceToFaceRequest, RequestOptions requestOptions, - Context context); + @HostParam("apiVersion") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData verifyFaceToFaceRequest, + RequestOptions requestOptions, Context context); @Post("/verify") @ExpectedResponses({ 200 }) @@ -232,9 +232,9 @@ Mono> verifyFaceToFace(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response verifyFaceToFaceSync(@HostParam("endpoint") String endpoint, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData verifyFaceToFaceRequest, RequestOptions requestOptions, - Context context); + @HostParam("apiVersion") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData verifyFaceToFaceRequest, + RequestOptions requestOptions, Context context); @Post("/group") @ExpectedResponses({ 200 }) @@ -243,8 +243,9 @@ Response verifyFaceToFaceSync(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> group(@HostParam("endpoint") String endpoint, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData groupRequest, RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData groupRequest, + RequestOptions requestOptions, Context context); @Post("/group") @ExpectedResponses({ 200 }) @@ -253,8 +254,9 @@ Mono> group(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response groupSync(@HostParam("endpoint") String endpoint, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData groupRequest, RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData groupRequest, + RequestOptions requestOptions, Context context); } /** @@ -1054,9 +1056,10 @@ public Response detectImplWithResponse(BinaryData imageContent, Requ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> findSimilarWithResponseAsync(BinaryData findSimilarRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.findSimilar(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, findSimilarRequest, requestOptions, context)); + this.getServiceVersion().getVersion(), contentType, accept, findSimilarRequest, requestOptions, context)); } /** @@ -1108,8 +1111,9 @@ public Mono> findSimilarWithResponseAsync(BinaryData findSi */ @ServiceMethod(returns = ReturnType.SINGLE) public Response findSimilarWithResponse(BinaryData findSimilarRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.findSimilarSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + return service.findSimilarSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, accept, findSimilarRequest, requestOptions, Context.NONE); } @@ -1152,9 +1156,11 @@ public Response findSimilarWithResponse(BinaryData findSimilarReques @ServiceMethod(returns = ReturnType.SINGLE) public Mono> verifyFaceToFaceWithResponseAsync(BinaryData verifyFaceToFaceRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.verifyFaceToFace(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, verifyFaceToFaceRequest, requestOptions, context)); + return FluxUtil + .withContext(context -> service.verifyFaceToFace(this.getEndpoint(), this.getServiceVersion().getVersion(), + contentType, accept, verifyFaceToFaceRequest, requestOptions, context)); } /** @@ -1196,9 +1202,10 @@ public Mono> verifyFaceToFaceWithResponseAsync(BinaryData v @ServiceMethod(returns = ReturnType.SINGLE) public Response verifyFaceToFaceWithResponse(BinaryData verifyFaceToFaceRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.verifyFaceToFaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, - verifyFaceToFaceRequest, requestOptions, Context.NONE); + return service.verifyFaceToFaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, + accept, verifyFaceToFaceRequest, requestOptions, Context.NONE); } /** @@ -1250,9 +1257,10 @@ public Response verifyFaceToFaceWithResponse(BinaryData verifyFaceTo */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> groupWithResponseAsync(BinaryData groupRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.group(this.getEndpoint(), this.getServiceVersion().getVersion(), - accept, groupRequest, requestOptions, context)); + contentType, accept, groupRequest, requestOptions, context)); } /** @@ -1303,8 +1311,9 @@ public Mono> groupWithResponseAsync(BinaryData groupRequest */ @ServiceMethod(returns = ReturnType.SINGLE) public Response groupWithResponse(BinaryData groupRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.groupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, groupRequest, - requestOptions, Context.NONE); + return service.groupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, accept, + groupRequest, requestOptions, Context.NONE); } } diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceSessionClientImpl.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceSessionClientImpl.java index 7267f1ec448c..39a6f806dd24 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceSessionClientImpl.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceSessionClientImpl.java @@ -159,8 +159,9 @@ public interface FaceSessionClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createLivenessSession(@HostParam("endpoint") String endpoint, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/detectLiveness/singleModal/sessions") @ExpectedResponses({ 200 }) @@ -169,8 +170,9 @@ Mono> createLivenessSession(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createLivenessSessionSync(@HostParam("endpoint") String endpoint, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Delete("/detectLiveness/singleModal/sessions/{sessionId}") @ExpectedResponses({ 200 }) @@ -180,7 +182,7 @@ Response createLivenessSessionSync(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteLivenessSession(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("sessionId") String sessionId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/detectLiveness/singleModal/sessions/{sessionId}") @ExpectedResponses({ 200 }) @@ -190,7 +192,7 @@ Mono> deleteLivenessSession(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteLivenessSessionSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("sessionId") String sessionId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/detectLiveness/singleModal/sessions/{sessionId}") @ExpectedResponses({ 200 }) @@ -200,7 +202,7 @@ Response deleteLivenessSessionSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getLivenessSessionResult(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("sessionId") String sessionId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/detectLiveness/singleModal/sessions/{sessionId}") @ExpectedResponses({ 200 }) @@ -210,7 +212,7 @@ Mono> getLivenessSessionResult(@HostParam("endpoint") Strin @UnexpectedResponseExceptionType(HttpResponseException.class) Response getLivenessSessionResultSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("sessionId") String sessionId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/detectLiveness/singleModal/sessions") @ExpectedResponses({ 200 }) @@ -219,7 +221,7 @@ Response getLivenessSessionResultSync(@HostParam("endpoint") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getLivenessSessions(@HostParam("endpoint") String endpoint, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @HostParam("apiVersion") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/detectLiveness/singleModal/sessions") @@ -229,7 +231,7 @@ Mono> getLivenessSessions(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getLivenessSessionsSync(@HostParam("endpoint") String endpoint, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @HostParam("apiVersion") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/detectLiveness/singleModal/sessions/{sessionId}/audit") @@ -240,7 +242,7 @@ Response getLivenessSessionsSync(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getLivenessSessionAuditEntries(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("sessionId") String sessionId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/detectLiveness/singleModal/sessions/{sessionId}/audit") @ExpectedResponses({ 200 }) @@ -250,7 +252,7 @@ Mono> getLivenessSessionAuditEntries(@HostParam("endpoint") @UnexpectedResponseExceptionType(HttpResponseException.class) Response getLivenessSessionAuditEntriesSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("sessionId") String sessionId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/detectLivenessWithVerify/singleModal/sessions") @ExpectedResponses({ 200 }) @@ -259,8 +261,9 @@ Response getLivenessSessionAuditEntriesSync(@HostParam("endpoint") S @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createLivenessWithVerifySession(@HostParam("endpoint") String endpoint, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/detectLivenessWithVerify/singleModal/sessions") @ExpectedResponses({ 200 }) @@ -269,8 +272,9 @@ Mono> createLivenessWithVerifySession(@HostParam("endpoint" @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createLivenessWithVerifySessionSync(@HostParam("endpoint") String endpoint, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/detectLivenessWithVerify/singleModal/sessions") @@ -281,7 +285,7 @@ Response createLivenessWithVerifySessionSync(@HostParam("endpoint") @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createLivenessWithVerifySessionWithVerifyImage( @HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @@ -293,7 +297,7 @@ Mono> createLivenessWithVerifySessionWithVerifyImage( @UnexpectedResponseExceptionType(HttpResponseException.class) Response createLivenessWithVerifySessionWithVerifyImageSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); @Delete("/detectLivenessWithVerify/singleModal/sessions/{sessionId}") @@ -304,7 +308,7 @@ Response createLivenessWithVerifySessionWithVerifyImageSync(@HostPar @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteLivenessWithVerifySession(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("sessionId") String sessionId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/detectLivenessWithVerify/singleModal/sessions/{sessionId}") @ExpectedResponses({ 200 }) @@ -314,7 +318,7 @@ Mono> deleteLivenessWithVerifySession(@HostParam("endpoint") Stri @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteLivenessWithVerifySessionSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("sessionId") String sessionId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/detectLivenessWithVerify/singleModal/sessions/{sessionId}") @ExpectedResponses({ 200 }) @@ -324,7 +328,7 @@ Response deleteLivenessWithVerifySessionSync(@HostParam("endpoint") String @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getLivenessWithVerifySessionResult(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("sessionId") String sessionId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/detectLivenessWithVerify/singleModal/sessions/{sessionId}") @ExpectedResponses({ 200 }) @@ -334,7 +338,7 @@ Mono> getLivenessWithVerifySessionResult(@HostParam("endpoi @UnexpectedResponseExceptionType(HttpResponseException.class) Response getLivenessWithVerifySessionResultSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("sessionId") String sessionId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/detectLivenessWithVerify/singleModal/sessions") @ExpectedResponses({ 200 }) @@ -343,7 +347,7 @@ Response getLivenessWithVerifySessionResultSync(@HostParam("endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getLivenessWithVerifySessions(@HostParam("endpoint") String endpoint, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @HostParam("apiVersion") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/detectLivenessWithVerify/singleModal/sessions") @@ -353,7 +357,7 @@ Mono> getLivenessWithVerifySessions(@HostParam("endpoint") @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getLivenessWithVerifySessionsSync(@HostParam("endpoint") String endpoint, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @HostParam("apiVersion") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/detectLivenessWithVerify/singleModal/sessions/{sessionId}/audit") @@ -364,7 +368,7 @@ Response getLivenessWithVerifySessionsSync(@HostParam("endpoint") St @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getLivenessWithVerifySessionAuditEntries(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("sessionId") String sessionId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/detectLivenessWithVerify/singleModal/sessions/{sessionId}/audit") @ExpectedResponses({ 200 }) @@ -374,7 +378,7 @@ Mono> getLivenessWithVerifySessionAuditEntries(@HostParam(" @UnexpectedResponseExceptionType(HttpResponseException.class) Response getLivenessWithVerifySessionAuditEntriesSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("sessionId") String sessionId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -429,9 +433,10 @@ Response getLivenessWithVerifySessionAuditEntriesSync(@HostParam("en @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createLivenessSessionWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.createLivenessSession(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, body, requestOptions, context)); + this.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, context)); } /** @@ -484,9 +489,10 @@ public Mono> createLivenessSessionWithResponseAsync(BinaryD */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createLivenessSessionWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.createLivenessSessionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, - body, requestOptions, Context.NONE); + return service.createLivenessSessionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, + accept, body, requestOptions, Context.NONE); } /** @@ -1023,9 +1029,10 @@ public Response getLivenessSessionAuditEntriesWithResponse(String se @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createLivenessWithVerifySessionWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.createLivenessWithVerifySession(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, body, requestOptions, context)); + this.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, context)); } /** @@ -1099,9 +1106,10 @@ public Mono> createLivenessWithVerifySessionWithResponseAsy @ServiceMethod(returns = ReturnType.SINGLE) public Response createLivenessWithVerifySessionWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.createLivenessWithVerifySessionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), - accept, body, requestOptions, Context.NONE); + contentType, accept, body, requestOptions, Context.NONE); } /** diff --git a/sdk/face/azure-ai-vision-face/src/main/resources/META-INF/azure-ai-vision-face_apiview_properties.json b/sdk/face/azure-ai-vision-face/src/main/resources/META-INF/azure-ai-vision-face_apiview_properties.json index e5d021fdcc4e..092afd387a89 100644 --- a/sdk/face/azure-ai-vision-face/src/main/resources/META-INF/azure-ai-vision-face_apiview_properties.json +++ b/sdk/face/azure-ai-vision-face/src/main/resources/META-INF/azure-ai-vision-face_apiview_properties.json @@ -1,7 +1,7 @@ { "flavor": "azure", "CrossLanguageDefinitionId": { - "com.azure.ai.vision.face.FaceAsyncClient": "Face.FaceClient", + "com.azure.ai.vision.face.FaceAsyncClient": "ClientCustomizations.FaceClient", "com.azure.ai.vision.face.FaceAsyncClient.detectFromUrlImpl": "ClientCustomizations.FaceClient.detectFromUrl", "com.azure.ai.vision.face.FaceAsyncClient.detectFromUrlImplWithResponse": "ClientCustomizations.FaceClient.detectFromUrl", "com.azure.ai.vision.face.FaceAsyncClient.detectImpl": "ClientCustomizations.FaceClient.detect", @@ -12,7 +12,7 @@ "com.azure.ai.vision.face.FaceAsyncClient.groupWithResponse": "ClientCustomizations.FaceClient.group", "com.azure.ai.vision.face.FaceAsyncClient.verifyFaceToFace": "ClientCustomizations.FaceClient.verifyFaceToFace", "com.azure.ai.vision.face.FaceAsyncClient.verifyFaceToFaceWithResponse": "ClientCustomizations.FaceClient.verifyFaceToFace", - "com.azure.ai.vision.face.FaceClient": "Face.FaceClient", + "com.azure.ai.vision.face.FaceClient": "ClientCustomizations.FaceClient", "com.azure.ai.vision.face.FaceClient.detectFromUrlImpl": "ClientCustomizations.FaceClient.detectFromUrl", "com.azure.ai.vision.face.FaceClient.detectFromUrlImplWithResponse": "ClientCustomizations.FaceClient.detectFromUrl", "com.azure.ai.vision.face.FaceClient.detectImpl": "ClientCustomizations.FaceClient.detect", @@ -23,8 +23,8 @@ "com.azure.ai.vision.face.FaceClient.groupWithResponse": "ClientCustomizations.FaceClient.group", "com.azure.ai.vision.face.FaceClient.verifyFaceToFace": "ClientCustomizations.FaceClient.verifyFaceToFace", "com.azure.ai.vision.face.FaceClient.verifyFaceToFaceWithResponse": "ClientCustomizations.FaceClient.verifyFaceToFace", - "com.azure.ai.vision.face.FaceClientBuilder": "Face.FaceClient", - "com.azure.ai.vision.face.FaceSessionAsyncClient": "Face.FaceSessionClient", + "com.azure.ai.vision.face.FaceClientBuilder": "ClientCustomizations.FaceClient", + "com.azure.ai.vision.face.FaceSessionAsyncClient": "ClientCustomizations.FaceSessionClient", "com.azure.ai.vision.face.FaceSessionAsyncClient.createLivenessSession": "ClientCustomizations.FaceSessionClient.createLivenessSession", "com.azure.ai.vision.face.FaceSessionAsyncClient.createLivenessSessionWithResponse": "ClientCustomizations.FaceSessionClient.createLivenessSession", "com.azure.ai.vision.face.FaceSessionAsyncClient.createLivenessWithVerifySession": "ClientCustomizations.FaceSessionClient.createLivenessWithVerifySession", @@ -47,7 +47,7 @@ "com.azure.ai.vision.face.FaceSessionAsyncClient.getLivenessWithVerifySessionResultWithResponse": "ClientCustomizations.FaceSessionClient.getLivenessWithVerifySessionResult", "com.azure.ai.vision.face.FaceSessionAsyncClient.getLivenessWithVerifySessions": "ClientCustomizations.FaceSessionClient.getLivenessWithVerifySessions", "com.azure.ai.vision.face.FaceSessionAsyncClient.getLivenessWithVerifySessionsWithResponse": "ClientCustomizations.FaceSessionClient.getLivenessWithVerifySessions", - "com.azure.ai.vision.face.FaceSessionClient": "Face.FaceSessionClient", + "com.azure.ai.vision.face.FaceSessionClient": "ClientCustomizations.FaceSessionClient", "com.azure.ai.vision.face.FaceSessionClient.createLivenessSession": "ClientCustomizations.FaceSessionClient.createLivenessSession", "com.azure.ai.vision.face.FaceSessionClient.createLivenessSessionWithResponse": "ClientCustomizations.FaceSessionClient.createLivenessSession", "com.azure.ai.vision.face.FaceSessionClient.createLivenessWithVerifySession": "ClientCustomizations.FaceSessionClient.createLivenessWithVerifySession", @@ -70,7 +70,7 @@ "com.azure.ai.vision.face.FaceSessionClient.getLivenessWithVerifySessionResultWithResponse": "ClientCustomizations.FaceSessionClient.getLivenessWithVerifySessionResult", "com.azure.ai.vision.face.FaceSessionClient.getLivenessWithVerifySessions": "ClientCustomizations.FaceSessionClient.getLivenessWithVerifySessions", "com.azure.ai.vision.face.FaceSessionClient.getLivenessWithVerifySessionsWithResponse": "ClientCustomizations.FaceSessionClient.getLivenessWithVerifySessions", - "com.azure.ai.vision.face.FaceSessionClientBuilder": "Face.FaceSessionClient", + "com.azure.ai.vision.face.FaceSessionClientBuilder": "ClientCustomizations.FaceSessionClient", "com.azure.ai.vision.face.implementation.models.CreateLivenessWithVerifySessionMultipartContent": "Face.CreateLivenessWithVerifySessionMultipartContent", "com.azure.ai.vision.face.implementation.models.DetectFromUrlImplOptions": "null", "com.azure.ai.vision.face.implementation.models.DetectFromUrlImplRequest": "detectFromUrl.Request.anonymous", diff --git a/sdk/healthdataaiservices/azure-health-deidentification/src/main/java/com/azure/health/deidentification/DeidentificationAsyncClient.java b/sdk/healthdataaiservices/azure-health-deidentification/src/main/java/com/azure/health/deidentification/DeidentificationAsyncClient.java index fb4dfd77ffb9..e8029ccdb7c5 100644 --- a/sdk/healthdataaiservices/azure-health-deidentification/src/main/java/com/azure/health/deidentification/DeidentificationAsyncClient.java +++ b/sdk/healthdataaiservices/azure-health-deidentification/src/main/java/com/azure/health/deidentification/DeidentificationAsyncClient.java @@ -102,8 +102,9 @@ public final class DeidentificationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a job containing a batch of documents to de-identify along with {@link Response} on successful completion - * of {@link Mono}. + * @return a de-identification job. + * + * Resource read operation template along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -498,7 +499,9 @@ public Mono> deidentifyWithResponse(BinaryData body, Reques * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a job containing a batch of documents to de-identify on successful completion of {@link Mono}. + * @return a de-identification job. + * + * Resource read operation template on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/sdk/healthdataaiservices/azure-health-deidentification/src/main/java/com/azure/health/deidentification/DeidentificationClient.java b/sdk/healthdataaiservices/azure-health-deidentification/src/main/java/com/azure/health/deidentification/DeidentificationClient.java index 9f5ab1ff550a..ca84ae974038 100644 --- a/sdk/healthdataaiservices/azure-health-deidentification/src/main/java/com/azure/health/deidentification/DeidentificationClient.java +++ b/sdk/healthdataaiservices/azure-health-deidentification/src/main/java/com/azure/health/deidentification/DeidentificationClient.java @@ -96,7 +96,9 @@ public final class DeidentificationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a job containing a batch of documents to de-identify along with {@link Response}. + * @return a de-identification job. + * + * Resource read operation template along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -489,7 +491,9 @@ public Response deidentifyWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a job containing a batch of documents to de-identify. + * @return a de-identification job. + * + * Resource read operation template. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/sdk/healthdataaiservices/azure-health-deidentification/src/main/java/com/azure/health/deidentification/implementation/DeidentificationClientImpl.java b/sdk/healthdataaiservices/azure-health-deidentification/src/main/java/com/azure/health/deidentification/implementation/DeidentificationClientImpl.java index 9e11f1465239..b58490bd4be8 100644 --- a/sdk/healthdataaiservices/azure-health-deidentification/src/main/java/com/azure/health/deidentification/implementation/DeidentificationClientImpl.java +++ b/sdk/healthdataaiservices/azure-health-deidentification/src/main/java/com/azure/health/deidentification/implementation/DeidentificationClientImpl.java @@ -173,7 +173,7 @@ public interface DeidentificationClientService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getJob(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/jobs/{name}") @ExpectedResponses({ 200 }) @@ -183,7 +183,7 @@ Mono> getJob(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response getJobSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/jobs/{name}") @ExpectedResponses({ 200, 201 }) @@ -193,8 +193,8 @@ Response getJobSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createJob(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData resource, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); @Put("/jobs/{name}") @ExpectedResponses({ 200, 201 }) @@ -204,8 +204,8 @@ Mono> createJob(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response createJobSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData resource, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); @Get("/jobs") @ExpectedResponses({ 200 }) @@ -214,7 +214,7 @@ Response createJobSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listJobs(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/jobs") @@ -224,7 +224,7 @@ Mono> listJobs(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listJobsSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/jobs/{name}/documents") @@ -235,7 +235,7 @@ Response listJobsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listJobDocuments(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/jobs/{name}/documents") @ExpectedResponses({ 200 }) @@ -245,7 +245,7 @@ Mono> listJobDocuments(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(HttpResponseException.class) Response listJobDocumentsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/jobs/{name}:cancel") @ExpectedResponses({ 200 }) @@ -255,7 +255,7 @@ Response listJobDocumentsSync(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> cancelJob(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/jobs/{name}:cancel") @ExpectedResponses({ 200 }) @@ -265,7 +265,7 @@ Mono> cancelJob(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response cancelJobSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/jobs/{name}") @ExpectedResponses({ 204 }) @@ -275,7 +275,7 @@ Response cancelJobSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteJob(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/jobs/{name}") @ExpectedResponses({ 204 }) @@ -285,7 +285,7 @@ Mono> deleteJob(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteJobSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/deid") @ExpectedResponses({ 200 }) @@ -294,8 +294,9 @@ Response deleteJobSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deidentify(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/deid") @ExpectedResponses({ 200 }) @@ -304,8 +305,9 @@ Mono> deidentify(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response deidentifySync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -314,7 +316,7 @@ Response deidentifySync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listJobsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -324,7 +326,7 @@ Mono> listJobsNext(@PathParam(value = "nextLink", encoded = @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listJobsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -334,7 +336,7 @@ Response listJobsNextSync(@PathParam(value = "nextLink", encoded = t @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listJobDocumentsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -344,7 +346,7 @@ Mono> listJobDocumentsNext(@PathParam(value = "nextLink", e @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listJobDocumentsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -403,8 +405,9 @@ Response listJobDocumentsNextSync(@PathParam(value = "nextLink", enc * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a job containing a batch of documents to de-identify along with {@link Response} on successful completion - * of {@link Mono}. + * @return a de-identification job. + * + * Resource read operation template along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getJobWithResponseAsync(String name, RequestOptions requestOptions) { @@ -468,7 +471,9 @@ public Mono> getJobWithResponseAsync(String name, RequestOp * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a job containing a batch of documents to de-identify along with {@link Response}. + * @return a de-identification job. + * + * Resource read operation template along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getJobWithResponse(String name, RequestOptions requestOptions) { @@ -584,9 +589,10 @@ public Response getJobWithResponse(String name, RequestOptions reque @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createJobWithResponseAsync(String name, BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.createJob(this.getEndpoint(), - this.getServiceVersion().getVersion(), name, accept, resource, requestOptions, context)); + this.getServiceVersion().getVersion(), name, contentType, accept, resource, requestOptions, context)); } /** @@ -695,9 +701,10 @@ private Mono> createJobWithResponseAsync(String name, Binar @ServiceMethod(returns = ReturnType.SINGLE) private Response createJobWithResponse(String name, BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.createJobSync(this.getEndpoint(), this.getServiceVersion().getVersion(), name, accept, resource, - requestOptions, Context.NONE); + return service.createJobSync(this.getEndpoint(), this.getServiceVersion().getVersion(), name, contentType, + accept, resource, requestOptions, Context.NONE); } /** @@ -2001,9 +2008,10 @@ public Response deleteJobWithResponse(String name, RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deidentifyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.deidentify(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, body, requestOptions, context)); + this.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, context)); } /** @@ -2056,9 +2064,10 @@ public Mono> deidentifyWithResponseAsync(BinaryData body, R */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deidentifyWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.deidentifySync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, body, - requestOptions, Context.NONE); + return service.deidentifySync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, accept, + body, requestOptions, Context.NONE); } /** diff --git a/sdk/healthdataaiservices/azure-health-deidentification/src/main/resources/META-INF/azure-health-deidentification_apiview_properties.json b/sdk/healthdataaiservices/azure-health-deidentification/src/main/resources/META-INF/azure-health-deidentification_apiview_properties.json index e9858021d010..075d4352f1a6 100644 --- a/sdk/healthdataaiservices/azure-health-deidentification/src/main/resources/META-INF/azure-health-deidentification_apiview_properties.json +++ b/sdk/healthdataaiservices/azure-health-deidentification/src/main/resources/META-INF/azure-health-deidentification_apiview_properties.json @@ -1,7 +1,7 @@ { "flavor": "azure", "CrossLanguageDefinitionId": { - "com.azure.health.deidentification.DeidentificationAsyncClient": "HealthDataAIServices.DeidServices.DeidentificationClient", + "com.azure.health.deidentification.DeidentificationAsyncClient": "HealthDataAIServices.DeidServices", "com.azure.health.deidentification.DeidentificationAsyncClient.beginCreateJob": "HealthDataAIServices.DeidServices.createJob", "com.azure.health.deidentification.DeidentificationAsyncClient.beginCreateJobWithModel": "HealthDataAIServices.DeidServices.createJob", "com.azure.health.deidentification.DeidentificationAsyncClient.cancelJob": "HealthDataAIServices.DeidServices.cancelJob", @@ -14,7 +14,7 @@ "com.azure.health.deidentification.DeidentificationAsyncClient.getJobWithResponse": "HealthDataAIServices.DeidServices.getJob", "com.azure.health.deidentification.DeidentificationAsyncClient.listJobDocuments": "HealthDataAIServices.DeidServices.listJobDocuments", "com.azure.health.deidentification.DeidentificationAsyncClient.listJobs": "HealthDataAIServices.DeidServices.listJobs", - "com.azure.health.deidentification.DeidentificationClient": "HealthDataAIServices.DeidServices.DeidentificationClient", + "com.azure.health.deidentification.DeidentificationClient": "HealthDataAIServices.DeidServices", "com.azure.health.deidentification.DeidentificationClient.beginCreateJob": "HealthDataAIServices.DeidServices.createJob", "com.azure.health.deidentification.DeidentificationClient.beginCreateJobWithModel": "HealthDataAIServices.DeidServices.createJob", "com.azure.health.deidentification.DeidentificationClient.cancelJob": "HealthDataAIServices.DeidServices.cancelJob", @@ -27,7 +27,7 @@ "com.azure.health.deidentification.DeidentificationClient.getJobWithResponse": "HealthDataAIServices.DeidServices.getJob", "com.azure.health.deidentification.DeidentificationClient.listJobDocuments": "HealthDataAIServices.DeidServices.listJobDocuments", "com.azure.health.deidentification.DeidentificationClient.listJobs": "HealthDataAIServices.DeidServices.listJobs", - "com.azure.health.deidentification.DeidentificationClientBuilder": "HealthDataAIServices.DeidServices.DeidentificationClient", + "com.azure.health.deidentification.DeidentificationClientBuilder": "HealthDataAIServices.DeidServices", "com.azure.health.deidentification.models.DeidentificationContent": "HealthDataAIServices.DeidServices.DeidentificationContent", "com.azure.health.deidentification.models.DeidentificationJob": "HealthDataAIServices.DeidServices.DeidentificationJob", "com.azure.health.deidentification.models.DeidentificationResult": "HealthDataAIServices.DeidServices.DeidentificationResult", diff --git a/sdk/healthdataaiservices/azure-resourcemanager-healthdataaiservices/src/main/java/com/azure/resourcemanager/healthdataaiservices/fluent/HealthDataAIServicesClient.java b/sdk/healthdataaiservices/azure-resourcemanager-healthdataaiservices/src/main/java/com/azure/resourcemanager/healthdataaiservices/fluent/HealthDataAIServicesClient.java index 3a09fe1e79f3..1aaf5549b346 100644 --- a/sdk/healthdataaiservices/azure-resourcemanager-healthdataaiservices/src/main/java/com/azure/resourcemanager/healthdataaiservices/fluent/HealthDataAIServicesClient.java +++ b/sdk/healthdataaiservices/azure-resourcemanager-healthdataaiservices/src/main/java/com/azure/resourcemanager/healthdataaiservices/fluent/HealthDataAIServicesClient.java @@ -12,7 +12,7 @@ */ public interface HealthDataAIServicesClient { /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ diff --git a/sdk/healthdataaiservices/azure-resourcemanager-healthdataaiservices/src/main/java/com/azure/resourcemanager/healthdataaiservices/implementation/DeidServicesClientImpl.java b/sdk/healthdataaiservices/azure-resourcemanager-healthdataaiservices/src/main/java/com/azure/resourcemanager/healthdataaiservices/implementation/DeidServicesClientImpl.java index 99c823e8e087..2add7a6fc6b5 100644 --- a/sdk/healthdataaiservices/azure-resourcemanager-healthdataaiservices/src/main/java/com/azure/resourcemanager/healthdataaiservices/implementation/DeidServicesClientImpl.java +++ b/sdk/healthdataaiservices/azure-resourcemanager-healthdataaiservices/src/main/java/com/azure/resourcemanager/healthdataaiservices/implementation/DeidServicesClientImpl.java @@ -79,7 +79,7 @@ public interface DeidServicesService { Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deidServiceName") String deidServiceName, @HeaderParam("accept") String accept, + @PathParam("deidServiceName") String deidServiceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -88,7 +88,7 @@ Mono> getByResourceGroup(@HostParam("endpoint") Strin @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -97,27 +97,27 @@ Mono> listByResourceGroup(@HostParam("endpoint") @UnexpectedResponseExceptionType(ManagementException.class) Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthDataAIServices/deidServices/{deidServiceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> create(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deidServiceName") String deidServiceName, @HeaderParam("accept") String accept, - @BodyParam("application/json") DeidServiceInner resource, Context context); + @PathParam("deidServiceName") String deidServiceName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DeidServiceInner resource, + Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthDataAIServices/deidServices/{deidServiceName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deidServiceName") String deidServiceName, @HeaderParam("accept") String accept, - @BodyParam("application/json") DeidUpdate properties, Context context); + @PathParam("deidServiceName") String deidServiceName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DeidUpdate properties, + Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthDataAIServices/deidServices/{deidServiceName}") @@ -126,7 +126,7 @@ Mono>> update(@HostParam("endpoint") String endpoint, Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deidServiceName") String deidServiceName, @HeaderParam("accept") String accept, + @PathParam("deidServiceName") String deidServiceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -135,7 +135,7 @@ Mono>> delete(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -143,7 +143,7 @@ Mono> listByResourceGroupNext( @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); } /** @@ -540,10 +540,12 @@ private Mono>> createWithResponseAsync(String resource } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, deidServiceName, accept, resource, context)) + this.client.getSubscriptionId(), resourceGroupName, deidServiceName, contentType, accept, resource, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -584,10 +586,11 @@ private Mono>> createWithResponseAsync(String resource } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, deidServiceName, accept, resource, context); + resourceGroupName, deidServiceName, contentType, accept, resource, context); } /** @@ -773,10 +776,12 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, deidServiceName, accept, properties, context)) + this.client.getSubscriptionId(), resourceGroupName, deidServiceName, contentType, accept, properties, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -817,10 +822,11 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, deidServiceName, accept, properties, context); + resourceGroupName, deidServiceName, contentType, accept, properties, context); } /** @@ -1173,6 +1179,8 @@ public void delete(String resourceGroupName, String deidServiceName, Context con } /** + * List DeidService resources by resource group + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1201,6 +1209,8 @@ private Mono> listByResourceGroupNextSinglePageA } /** + * List DeidService resources by resource group + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1229,6 +1239,8 @@ private Mono> listByResourceGroupNextSinglePageA } /** + * List DeidService resources by subscription ID + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1257,6 +1269,8 @@ private Mono> listBySubscriptionNextSinglePageAs } /** + * List DeidService resources by subscription ID + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/sdk/healthdataaiservices/azure-resourcemanager-healthdataaiservices/src/main/java/com/azure/resourcemanager/healthdataaiservices/implementation/HealthDataAIServicesClientBuilder.java b/sdk/healthdataaiservices/azure-resourcemanager-healthdataaiservices/src/main/java/com/azure/resourcemanager/healthdataaiservices/implementation/HealthDataAIServicesClientBuilder.java index 070bad2df3ba..7f5966343f84 100644 --- a/sdk/healthdataaiservices/azure-resourcemanager-healthdataaiservices/src/main/java/com/azure/resourcemanager/healthdataaiservices/implementation/HealthDataAIServicesClientBuilder.java +++ b/sdk/healthdataaiservices/azure-resourcemanager-healthdataaiservices/src/main/java/com/azure/resourcemanager/healthdataaiservices/implementation/HealthDataAIServicesClientBuilder.java @@ -20,12 +20,12 @@ @ServiceClientBuilder(serviceClients = { HealthDataAIServicesClientImpl.class }) public final class HealthDataAIServicesClientBuilder { /* - * Server parameter + * Service host */ private String endpoint; /** - * Sets Server parameter. + * Sets Service host. * * @param endpoint the endpoint value. * @return the HealthDataAIServicesClientBuilder. @@ -121,6 +121,7 @@ public HealthDataAIServicesClientBuilder serializerAdapter(SerializerAdapter ser * @return an instance of HealthDataAIServicesClientImpl. */ public HealthDataAIServicesClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; HttpPipeline localPipeline = (pipeline != null) ? pipeline @@ -131,7 +132,7 @@ public HealthDataAIServicesClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); HealthDataAIServicesClientImpl client = new HealthDataAIServicesClientImpl(localPipeline, - localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.endpoint, this.subscriptionId); + localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/sdk/healthdataaiservices/azure-resourcemanager-healthdataaiservices/src/main/java/com/azure/resourcemanager/healthdataaiservices/implementation/HealthDataAIServicesClientImpl.java b/sdk/healthdataaiservices/azure-resourcemanager-healthdataaiservices/src/main/java/com/azure/resourcemanager/healthdataaiservices/implementation/HealthDataAIServicesClientImpl.java index b9aeb2fc5139..2eb39db8ce61 100644 --- a/sdk/healthdataaiservices/azure-resourcemanager-healthdataaiservices/src/main/java/com/azure/resourcemanager/healthdataaiservices/implementation/HealthDataAIServicesClientImpl.java +++ b/sdk/healthdataaiservices/azure-resourcemanager-healthdataaiservices/src/main/java/com/azure/resourcemanager/healthdataaiservices/implementation/HealthDataAIServicesClientImpl.java @@ -43,12 +43,12 @@ @ServiceClient(builder = HealthDataAIServicesClientBuilder.class) public final class HealthDataAIServicesClientImpl implements HealthDataAIServicesClient { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -189,7 +189,7 @@ public PrivateLinksClient getPrivateLinks() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ HealthDataAIServicesClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, diff --git a/sdk/healthdataaiservices/azure-resourcemanager-healthdataaiservices/src/main/java/com/azure/resourcemanager/healthdataaiservices/implementation/OperationsClientImpl.java b/sdk/healthdataaiservices/azure-resourcemanager-healthdataaiservices/src/main/java/com/azure/resourcemanager/healthdataaiservices/implementation/OperationsClientImpl.java index a30b59cd63fc..741349e19fd9 100644 --- a/sdk/healthdataaiservices/azure-resourcemanager-healthdataaiservices/src/main/java/com/azure/resourcemanager/healthdataaiservices/implementation/OperationsClientImpl.java +++ b/sdk/healthdataaiservices/azure-resourcemanager-healthdataaiservices/src/main/java/com/azure/resourcemanager/healthdataaiservices/implementation/OperationsClientImpl.java @@ -67,14 +67,14 @@ public interface OperationsService { @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list(@HostParam("endpoint") String endpoint, - @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" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -181,6 +181,8 @@ public PagedIterable list(Context context) { } /** + * List the operations for the provider + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -207,6 +209,8 @@ private Mono> listNextSinglePageAsync(String nextL } /** + * List the operations for the provider + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/sdk/healthdataaiservices/azure-resourcemanager-healthdataaiservices/src/main/java/com/azure/resourcemanager/healthdataaiservices/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/healthdataaiservices/azure-resourcemanager-healthdataaiservices/src/main/java/com/azure/resourcemanager/healthdataaiservices/implementation/PrivateEndpointConnectionsClientImpl.java index 87cc07ae5cc6..f3b5da0e57fc 100644 --- a/sdk/healthdataaiservices/azure-resourcemanager-healthdataaiservices/src/main/java/com/azure/resourcemanager/healthdataaiservices/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/healthdataaiservices/azure-resourcemanager-healthdataaiservices/src/main/java/com/azure/resourcemanager/healthdataaiservices/implementation/PrivateEndpointConnectionsClientImpl.java @@ -79,9 +79,8 @@ Mono> get(@HostParam("endpoint" @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deidServiceName") String deidServiceName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthDataAIServices/deidServices/{deidServiceName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) @@ -90,7 +89,7 @@ Mono>> create(@HostParam("endpoint") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deidServiceName") String deidServiceName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") PrivateEndpointConnectionResourceInner resource, Context context); @Headers({ "Content-Type: application/json" }) @@ -102,7 +101,7 @@ Mono>> delete(@HostParam("endpoint") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deidServiceName") String deidServiceName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthDataAIServices/deidServices/{deidServiceName}/privateEndpointConnections") @@ -112,7 +111,7 @@ Mono> listByDeidService( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deidServiceName") String deidServiceName, @HeaderParam("accept") String accept, + @PathParam("deidServiceName") String deidServiceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -121,7 +120,7 @@ Mono> listByDeidService( @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByDeidServiceNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); } /** @@ -308,11 +307,12 @@ private Mono>> createWithResponseAsync(String resource } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, deidServiceName, privateEndpointConnectionName, - accept, resource, context)) + contentType, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -359,10 +359,11 @@ private Mono>> createWithResponseAsync(String resource } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, deidServiceName, privateEndpointConnectionName, accept, resource, context); + resourceGroupName, deidServiceName, privateEndpointConnectionName, contentType, accept, resource, context); } /** @@ -933,6 +934,8 @@ public PagedIterable listByDeidService(S } /** + * List private endpoint connections on the given resource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -961,6 +964,8 @@ public PagedIterable listByDeidService(S } /** + * List private endpoint connections on the given resource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/sdk/healthdataaiservices/azure-resourcemanager-healthdataaiservices/src/main/java/com/azure/resourcemanager/healthdataaiservices/implementation/PrivateLinksClientImpl.java b/sdk/healthdataaiservices/azure-resourcemanager-healthdataaiservices/src/main/java/com/azure/resourcemanager/healthdataaiservices/implementation/PrivateLinksClientImpl.java index 0f2340d0a09e..d3deab2298b5 100644 --- a/sdk/healthdataaiservices/azure-resourcemanager-healthdataaiservices/src/main/java/com/azure/resourcemanager/healthdataaiservices/implementation/PrivateLinksClientImpl.java +++ b/sdk/healthdataaiservices/azure-resourcemanager-healthdataaiservices/src/main/java/com/azure/resourcemanager/healthdataaiservices/implementation/PrivateLinksClientImpl.java @@ -69,7 +69,7 @@ public interface PrivateLinksService { Mono> listByDeidService(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deidServiceName") String deidServiceName, @HeaderParam("accept") String accept, + @PathParam("deidServiceName") String deidServiceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -78,7 +78,7 @@ Mono> listByDeidService(@HostParam("endp @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByDeidServiceNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); } /** @@ -228,6 +228,8 @@ public PagedIterable listByDeidService(String resource } /** + * List private links on the given resource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -255,6 +257,8 @@ private Mono> listByDeidServiceNextSingl } /** + * List private links on the given resource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/DocumentDBClient.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/DocumentDBClient.java index 38bdf7114dcf..c59d30e3fab6 100644 --- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/DocumentDBClient.java +++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/DocumentDBClient.java @@ -12,7 +12,7 @@ */ public interface DocumentDBClient { /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/DocumentDBClientBuilder.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/DocumentDBClientBuilder.java index 899aa78dc126..686a0e2f1269 100644 --- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/DocumentDBClientBuilder.java +++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/DocumentDBClientBuilder.java @@ -20,12 +20,12 @@ @ServiceClientBuilder(serviceClients = { DocumentDBClientImpl.class }) public final class DocumentDBClientBuilder { /* - * Server parameter + * Service host */ private String endpoint; /** - * Sets Server parameter. + * Sets Service host. * * @param endpoint the endpoint value. * @return the DocumentDBClientBuilder. @@ -121,6 +121,7 @@ public DocumentDBClientBuilder serializerAdapter(SerializerAdapter serializerAda * @return an instance of DocumentDBClientImpl. */ public DocumentDBClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; HttpPipeline localPipeline = (pipeline != null) ? pipeline @@ -131,7 +132,7 @@ public DocumentDBClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); DocumentDBClientImpl client = new DocumentDBClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.endpoint, this.subscriptionId); + localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/DocumentDBClientImpl.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/DocumentDBClientImpl.java index 8175c14c61ea..c9102253ca2d 100644 --- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/DocumentDBClientImpl.java +++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/DocumentDBClientImpl.java @@ -44,12 +44,12 @@ @ServiceClient(builder = DocumentDBClientBuilder.class) public final class DocumentDBClientImpl implements DocumentDBClient { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -204,7 +204,7 @@ public PrivateLinksClient getPrivateLinks() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ DocumentDBClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/FirewallRulesClientImpl.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/FirewallRulesClientImpl.java index 3e134773a758..0ab4462b8ed7 100644 --- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/FirewallRulesClientImpl.java +++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/FirewallRulesClientImpl.java @@ -78,10 +78,9 @@ Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("mongoClusterName") String mongoClusterName, - @PathParam("firewallRuleName") String firewallRuleName, @HeaderParam("accept") String accept, + @PathParam("firewallRuleName") String firewallRuleName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName}") @ExpectedResponses({ 200, 201, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) @@ -89,8 +88,9 @@ Mono>> createOrUpdate(@HostParam("endpoint") String en @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("mongoClusterName") String mongoClusterName, - @PathParam("firewallRuleName") String firewallRuleName, @HeaderParam("accept") String accept, - @BodyParam("application/json") FirewallRuleInner resource, Context context); + @PathParam("firewallRuleName") String firewallRuleName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") FirewallRuleInner resource, + Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName}") @@ -100,7 +100,7 @@ Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("mongoClusterName") String mongoClusterName, - @PathParam("firewallRuleName") String firewallRuleName, @HeaderParam("accept") String accept, + @PathParam("firewallRuleName") String firewallRuleName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -110,7 +110,7 @@ Mono>> delete(@HostParam("endpoint") String endpoint, Mono> listByMongoCluster(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("mongoClusterName") String mongoClusterName, @HeaderParam("accept") String accept, + @PathParam("mongoClusterName") String mongoClusterName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -119,7 +119,7 @@ Mono> listByMongoCluster(@HostParam("endpoint") @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByMongoClusterNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); } /** @@ -298,11 +298,12 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, firewallRuleName, accept, - resource, context)) + this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, firewallRuleName, contentType, + accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -348,11 +349,12 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, firewallRuleName, accept, resource, - context); + this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, firewallRuleName, contentType, accept, + resource, context); } /** @@ -886,6 +888,8 @@ public PagedIterable listByMongoCluster(String resourceGroupN } /** + * List all the firewall rules in a given mongo cluster. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -914,6 +918,8 @@ private Mono> listByMongoClusterNextSinglePageA } /** + * List all the firewall rules in a given mongo cluster. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/MongoClustersClientImpl.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/MongoClustersClientImpl.java index a762da85e656..afdea8b37757 100644 --- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/MongoClustersClientImpl.java +++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/MongoClustersClientImpl.java @@ -83,28 +83,28 @@ public interface MongoClustersService { Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("mongoClusterName") String mongoClusterName, @HeaderParam("accept") String accept, + @PathParam("mongoClusterName") String mongoClusterName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("mongoClusterName") String mongoClusterName, @HeaderParam("accept") String accept, - @BodyParam("application/json") MongoClusterInner resource, Context context); + @PathParam("mongoClusterName") String mongoClusterName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") MongoClusterInner resource, + Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("mongoClusterName") String mongoClusterName, @HeaderParam("accept") String accept, - @BodyParam("application/json") MongoClusterUpdate properties, Context context); + @PathParam("mongoClusterName") String mongoClusterName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") MongoClusterUpdate properties, + Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}") @@ -113,7 +113,7 @@ Mono>> update(@HostParam("endpoint") String endpoint, Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("mongoClusterName") String mongoClusterName, @HeaderParam("accept") String accept, + @PathParam("mongoClusterName") String mongoClusterName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -122,7 +122,7 @@ Mono>> delete(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -131,7 +131,7 @@ Mono> listByResourceGroup(@HostParam("endpoint" @UnexpectedResponseExceptionType(ManagementException.class) Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/listConnectionStrings") @@ -140,17 +140,17 @@ Mono> list(@HostParam("endpoint") String endpoi Mono> listConnectionStrings(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("mongoClusterName") String mongoClusterName, @HeaderParam("accept") String accept, + @PathParam("mongoClusterName") String mongoClusterName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/checkMongoClusterNameAvailability") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> checkNameAvailability(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @HeaderParam("accept") String accept, - @BodyParam("application/json") CheckNameAvailabilityRequest body, Context context); + @PathParam("location") String location, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CheckNameAvailabilityRequest body, + Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -158,14 +158,14 @@ Mono> checkNameAvailability(@HostPa @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -324,10 +324,12 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, accept, resource, context)) + this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, contentType, accept, resource, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -368,10 +370,12 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, accept, resource, context); + this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, contentType, accept, resource, + context); } /** @@ -567,10 +571,12 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, accept, properties, context)) + this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, contentType, accept, properties, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -611,10 +617,11 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, mongoClusterName, accept, properties, context); + resourceGroupName, mongoClusterName, contentType, accept, properties, context); } /** @@ -1371,10 +1378,12 @@ private Mono> checkNameAvailability } else { body.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.checkNameAvailability(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, body, context)) + .withContext( + context -> service.checkNameAvailability(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, contentType, accept, body, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1408,10 +1417,11 @@ private Mono> checkNameAvailability } else { body.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.checkNameAvailability(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, accept, body, context); + this.client.getSubscriptionId(), location, contentType, accept, body, context); } /** @@ -1464,6 +1474,8 @@ public CheckNameAvailabilityResponseInner checkNameAvailability(String location, } /** + * List all the mongo clusters in a given resource group. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1492,6 +1504,8 @@ private Mono> listByResourceGroupNextSinglePage } /** + * List all the mongo clusters in a given resource group. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1520,6 +1534,8 @@ private Mono> listByResourceGroupNextSinglePage } /** + * List all the mongo clusters in a given subscription. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1546,6 +1562,8 @@ private Mono> listNextSinglePageAsync(String ne } /** + * List all the mongo clusters in a given subscription. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/OperationsClientImpl.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/OperationsClientImpl.java index ddcad08ab734..40c468a95417 100644 --- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/OperationsClientImpl.java +++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/OperationsClientImpl.java @@ -67,14 +67,14 @@ public interface OperationsService { @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list(@HostParam("endpoint") String endpoint, - @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" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -181,6 +181,8 @@ public PagedIterable list(Context context) { } /** + * List the operations for the provider + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -207,6 +209,8 @@ private Mono> listNextSinglePageAsync(String nextL } /** + * List the operations for the provider + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateEndpointConnectionsClientImpl.java index 277e962a7b36..b8b50600cd2c 100644 --- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateEndpointConnectionsClientImpl.java @@ -78,7 +78,7 @@ Mono> listByMongoCluster( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("mongoClusterName") String mongoClusterName, @HeaderParam("accept") String accept, + @PathParam("mongoClusterName") String mongoClusterName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -90,9 +90,8 @@ Mono> get(@HostParam("endpoint" @PathParam("resourceGroupName") String resourceGroupName, @PathParam("mongoClusterName") String mongoClusterName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 200, 201, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) @@ -101,7 +100,7 @@ Mono>> create(@HostParam("endpoint") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("mongoClusterName") String mongoClusterName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") PrivateEndpointConnectionResourceInner resource, Context context); @Headers({ "Content-Type: application/json" }) @@ -113,7 +112,7 @@ Mono>> delete(@HostParam("endpoint") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("mongoClusterName") String mongoClusterName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -121,7 +120,7 @@ Mono>> delete(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByMongoClusterNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); } /** @@ -459,11 +458,12 @@ private Mono>> createWithResponseAsync(String resource } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, privateEndpointConnectionName, - accept, resource, context)) + contentType, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -509,10 +509,11 @@ private Mono>> createWithResponseAsync(String resource } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, mongoClusterName, privateEndpointConnectionName, accept, resource, context); + resourceGroupName, mongoClusterName, privateEndpointConnectionName, contentType, accept, resource, context); } /** @@ -933,6 +934,8 @@ public void delete(String resourceGroupName, String mongoClusterName, String pri } /** + * List existing private connections + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -962,6 +965,8 @@ public void delete(String resourceGroupName, String mongoClusterName, String pri } /** + * List existing private connections + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateLinksClientImpl.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateLinksClientImpl.java index 26b63a75d40c..ec7bc2f2cb8c 100644 --- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateLinksClientImpl.java +++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateLinksClientImpl.java @@ -69,7 +69,7 @@ public interface PrivateLinksService { Mono> listByMongoCluster(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("mongoClusterName") String mongoClusterName, @HeaderParam("accept") String accept, + @PathParam("mongoClusterName") String mongoClusterName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -78,7 +78,7 @@ Mono> listByMongoCluster(@HostParam("end @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByMongoClusterNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); } /** @@ -229,6 +229,8 @@ public PagedIterable listByMongoCluster(String resourc } /** + * list private links on the given resource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -257,6 +259,8 @@ private Mono> listByMongoClusterNextSing } /** + * list private links on the given resource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/AssistantsClientImpl.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/AssistantsClientImpl.java index 11d232aea5cd..2574bcdd978c 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/AssistantsClientImpl.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/AssistantsClientImpl.java @@ -154,8 +154,9 @@ public interface AssistantsClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createAssistant(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData assistantCreationOptions, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData assistantCreationOptions, RequestOptions requestOptions, + Context context); @Post("/assistants") @ExpectedResponses({ 200 }) @@ -164,8 +165,9 @@ Mono> createAssistant(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createAssistantSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData assistantCreationOptions, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData assistantCreationOptions, RequestOptions requestOptions, + Context context); @Get("/assistants") @ExpectedResponses({ 200 }) @@ -174,7 +176,7 @@ Response createAssistantSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listAssistants(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/assistants") @ExpectedResponses({ 200 }) @@ -183,7 +185,7 @@ Mono> listAssistants(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listAssistantsSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/assistants/{assistantId}") @ExpectedResponses({ 200 }) @@ -192,7 +194,7 @@ Response listAssistantsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getAssistant(@HostParam("endpoint") String endpoint, - @PathParam("assistantId") String assistantId, @HeaderParam("accept") String accept, + @PathParam("assistantId") String assistantId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/assistants/{assistantId}") @@ -202,7 +204,7 @@ Mono> getAssistant(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getAssistantSync(@HostParam("endpoint") String endpoint, - @PathParam("assistantId") String assistantId, @HeaderParam("accept") String accept, + @PathParam("assistantId") String assistantId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/assistants/{assistantId}") @@ -212,9 +214,9 @@ Response getAssistantSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> updateAssistant(@HostParam("endpoint") String endpoint, - @PathParam("assistantId") String assistantId, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData updateAssistantOptions, RequestOptions requestOptions, - Context context); + @PathParam("assistantId") String assistantId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData updateAssistantOptions, + RequestOptions requestOptions, Context context); @Post("/assistants/{assistantId}") @ExpectedResponses({ 200 }) @@ -223,9 +225,9 @@ Mono> updateAssistant(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response updateAssistantSync(@HostParam("endpoint") String endpoint, - @PathParam("assistantId") String assistantId, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData updateAssistantOptions, RequestOptions requestOptions, - Context context); + @PathParam("assistantId") String assistantId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData updateAssistantOptions, + RequestOptions requestOptions, Context context); @Delete("/assistants/{assistantId}") @ExpectedResponses({ 200 }) @@ -234,7 +236,7 @@ Response updateAssistantSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteAssistant(@HostParam("endpoint") String endpoint, - @PathParam("assistantId") String assistantId, @HeaderParam("accept") String accept, + @PathParam("assistantId") String assistantId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/assistants/{assistantId}") @@ -244,7 +246,7 @@ Mono> deleteAssistant(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteAssistantSync(@HostParam("endpoint") String endpoint, - @PathParam("assistantId") String assistantId, @HeaderParam("accept") String accept, + @PathParam("assistantId") String assistantId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/threads") @@ -254,7 +256,7 @@ Response deleteAssistantSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createThread(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData assistantThreadCreationOptions, RequestOptions requestOptions, Context context); @@ -265,7 +267,7 @@ Mono> createThread(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createThreadSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData assistantThreadCreationOptions, RequestOptions requestOptions, Context context); @@ -276,7 +278,7 @@ Response createThreadSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getThread(@HostParam("endpoint") String endpoint, - @PathParam("threadId") String threadId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("threadId") String threadId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/threads/{threadId}") @@ -286,7 +288,7 @@ Mono> getThread(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getThreadSync(@HostParam("endpoint") String endpoint, - @PathParam("threadId") String threadId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("threadId") String threadId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/threads/{threadId}") @@ -296,7 +298,8 @@ Response getThreadSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> updateThread(@HostParam("endpoint") String endpoint, - @PathParam("threadId") String threadId, @HeaderParam("accept") String accept, + @PathParam("threadId") String threadId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData updateAssistantThreadOptions, RequestOptions requestOptions, Context context); @@ -307,7 +310,8 @@ Mono> updateThread(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response updateThreadSync(@HostParam("endpoint") String endpoint, - @PathParam("threadId") String threadId, @HeaderParam("accept") String accept, + @PathParam("threadId") String threadId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData updateAssistantThreadOptions, RequestOptions requestOptions, Context context); @@ -318,7 +322,7 @@ Response updateThreadSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteThread(@HostParam("endpoint") String endpoint, - @PathParam("threadId") String threadId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("threadId") String threadId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/threads/{threadId}") @@ -328,7 +332,7 @@ Mono> deleteThread(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteThreadSync(@HostParam("endpoint") String endpoint, - @PathParam("threadId") String threadId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("threadId") String threadId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/threads/{threadId}/messages") @@ -338,9 +342,9 @@ Response deleteThreadSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createMessage(@HostParam("endpoint") String endpoint, - @PathParam("threadId") String threadId, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData threadMessageOptions, RequestOptions requestOptions, - Context context); + @PathParam("threadId") String threadId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData threadMessageOptions, + RequestOptions requestOptions, Context context); @Post("/threads/{threadId}/messages") @ExpectedResponses({ 200 }) @@ -349,9 +353,9 @@ Mono> createMessage(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createMessageSync(@HostParam("endpoint") String endpoint, - @PathParam("threadId") String threadId, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData threadMessageOptions, RequestOptions requestOptions, - Context context); + @PathParam("threadId") String threadId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData threadMessageOptions, + RequestOptions requestOptions, Context context); @Get("/threads/{threadId}/messages") @ExpectedResponses({ 200 }) @@ -360,7 +364,7 @@ Response createMessageSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listMessages(@HostParam("endpoint") String endpoint, - @PathParam("threadId") String threadId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("threadId") String threadId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/threads/{threadId}/messages") @@ -370,7 +374,7 @@ Mono> listMessages(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listMessagesSync(@HostParam("endpoint") String endpoint, - @PathParam("threadId") String threadId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("threadId") String threadId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/threads/{threadId}/messages/{messageId}") @@ -381,7 +385,7 @@ Response listMessagesSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getMessage(@HostParam("endpoint") String endpoint, @PathParam("threadId") String threadId, @PathParam("messageId") String messageId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/threads/{threadId}/messages/{messageId}") @ExpectedResponses({ 200 }) @@ -391,7 +395,7 @@ Mono> getMessage(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response getMessageSync(@HostParam("endpoint") String endpoint, @PathParam("threadId") String threadId, @PathParam("messageId") String messageId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/threads/{threadId}/messages/{messageId}") @ExpectedResponses({ 200 }) @@ -401,8 +405,9 @@ Response getMessageSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> updateMessage(@HostParam("endpoint") String endpoint, @PathParam("threadId") String threadId, @PathParam("messageId") String messageId, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData updateMessageRequest, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData updateMessageRequest, RequestOptions requestOptions, + Context context); @Post("/threads/{threadId}/messages/{messageId}") @ExpectedResponses({ 200 }) @@ -412,8 +417,9 @@ Mono> updateMessage(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response updateMessageSync(@HostParam("endpoint") String endpoint, @PathParam("threadId") String threadId, @PathParam("messageId") String messageId, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData updateMessageRequest, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData updateMessageRequest, RequestOptions requestOptions, + Context context); @Post("/threads/{threadId}/runs") @ExpectedResponses({ 200 }) @@ -422,8 +428,9 @@ Response updateMessageSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createRun(@HostParam("endpoint") String endpoint, - @PathParam("threadId") String threadId, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData createRunOptions, RequestOptions requestOptions, Context context); + @PathParam("threadId") String threadId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData createRunOptions, + RequestOptions requestOptions, Context context); @Post("/threads/{threadId}/runs") @ExpectedResponses({ 200 }) @@ -432,8 +439,9 @@ Mono> createRun(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createRunSync(@HostParam("endpoint") String endpoint, - @PathParam("threadId") String threadId, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData createRunOptions, RequestOptions requestOptions, Context context); + @PathParam("threadId") String threadId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData createRunOptions, + RequestOptions requestOptions, Context context); @Get("/threads/{threadId}/runs") @ExpectedResponses({ 200 }) @@ -442,7 +450,7 @@ Response createRunSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listRuns(@HostParam("endpoint") String endpoint, - @PathParam("threadId") String threadId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("threadId") String threadId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/threads/{threadId}/runs") @@ -452,7 +460,7 @@ Mono> listRuns(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listRunsSync(@HostParam("endpoint") String endpoint, - @PathParam("threadId") String threadId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("threadId") String threadId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/threads/{threadId}/runs/{runId}") @@ -463,7 +471,7 @@ Response listRunsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getRun(@HostParam("endpoint") String endpoint, @PathParam("threadId") String threadId, @PathParam("runId") String runId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/threads/{threadId}/runs/{runId}") @ExpectedResponses({ 200 }) @@ -472,7 +480,7 @@ Mono> getRun(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getRunSync(@HostParam("endpoint") String endpoint, @PathParam("threadId") String threadId, - @PathParam("runId") String runId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("runId") String runId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/threads/{threadId}/runs/{runId}") @@ -483,8 +491,8 @@ Response getRunSync(@HostParam("endpoint") String endpoint, @PathPar @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> updateRun(@HostParam("endpoint") String endpoint, @PathParam("threadId") String threadId, @PathParam("runId") String runId, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData updateRunRequest, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData updateRunRequest, RequestOptions requestOptions, Context context); @Post("/threads/{threadId}/runs/{runId}") @ExpectedResponses({ 200 }) @@ -494,8 +502,8 @@ Mono> updateRun(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response updateRunSync(@HostParam("endpoint") String endpoint, @PathParam("threadId") String threadId, @PathParam("runId") String runId, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData updateRunRequest, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData updateRunRequest, RequestOptions requestOptions, Context context); @Post("/threads/{threadId}/runs/{runId}/submit_tool_outputs") @ExpectedResponses({ 200 }) @@ -505,7 +513,7 @@ Response updateRunSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> submitToolOutputsToRun(@HostParam("endpoint") String endpoint, @PathParam("threadId") String threadId, @PathParam("runId") String runId, - @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData submitToolOutputsToRunRequest, RequestOptions requestOptions, Context context); @@ -517,7 +525,7 @@ Mono> submitToolOutputsToRun(@HostParam("endpoint") String @UnexpectedResponseExceptionType(HttpResponseException.class) Response submitToolOutputsToRunSync(@HostParam("endpoint") String endpoint, @PathParam("threadId") String threadId, @PathParam("runId") String runId, - @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData submitToolOutputsToRunRequest, RequestOptions requestOptions, Context context); @@ -529,7 +537,7 @@ Response submitToolOutputsToRunSync(@HostParam("endpoint") String en @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> cancelRun(@HostParam("endpoint") String endpoint, @PathParam("threadId") String threadId, @PathParam("runId") String runId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/threads/{threadId}/runs/{runId}/cancel") @ExpectedResponses({ 200 }) @@ -539,7 +547,7 @@ Mono> cancelRun(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response cancelRunSync(@HostParam("endpoint") String endpoint, @PathParam("threadId") String threadId, @PathParam("runId") String runId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/threads/runs") @ExpectedResponses({ 200 }) @@ -548,8 +556,9 @@ Response cancelRunSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createThreadAndRun(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData createAndRunThreadOptions, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData createAndRunThreadOptions, RequestOptions requestOptions, + Context context); @Post("/threads/runs") @ExpectedResponses({ 200 }) @@ -558,8 +567,9 @@ Mono> createThreadAndRun(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createThreadAndRunSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData createAndRunThreadOptions, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData createAndRunThreadOptions, RequestOptions requestOptions, + Context context); @Get("/threads/{threadId}/runs/{runId}/steps/{stepId}") @ExpectedResponses({ 200 }) @@ -569,7 +579,7 @@ Response createThreadAndRunSync(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getRunStep(@HostParam("endpoint") String endpoint, @PathParam("threadId") String threadId, @PathParam("runId") String runId, - @PathParam("stepId") String stepId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("stepId") String stepId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/threads/{threadId}/runs/{runId}/steps/{stepId}") @@ -580,7 +590,7 @@ Mono> getRunStep(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response getRunStepSync(@HostParam("endpoint") String endpoint, @PathParam("threadId") String threadId, @PathParam("runId") String runId, - @PathParam("stepId") String stepId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("stepId") String stepId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/threads/{threadId}/runs/{runId}/steps") @@ -591,7 +601,7 @@ Response getRunStepSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listRunSteps(@HostParam("endpoint") String endpoint, @PathParam("threadId") String threadId, @PathParam("runId") String runId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/threads/{threadId}/runs/{runId}/steps") @ExpectedResponses({ 200 }) @@ -601,7 +611,7 @@ Mono> listRunSteps(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response listRunStepsSync(@HostParam("endpoint") String endpoint, @PathParam("threadId") String threadId, @PathParam("runId") String runId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/files") @ExpectedResponses({ 200 }) @@ -610,7 +620,7 @@ Response listRunStepsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listFiles(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/files") @ExpectedResponses({ 200 }) @@ -618,7 +628,7 @@ Mono> listFiles(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listFilesSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response listFilesSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @@ -629,7 +639,7 @@ Response listFilesSync(@HostParam("endpoint") String endpoint, @Head @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> uploadFile(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData uploadFileRequest, RequestOptions requestOptions, Context context); @@ -641,7 +651,7 @@ Mono> uploadFile(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadFileSync(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData uploadFileRequest, RequestOptions requestOptions, Context context); @@ -652,7 +662,7 @@ Response uploadFileSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteFile(@HostParam("endpoint") String endpoint, - @PathParam("fileId") String fileId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("fileId") String fileId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/files/{fileId}") @@ -662,7 +672,7 @@ Mono> deleteFile(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteFileSync(@HostParam("endpoint") String endpoint, @PathParam("fileId") String fileId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/files/{fileId}") @ExpectedResponses({ 200 }) @@ -671,7 +681,7 @@ Response deleteFileSync(@HostParam("endpoint") String endpoint, @Pat @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getFile(@HostParam("endpoint") String endpoint, @PathParam("fileId") String fileId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/files/{fileId}") @ExpectedResponses({ 200 }) @@ -680,7 +690,7 @@ Mono> getFile(@HostParam("endpoint") String endpoint, @Path @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getFileSync(@HostParam("endpoint") String endpoint, @PathParam("fileId") String fileId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/files/{fileId}/content") @ExpectedResponses({ 200 }) @@ -689,7 +699,7 @@ Response getFileSync(@HostParam("endpoint") String endpoint, @PathPa @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getFileContent(@HostParam("endpoint") String endpoint, - @PathParam("fileId") String fileId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("fileId") String fileId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/files/{fileId}/content") @@ -699,7 +709,7 @@ Mono> getFileContent(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getFileContentSync(@HostParam("endpoint") String endpoint, - @PathParam("fileId") String fileId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("fileId") String fileId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/vector_stores") @@ -709,7 +719,7 @@ Response getFileContentSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listVectorStores(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/vector_stores") @ExpectedResponses({ 200 }) @@ -718,7 +728,7 @@ Mono> listVectorStores(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listVectorStoresSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/vector_stores") @ExpectedResponses({ 200 }) @@ -727,8 +737,9 @@ Response listVectorStoresSync(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createVectorStore(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData vectorStoreOptions, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData vectorStoreOptions, RequestOptions requestOptions, + Context context); @Post("/vector_stores") @ExpectedResponses({ 200 }) @@ -737,8 +748,9 @@ Mono> createVectorStore(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createVectorStoreSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData vectorStoreOptions, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData vectorStoreOptions, RequestOptions requestOptions, + Context context); @Get("/vector_stores/{vectorStoreId}") @ExpectedResponses({ 200 }) @@ -747,7 +759,7 @@ Response createVectorStoreSync(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getVectorStore(@HostParam("endpoint") String endpoint, - @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("accept") String accept, + @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/vector_stores/{vectorStoreId}") @@ -757,7 +769,7 @@ Mono> getVectorStore(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getVectorStoreSync(@HostParam("endpoint") String endpoint, - @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("accept") String accept, + @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/vector_stores/{vectorStoreId}") @@ -767,9 +779,9 @@ Response getVectorStoreSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> modifyVectorStore(@HostParam("endpoint") String endpoint, - @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData vectorStoreUpdateOptions, RequestOptions requestOptions, - Context context); + @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData vectorStoreUpdateOptions, + RequestOptions requestOptions, Context context); @Post("/vector_stores/{vectorStoreId}") @ExpectedResponses({ 200 }) @@ -778,9 +790,9 @@ Mono> modifyVectorStore(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response modifyVectorStoreSync(@HostParam("endpoint") String endpoint, - @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData vectorStoreUpdateOptions, RequestOptions requestOptions, - Context context); + @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData vectorStoreUpdateOptions, + RequestOptions requestOptions, Context context); @Delete("/vector_stores/{vectorStoreId}") @ExpectedResponses({ 200 }) @@ -789,7 +801,7 @@ Response modifyVectorStoreSync(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteVectorStore(@HostParam("endpoint") String endpoint, - @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("accept") String accept, + @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/vector_stores/{vectorStoreId}") @@ -799,7 +811,7 @@ Mono> deleteVectorStore(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteVectorStoreSync(@HostParam("endpoint") String endpoint, - @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("accept") String accept, + @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/vector_stores/{vectorStoreId}/files") @@ -809,7 +821,7 @@ Response deleteVectorStoreSync(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listVectorStoreFiles(@HostParam("endpoint") String endpoint, - @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("accept") String accept, + @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/vector_stores/{vectorStoreId}/files") @@ -819,7 +831,7 @@ Mono> listVectorStoreFiles(@HostParam("endpoint") String en @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listVectorStoreFilesSync(@HostParam("endpoint") String endpoint, - @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("accept") String accept, + @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/vector_stores/{vectorStoreId}/files") @@ -829,7 +841,8 @@ Response listVectorStoreFilesSync(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createVectorStoreFile(@HostParam("endpoint") String endpoint, - @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("accept") String accept, + @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData createVectorStoreFileRequest, RequestOptions requestOptions, Context context); @@ -840,7 +853,8 @@ Mono> createVectorStoreFile(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createVectorStoreFileSync(@HostParam("endpoint") String endpoint, - @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("accept") String accept, + @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData createVectorStoreFileRequest, RequestOptions requestOptions, Context context); @@ -852,7 +866,7 @@ Response createVectorStoreFileSync(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getVectorStoreFile(@HostParam("endpoint") String endpoint, @PathParam("vectorStoreId") String vectorStoreId, @PathParam("fileId") String fileId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/vector_stores/{vectorStoreId}/files/{fileId}") @ExpectedResponses({ 200 }) @@ -862,7 +876,7 @@ Mono> getVectorStoreFile(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(HttpResponseException.class) Response getVectorStoreFileSync(@HostParam("endpoint") String endpoint, @PathParam("vectorStoreId") String vectorStoreId, @PathParam("fileId") String fileId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/vector_stores/{vectorStoreId}/files/{fileId}") @ExpectedResponses({ 200 }) @@ -872,7 +886,7 @@ Response getVectorStoreFileSync(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteVectorStoreFile(@HostParam("endpoint") String endpoint, @PathParam("vectorStoreId") String vectorStoreId, @PathParam("fileId") String fileId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/vector_stores/{vectorStoreId}/files/{fileId}") @ExpectedResponses({ 200 }) @@ -882,7 +896,7 @@ Mono> deleteVectorStoreFile(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteVectorStoreFileSync(@HostParam("endpoint") String endpoint, @PathParam("vectorStoreId") String vectorStoreId, @PathParam("fileId") String fileId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/vector_stores/{vectorStoreId}/file_batches") @ExpectedResponses({ 200 }) @@ -891,7 +905,8 @@ Response deleteVectorStoreFileSync(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createVectorStoreFileBatch(@HostParam("endpoint") String endpoint, - @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("accept") String accept, + @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData createVectorStoreFileBatchRequest, RequestOptions requestOptions, Context context); @@ -902,7 +917,8 @@ Mono> createVectorStoreFileBatch(@HostParam("endpoint") Str @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createVectorStoreFileBatchSync(@HostParam("endpoint") String endpoint, - @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("accept") String accept, + @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData createVectorStoreFileBatchRequest, RequestOptions requestOptions, Context context); @@ -914,7 +930,7 @@ Response createVectorStoreFileBatchSync(@HostParam("endpoint") Strin @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getVectorStoreFileBatch(@HostParam("endpoint") String endpoint, @PathParam("vectorStoreId") String vectorStoreId, @PathParam("batchId") String batchId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/vector_stores/{vectorStoreId}/file_batches/{batchId}") @ExpectedResponses({ 200 }) @@ -924,7 +940,7 @@ Mono> getVectorStoreFileBatch(@HostParam("endpoint") String @UnexpectedResponseExceptionType(HttpResponseException.class) Response getVectorStoreFileBatchSync(@HostParam("endpoint") String endpoint, @PathParam("vectorStoreId") String vectorStoreId, @PathParam("batchId") String batchId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/vector_stores/{vectorStoreId}/file_batches/{batchId}/cancel") @ExpectedResponses({ 200 }) @@ -934,7 +950,7 @@ Response getVectorStoreFileBatchSync(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> cancelVectorStoreFileBatch(@HostParam("endpoint") String endpoint, @PathParam("vectorStoreId") String vectorStoreId, @PathParam("batchId") String batchId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/vector_stores/{vectorStoreId}/file_batches/{batchId}/cancel") @ExpectedResponses({ 200 }) @@ -944,7 +960,7 @@ Mono> cancelVectorStoreFileBatch(@HostParam("endpoint") Str @UnexpectedResponseExceptionType(HttpResponseException.class) Response cancelVectorStoreFileBatchSync(@HostParam("endpoint") String endpoint, @PathParam("vectorStoreId") String vectorStoreId, @PathParam("batchId") String batchId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/vector_stores/{vectorStoreId}/file_batches/{batchId}/files") @ExpectedResponses({ 200 }) @@ -954,7 +970,7 @@ Response cancelVectorStoreFileBatchSync(@HostParam("endpoint") Strin @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listVectorStoreFileBatchFiles(@HostParam("endpoint") String endpoint, @PathParam("vectorStoreId") String vectorStoreId, @PathParam("batchId") String batchId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/vector_stores/{vectorStoreId}/file_batches/{batchId}/files") @ExpectedResponses({ 200 }) @@ -964,7 +980,7 @@ Mono> listVectorStoreFileBatchFiles(@HostParam("endpoint") @UnexpectedResponseExceptionType(HttpResponseException.class) Response listVectorStoreFileBatchFilesSync(@HostParam("endpoint") String endpoint, @PathParam("vectorStoreId") String vectorStoreId, @PathParam("batchId") String batchId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -1048,8 +1064,9 @@ Response listVectorStoreFileBatchFilesSync(@HostParam("endpoint") St @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createAssistantWithResponseAsync(BinaryData assistantCreationOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createAssistant(this.getEndpoint(), accept, + return FluxUtil.withContext(context -> service.createAssistant(this.getEndpoint(), contentType, accept, assistantCreationOptions, requestOptions, context)); } @@ -1133,9 +1150,10 @@ public Mono> createAssistantWithResponseAsync(BinaryData as @ServiceMethod(returns = ReturnType.SINGLE) public Response createAssistantWithResponse(BinaryData assistantCreationOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.createAssistantSync(this.getEndpoint(), accept, assistantCreationOptions, requestOptions, - Context.NONE); + return service.createAssistantSync(this.getEndpoint(), contentType, accept, assistantCreationOptions, + requestOptions, Context.NONE); } /** @@ -1488,9 +1506,10 @@ public Response getAssistantWithResponse(String assistantId, Request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> updateAssistantWithResponseAsync(String assistantId, BinaryData updateAssistantOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.updateAssistant(this.getEndpoint(), assistantId, accept, - updateAssistantOptions, requestOptions, context)); + return FluxUtil.withContext(context -> service.updateAssistant(this.getEndpoint(), assistantId, contentType, + accept, updateAssistantOptions, requestOptions, context)); } /** @@ -1578,8 +1597,9 @@ public Mono> updateAssistantWithResponseAsync(String assist @ServiceMethod(returns = ReturnType.SINGLE) public Response updateAssistantWithResponse(String assistantId, BinaryData updateAssistantOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.updateAssistantSync(this.getEndpoint(), assistantId, accept, updateAssistantOptions, + return service.updateAssistantSync(this.getEndpoint(), assistantId, contentType, accept, updateAssistantOptions, requestOptions, Context.NONE); } @@ -1712,8 +1732,9 @@ public Response deleteAssistantWithResponse(String assistantId, Requ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createThreadWithResponseAsync(BinaryData assistantThreadCreationOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createThread(this.getEndpoint(), accept, + return FluxUtil.withContext(context -> service.createThread(this.getEndpoint(), contentType, accept, assistantThreadCreationOptions, requestOptions, context)); } @@ -1790,9 +1811,10 @@ public Mono> createThreadWithResponseAsync(BinaryData assis @ServiceMethod(returns = ReturnType.SINGLE) public Response createThreadWithResponse(BinaryData assistantThreadCreationOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.createThreadSync(this.getEndpoint(), accept, assistantThreadCreationOptions, requestOptions, - Context.NONE); + return service.createThreadSync(this.getEndpoint(), contentType, accept, assistantThreadCreationOptions, + requestOptions, Context.NONE); } /** @@ -1941,8 +1963,9 @@ public Response getThreadWithResponse(String threadId, RequestOption @ServiceMethod(returns = ReturnType.SINGLE) public Mono> updateThreadWithResponseAsync(String threadId, BinaryData updateAssistantThreadOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.updateThread(this.getEndpoint(), threadId, accept, + return FluxUtil.withContext(context -> service.updateThread(this.getEndpoint(), threadId, contentType, accept, updateAssistantThreadOptions, requestOptions, context)); } @@ -2007,8 +2030,9 @@ public Mono> updateThreadWithResponseAsync(String threadId, @ServiceMethod(returns = ReturnType.SINGLE) public Response updateThreadWithResponse(String threadId, BinaryData updateAssistantThreadOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.updateThreadSync(this.getEndpoint(), threadId, accept, updateAssistantThreadOptions, + return service.updateThreadSync(this.getEndpoint(), threadId, contentType, accept, updateAssistantThreadOptions, requestOptions, Context.NONE); } @@ -2138,8 +2162,9 @@ public Response deleteThreadWithResponse(String threadId, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createMessageWithResponseAsync(String threadId, BinaryData threadMessageOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createMessage(this.getEndpoint(), threadId, accept, + return FluxUtil.withContext(context -> service.createMessage(this.getEndpoint(), threadId, contentType, accept, threadMessageOptions, requestOptions, context)); } @@ -2214,9 +2239,10 @@ public Mono> createMessageWithResponseAsync(String threadId @ServiceMethod(returns = ReturnType.SINGLE) public Response createMessageWithResponse(String threadId, BinaryData threadMessageOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.createMessageSync(this.getEndpoint(), threadId, accept, threadMessageOptions, requestOptions, - Context.NONE); + return service.createMessageSync(this.getEndpoint(), threadId, contentType, accept, threadMessageOptions, + requestOptions, Context.NONE); } /** @@ -2549,9 +2575,10 @@ public Response getMessageWithResponse(String threadId, String messa @ServiceMethod(returns = ReturnType.SINGLE) public Mono> updateMessageWithResponseAsync(String threadId, String messageId, BinaryData updateMessageRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.updateMessage(this.getEndpoint(), threadId, messageId, accept, - updateMessageRequest, requestOptions, context)); + return FluxUtil.withContext(context -> service.updateMessage(this.getEndpoint(), threadId, messageId, + contentType, accept, updateMessageRequest, requestOptions, context)); } /** @@ -2615,9 +2642,10 @@ public Mono> updateMessageWithResponseAsync(String threadId @ServiceMethod(returns = ReturnType.SINGLE) public Response updateMessageWithResponse(String threadId, String messageId, BinaryData updateMessageRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.updateMessageSync(this.getEndpoint(), threadId, messageId, accept, updateMessageRequest, - requestOptions, Context.NONE); + return service.updateMessageSync(this.getEndpoint(), threadId, messageId, contentType, accept, + updateMessageRequest, requestOptions, Context.NONE); } /** @@ -2749,9 +2777,10 @@ public Response updateMessageWithResponse(String threadId, String me @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createRunWithResponseAsync(String threadId, BinaryData createRunOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createRun(this.getEndpoint(), threadId, accept, createRunOptions, - requestOptions, context)); + return FluxUtil.withContext(context -> service.createRun(this.getEndpoint(), threadId, contentType, accept, + createRunOptions, requestOptions, context)); } /** @@ -2882,9 +2911,10 @@ public Mono> createRunWithResponseAsync(String threadId, Bi @ServiceMethod(returns = ReturnType.SINGLE) public Response createRunWithResponse(String threadId, BinaryData createRunOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.createRunSync(this.getEndpoint(), threadId, accept, createRunOptions, requestOptions, - Context.NONE); + return service.createRunSync(this.getEndpoint(), threadId, contentType, accept, createRunOptions, + requestOptions, Context.NONE); } /** @@ -3289,9 +3319,10 @@ public Response getRunWithResponse(String threadId, String runId, Re @ServiceMethod(returns = ReturnType.SINGLE) public Mono> updateRunWithResponseAsync(String threadId, String runId, BinaryData updateRunRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.updateRun(this.getEndpoint(), threadId, runId, accept, - updateRunRequest, requestOptions, context)); + return FluxUtil.withContext(context -> service.updateRun(this.getEndpoint(), threadId, runId, contentType, + accept, updateRunRequest, requestOptions, context)); } /** @@ -3370,9 +3401,10 @@ public Mono> updateRunWithResponseAsync(String threadId, St @ServiceMethod(returns = ReturnType.SINGLE) public Response updateRunWithResponse(String threadId, String runId, BinaryData updateRunRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.updateRunSync(this.getEndpoint(), threadId, runId, accept, updateRunRequest, requestOptions, - Context.NONE); + return service.updateRunSync(this.getEndpoint(), threadId, runId, contentType, accept, updateRunRequest, + requestOptions, Context.NONE); } /** @@ -3457,9 +3489,10 @@ public Response updateRunWithResponse(String threadId, String runId, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> submitToolOutputsToRunWithResponseAsync(String threadId, String runId, BinaryData submitToolOutputsToRunRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.submitToolOutputsToRun(this.getEndpoint(), threadId, runId, - accept, submitToolOutputsToRunRequest, requestOptions, context)); + contentType, accept, submitToolOutputsToRunRequest, requestOptions, context)); } /** @@ -3543,8 +3576,9 @@ public Mono> submitToolOutputsToRunWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) public Response submitToolOutputsToRunWithResponse(String threadId, String runId, BinaryData submitToolOutputsToRunRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.submitToolOutputsToRunSync(this.getEndpoint(), threadId, runId, accept, + return service.submitToolOutputsToRunSync(this.getEndpoint(), threadId, runId, contentType, accept, submitToolOutputsToRunRequest, requestOptions, Context.NONE); } @@ -3823,8 +3857,9 @@ public Response cancelRunWithResponse(String threadId, String runId, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createThreadAndRunWithResponseAsync(BinaryData createAndRunThreadOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createThreadAndRun(this.getEndpoint(), accept, + return FluxUtil.withContext(context -> service.createThreadAndRun(this.getEndpoint(), contentType, accept, createAndRunThreadOptions, requestOptions, context)); } @@ -3963,9 +3998,10 @@ public Mono> createThreadAndRunWithResponseAsync(BinaryData @ServiceMethod(returns = ReturnType.SINGLE) public Response createThreadAndRunWithResponse(BinaryData createAndRunThreadOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.createThreadAndRunSync(this.getEndpoint(), accept, createAndRunThreadOptions, requestOptions, - Context.NONE); + return service.createThreadAndRunSync(this.getEndpoint(), contentType, accept, createAndRunThreadOptions, + requestOptions, Context.NONE); } /** @@ -4751,9 +4787,10 @@ public Response listVectorStoresWithResponse(RequestOptions requestO @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createVectorStoreWithResponseAsync(BinaryData vectorStoreOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createVectorStore(this.getEndpoint(), accept, vectorStoreOptions, - requestOptions, context)); + return FluxUtil.withContext(context -> service.createVectorStore(this.getEndpoint(), contentType, accept, + vectorStoreOptions, requestOptions, context)); } /** @@ -4817,9 +4854,10 @@ public Mono> createVectorStoreWithResponseAsync(BinaryData @ServiceMethod(returns = ReturnType.SINGLE) public Response createVectorStoreWithResponse(BinaryData vectorStoreOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.createVectorStoreSync(this.getEndpoint(), accept, vectorStoreOptions, requestOptions, - Context.NONE); + return service.createVectorStoreSync(this.getEndpoint(), contentType, accept, vectorStoreOptions, + requestOptions, Context.NONE); } /** @@ -4975,9 +5013,10 @@ public Response getVectorStoreWithResponse(String vectorStoreId, Req @ServiceMethod(returns = ReturnType.SINGLE) public Mono> modifyVectorStoreWithResponseAsync(String vectorStoreId, BinaryData vectorStoreUpdateOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.modifyVectorStore(this.getEndpoint(), vectorStoreId, accept, - vectorStoreUpdateOptions, requestOptions, context)); + return FluxUtil.withContext(context -> service.modifyVectorStore(this.getEndpoint(), vectorStoreId, contentType, + accept, vectorStoreUpdateOptions, requestOptions, context)); } /** @@ -5039,9 +5078,10 @@ public Mono> modifyVectorStoreWithResponseAsync(String vect @ServiceMethod(returns = ReturnType.SINGLE) public Response modifyVectorStoreWithResponse(String vectorStoreId, BinaryData vectorStoreUpdateOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.modifyVectorStoreSync(this.getEndpoint(), vectorStoreId, accept, vectorStoreUpdateOptions, - requestOptions, Context.NONE); + return service.modifyVectorStoreSync(this.getEndpoint(), vectorStoreId, contentType, accept, + vectorStoreUpdateOptions, requestOptions, Context.NONE); } /** @@ -5263,9 +5303,10 @@ public Response listVectorStoreFilesWithResponse(String vectorStoreI @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createVectorStoreFileWithResponseAsync(String vectorStoreId, BinaryData createVectorStoreFileRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createVectorStoreFile(this.getEndpoint(), vectorStoreId, accept, - createVectorStoreFileRequest, requestOptions, context)); + return FluxUtil.withContext(context -> service.createVectorStoreFile(this.getEndpoint(), vectorStoreId, + contentType, accept, createVectorStoreFileRequest, requestOptions, context)); } /** @@ -5307,8 +5348,9 @@ public Mono> createVectorStoreFileWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) public Response createVectorStoreFileWithResponse(String vectorStoreId, BinaryData createVectorStoreFileRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.createVectorStoreFileSync(this.getEndpoint(), vectorStoreId, accept, + return service.createVectorStoreFileSync(this.getEndpoint(), vectorStoreId, contentType, accept, createVectorStoreFileRequest, requestOptions, Context.NONE); } @@ -5492,9 +5534,10 @@ public Response deleteVectorStoreFileWithResponse(String vectorStore @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createVectorStoreFileBatchWithResponseAsync(String vectorStoreId, BinaryData createVectorStoreFileBatchRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.createVectorStoreFileBatch(this.getEndpoint(), vectorStoreId, - accept, createVectorStoreFileBatchRequest, requestOptions, context)); + contentType, accept, createVectorStoreFileBatchRequest, requestOptions, context)); } /** @@ -5540,8 +5583,9 @@ public Mono> createVectorStoreFileBatchWithResponseAsync(St @ServiceMethod(returns = ReturnType.SINGLE) public Response createVectorStoreFileBatchWithResponse(String vectorStoreId, BinaryData createVectorStoreFileBatchRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.createVectorStoreFileBatchSync(this.getEndpoint(), vectorStoreId, accept, + return service.createVectorStoreFileBatchSync(this.getEndpoint(), vectorStoreId, contentType, accept, createVectorStoreFileBatchRequest, requestOptions, Context.NONE); } diff --git a/sdk/openai/azure-ai-openai/assets.json b/sdk/openai/azure-ai-openai/assets.json index 325caff17304..f77c86800ba5 100644 --- a/sdk/openai/azure-ai-openai/assets.json +++ b/sdk/openai/azure-ai-openai/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/openai/azure-ai-openai", - "Tag": "java/openai/azure-ai-openai_6aab94ce2d" + "Tag": "java/openai/azure-ai-openai_2a0196dd29" } diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/OpenAIClientImpl.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/OpenAIClientImpl.java index 48b58a1ad600..869340dba788 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/OpenAIClientImpl.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/OpenAIClientImpl.java @@ -159,7 +159,7 @@ public interface OpenAIClientService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getAudioTranscriptionAsPlainText(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData audioTranscriptionOptions, RequestOptions requestOptions, Context context); @@ -172,7 +172,7 @@ Mono> getAudioTranscriptionAsPlainText(@HostParam("endpoint @UnexpectedResponseExceptionType(HttpResponseException.class) Response getAudioTranscriptionAsPlainTextSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData audioTranscriptionOptions, RequestOptions requestOptions, Context context); @@ -185,7 +185,7 @@ Response getAudioTranscriptionAsPlainTextSync(@HostParam("endpoint") @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getAudioTranscriptionAsResponseObject(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData audioTranscriptionOptions, RequestOptions requestOptions, Context context); @@ -198,7 +198,7 @@ Mono> getAudioTranscriptionAsResponseObject(@HostParam("end @UnexpectedResponseExceptionType(HttpResponseException.class) Response getAudioTranscriptionAsResponseObjectSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData audioTranscriptionOptions, RequestOptions requestOptions, Context context); @@ -211,7 +211,7 @@ Response getAudioTranscriptionAsResponseObjectSync(@HostParam("endpo @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getAudioTranslationAsPlainText(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData audioTranslationOptions, RequestOptions requestOptions, Context context); @@ -224,7 +224,7 @@ Mono> getAudioTranslationAsPlainText(@HostParam("endpoint") @UnexpectedResponseExceptionType(HttpResponseException.class) Response getAudioTranslationAsPlainTextSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData audioTranslationOptions, RequestOptions requestOptions, Context context); @@ -237,7 +237,7 @@ Response getAudioTranslationAsPlainTextSync(@HostParam("endpoint") S @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getAudioTranslationAsResponseObject(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData audioTranslationOptions, RequestOptions requestOptions, Context context); @@ -250,7 +250,7 @@ Mono> getAudioTranslationAsResponseObject(@HostParam("endpo @UnexpectedResponseExceptionType(HttpResponseException.class) Response getAudioTranslationAsResponseObjectSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData audioTranslationOptions, RequestOptions requestOptions, Context context); @@ -262,8 +262,9 @@ Response getAudioTranslationAsResponseObjectSync(@HostParam("endpoin @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getCompletions(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData completionsOptions, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData completionsOptions, RequestOptions requestOptions, + Context context); @Post("/deployments/{deploymentId}/completions") @ExpectedResponses({ 200 }) @@ -273,8 +274,9 @@ Mono> getCompletions(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(HttpResponseException.class) Response getCompletionsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData completionsOptions, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData completionsOptions, RequestOptions requestOptions, + Context context); @Post("/deployments/{deploymentId}/chat/completions") @ExpectedResponses({ 200 }) @@ -284,8 +286,9 @@ Response getCompletionsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getChatCompletions(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData chatCompletionsOptions, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData chatCompletionsOptions, RequestOptions requestOptions, + Context context); @Post("/deployments/{deploymentId}/chat/completions") @ExpectedResponses({ 200 }) @@ -295,8 +298,9 @@ Mono> getChatCompletions(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(HttpResponseException.class) Response getChatCompletionsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData chatCompletionsOptions, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData chatCompletionsOptions, RequestOptions requestOptions, + Context context); @Post("/deployments/{deploymentId}/images/generations") @ExpectedResponses({ 200 }) @@ -306,8 +310,9 @@ Response getChatCompletionsSync(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getImageGenerations(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData imageGenerationOptions, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData imageGenerationOptions, RequestOptions requestOptions, + Context context); @Post("/deployments/{deploymentId}/images/generations") @ExpectedResponses({ 200 }) @@ -317,8 +322,9 @@ Mono> getImageGenerations(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(HttpResponseException.class) Response getImageGenerationsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData imageGenerationOptions, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData imageGenerationOptions, RequestOptions requestOptions, + Context context); @Post("/deployments/{deploymentId}/audio/speech") @ExpectedResponses({ 200 }) @@ -328,8 +334,9 @@ Response getImageGenerationsSync(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> generateSpeechFromText(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData speechGenerationOptions, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData speechGenerationOptions, RequestOptions requestOptions, + Context context); @Post("/deployments/{deploymentId}/audio/speech") @ExpectedResponses({ 200 }) @@ -339,8 +346,9 @@ Mono> generateSpeechFromText(@HostParam("endpoint") String @UnexpectedResponseExceptionType(HttpResponseException.class) Response generateSpeechFromTextSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData speechGenerationOptions, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData speechGenerationOptions, RequestOptions requestOptions, + Context context); @Post("/deployments/{deploymentId}/embeddings") @ExpectedResponses({ 200 }) @@ -350,8 +358,9 @@ Response generateSpeechFromTextSync(@HostParam("endpoint") String en @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getEmbeddings(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData embeddingsOptions, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData embeddingsOptions, RequestOptions requestOptions, + Context context); @Post("/deployments/{deploymentId}/embeddings") @ExpectedResponses({ 200 }) @@ -361,8 +370,9 @@ Mono> getEmbeddings(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response getEmbeddingsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData embeddingsOptions, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData embeddingsOptions, RequestOptions requestOptions, + Context context); } /** @@ -389,7 +399,7 @@ Response getEmbeddingsSync(@HostParam("endpoint") String endpoint, public Mono> getAudioTranscriptionAsPlainTextWithResponseAsync(String deploymentOrModelName, BinaryData audioTranscriptionOptions, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "text/plain, application/json"; + final String accept = "text/plain"; return FluxUtil.withContext(context -> service.getAudioTranscriptionAsPlainText(this.getEndpoint(), this.getServiceVersion().getVersion(), deploymentOrModelName, contentType, accept, audioTranscriptionOptions, requestOptions, context)); @@ -418,7 +428,7 @@ public Mono> getAudioTranscriptionAsPlainTextWithResponseAs public Response getAudioTranscriptionAsPlainTextWithResponse(String deploymentOrModelName, BinaryData audioTranscriptionOptions, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "text/plain, application/json"; + final String accept = "text/plain"; return service.getAudioTranscriptionAsPlainTextSync(this.getEndpoint(), this.getServiceVersion().getVersion(), deploymentOrModelName, contentType, accept, audioTranscriptionOptions, requestOptions, Context.NONE); } @@ -561,7 +571,7 @@ public Response getAudioTranscriptionAsResponseObjectWithResponse(St public Mono> getAudioTranslationAsPlainTextWithResponseAsync(String deploymentOrModelName, BinaryData audioTranslationOptions, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "text/plain, application/json"; + final String accept = "text/plain"; return FluxUtil.withContext( context -> service.getAudioTranslationAsPlainText(this.getEndpoint(), this.getServiceVersion().getVersion(), deploymentOrModelName, contentType, accept, audioTranslationOptions, requestOptions, context)); @@ -590,7 +600,7 @@ public Mono> getAudioTranslationAsPlainTextWithResponseAsyn public Response getAudioTranslationAsPlainTextWithResponse(String deploymentOrModelName, BinaryData audioTranslationOptions, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "text/plain, application/json"; + final String accept = "text/plain"; return service.getAudioTranslationAsPlainTextSync(this.getEndpoint(), this.getServiceVersion().getVersion(), deploymentOrModelName, contentType, accept, audioTranslationOptions, requestOptions, Context.NONE); } @@ -839,10 +849,11 @@ public Response getAudioTranslationAsResponseObjectWithResponse(Stri @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getCompletionsWithResponseAsync(String deploymentOrModelName, BinaryData completionsOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.getCompletions(this.getEndpoint(), this.getServiceVersion().getVersion(), - deploymentOrModelName, accept, completionsOptions, requestOptions, context)); + deploymentOrModelName, contentType, accept, completionsOptions, requestOptions, context)); } /** @@ -989,9 +1000,10 @@ public Mono> getCompletionsWithResponseAsync(String deploym @ServiceMethod(returns = ReturnType.SINGLE) public Response getCompletionsWithResponse(String deploymentOrModelName, BinaryData completionsOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.getCompletionsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), - deploymentOrModelName, accept, completionsOptions, requestOptions, Context.NONE); + deploymentOrModelName, contentType, accept, completionsOptions, requestOptions, Context.NONE); } /** @@ -1242,10 +1254,11 @@ public Response getCompletionsWithResponse(String deploymentOrModelN @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getChatCompletionsWithResponseAsync(String deploymentOrModelName, BinaryData chatCompletionsOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext( context -> service.getChatCompletions(this.getEndpoint(), this.getServiceVersion().getVersion(), - deploymentOrModelName, accept, chatCompletionsOptions, requestOptions, context)); + deploymentOrModelName, contentType, accept, chatCompletionsOptions, requestOptions, context)); } /** @@ -1496,9 +1509,10 @@ public Mono> getChatCompletionsWithResponseAsync(String dep @ServiceMethod(returns = ReturnType.SINGLE) public Response getChatCompletionsWithResponse(String deploymentOrModelName, BinaryData chatCompletionsOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.getChatCompletionsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), - deploymentOrModelName, accept, chatCompletionsOptions, requestOptions, Context.NONE); + deploymentOrModelName, contentType, accept, chatCompletionsOptions, requestOptions, Context.NONE); } /** @@ -1576,10 +1590,11 @@ public Response getChatCompletionsWithResponse(String deploymentOrMo @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getImageGenerationsWithResponseAsync(String deploymentOrModelName, BinaryData imageGenerationOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext( context -> service.getImageGenerations(this.getEndpoint(), this.getServiceVersion().getVersion(), - deploymentOrModelName, accept, imageGenerationOptions, requestOptions, context)); + deploymentOrModelName, contentType, accept, imageGenerationOptions, requestOptions, context)); } /** @@ -1656,9 +1671,10 @@ public Mono> getImageGenerationsWithResponseAsync(String de @ServiceMethod(returns = ReturnType.SINGLE) public Response getImageGenerationsWithResponse(String deploymentOrModelName, BinaryData imageGenerationOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.getImageGenerationsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), - deploymentOrModelName, accept, imageGenerationOptions, requestOptions, Context.NONE); + deploymentOrModelName, contentType, accept, imageGenerationOptions, requestOptions, Context.NONE); } /** @@ -1695,10 +1711,11 @@ public Response getImageGenerationsWithResponse(String deploymentOrM @ServiceMethod(returns = ReturnType.SINGLE) public Mono> generateSpeechFromTextWithResponseAsync(String deploymentOrModelName, BinaryData speechGenerationOptions, RequestOptions requestOptions) { - final String accept = "application/octet-stream, application/json"; + final String contentType = "application/json"; + final String accept = "application/octet-stream"; return FluxUtil.withContext( context -> service.generateSpeechFromText(this.getEndpoint(), this.getServiceVersion().getVersion(), - deploymentOrModelName, accept, speechGenerationOptions, requestOptions, context)); + deploymentOrModelName, contentType, accept, speechGenerationOptions, requestOptions, context)); } /** @@ -1735,9 +1752,10 @@ public Mono> generateSpeechFromTextWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) public Response generateSpeechFromTextWithResponse(String deploymentOrModelName, BinaryData speechGenerationOptions, RequestOptions requestOptions) { - final String accept = "application/octet-stream, application/json"; + final String contentType = "application/json"; + final String accept = "application/octet-stream"; return service.generateSpeechFromTextSync(this.getEndpoint(), this.getServiceVersion().getVersion(), - deploymentOrModelName, accept, speechGenerationOptions, requestOptions, Context.NONE); + deploymentOrModelName, contentType, accept, speechGenerationOptions, requestOptions, Context.NONE); } /** @@ -1794,10 +1812,11 @@ public Response generateSpeechFromTextWithResponse(String deployment @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmbeddingsWithResponseAsync(String deploymentOrModelName, BinaryData embeddingsOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.getEmbeddings(this.getEndpoint(), this.getServiceVersion().getVersion(), - deploymentOrModelName, accept, embeddingsOptions, requestOptions, context)); + deploymentOrModelName, contentType, accept, embeddingsOptions, requestOptions, context)); } /** @@ -1853,8 +1872,9 @@ public Mono> getEmbeddingsWithResponseAsync(String deployme @ServiceMethod(returns = ReturnType.SINGLE) public Response getEmbeddingsWithResponse(String deploymentOrModelName, BinaryData embeddingsOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.getEmbeddingsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), - deploymentOrModelName, accept, embeddingsOptions, requestOptions, Context.NONE); + deploymentOrModelName, contentType, accept, embeddingsOptions, requestOptions, Context.NONE); } } diff --git a/sdk/openai/azure-ai-openai/src/main/resources/META-INF/azure-ai-openai_apiview_properties.json b/sdk/openai/azure-ai-openai/src/main/resources/META-INF/azure-ai-openai_apiview_properties.json index 4b3970714a61..f43ca80b14b5 100644 --- a/sdk/openai/azure-ai-openai/src/main/resources/META-INF/azure-ai-openai_apiview_properties.json +++ b/sdk/openai/azure-ai-openai/src/main/resources/META-INF/azure-ai-openai_apiview_properties.json @@ -1,7 +1,7 @@ { "flavor": "azure", "CrossLanguageDefinitionId": { - "com.azure.ai.openai.OpenAIAsyncClient": "Azure.OpenAI.OpenAIClient", + "com.azure.ai.openai.OpenAIAsyncClient": "Client.OpenAIClient", "com.azure.ai.openai.OpenAIAsyncClient.generateSpeechFromText": "Client.OpenAIClient.generateSpeechFromText", "com.azure.ai.openai.OpenAIAsyncClient.generateSpeechFromTextWithResponse": "Client.OpenAIClient.generateSpeechFromText", "com.azure.ai.openai.OpenAIAsyncClient.getAudioTranscriptionAsPlainText": "Client.OpenAIClient.getAudioTranscriptionAsPlainText", @@ -20,7 +20,7 @@ "com.azure.ai.openai.OpenAIAsyncClient.getEmbeddingsWithResponse": "Client.OpenAIClient.getEmbeddings", "com.azure.ai.openai.OpenAIAsyncClient.getImageGenerations": "Client.OpenAIClient.getImageGenerations", "com.azure.ai.openai.OpenAIAsyncClient.getImageGenerationsWithResponse": "Client.OpenAIClient.getImageGenerations", - "com.azure.ai.openai.OpenAIClient": "Azure.OpenAI.OpenAIClient", + "com.azure.ai.openai.OpenAIClient": "Client.OpenAIClient", "com.azure.ai.openai.OpenAIClient.generateSpeechFromText": "Client.OpenAIClient.generateSpeechFromText", "com.azure.ai.openai.OpenAIClient.generateSpeechFromTextWithResponse": "Client.OpenAIClient.generateSpeechFromText", "com.azure.ai.openai.OpenAIClient.getAudioTranscriptionAsPlainText": "Client.OpenAIClient.getAudioTranscriptionAsPlainText", @@ -39,7 +39,7 @@ "com.azure.ai.openai.OpenAIClient.getEmbeddingsWithResponse": "Client.OpenAIClient.getEmbeddings", "com.azure.ai.openai.OpenAIClient.getImageGenerations": "Client.OpenAIClient.getImageGenerations", "com.azure.ai.openai.OpenAIClient.getImageGenerationsWithResponse": "Client.OpenAIClient.getImageGenerations", - "com.azure.ai.openai.OpenAIClientBuilder": "Azure.OpenAI.OpenAIClient", + "com.azure.ai.openai.OpenAIClientBuilder": "Client.OpenAIClient", "com.azure.ai.openai.implementation.models.FunctionCallPreset": "Azure.OpenAI.FunctionCallPreset", "com.azure.ai.openai.models.AudioTaskLabel": "Azure.OpenAI.AudioTaskLabel", "com.azure.ai.openai.models.AudioTranscription": "Azure.OpenAI.AudioTranscription", diff --git a/sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/implementation/DiscoveriesImpl.java b/sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/implementation/DiscoveriesImpl.java index e87aa69a9946..0329f975d214 100644 --- a/sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/implementation/DiscoveriesImpl.java +++ b/sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/implementation/DiscoveriesImpl.java @@ -76,8 +76,9 @@ public interface DiscoveriesService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> query(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/search/query") @ExpectedResponses({ 200 }) @@ -86,8 +87,9 @@ Mono> query(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response querySync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/search/suggest") @ExpectedResponses({ 200 }) @@ -96,8 +98,9 @@ Response querySync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> suggest(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/search/suggest") @ExpectedResponses({ 200 }) @@ -106,8 +109,9 @@ Mono> suggest(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response suggestSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/search/autocomplete") @ExpectedResponses({ 200 }) @@ -116,8 +120,9 @@ Response suggestSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> autoComplete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/search/autocomplete") @ExpectedResponses({ 200 }) @@ -126,8 +131,9 @@ Mono> autoComplete(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response autoCompleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -281,9 +287,10 @@ Response autoCompleteSync(@HostParam("endpoint") String endpoint, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> queryWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.query(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, body, requestOptions, context)); + this.client.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, context)); } /** @@ -437,9 +444,10 @@ public Mono> queryWithResponseAsync(BinaryData body, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response queryWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.querySync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), accept, body, - requestOptions, Context.NONE); + return service.querySync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), contentType, + accept, body, requestOptions, Context.NONE); } /** @@ -520,9 +528,10 @@ public Response queryWithResponse(BinaryData body, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> suggestWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.suggest(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, body, requestOptions, context)); + this.client.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, context)); } /** @@ -602,9 +611,10 @@ public Mono> suggestWithResponseAsync(BinaryData body, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response suggestWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.suggestSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), accept, - body, requestOptions, Context.NONE); + return service.suggestSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), contentType, + accept, body, requestOptions, Context.NONE); } /** @@ -642,9 +652,10 @@ public Response suggestWithResponse(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> autoCompleteWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.autoComplete(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, body, requestOptions, context)); + this.client.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, context)); } /** @@ -682,8 +693,9 @@ public Mono> autoCompleteWithResponseAsync(BinaryData body, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response autoCompleteWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.autoCompleteSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), accept, - body, requestOptions, Context.NONE); + return service.autoCompleteSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + contentType, accept, body, requestOptions, Context.NONE); } } diff --git a/sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/implementation/EntitiesImpl.java b/sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/implementation/EntitiesImpl.java index 8cc3fc06c754..574a285cded0 100644 --- a/sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/implementation/EntitiesImpl.java +++ b/sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/implementation/EntitiesImpl.java @@ -83,8 +83,9 @@ public interface EntitiesService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/atlas/v2/entity") @ExpectedResponses({ 200 }) @@ -93,8 +94,9 @@ Mono> createOrUpdate(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Get("/atlas/v2/entity/bulk") @ExpectedResponses({ 200 }) @@ -105,7 +107,7 @@ Response createOrUpdateSync(@HostParam("endpoint") String endpoint, Mono> getByIds(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @QueryParam(value = "guid", multipleQueryParams = true) List guid, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/entity/bulk") @ExpectedResponses({ 200 }) @@ -116,7 +118,7 @@ Mono> getByIds(@HostParam("endpoint") String endpoint, Response getByIdsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @QueryParam(value = "guid", multipleQueryParams = true) List guid, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/atlas/v2/entity/bulk") @ExpectedResponses({ 200 }) @@ -125,8 +127,9 @@ Response getByIdsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> batchCreateOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/atlas/v2/entity/bulk") @ExpectedResponses({ 200 }) @@ -135,8 +138,9 @@ Mono> batchCreateOrUpdate(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response batchCreateOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Delete("/atlas/v2/entity/bulk") @ExpectedResponses({ 200 }) @@ -146,7 +150,7 @@ Response batchCreateOrUpdateSync(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> batchDelete(@HostParam("endpoint") String endpoint, @QueryParam(value = "guid", multipleQueryParams = true) List guid, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/atlas/v2/entity/bulk") @ExpectedResponses({ 200 }) @@ -156,7 +160,7 @@ Mono> batchDelete(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response batchDeleteSync(@HostParam("endpoint") String endpoint, @QueryParam(value = "guid", multipleQueryParams = true) List guid, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/atlas/v2/entity/bulk/classification") @ExpectedResponses({ 204 }) @@ -165,8 +169,8 @@ Response batchDeleteSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> addClassification(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/atlas/v2/entity/bulk/classification") @ExpectedResponses({ 204 }) @@ -175,8 +179,8 @@ Mono> addClassification(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response addClassificationSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/atlas/v2/entity/guid/{guid}") @ExpectedResponses({ 200 }) @@ -185,7 +189,7 @@ Response addClassificationSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> get(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/entity/guid/{guid}") @ExpectedResponses({ 200 }) @@ -194,7 +198,7 @@ Mono> get(@HostParam("endpoint") String endpoint, @PathPara @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getSync(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/atlas/v2/entity/guid/{guid}") @ExpectedResponses({ 200 }) @@ -203,7 +207,8 @@ Response getSync(@HostParam("endpoint") String endpoint, @PathParam( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> updateAttributeById(@HostParam("endpoint") String endpoint, - @PathParam("guid") String guid, @QueryParam("name") String name, @HeaderParam("accept") String accept, + @PathParam("guid") String guid, @QueryParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/atlas/v2/entity/guid/{guid}") @@ -213,7 +218,8 @@ Mono> updateAttributeById(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response updateAttributeByIdSync(@HostParam("endpoint") String endpoint, - @PathParam("guid") String guid, @QueryParam("name") String name, @HeaderParam("accept") String accept, + @PathParam("guid") String guid, @QueryParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Delete("/atlas/v2/entity/guid/{guid}") @@ -223,7 +229,7 @@ Response updateAttributeByIdSync(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/atlas/v2/entity/guid/{guid}") @ExpectedResponses({ 200 }) @@ -232,7 +238,7 @@ Mono> delete(@HostParam("endpoint") String endpoint, @PathP @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteSync(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/entity/guid/{guid}/classification/{classificationName}") @ExpectedResponses({ 200 }) @@ -242,7 +248,7 @@ Response deleteSync(@HostParam("endpoint") String endpoint, @PathPar @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getClassification(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, @PathParam("classificationName") String classificationName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/entity/guid/{guid}/classification/{classificationName}") @ExpectedResponses({ 200 }) @@ -252,7 +258,7 @@ Mono> getClassification(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(HttpResponseException.class) Response getClassificationSync(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, @PathParam("classificationName") String classificationName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/atlas/v2/entity/guid/{guid}/classification/{classificationName}") @ExpectedResponses({ 204 }) @@ -262,7 +268,7 @@ Response getClassificationSync(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> removeClassification(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, @PathParam("classificationName") String classificationName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/atlas/v2/entity/guid/{guid}/classification/{classificationName}") @ExpectedResponses({ 204 }) @@ -271,7 +277,7 @@ Mono> removeClassification(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response removeClassificationSync(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, - @PathParam("classificationName") String classificationName, @HeaderParam("accept") String accept, + @PathParam("classificationName") String classificationName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/entity/guid/{guid}/classifications") @@ -281,7 +287,7 @@ Response removeClassificationSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getClassifications(@HostParam("endpoint") String endpoint, - @PathParam("guid") String guid, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("guid") String guid, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/entity/guid/{guid}/classifications") @@ -291,7 +297,7 @@ Mono> getClassifications(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getClassificationsSync(@HostParam("endpoint") String endpoint, - @PathParam("guid") String guid, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("guid") String guid, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/atlas/v2/entity/guid/{guid}/classifications") @@ -301,8 +307,8 @@ Response getClassificationsSync(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> addClassifications(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/atlas/v2/entity/guid/{guid}/classifications") @ExpectedResponses({ 204 }) @@ -311,8 +317,8 @@ Mono> addClassifications(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response addClassificationsSync(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/atlas/v2/entity/guid/{guid}/classifications") @ExpectedResponses({ 204 }) @@ -321,8 +327,9 @@ Response addClassificationsSync(@HostParam("endpoint") String endpoint, @P @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> updateClassifications(@HostParam("endpoint") String endpoint, - @PathParam("guid") String guid, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @PathParam("guid") String guid, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/atlas/v2/entity/guid/{guid}/classifications") @ExpectedResponses({ 204 }) @@ -331,8 +338,8 @@ Mono> updateClassifications(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response updateClassificationsSync(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/atlas/v2/entity/uniqueAttribute/type/{typeName}") @ExpectedResponses({ 200 }) @@ -341,7 +348,7 @@ Response updateClassificationsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getByUniqueAttribute(@HostParam("endpoint") String endpoint, - @PathParam("typeName") String typeName, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("typeName") String typeName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/entity/uniqueAttribute/type/{typeName}") @@ -351,7 +358,7 @@ Mono> getByUniqueAttribute(@HostParam("endpoint") String en @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getByUniqueAttributeSync(@HostParam("endpoint") String endpoint, - @PathParam("typeName") String typeName, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("typeName") String typeName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/atlas/v2/entity/uniqueAttribute/type/{typeName}") @@ -361,8 +368,9 @@ Response getByUniqueAttributeSync(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> updateByUniqueAttribute(@HostParam("endpoint") String endpoint, - @PathParam("typeName") String typeName, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @PathParam("typeName") String typeName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/atlas/v2/entity/uniqueAttribute/type/{typeName}") @ExpectedResponses({ 200 }) @@ -371,8 +379,9 @@ Mono> updateByUniqueAttribute(@HostParam("endpoint") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response updateByUniqueAttributeSync(@HostParam("endpoint") String endpoint, - @PathParam("typeName") String typeName, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @PathParam("typeName") String typeName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Delete("/atlas/v2/entity/uniqueAttribute/type/{typeName}") @ExpectedResponses({ 200 }) @@ -381,7 +390,7 @@ Response updateByUniqueAttributeSync(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteByUniqueAttribute(@HostParam("endpoint") String endpoint, - @PathParam("typeName") String typeName, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("typeName") String typeName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/atlas/v2/entity/uniqueAttribute/type/{typeName}") @@ -391,7 +400,7 @@ Mono> deleteByUniqueAttribute(@HostParam("endpoint") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteByUniqueAttributeSync(@HostParam("endpoint") String endpoint, - @PathParam("typeName") String typeName, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("typeName") String typeName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/atlas/v2/entity/uniqueAttribute/type/{typeName}/classification/{classificationName}") @@ -402,7 +411,7 @@ Response deleteByUniqueAttributeSync(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> removeClassificationByUniqueAttribute(@HostParam("endpoint") String endpoint, @PathParam("typeName") String typeName, @PathParam("classificationName") String classificationName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/atlas/v2/entity/uniqueAttribute/type/{typeName}/classification/{classificationName}") @ExpectedResponses({ 204 }) @@ -412,7 +421,7 @@ Mono> removeClassificationByUniqueAttribute(@HostParam("endpoint" @UnexpectedResponseExceptionType(HttpResponseException.class) Response removeClassificationByUniqueAttributeSync(@HostParam("endpoint") String endpoint, @PathParam("typeName") String typeName, @PathParam("classificationName") String classificationName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/atlas/v2/entity/uniqueAttribute/type/{typeName}/classifications") @ExpectedResponses({ 204 }) @@ -421,8 +430,9 @@ Response removeClassificationByUniqueAttributeSync(@HostParam("endpoint") @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> addClassificationsByUniqueAttribute(@HostParam("endpoint") String endpoint, - @PathParam("typeName") String typeName, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @PathParam("typeName") String typeName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/atlas/v2/entity/uniqueAttribute/type/{typeName}/classifications") @ExpectedResponses({ 204 }) @@ -431,8 +441,9 @@ Mono> addClassificationsByUniqueAttribute(@HostParam("endpoint") @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response addClassificationsByUniqueAttributeSync(@HostParam("endpoint") String endpoint, - @PathParam("typeName") String typeName, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @PathParam("typeName") String typeName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/atlas/v2/entity/uniqueAttribute/type/{typeName}/classifications") @ExpectedResponses({ 204 }) @@ -441,8 +452,9 @@ Response addClassificationsByUniqueAttributeSync(@HostParam("endpoint") St @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> updateClassificationsUniqueByAttribute(@HostParam("endpoint") String endpoint, - @PathParam("typeName") String typeName, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @PathParam("typeName") String typeName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/atlas/v2/entity/uniqueAttribute/type/{typeName}/classifications") @ExpectedResponses({ 204 }) @@ -451,8 +463,9 @@ Mono> updateClassificationsUniqueByAttribute(@HostParam("endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response updateClassificationsUniqueByAttributeSync(@HostParam("endpoint") String endpoint, - @PathParam("typeName") String typeName, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @PathParam("typeName") String typeName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/atlas/v2/entity/bulk/setClassifications") @ExpectedResponses({ 200 }) @@ -461,8 +474,8 @@ Response updateClassificationsUniqueByAttributeSync(@HostParam("endpoint") @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> batchSetClassifications(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/atlas/v2/entity/bulk/setClassifications") @ExpectedResponses({ 200 }) @@ -471,8 +484,8 @@ Mono> batchSetClassifications(@HostParam("endpoint") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response batchSetClassificationsSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/atlas/v2/entity/bulk/uniqueAttribute/type/{typeName}") @ExpectedResponses({ 200 }) @@ -481,7 +494,7 @@ Response batchSetClassificationsSync(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> batchGetByUniqueAttributes(@HostParam("endpoint") String endpoint, - @PathParam("typeName") String typeName, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("typeName") String typeName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/entity/bulk/uniqueAttribute/type/{typeName}") @@ -491,7 +504,7 @@ Mono> batchGetByUniqueAttributes(@HostParam("endpoint") Str @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response batchGetByUniqueAttributesSync(@HostParam("endpoint") String endpoint, - @PathParam("typeName") String typeName, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("typeName") String typeName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/entity/guid/{guid}/header") @@ -501,7 +514,7 @@ Response batchGetByUniqueAttributesSync(@HostParam("endpoint") Strin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getHeader(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/entity/guid/{guid}/header") @ExpectedResponses({ 200 }) @@ -510,7 +523,7 @@ Mono> getHeader(@HostParam("endpoint") String endpoint, @Pa @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getHeaderSync(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/atlas/v2/entity/guid/{guid}/businessmetadata") @ExpectedResponses({ 204 }) @@ -519,8 +532,9 @@ Response getHeaderSync(@HostParam("endpoint") String endpoint, @Path @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> removeBusinessMetadata(@HostParam("endpoint") String endpoint, - @PathParam("guid") String guid, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @PathParam("guid") String guid, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Delete("/atlas/v2/entity/guid/{guid}/businessmetadata") @ExpectedResponses({ 204 }) @@ -529,8 +543,9 @@ Mono> removeBusinessMetadata(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response removeBusinessMetadataSync(@HostParam("endpoint") String endpoint, - @PathParam("guid") String guid, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @PathParam("guid") String guid, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/atlas/v2/entity/guid/{guid}/businessmetadata") @ExpectedResponses({ 204 }) @@ -539,8 +554,9 @@ Response removeBusinessMetadataSync(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> addOrUpdateBusinessMetadata(@HostParam("endpoint") String endpoint, - @PathParam("guid") String guid, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @PathParam("guid") String guid, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/atlas/v2/entity/guid/{guid}/businessmetadata") @ExpectedResponses({ 204 }) @@ -549,8 +565,9 @@ Mono> addOrUpdateBusinessMetadata(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response addOrUpdateBusinessMetadataSync(@HostParam("endpoint") String endpoint, - @PathParam("guid") String guid, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @PathParam("guid") String guid, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Delete("/atlas/v2/entity/guid/{guid}/businessmetadata/{businessMetadataName}") @ExpectedResponses({ 204 }) @@ -560,8 +577,8 @@ Response addOrUpdateBusinessMetadataSync(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> removeBusinessMetadataAttributes(@HostParam("endpoint") String endpoint, @PathParam("businessMetadataName") String businessMetadataName, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Delete("/atlas/v2/entity/guid/{guid}/businessmetadata/{businessMetadataName}") @ExpectedResponses({ 204 }) @@ -571,8 +588,8 @@ Mono> removeBusinessMetadataAttributes(@HostParam("endpoint") Str @UnexpectedResponseExceptionType(HttpResponseException.class) Response removeBusinessMetadataAttributesSync(@HostParam("endpoint") String endpoint, @PathParam("businessMetadataName") String businessMetadataName, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/atlas/v2/entity/guid/{guid}/businessmetadata/{businessMetadataName}") @ExpectedResponses({ 204 }) @@ -582,8 +599,8 @@ Response removeBusinessMetadataAttributesSync(@HostParam("endpoint") Strin @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> addOrUpdateBusinessMetadataAttributes(@HostParam("endpoint") String endpoint, @PathParam("businessMetadataName") String businessMetadataName, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/atlas/v2/entity/guid/{guid}/businessmetadata/{businessMetadataName}") @ExpectedResponses({ 204 }) @@ -593,8 +610,8 @@ Mono> addOrUpdateBusinessMetadataAttributes(@HostParam("endpoint" @UnexpectedResponseExceptionType(HttpResponseException.class) Response addOrUpdateBusinessMetadataAttributesSync(@HostParam("endpoint") String endpoint, @PathParam("businessMetadataName") String businessMetadataName, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/atlas/v2/entity/businessmetadata/import/template") @ExpectedResponses({ 200 }) @@ -603,7 +620,7 @@ Response addOrUpdateBusinessMetadataAttributesSync(@HostParam("endpoint") @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getBusinessMetadataTemplate(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/entity/businessmetadata/import/template") @ExpectedResponses({ 200 }) @@ -612,7 +629,7 @@ Mono> getBusinessMetadataTemplate(@HostParam("endpoint") St @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getBusinessMetadataTemplateSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/atlas/v2/entity/businessmetadata/import") @@ -622,7 +639,7 @@ Response getBusinessMetadataTemplateSync(@HostParam("endpoint") Stri @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> importBusinessMetadata(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @@ -633,7 +650,7 @@ Mono> importBusinessMetadata(@HostParam("endpoint") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response importBusinessMetadataSync(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); @Delete("/atlas/v2/entity/guid/{guid}/labels") @@ -643,7 +660,7 @@ Response importBusinessMetadataSync(@HostParam("endpoint") String en @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> removeLabels(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/atlas/v2/entity/guid/{guid}/labels") @ExpectedResponses({ 204 }) @@ -652,7 +669,7 @@ Mono> removeLabels(@HostParam("endpoint") String endpoint, @PathP @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response removeLabelsSync(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/atlas/v2/entity/guid/{guid}/labels") @ExpectedResponses({ 204 }) @@ -661,7 +678,7 @@ Response removeLabelsSync(@HostParam("endpoint") String endpoint, @PathPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setLabels(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/atlas/v2/entity/guid/{guid}/labels") @ExpectedResponses({ 204 }) @@ -670,7 +687,7 @@ Mono> setLabels(@HostParam("endpoint") String endpoint, @PathPara @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response setLabelsSync(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/atlas/v2/entity/guid/{guid}/labels") @ExpectedResponses({ 204 }) @@ -679,7 +696,7 @@ Response setLabelsSync(@HostParam("endpoint") String endpoint, @PathParam( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> addLabel(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/atlas/v2/entity/guid/{guid}/labels") @ExpectedResponses({ 204 }) @@ -688,7 +705,7 @@ Mono> addLabel(@HostParam("endpoint") String endpoint, @PathParam @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response addLabelSync(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/atlas/v2/entity/uniqueAttribute/type/{typeName}/labels") @ExpectedResponses({ 204 }) @@ -697,7 +714,7 @@ Response addLabelSync(@HostParam("endpoint") String endpoint, @PathParam(" @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> removeLabelsByUniqueAttribute(@HostParam("endpoint") String endpoint, - @PathParam("typeName") String typeName, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("typeName") String typeName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/atlas/v2/entity/uniqueAttribute/type/{typeName}/labels") @@ -707,7 +724,7 @@ Mono> removeLabelsByUniqueAttribute(@HostParam("endpoint") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response removeLabelsByUniqueAttributeSync(@HostParam("endpoint") String endpoint, - @PathParam("typeName") String typeName, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("typeName") String typeName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/atlas/v2/entity/uniqueAttribute/type/{typeName}/labels") @@ -717,7 +734,7 @@ Response removeLabelsByUniqueAttributeSync(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setLabelsByUniqueAttribute(@HostParam("endpoint") String endpoint, - @PathParam("typeName") String typeName, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("typeName") String typeName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/atlas/v2/entity/uniqueAttribute/type/{typeName}/labels") @@ -727,7 +744,7 @@ Mono> setLabelsByUniqueAttribute(@HostParam("endpoint") String en @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response setLabelsByUniqueAttributeSync(@HostParam("endpoint") String endpoint, - @PathParam("typeName") String typeName, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("typeName") String typeName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/atlas/v2/entity/uniqueAttribute/type/{typeName}/labels") @@ -737,7 +754,7 @@ Response setLabelsByUniqueAttributeSync(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> addLabelsByUniqueAttribute(@HostParam("endpoint") String endpoint, - @PathParam("typeName") String typeName, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("typeName") String typeName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/atlas/v2/entity/uniqueAttribute/type/{typeName}/labels") @@ -747,7 +764,7 @@ Mono> addLabelsByUniqueAttribute(@HostParam("endpoint") String en @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response addLabelsByUniqueAttributeSync(@HostParam("endpoint") String endpoint, - @PathParam("typeName") String typeName, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("typeName") String typeName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/entity/moveTo") @@ -758,8 +775,8 @@ Response addLabelsByUniqueAttributeSync(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> moveEntitiesToCollection(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @QueryParam("collectionId") String collectionId, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/entity/moveTo") @ExpectedResponses({ 200 }) @@ -769,8 +786,8 @@ Mono> moveEntitiesToCollection(@HostParam("endpoint") Strin @UnexpectedResponseExceptionType(HttpResponseException.class) Response moveEntitiesToCollectionSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @QueryParam("collectionId") String collectionId, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -954,9 +971,10 @@ Response moveEntitiesToCollectionSync(@HostParam("endpoint") String */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createOrUpdateWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, body, requestOptions, context)); + this.client.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, context)); } /** @@ -1139,9 +1157,10 @@ public Mono> createOrUpdateWithResponseAsync(BinaryData bod */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - accept, body, requestOptions, Context.NONE); + contentType, accept, body, requestOptions, Context.NONE); } /** @@ -1553,9 +1572,10 @@ public Response getByIdsWithResponse(List guid, RequestOptio @ServiceMethod(returns = ReturnType.SINGLE) public Mono> batchCreateOrUpdateWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.batchCreateOrUpdate(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, body, requestOptions, context)); + this.client.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, context)); } /** @@ -1741,9 +1761,10 @@ public Mono> batchCreateOrUpdateWithResponseAsync(BinaryDat */ @ServiceMethod(returns = ReturnType.SINGLE) public Response batchCreateOrUpdateWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.batchCreateOrUpdateSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - accept, body, requestOptions, Context.NONE); + contentType, accept, body, requestOptions, Context.NONE); } /** @@ -1961,9 +1982,10 @@ public Response batchDeleteWithResponse(List guid, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> addClassificationWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.addClassification(this.client.getEndpoint(), accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.addClassification(this.client.getEndpoint(), contentType, accept, + body, requestOptions, context)); } /** @@ -2005,8 +2027,10 @@ public Mono> addClassificationWithResponseAsync(BinaryData body, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response addClassificationWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.addClassificationSync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); + return service.addClassificationSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } /** @@ -2320,9 +2344,10 @@ public Response getWithResponse(String guid, RequestOptions requestO @ServiceMethod(returns = ReturnType.SINGLE) public Mono> updateAttributeByIdWithResponseAsync(String guid, String name, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.updateAttributeById(this.client.getEndpoint(), guid, name, - accept, body, requestOptions, context)); + contentType, accept, body, requestOptions, context)); } /** @@ -2419,9 +2444,10 @@ public Mono> updateAttributeByIdWithResponseAsync(String gu @ServiceMethod(returns = ReturnType.SINGLE) public Response updateAttributeByIdWithResponse(String guid, String name, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.updateAttributeByIdSync(this.client.getEndpoint(), guid, name, accept, body, requestOptions, - Context.NONE); + return service.updateAttributeByIdSync(this.client.getEndpoint(), guid, name, contentType, accept, body, + requestOptions, Context.NONE); } /** @@ -2820,9 +2846,10 @@ public Response getClassificationsWithResponse(String guid, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Mono> addClassificationsWithResponseAsync(String guid, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.addClassifications(this.client.getEndpoint(), guid, accept, body, - requestOptions, context)); + return FluxUtil.withContext(context -> service.addClassifications(this.client.getEndpoint(), guid, contentType, + accept, body, requestOptions, context)); } /** @@ -2862,9 +2889,10 @@ public Mono> addClassificationsWithResponseAsync(String guid, Bin */ @ServiceMethod(returns = ReturnType.SINGLE) public Response addClassificationsWithResponse(String guid, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.addClassificationsSync(this.client.getEndpoint(), guid, accept, body, requestOptions, - Context.NONE); + return service.addClassificationsSync(this.client.getEndpoint(), guid, contentType, accept, body, + requestOptions, Context.NONE); } /** @@ -2905,9 +2933,10 @@ public Response addClassificationsWithResponse(String guid, BinaryData bod @ServiceMethod(returns = ReturnType.SINGLE) public Mono> updateClassificationsWithResponseAsync(String guid, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.updateClassifications(this.client.getEndpoint(), guid, accept, - body, requestOptions, context)); + return FluxUtil.withContext(context -> service.updateClassifications(this.client.getEndpoint(), guid, + contentType, accept, body, requestOptions, context)); } /** @@ -2948,9 +2977,10 @@ public Mono> updateClassificationsWithResponseAsync(String guid, @ServiceMethod(returns = ReturnType.SINGLE) public Response updateClassificationsWithResponse(String guid, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.updateClassificationsSync(this.client.getEndpoint(), guid, accept, body, requestOptions, - Context.NONE); + return service.updateClassificationsSync(this.client.getEndpoint(), guid, contentType, accept, body, + requestOptions, Context.NONE); } /** @@ -3418,9 +3448,10 @@ public Response getByUniqueAttributeWithResponse(String typeName, Re @ServiceMethod(returns = ReturnType.SINGLE) public Mono> updateByUniqueAttributeWithResponseAsync(String typeName, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.updateByUniqueAttribute(this.client.getEndpoint(), typeName, - accept, body, requestOptions, context)); + contentType, accept, body, requestOptions, context)); } /** @@ -3611,9 +3642,10 @@ public Mono> updateByUniqueAttributeWithResponseAsync(Strin @ServiceMethod(returns = ReturnType.SINGLE) public Response updateByUniqueAttributeWithResponse(String typeName, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.updateByUniqueAttributeSync(this.client.getEndpoint(), typeName, accept, body, requestOptions, - Context.NONE); + return service.updateByUniqueAttributeSync(this.client.getEndpoint(), typeName, contentType, accept, body, + requestOptions, Context.NONE); } /** @@ -3937,9 +3969,10 @@ public Response removeClassificationByUniqueAttributeWithResponse(String t @ServiceMethod(returns = ReturnType.SINGLE) public Mono> addClassificationsByUniqueAttributeWithResponseAsync(String typeName, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.addClassificationsByUniqueAttribute(this.client.getEndpoint(), - typeName, accept, body, requestOptions, context)); + typeName, contentType, accept, body, requestOptions, context)); } /** @@ -3989,9 +4022,10 @@ public Mono> addClassificationsByUniqueAttributeWithResponseAsync @ServiceMethod(returns = ReturnType.SINGLE) public Response addClassificationsByUniqueAttributeWithResponse(String typeName, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.addClassificationsByUniqueAttributeSync(this.client.getEndpoint(), typeName, accept, body, - requestOptions, Context.NONE); + return service.addClassificationsByUniqueAttributeSync(this.client.getEndpoint(), typeName, contentType, accept, + body, requestOptions, Context.NONE); } /** @@ -4041,9 +4075,10 @@ public Response addClassificationsByUniqueAttributeWithResponse(String typ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> updateClassificationsUniqueByAttributeWithResponseAsync(String typeName, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.updateClassificationsUniqueByAttribute(this.client.getEndpoint(), - typeName, accept, body, requestOptions, context)); + typeName, contentType, accept, body, requestOptions, context)); } /** @@ -4093,9 +4128,10 @@ public Mono> updateClassificationsUniqueByAttributeWithResponseAs @ServiceMethod(returns = ReturnType.SINGLE) public Response updateClassificationsUniqueByAttributeWithResponse(String typeName, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.updateClassificationsUniqueByAttributeSync(this.client.getEndpoint(), typeName, accept, body, - requestOptions, Context.NONE); + return service.updateClassificationsUniqueByAttributeSync(this.client.getEndpoint(), typeName, contentType, + accept, body, requestOptions, Context.NONE); } /** @@ -4180,9 +4216,10 @@ public Response updateClassificationsUniqueByAttributeWithResponse(String @ServiceMethod(returns = ReturnType.SINGLE) public Mono> batchSetClassificationsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.batchSetClassifications(this.client.getEndpoint(), accept, body, - requestOptions, context)); + return FluxUtil.withContext(context -> service.batchSetClassifications(this.client.getEndpoint(), contentType, + accept, body, requestOptions, context)); } /** @@ -4266,8 +4303,9 @@ public Mono> batchSetClassificationsWithResponseAsync(Binar */ @ServiceMethod(returns = ReturnType.SINGLE) public Response batchSetClassificationsWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.batchSetClassificationsSync(this.client.getEndpoint(), accept, body, requestOptions, + return service.batchSetClassificationsSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, Context.NONE); } @@ -4707,9 +4745,10 @@ public Response getHeaderWithResponse(String guid, RequestOptions re @ServiceMethod(returns = ReturnType.SINGLE) public Mono> removeBusinessMetadataWithResponseAsync(String guid, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.removeBusinessMetadata(this.client.getEndpoint(), guid, accept, - body, requestOptions, context)); + return FluxUtil.withContext(context -> service.removeBusinessMetadata(this.client.getEndpoint(), guid, + contentType, accept, body, requestOptions, context)); } /** @@ -4736,9 +4775,10 @@ public Mono> removeBusinessMetadataWithResponseAsync(String guid, @ServiceMethod(returns = ReturnType.SINGLE) public Response removeBusinessMetadataWithResponse(String guid, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.removeBusinessMetadataSync(this.client.getEndpoint(), guid, accept, body, requestOptions, - Context.NONE); + return service.removeBusinessMetadataSync(this.client.getEndpoint(), guid, contentType, accept, body, + requestOptions, Context.NONE); } /** @@ -4774,9 +4814,10 @@ public Response removeBusinessMetadataWithResponse(String guid, BinaryData @ServiceMethod(returns = ReturnType.SINGLE) public Mono> addOrUpdateBusinessMetadataWithResponseAsync(String guid, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.addOrUpdateBusinessMetadata(this.client.getEndpoint(), guid, - accept, body, requestOptions, context)); + contentType, accept, body, requestOptions, context)); } /** @@ -4812,9 +4853,10 @@ public Mono> addOrUpdateBusinessMetadataWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) public Response addOrUpdateBusinessMetadataWithResponse(String guid, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.addOrUpdateBusinessMetadataSync(this.client.getEndpoint(), guid, accept, body, requestOptions, - Context.NONE); + return service.addOrUpdateBusinessMetadataSync(this.client.getEndpoint(), guid, contentType, accept, body, + requestOptions, Context.NONE); } /** @@ -4840,9 +4882,10 @@ public Response addOrUpdateBusinessMetadataWithResponse(String guid, Binar @ServiceMethod(returns = ReturnType.SINGLE) public Mono> removeBusinessMetadataAttributesWithResponseAsync(String businessMetadataName, String guid, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.removeBusinessMetadataAttributes(this.client.getEndpoint(), - businessMetadataName, guid, accept, body, requestOptions, context)); + businessMetadataName, guid, contentType, accept, body, requestOptions, context)); } /** @@ -4868,9 +4911,10 @@ public Mono> removeBusinessMetadataAttributesWithResponseAsync(St @ServiceMethod(returns = ReturnType.SINGLE) public Response removeBusinessMetadataAttributesWithResponse(String businessMetadataName, String guid, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.removeBusinessMetadataAttributesSync(this.client.getEndpoint(), businessMetadataName, guid, - accept, body, requestOptions, Context.NONE); + contentType, accept, body, requestOptions, Context.NONE); } /** @@ -4896,9 +4940,10 @@ public Response removeBusinessMetadataAttributesWithResponse(String busine @ServiceMethod(returns = ReturnType.SINGLE) public Mono> addOrUpdateBusinessMetadataAttributesWithResponseAsync(String businessMetadataName, String guid, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.addOrUpdateBusinessMetadataAttributes(this.client.getEndpoint(), - businessMetadataName, guid, accept, body, requestOptions, context)); + businessMetadataName, guid, contentType, accept, body, requestOptions, context)); } /** @@ -4924,9 +4969,10 @@ public Mono> addOrUpdateBusinessMetadataAttributesWithResponseAsy @ServiceMethod(returns = ReturnType.SINGLE) public Response addOrUpdateBusinessMetadataAttributesWithResponse(String businessMetadataName, String guid, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.addOrUpdateBusinessMetadataAttributesSync(this.client.getEndpoint(), businessMetadataName, guid, - accept, body, requestOptions, Context.NONE); + contentType, accept, body, requestOptions, Context.NONE); } /** @@ -4947,7 +4993,7 @@ public Response addOrUpdateBusinessMetadataAttributesWithResponse(String b */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getBusinessMetadataTemplateWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/octet-stream, application/json"; + final String accept = "application/octet-stream"; return FluxUtil.withContext( context -> service.getBusinessMetadataTemplate(this.client.getEndpoint(), accept, requestOptions, context)); } @@ -4969,7 +5015,7 @@ public Mono> getBusinessMetadataTemplateWithResponseAsync(R */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getBusinessMetadataTemplateWithResponse(RequestOptions requestOptions) { - final String accept = "application/octet-stream, application/json"; + final String accept = "application/octet-stream"; return service.getBusinessMetadataTemplateSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } @@ -5742,9 +5788,11 @@ public Response addLabelsByUniqueAttributeWithResponse(String typeName, Re @ServiceMethod(returns = ReturnType.SINGLE) public Mono> moveEntitiesToCollectionWithResponseAsync(String collectionId, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.moveEntitiesToCollection(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), collectionId, accept, body, requestOptions, context)); + this.client.getServiceVersion().getVersion(), collectionId, contentType, accept, body, requestOptions, + context)); } /** @@ -5840,8 +5888,10 @@ public Mono> moveEntitiesToCollectionWithResponseAsync(Stri @ServiceMethod(returns = ReturnType.SINGLE) public Response moveEntitiesToCollectionWithResponse(String collectionId, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.moveEntitiesToCollectionSync(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), collectionId, accept, body, requestOptions, Context.NONE); + this.client.getServiceVersion().getVersion(), collectionId, contentType, accept, body, requestOptions, + Context.NONE); } } diff --git a/sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/implementation/GlossariesImpl.java b/sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/implementation/GlossariesImpl.java index aeb738526f0f..eea2ebd1ba99 100644 --- a/sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/implementation/GlossariesImpl.java +++ b/sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/implementation/GlossariesImpl.java @@ -80,7 +80,7 @@ public interface GlossariesService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> batchGet(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/glossary") @@ -90,7 +90,7 @@ Mono> batchGet(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response batchGetSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/atlas/v2/glossary") @@ -99,7 +99,8 @@ Response batchGetSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> create(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Mono> create(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/atlas/v2/glossary") @@ -108,7 +109,8 @@ Mono> create(@HostParam("endpoint") String endpoint, @Heade @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response createSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response createSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/atlas/v2/glossary/categories") @@ -118,8 +120,8 @@ Response createSync(@HostParam("endpoint") String endpoint, @HeaderP @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createCategories(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/atlas/v2/glossary/categories") @ExpectedResponses({ 200 }) @@ -128,8 +130,8 @@ Mono> createCategories(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createCategoriesSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/atlas/v2/glossary/category") @ExpectedResponses({ 200 }) @@ -138,8 +140,8 @@ Response createCategoriesSync(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createCategory(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/atlas/v2/glossary/category") @ExpectedResponses({ 200 }) @@ -148,8 +150,8 @@ Mono> createCategory(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createCategorySync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/atlas/v2/glossary/category/{categoryId}") @ExpectedResponses({ 200 }) @@ -158,7 +160,7 @@ Response createCategorySync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getCategory(@HostParam("endpoint") String endpoint, - @PathParam("categoryId") String categoryId, @HeaderParam("accept") String accept, + @PathParam("categoryId") String categoryId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/glossary/category/{categoryId}") @@ -168,7 +170,7 @@ Mono> getCategory(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getCategorySync(@HostParam("endpoint") String endpoint, - @PathParam("categoryId") String categoryId, @HeaderParam("accept") String accept, + @PathParam("categoryId") String categoryId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/atlas/v2/glossary/category/{categoryId}") @@ -178,8 +180,9 @@ Response getCategorySync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> updateCategory(@HostParam("endpoint") String endpoint, - @PathParam("categoryId") String categoryId, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @PathParam("categoryId") String categoryId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/atlas/v2/glossary/category/{categoryId}") @ExpectedResponses({ 200 }) @@ -188,8 +191,9 @@ Mono> updateCategory(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response updateCategorySync(@HostParam("endpoint") String endpoint, - @PathParam("categoryId") String categoryId, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @PathParam("categoryId") String categoryId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Delete("/atlas/v2/glossary/category/{categoryId}") @ExpectedResponses({ 204 }) @@ -198,7 +202,7 @@ Response updateCategorySync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteCategory(@HostParam("endpoint") String endpoint, - @PathParam("categoryId") String categoryId, @HeaderParam("accept") String accept, + @PathParam("categoryId") String categoryId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/atlas/v2/glossary/category/{categoryId}") @@ -208,7 +212,7 @@ Mono> deleteCategory(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteCategorySync(@HostParam("endpoint") String endpoint, - @PathParam("categoryId") String categoryId, @HeaderParam("accept") String accept, + @PathParam("categoryId") String categoryId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/atlas/v2/glossary/category/{categoryId}/partial") @@ -218,8 +222,9 @@ Response deleteCategorySync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> partialUpdateCategory(@HostParam("endpoint") String endpoint, - @PathParam("categoryId") String categoryId, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @PathParam("categoryId") String categoryId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/atlas/v2/glossary/category/{categoryId}/partial") @ExpectedResponses({ 200 }) @@ -228,8 +233,9 @@ Mono> partialUpdateCategory(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response partialUpdateCategorySync(@HostParam("endpoint") String endpoint, - @PathParam("categoryId") String categoryId, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @PathParam("categoryId") String categoryId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Get("/atlas/v2/glossary/category/{categoryId}/related") @ExpectedResponses({ 200 }) @@ -238,7 +244,7 @@ Response partialUpdateCategorySync(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getRelatedCategories(@HostParam("endpoint") String endpoint, - @PathParam("categoryId") String categoryId, @HeaderParam("accept") String accept, + @PathParam("categoryId") String categoryId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/glossary/category/{categoryId}/related") @@ -248,7 +254,7 @@ Mono> getRelatedCategories(@HostParam("endpoint") String en @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getRelatedCategoriesSync(@HostParam("endpoint") String endpoint, - @PathParam("categoryId") String categoryId, @HeaderParam("accept") String accept, + @PathParam("categoryId") String categoryId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/glossary/category/{categoryId}/terms") @@ -258,7 +264,7 @@ Response getRelatedCategoriesSync(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getCategoryTerms(@HostParam("endpoint") String endpoint, - @PathParam("categoryId") String categoryId, @HeaderParam("accept") String accept, + @PathParam("categoryId") String categoryId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/glossary/category/{categoryId}/terms") @@ -268,7 +274,7 @@ Mono> getCategoryTerms(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getCategoryTermsSync(@HostParam("endpoint") String endpoint, - @PathParam("categoryId") String categoryId, @HeaderParam("accept") String accept, + @PathParam("categoryId") String categoryId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/atlas/v2/glossary/term") @@ -278,8 +284,8 @@ Response getCategoryTermsSync(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createTerm(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/atlas/v2/glossary/term") @ExpectedResponses({ 200 }) @@ -288,8 +294,8 @@ Mono> createTerm(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createTermSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/atlas/v2/glossary/term/{termId}") @ExpectedResponses({ 200 }) @@ -299,7 +305,7 @@ Response createTermSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getTerm(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("termId") String termId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/glossary/term/{termId}") @ExpectedResponses({ 200 }) @@ -309,7 +315,7 @@ Mono> getTerm(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response getTermSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("termId") String termId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/atlas/v2/glossary/term/{termId}") @ExpectedResponses({ 200 }) @@ -319,8 +325,8 @@ Response getTermSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> updateTerm(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("termId") String termId, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/atlas/v2/glossary/term/{termId}") @ExpectedResponses({ 200 }) @@ -330,8 +336,8 @@ Mono> updateTerm(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response updateTermSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("termId") String termId, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Delete("/atlas/v2/glossary/term/{termId}") @ExpectedResponses({ 204 }) @@ -340,7 +346,7 @@ Response updateTermSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteTerm(@HostParam("endpoint") String endpoint, @PathParam("termId") String termId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/atlas/v2/glossary/term/{termId}") @ExpectedResponses({ 204 }) @@ -349,7 +355,7 @@ Mono> deleteTerm(@HostParam("endpoint") String endpoint, @PathPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteTermSync(@HostParam("endpoint") String endpoint, @PathParam("termId") String termId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/atlas/v2/glossary/term/{termId}/partial") @ExpectedResponses({ 200 }) @@ -359,8 +365,8 @@ Response deleteTermSync(@HostParam("endpoint") String endpoint, @PathParam @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> partialUpdateTerm(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("termId") String termId, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/atlas/v2/glossary/term/{termId}/partial") @ExpectedResponses({ 200 }) @@ -370,8 +376,8 @@ Mono> partialUpdateTerm(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(HttpResponseException.class) Response partialUpdateTermSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("termId") String termId, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/atlas/v2/glossary/terms") @ExpectedResponses({ 200 }) @@ -380,8 +386,9 @@ Response partialUpdateTermSync(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createTerms(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/atlas/v2/glossary/terms") @ExpectedResponses({ 200 }) @@ -390,8 +397,9 @@ Mono> createTerms(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createTermsSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Get("/atlas/v2/glossary/terms/{termId}/assignedEntities") @ExpectedResponses({ 200 }) @@ -400,7 +408,7 @@ Response createTermsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getEntitiesAssignedWithTerm(@HostParam("endpoint") String endpoint, - @PathParam("termId") String termId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("termId") String termId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/glossary/terms/{termId}/assignedEntities") @@ -410,7 +418,7 @@ Mono> getEntitiesAssignedWithTerm(@HostParam("endpoint") St @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getEntitiesAssignedWithTermSync(@HostParam("endpoint") String endpoint, - @PathParam("termId") String termId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("termId") String termId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/atlas/v2/glossary/terms/{termId}/assignedEntities") @@ -420,8 +428,9 @@ Response getEntitiesAssignedWithTermSync(@HostParam("endpoint") Stri @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> assignTermToEntities(@HostParam("endpoint") String endpoint, - @PathParam("termId") String termId, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @PathParam("termId") String termId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/atlas/v2/glossary/terms/{termId}/assignedEntities") @ExpectedResponses({ 204 }) @@ -430,8 +439,9 @@ Mono> assignTermToEntities(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response assignTermToEntitiesSync(@HostParam("endpoint") String endpoint, - @PathParam("termId") String termId, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @PathParam("termId") String termId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Delete("/atlas/v2/glossary/terms/{termId}/assignedEntities") @ExpectedResponses({ 204 }) @@ -440,8 +450,9 @@ Response assignTermToEntitiesSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteTermAssignmentFromEntities(@HostParam("endpoint") String endpoint, - @PathParam("termId") String termId, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @PathParam("termId") String termId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Delete("/atlas/v2/glossary/terms/{termId}/assignedEntities") @ExpectedResponses({ 204 }) @@ -450,8 +461,9 @@ Mono> deleteTermAssignmentFromEntities(@HostParam("endpoint") Str @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteTermAssignmentFromEntitiesSync(@HostParam("endpoint") String endpoint, - @PathParam("termId") String termId, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @PathParam("termId") String termId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Get("/atlas/v2/glossary/terms/{termId}/related") @ExpectedResponses({ 200 }) @@ -461,7 +473,7 @@ Response deleteTermAssignmentFromEntitiesSync(@HostParam("endpoint") Strin @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getRelatedTerms(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("termId") String termId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/glossary/terms/{termId}/related") @ExpectedResponses({ 200 }) @@ -471,7 +483,7 @@ Mono> getRelatedTerms(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(HttpResponseException.class) Response getRelatedTermsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("termId") String termId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/glossary/{glossaryId}") @ExpectedResponses({ 200 }) @@ -480,7 +492,7 @@ Response getRelatedTermsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> get(@HostParam("endpoint") String endpoint, - @PathParam("glossaryId") String glossaryId, @HeaderParam("accept") String accept, + @PathParam("glossaryId") String glossaryId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/glossary/{glossaryId}") @@ -490,7 +502,7 @@ Mono> get(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getSync(@HostParam("endpoint") String endpoint, @PathParam("glossaryId") String glossaryId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/atlas/v2/glossary/{glossaryId}") @ExpectedResponses({ 200 }) @@ -500,8 +512,8 @@ Response getSync(@HostParam("endpoint") String endpoint, @PathParam( @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> update(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("glossaryId") String glossaryId, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/atlas/v2/glossary/{glossaryId}") @ExpectedResponses({ 200 }) @@ -511,8 +523,8 @@ Mono> update(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response updateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("glossaryId") String glossaryId, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Delete("/atlas/v2/glossary/{glossaryId}") @ExpectedResponses({ 204 }) @@ -521,7 +533,7 @@ Response updateSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("glossaryId") String glossaryId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/atlas/v2/glossary/{glossaryId}") @ExpectedResponses({ 204 }) @@ -530,7 +542,7 @@ Mono> delete(@HostParam("endpoint") String endpoint, @PathParam(" @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteSync(@HostParam("endpoint") String endpoint, @PathParam("glossaryId") String glossaryId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/glossary/{glossaryId}/categories") @ExpectedResponses({ 200 }) @@ -539,7 +551,7 @@ Response deleteSync(@HostParam("endpoint") String endpoint, @PathParam("gl @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getCategories(@HostParam("endpoint") String endpoint, - @PathParam("glossaryId") String glossaryId, @HeaderParam("accept") String accept, + @PathParam("glossaryId") String glossaryId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/glossary/{glossaryId}/categories") @@ -549,7 +561,7 @@ Mono> getCategories(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getCategoriesSync(@HostParam("endpoint") String endpoint, - @PathParam("glossaryId") String glossaryId, @HeaderParam("accept") String accept, + @PathParam("glossaryId") String glossaryId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/glossary/{glossaryId}/categories/headers") @@ -559,7 +571,7 @@ Response getCategoriesSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getCategoriesHeaders(@HostParam("endpoint") String endpoint, - @PathParam("glossaryId") String glossaryId, @HeaderParam("accept") String accept, + @PathParam("glossaryId") String glossaryId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/glossary/{glossaryId}/categories/headers") @@ -569,7 +581,7 @@ Mono> getCategoriesHeaders(@HostParam("endpoint") String en @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getCategoriesHeadersSync(@HostParam("endpoint") String endpoint, - @PathParam("glossaryId") String glossaryId, @HeaderParam("accept") String accept, + @PathParam("glossaryId") String glossaryId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/glossary/{glossaryId}/detailed") @@ -580,7 +592,7 @@ Response getCategoriesHeadersSync(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getDetailed(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("glossaryId") String glossaryId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/glossary/{glossaryId}/detailed") @ExpectedResponses({ 200 }) @@ -590,7 +602,7 @@ Mono> getDetailed(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response getDetailedSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("glossaryId") String glossaryId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/atlas/v2/glossary/{glossaryId}/partial") @ExpectedResponses({ 200 }) @@ -600,8 +612,8 @@ Response getDetailedSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> partialUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("glossaryId") String glossaryId, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/atlas/v2/glossary/{glossaryId}/partial") @ExpectedResponses({ 200 }) @@ -611,8 +623,8 @@ Mono> partialUpdate(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response partialUpdateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("glossaryId") String glossaryId, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/atlas/v2/glossary/{glossaryId}/terms") @ExpectedResponses({ 200 }) @@ -622,7 +634,7 @@ Response partialUpdateSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getTerms(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("glossaryId") String glossaryId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/glossary/{glossaryId}/terms") @ExpectedResponses({ 200 }) @@ -632,7 +644,7 @@ Mono> getTerms(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response getTermsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("glossaryId") String glossaryId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/glossary/{glossaryId}/terms/headers") @ExpectedResponses({ 200 }) @@ -641,7 +653,7 @@ Response getTermsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getTermHeaders(@HostParam("endpoint") String endpoint, - @PathParam("glossaryId") String glossaryId, @HeaderParam("accept") String accept, + @PathParam("glossaryId") String glossaryId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/glossary/{glossaryId}/terms/headers") @@ -651,7 +663,7 @@ Mono> getTermHeaders(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getTermHeadersSync(@HostParam("endpoint") String endpoint, - @PathParam("glossaryId") String glossaryId, @HeaderParam("accept") String accept, + @PathParam("glossaryId") String glossaryId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -961,9 +973,10 @@ public Response batchGetWithResponse(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.create(this.client.getEndpoint(), contentType, accept, body, requestOptions, context)); } /** @@ -1094,8 +1107,9 @@ public Mono> createWithResponseAsync(BinaryData body, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.createSync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); + return service.createSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, Context.NONE); } /** @@ -1239,9 +1253,10 @@ public Response createWithResponse(BinaryData body, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createCategoriesWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.createCategories(this.client.getEndpoint(), accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.createCategories(this.client.getEndpoint(), contentType, accept, + body, requestOptions, context)); } /** @@ -1384,8 +1399,10 @@ public Mono> createCategoriesWithResponseAsync(BinaryData b */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createCategoriesWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.createCategoriesSync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); + return service.createCategoriesSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } /** @@ -1524,9 +1541,10 @@ public Response createCategoriesWithResponse(BinaryData body, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createCategoryWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.createCategory(this.client.getEndpoint(), accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.createCategory(this.client.getEndpoint(), contentType, accept, + body, requestOptions, context)); } /** @@ -1665,8 +1683,10 @@ public Mono> createCategoryWithResponseAsync(BinaryData bod */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createCategoryWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.createCategorySync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); + return service.createCategorySync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } /** @@ -1965,9 +1985,10 @@ public Response getCategoryWithResponse(String categoryId, RequestOp @ServiceMethod(returns = ReturnType.SINGLE) public Mono> updateCategoryWithResponseAsync(String categoryId, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.updateCategory(this.client.getEndpoint(), categoryId, accept, - body, requestOptions, context)); + return FluxUtil.withContext(context -> service.updateCategory(this.client.getEndpoint(), categoryId, + contentType, accept, body, requestOptions, context)); } /** @@ -2108,9 +2129,10 @@ public Mono> updateCategoryWithResponseAsync(String categor @ServiceMethod(returns = ReturnType.SINGLE) public Response updateCategoryWithResponse(String categoryId, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.updateCategorySync(this.client.getEndpoint(), categoryId, accept, body, requestOptions, - Context.NONE); + return service.updateCategorySync(this.client.getEndpoint(), categoryId, contentType, accept, body, + requestOptions, Context.NONE); } /** @@ -2234,9 +2256,10 @@ public Response deleteCategoryWithResponse(String categoryId, RequestOptio @ServiceMethod(returns = ReturnType.SINGLE) public Mono> partialUpdateCategoryWithResponseAsync(String categoryId, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.partialUpdateCategory(this.client.getEndpoint(), categoryId, - accept, body, requestOptions, context)); + contentType, accept, body, requestOptions, context)); } /** @@ -2325,9 +2348,10 @@ public Mono> partialUpdateCategoryWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) public Response partialUpdateCategoryWithResponse(String categoryId, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.partialUpdateCategorySync(this.client.getEndpoint(), categoryId, accept, body, requestOptions, - Context.NONE); + return service.partialUpdateCategorySync(this.client.getEndpoint(), categoryId, contentType, accept, body, + requestOptions, Context.NONE); } /** @@ -2849,9 +2873,10 @@ public Response getCategoryTermsWithResponse(String categoryId, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createTermWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.createTerm(this.client.getEndpoint(), accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.createTerm(this.client.getEndpoint(), contentType, accept, body, + requestOptions, context)); } /** @@ -3199,8 +3224,10 @@ public Mono> createTermWithResponseAsync(BinaryData body, R */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createTermWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.createTermSync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); + return service.createTermSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } /** @@ -3911,9 +3938,10 @@ public Response getTermWithResponse(String termId, RequestOptions re @ServiceMethod(returns = ReturnType.SINGLE) public Mono> updateTermWithResponseAsync(String termId, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.updateTerm(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), termId, accept, body, requestOptions, context)); + this.client.getServiceVersion().getVersion(), termId, contentType, accept, body, requestOptions, context)); } /** @@ -4262,9 +4290,10 @@ public Mono> updateTermWithResponseAsync(String termId, Bin */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateTermWithResponse(String termId, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.updateTermSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), termId, - accept, body, requestOptions, Context.NONE); + contentType, accept, body, requestOptions, Context.NONE); } /** @@ -4496,9 +4525,10 @@ public Response deleteTermWithResponse(String termId, RequestOptions reque @ServiceMethod(returns = ReturnType.SINGLE) public Mono> partialUpdateTermWithResponseAsync(String termId, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.partialUpdateTerm(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), termId, accept, body, requestOptions, context)); + this.client.getServiceVersion().getVersion(), termId, contentType, accept, body, requestOptions, context)); } /** @@ -4695,9 +4725,10 @@ public Mono> partialUpdateTermWithResponseAsync(String term @ServiceMethod(returns = ReturnType.SINGLE) public Response partialUpdateTermWithResponse(String termId, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.partialUpdateTermSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - termId, accept, body, requestOptions, Context.NONE); + termId, contentType, accept, body, requestOptions, Context.NONE); } /** @@ -5049,9 +5080,10 @@ public Response partialUpdateTermWithResponse(String termId, BinaryD */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createTermsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.createTerms(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, body, requestOptions, context)); + this.client.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, context)); } /** @@ -5403,9 +5435,10 @@ public Mono> createTermsWithResponseAsync(BinaryData body, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createTermsWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.createTermsSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), accept, - body, requestOptions, Context.NONE); + return service.createTermsSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + contentType, accept, body, requestOptions, Context.NONE); } /** @@ -5560,9 +5593,10 @@ public Response getEntitiesAssignedWithTermWithResponse(String termI @ServiceMethod(returns = ReturnType.SINGLE) public Mono> assignTermToEntitiesWithResponseAsync(String termId, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.assignTermToEntities(this.client.getEndpoint(), termId, accept, - body, requestOptions, context)); + return FluxUtil.withContext(context -> service.assignTermToEntities(this.client.getEndpoint(), termId, + contentType, accept, body, requestOptions, context)); } /** @@ -5610,9 +5644,10 @@ public Mono> assignTermToEntitiesWithResponseAsync(String termId, @ServiceMethod(returns = ReturnType.SINGLE) public Response assignTermToEntitiesWithResponse(String termId, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.assignTermToEntitiesSync(this.client.getEndpoint(), termId, accept, body, requestOptions, - Context.NONE); + return service.assignTermToEntitiesSync(this.client.getEndpoint(), termId, contentType, accept, body, + requestOptions, Context.NONE); } /** @@ -5655,9 +5690,10 @@ public Response assignTermToEntitiesWithResponse(String termId, BinaryData @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteTermAssignmentFromEntitiesWithResponseAsync(String termId, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.deleteTermAssignmentFromEntities(this.client.getEndpoint(), - termId, accept, body, requestOptions, context)); + termId, contentType, accept, body, requestOptions, context)); } /** @@ -5700,9 +5736,10 @@ public Mono> deleteTermAssignmentFromEntitiesWithResponseAsync(St @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteTermAssignmentFromEntitiesWithResponse(String termId, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.deleteTermAssignmentFromEntitiesSync(this.client.getEndpoint(), termId, accept, body, - requestOptions, Context.NONE); + return service.deleteTermAssignmentFromEntitiesSync(this.client.getEndpoint(), termId, contentType, accept, + body, requestOptions, Context.NONE); } /** @@ -6082,9 +6119,11 @@ public Response getWithResponse(String glossaryId, RequestOptions re @ServiceMethod(returns = ReturnType.SINGLE) public Mono> updateWithResponseAsync(String glossaryId, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), glossaryId, accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.update(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + glossaryId, contentType, accept, body, requestOptions, context)); } /** @@ -6223,9 +6262,10 @@ public Mono> updateWithResponseAsync(String glossaryId, Bin */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse(String glossaryId, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.updateSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), glossaryId, - accept, body, requestOptions, Context.NONE); + contentType, accept, body, requestOptions, Context.NONE); } /** @@ -7113,9 +7153,11 @@ public Response getDetailedWithResponse(String glossaryId, RequestOp @ServiceMethod(returns = ReturnType.SINGLE) public Mono> partialUpdateWithResponseAsync(String glossaryId, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.partialUpdate(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), glossaryId, accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.partialUpdate(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + glossaryId, contentType, accept, body, requestOptions, context)); } /** @@ -7213,9 +7255,10 @@ public Mono> partialUpdateWithResponseAsync(String glossary @ServiceMethod(returns = ReturnType.SINGLE) public Response partialUpdateWithResponse(String glossaryId, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.partialUpdateSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - glossaryId, accept, body, requestOptions, Context.NONE); + glossaryId, contentType, accept, body, requestOptions, Context.NONE); } /** diff --git a/sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/implementation/LineagesImpl.java b/sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/implementation/LineagesImpl.java index d6d4026447d9..5f311d34e291 100644 --- a/sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/implementation/LineagesImpl.java +++ b/sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/implementation/LineagesImpl.java @@ -75,7 +75,7 @@ public interface LineagesService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> get(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, - @QueryParam("direction") String direction, @HeaderParam("accept") String accept, + @QueryParam("direction") String direction, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/lineage/{guid}") @@ -85,7 +85,7 @@ Mono> get(@HostParam("endpoint") String endpoint, @PathPara @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getSync(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, - @QueryParam("direction") String direction, @HeaderParam("accept") String accept, + @QueryParam("direction") String direction, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/lineage/{guid}/next/") @@ -96,7 +96,7 @@ Response getSync(@HostParam("endpoint") String endpoint, @PathParam( @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getNextPage(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("guid") String guid, - @QueryParam("direction") String direction, @HeaderParam("accept") String accept, + @QueryParam("direction") String direction, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/lineage/{guid}/next/") @@ -107,7 +107,7 @@ Mono> getNextPage(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response getNextPageSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("guid") String guid, - @QueryParam("direction") String direction, @HeaderParam("accept") String accept, + @QueryParam("direction") String direction, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/lineage/uniqueAttribute/type/{typeName}") @@ -118,7 +118,7 @@ Response getNextPageSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getByUniqueAttribute(@HostParam("endpoint") String endpoint, @PathParam("typeName") String typeName, @QueryParam("direction") String direction, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/lineage/uniqueAttribute/type/{typeName}") @ExpectedResponses({ 200 }) @@ -128,7 +128,7 @@ Mono> getByUniqueAttribute(@HostParam("endpoint") String en @UnexpectedResponseExceptionType(HttpResponseException.class) Response getByUniqueAttributeSync(@HostParam("endpoint") String endpoint, @PathParam("typeName") String typeName, @QueryParam("direction") String direction, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** diff --git a/sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/implementation/RelationshipsImpl.java b/sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/implementation/RelationshipsImpl.java index a7b4c9c74e6f..f5dafd73e858 100644 --- a/sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/implementation/RelationshipsImpl.java +++ b/sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/implementation/RelationshipsImpl.java @@ -78,7 +78,8 @@ public interface RelationshipsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> create(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Mono> create(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/atlas/v2/relationship") @@ -87,7 +88,8 @@ Mono> create(@HostParam("endpoint") String endpoint, @Heade @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response createSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response createSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/atlas/v2/relationship") @@ -96,7 +98,8 @@ Response createSync(@HostParam("endpoint") String endpoint, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> update(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Mono> update(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/atlas/v2/relationship") @@ -105,7 +108,8 @@ Mono> update(@HostParam("endpoint") String endpoint, @Heade @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response updateSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response updateSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/atlas/v2/relationship/guid/{guid}") @@ -115,7 +119,7 @@ Response updateSync(@HostParam("endpoint") String endpoint, @HeaderP @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> get(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/relationship/guid/{guid}") @ExpectedResponses({ 200 }) @@ -124,7 +128,7 @@ Mono> get(@HostParam("endpoint") String endpoint, @PathPara @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getSync(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/atlas/v2/relationship/guid/{guid}") @ExpectedResponses({ 204 }) @@ -133,7 +137,7 @@ Response getSync(@HostParam("endpoint") String endpoint, @PathParam( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/atlas/v2/relationship/guid/{guid}") @ExpectedResponses({ 204 }) @@ -142,7 +146,7 @@ Mono> delete(@HostParam("endpoint") String endpoint, @PathParam(" @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteSync(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -217,9 +221,10 @@ Response deleteSync(@HostParam("endpoint") String endpoint, @PathParam("gu */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.create(this.client.getEndpoint(), contentType, accept, body, requestOptions, context)); } /** @@ -294,8 +299,9 @@ public Mono> createWithResponseAsync(BinaryData body, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.createSync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); + return service.createSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, Context.NONE); } /** @@ -370,9 +376,10 @@ public Response createWithResponse(BinaryData body, RequestOptions r */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> updateWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.update(this.client.getEndpoint(), contentType, accept, body, requestOptions, context)); } /** @@ -447,8 +454,9 @@ public Mono> updateWithResponseAsync(BinaryData body, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); + return service.updateSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, Context.NONE); } /** diff --git a/sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/implementation/TypeDefinitionsImpl.java b/sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/implementation/TypeDefinitionsImpl.java index d06908ddf5c2..ec65a37a95c5 100644 --- a/sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/implementation/TypeDefinitionsImpl.java +++ b/sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/implementation/TypeDefinitionsImpl.java @@ -80,7 +80,7 @@ public interface TypeDefinitionsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getBusinessMetadataById(@HostParam("endpoint") String endpoint, - @PathParam("guid") String guid, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("guid") String guid, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/businessmetadatadef/guid/{guid}") @@ -90,7 +90,7 @@ Mono> getBusinessMetadataById(@HostParam("endpoint") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getBusinessMetadataByIdSync(@HostParam("endpoint") String endpoint, - @PathParam("guid") String guid, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("guid") String guid, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/businessmetadatadef/name/{name}") @@ -100,7 +100,7 @@ Response getBusinessMetadataByIdSync(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getBusinessMetadataByName(@HostParam("endpoint") String endpoint, - @PathParam("name") String name, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/businessmetadatadef/name/{name}") @@ -110,7 +110,7 @@ Mono> getBusinessMetadataByName(@HostParam("endpoint") Stri @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getBusinessMetadataByNameSync(@HostParam("endpoint") String endpoint, - @PathParam("name") String name, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/classificationdef/guid/{guid}") @@ -120,7 +120,7 @@ Response getBusinessMetadataByNameSync(@HostParam("endpoint") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getClassificationById(@HostParam("endpoint") String endpoint, - @PathParam("guid") String guid, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("guid") String guid, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/classificationdef/guid/{guid}") @@ -130,7 +130,7 @@ Mono> getClassificationById(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getClassificationByIdSync(@HostParam("endpoint") String endpoint, - @PathParam("guid") String guid, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("guid") String guid, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/classificationdef/name/{name}") @@ -140,7 +140,7 @@ Response getClassificationByIdSync(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getClassificationByName(@HostParam("endpoint") String endpoint, - @PathParam("name") String name, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/classificationdef/name/{name}") @@ -150,7 +150,7 @@ Mono> getClassificationByName(@HostParam("endpoint") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getClassificationByNameSync(@HostParam("endpoint") String endpoint, - @PathParam("name") String name, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/entitydef/guid/{guid}") @@ -160,7 +160,7 @@ Response getClassificationByNameSync(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getEntityById(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/entitydef/guid/{guid}") @ExpectedResponses({ 200 }) @@ -169,7 +169,7 @@ Mono> getEntityById(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getEntityByIdSync(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/entitydef/name/{name}") @ExpectedResponses({ 200 }) @@ -178,7 +178,7 @@ Response getEntityByIdSync(@HostParam("endpoint") String endpoint, @ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getEntityByName(@HostParam("endpoint") String endpoint, - @PathParam("name") String name, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/entitydef/name/{name}") @@ -188,7 +188,7 @@ Mono> getEntityByName(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getEntityByNameSync(@HostParam("endpoint") String endpoint, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/enumdef/guid/{guid}") @ExpectedResponses({ 200 }) @@ -197,7 +197,7 @@ Response getEntityByNameSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getEnumById(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/enumdef/guid/{guid}") @ExpectedResponses({ 200 }) @@ -206,7 +206,7 @@ Mono> getEnumById(@HostParam("endpoint") String endpoint, @ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getEnumByIdSync(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/enumdef/name/{name}") @ExpectedResponses({ 200 }) @@ -215,7 +215,7 @@ Response getEnumByIdSync(@HostParam("endpoint") String endpoint, @Pa @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getEnumByName(@HostParam("endpoint") String endpoint, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/enumdef/name/{name}") @ExpectedResponses({ 200 }) @@ -224,7 +224,7 @@ Mono> getEnumByName(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getEnumByNameSync(@HostParam("endpoint") String endpoint, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/relationshipdef/guid/{guid}") @ExpectedResponses({ 200 }) @@ -233,7 +233,7 @@ Response getEnumByNameSync(@HostParam("endpoint") String endpoint, @ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getRelationshipById(@HostParam("endpoint") String endpoint, - @PathParam("guid") String guid, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("guid") String guid, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/relationshipdef/guid/{guid}") @@ -243,7 +243,7 @@ Mono> getRelationshipById(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getRelationshipByIdSync(@HostParam("endpoint") String endpoint, - @PathParam("guid") String guid, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("guid") String guid, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/relationshipdef/name/{name}") @@ -253,7 +253,7 @@ Response getRelationshipByIdSync(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getRelationshipByName(@HostParam("endpoint") String endpoint, - @PathParam("name") String name, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/relationshipdef/name/{name}") @@ -263,7 +263,7 @@ Mono> getRelationshipByName(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getRelationshipByNameSync(@HostParam("endpoint") String endpoint, - @PathParam("name") String name, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/structdef/guid/{guid}") @@ -273,7 +273,7 @@ Response getRelationshipByNameSync(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getStructById(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/structdef/guid/{guid}") @ExpectedResponses({ 200 }) @@ -282,7 +282,7 @@ Mono> getStructById(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getStructByIdSync(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/structdef/name/{name}") @ExpectedResponses({ 200 }) @@ -291,7 +291,7 @@ Response getStructByIdSync(@HostParam("endpoint") String endpoint, @ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getStructByName(@HostParam("endpoint") String endpoint, - @PathParam("name") String name, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @PathParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/structdef/name/{name}") @@ -301,7 +301,7 @@ Mono> getStructByName(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getStructByNameSync(@HostParam("endpoint") String endpoint, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/typedef/guid/{guid}") @ExpectedResponses({ 200 }) @@ -310,7 +310,7 @@ Response getStructByNameSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getById(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/typedef/guid/{guid}") @ExpectedResponses({ 200 }) @@ -319,7 +319,7 @@ Mono> getById(@HostParam("endpoint") String endpoint, @Path @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getByIdSync(@HostParam("endpoint") String endpoint, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/typedef/name/{name}") @ExpectedResponses({ 200 }) @@ -328,7 +328,7 @@ Response getByIdSync(@HostParam("endpoint") String endpoint, @PathPa @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getByName(@HostParam("endpoint") String endpoint, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/typedef/name/{name}") @ExpectedResponses({ 200 }) @@ -337,7 +337,7 @@ Mono> getByName(@HostParam("endpoint") String endpoint, @Pa @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getByNameSync(@HostParam("endpoint") String endpoint, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/atlas/v2/types/typedef/name/{name}") @ExpectedResponses({ 204 }) @@ -346,7 +346,7 @@ Response getByNameSync(@HostParam("endpoint") String endpoint, @Path @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/atlas/v2/types/typedef/name/{name}") @ExpectedResponses({ 204 }) @@ -355,7 +355,7 @@ Mono> delete(@HostParam("endpoint") String endpoint, @PathParam(" @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteSync(@HostParam("endpoint") String endpoint, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/typedefs") @ExpectedResponses({ 200 }) @@ -364,7 +364,7 @@ Response deleteSync(@HostParam("endpoint") String endpoint, @PathParam("na @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/typedefs") @@ -374,7 +374,7 @@ Mono> get(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/atlas/v2/types/typedefs") @@ -384,8 +384,8 @@ Response getSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> batchCreate(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/atlas/v2/types/typedefs") @ExpectedResponses({ 200 }) @@ -394,8 +394,8 @@ Mono> batchCreate(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response batchCreateSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/atlas/v2/types/typedefs") @ExpectedResponses({ 200 }) @@ -404,8 +404,8 @@ Response batchCreateSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> batchUpdate(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/atlas/v2/types/typedefs") @ExpectedResponses({ 200 }) @@ -414,8 +414,8 @@ Mono> batchUpdate(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response batchUpdateSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Delete("/atlas/v2/types/typedefs") @ExpectedResponses({ 204 }) @@ -423,7 +423,8 @@ Response batchUpdateSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> batchDelete(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Mono> batchDelete(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Delete("/atlas/v2/types/typedefs") @@ -432,7 +433,8 @@ Mono> batchDelete(@HostParam("endpoint") String endpoint, @Header @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response batchDeleteSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response batchDeleteSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/typedefs/headers") @@ -442,7 +444,7 @@ Response batchDeleteSync(@HostParam("endpoint") String endpoint, @HeaderPa @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getHeaders(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/atlas/v2/types/typedefs/headers") @@ -452,7 +454,7 @@ Mono> getHeaders(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getHeadersSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/types/termtemplatedef/guid/{guid}") @@ -463,7 +465,7 @@ Response getHeadersSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getTermTemplateById(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/types/termtemplatedef/guid/{guid}") @ExpectedResponses({ 200 }) @@ -473,7 +475,7 @@ Mono> getTermTemplateById(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(HttpResponseException.class) Response getTermTemplateByIdSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("guid") String guid, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/types/termtemplatedef/name/{name}") @ExpectedResponses({ 200 }) @@ -483,7 +485,7 @@ Response getTermTemplateByIdSync(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getTermTemplateByName(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/types/termtemplatedef/name/{name}") @ExpectedResponses({ 200 }) @@ -493,7 +495,7 @@ Mono> getTermTemplateByName(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(HttpResponseException.class) Response getTermTemplateByNameSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -4981,9 +4983,10 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> batchCreateWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.batchCreate(this.client.getEndpoint(), accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.batchCreate(this.client.getEndpoint(), contentType, accept, body, + requestOptions, context)); } /** @@ -5564,8 +5567,10 @@ public Mono> batchCreateWithResponseAsync(BinaryData body, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response batchCreateWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.batchCreateSync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); + return service.batchCreateSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } /** @@ -6147,9 +6152,10 @@ public Response batchCreateWithResponse(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> batchUpdateWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.batchUpdate(this.client.getEndpoint(), accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.batchUpdate(this.client.getEndpoint(), contentType, accept, body, + requestOptions, context)); } /** @@ -6731,8 +6737,10 @@ public Mono> batchUpdateWithResponseAsync(BinaryData body, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response batchUpdateWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.batchUpdateSync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); + return service.batchUpdateSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } /** @@ -7030,9 +7038,10 @@ public Response batchUpdateWithResponse(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> batchDeleteWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.batchDelete(this.client.getEndpoint(), accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.batchDelete(this.client.getEndpoint(), contentType, accept, body, + requestOptions, context)); } /** @@ -7330,8 +7339,10 @@ public Mono> batchDeleteWithResponseAsync(BinaryData body, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response batchDeleteWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.batchDeleteSync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); + return service.batchDeleteSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } /** diff --git a/sdk/purview/azure-analytics-purview-datamap/src/main/resources/META-INF/azure-analytics-purview-datamap_apiview_properties.json b/sdk/purview/azure-analytics-purview-datamap/src/main/resources/META-INF/azure-analytics-purview-datamap_apiview_properties.json index f415cee9b86a..9f5039c98fa9 100644 --- a/sdk/purview/azure-analytics-purview-datamap/src/main/resources/META-INF/azure-analytics-purview-datamap_apiview_properties.json +++ b/sdk/purview/azure-analytics-purview-datamap/src/main/resources/META-INF/azure-analytics-purview-datamap_apiview_properties.json @@ -1,7 +1,7 @@ { "flavor": "azure", "CrossLanguageDefinitionId": { - "com.azure.analytics.purview.datamap.DataMapClientBuilder": "PurviewDataMap.DataMapClient", + "com.azure.analytics.purview.datamap.DataMapClientBuilder": "Customizations", "com.azure.analytics.purview.datamap.DiscoveryAsyncClient": "null", "com.azure.analytics.purview.datamap.DiscoveryAsyncClient.autoComplete": "Customizations.Discovery.autoComplete", "com.azure.analytics.purview.datamap.DiscoveryAsyncClient.autoCompleteWithResponse": "Customizations.Discovery.autoComplete", diff --git a/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/fluent/StandbyPoolClient.java b/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/fluent/StandbyPoolClient.java index 145bb6db7b96..943d29ef9642 100644 --- a/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/fluent/StandbyPoolClient.java +++ b/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/fluent/StandbyPoolClient.java @@ -12,7 +12,7 @@ */ public interface StandbyPoolClient { /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ diff --git a/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/OperationsClientImpl.java b/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/OperationsClientImpl.java index 9bab365dfef4..b4c9b020a5f1 100644 --- a/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/OperationsClientImpl.java +++ b/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/OperationsClientImpl.java @@ -67,14 +67,14 @@ public interface OperationsService { @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list(@HostParam("endpoint") String endpoint, - @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" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -181,6 +181,8 @@ public PagedIterable list(Context context) { } /** + * List the operations for the provider + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -207,6 +209,8 @@ private Mono> listNextSinglePageAsync(String nextL } /** + * List the operations for the provider + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/StandbyContainerGroupPoolRuntimeViewsClientImpl.java b/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/StandbyContainerGroupPoolRuntimeViewsClientImpl.java index fa3a10af8a2b..cacc1e34b04d 100644 --- a/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/StandbyContainerGroupPoolRuntimeViewsClientImpl.java +++ b/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/StandbyContainerGroupPoolRuntimeViewsClientImpl.java @@ -72,7 +72,7 @@ Mono> get(@HostParam @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("standbyContainerGroupPoolName") String standbyContainerGroupPoolName, - @PathParam("runtimeView") String runtimeView, @HeaderParam("accept") String accept, Context context); + @PathParam("runtimeView") String runtimeView, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}/runtimeViews") @@ -83,7 +83,7 @@ Mono> listBySta @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("standbyContainerGroupPoolName") String standbyContainerGroupPoolName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -91,7 +91,7 @@ Mono> listBySta @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByStandbyPoolNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); } /** @@ -389,6 +389,8 @@ public PagedIterable listBySt } /** + * List StandbyContainerGroupPoolRuntimeViewResource resources by StandbyContainerGroupPoolResource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -418,6 +420,8 @@ public PagedIterable listBySt } /** + * List StandbyContainerGroupPoolRuntimeViewResource resources by StandbyContainerGroupPoolResource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/StandbyContainerGroupPoolsClientImpl.java b/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/StandbyContainerGroupPoolsClientImpl.java index b4b6855b62ac..9bb6e6e4063a 100644 --- a/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/StandbyContainerGroupPoolsClientImpl.java +++ b/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/StandbyContainerGroupPoolsClientImpl.java @@ -81,9 +81,8 @@ Mono> getByResourceGroup( @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("standbyContainerGroupPoolName") String standbyContainerGroupPoolName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) @@ -91,7 +90,7 @@ Mono>> createOrUpdate(@HostParam("endpoint") String en @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("standbyContainerGroupPoolName") String standbyContainerGroupPoolName, - @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") StandbyContainerGroupPoolResourceInner resource, Context context); @Headers({ "Content-Type: application/json" }) @@ -102,9 +101,8 @@ Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("standbyContainerGroupPoolName") String standbyContainerGroupPoolName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) @@ -112,7 +110,7 @@ Mono> update(@HostParam("endpoi @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("standbyContainerGroupPoolName") String standbyContainerGroupPoolName, - @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") StandbyContainerGroupPoolResourceUpdate properties, Context context); @Headers({ "Content-Type: application/json" }) @@ -122,7 +120,7 @@ Mono> update(@HostParam("endpoi Mono> listByResourceGroup( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -131,7 +129,7 @@ Mono> listByResourceGroup( @UnexpectedResponseExceptionType(ManagementException.class) Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -139,7 +137,7 @@ Mono> list(@HostParam("end @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -147,7 +145,7 @@ Mono> listByResourceGroupN @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); } /** @@ -308,11 +306,12 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, standbyContainerGroupPoolName, accept, resource, - context)) + this.client.getSubscriptionId(), resourceGroupName, standbyContainerGroupPoolName, contentType, accept, + resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -352,11 +351,12 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, standbyContainerGroupPoolName, accept, resource, - context); + this.client.getSubscriptionId(), resourceGroupName, standbyContainerGroupPoolName, contentType, accept, + resource, context); } /** @@ -758,11 +758,12 @@ private Mono> updateWithRespons } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, standbyContainerGroupPoolName, accept, properties, - context)) + this.client.getSubscriptionId(), resourceGroupName, standbyContainerGroupPoolName, contentType, accept, + properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -802,10 +803,11 @@ private Mono> updateWithRespons } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, standbyContainerGroupPoolName, accept, properties, context); + resourceGroupName, standbyContainerGroupPoolName, contentType, accept, properties, context); } /** @@ -1112,6 +1114,8 @@ public PagedIterable list(Context contex } /** + * List StandbyContainerGroupPoolResource resources by resource group + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1141,6 +1145,8 @@ public PagedIterable list(Context contex } /** + * List StandbyContainerGroupPoolResource resources by resource group + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1169,6 +1175,8 @@ public PagedIterable list(Context contex } /** + * List StandbyContainerGroupPoolResource resources by subscription ID + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1198,6 +1206,8 @@ public PagedIterable list(Context contex } /** + * List StandbyContainerGroupPoolResource resources by subscription ID + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/StandbyPoolClientBuilder.java b/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/StandbyPoolClientBuilder.java index a3b885c502d5..9df0fdc8c466 100644 --- a/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/StandbyPoolClientBuilder.java +++ b/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/StandbyPoolClientBuilder.java @@ -20,12 +20,12 @@ @ServiceClientBuilder(serviceClients = { StandbyPoolClientImpl.class }) public final class StandbyPoolClientBuilder { /* - * Server parameter + * Service host */ private String endpoint; /** - * Sets Server parameter. + * Sets Service host. * * @param endpoint the endpoint value. * @return the StandbyPoolClientBuilder. @@ -121,6 +121,7 @@ public StandbyPoolClientBuilder serializerAdapter(SerializerAdapter serializerAd * @return an instance of StandbyPoolClientImpl. */ public StandbyPoolClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; HttpPipeline localPipeline = (pipeline != null) ? pipeline @@ -131,7 +132,7 @@ public StandbyPoolClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); StandbyPoolClientImpl client = new StandbyPoolClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.endpoint, this.subscriptionId); + localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/StandbyPoolClientImpl.java b/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/StandbyPoolClientImpl.java index b90d0c531848..c1a3e0845627 100644 --- a/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/StandbyPoolClientImpl.java +++ b/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/StandbyPoolClientImpl.java @@ -45,12 +45,12 @@ @ServiceClient(builder = StandbyPoolClientBuilder.class) public final class StandbyPoolClientImpl implements StandbyPoolClient { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -219,7 +219,7 @@ public StandbyContainerGroupPoolRuntimeViewsClient getStandbyContainerGroupPoolR * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ StandbyPoolClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, diff --git a/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/StandbyVirtualMachinePoolRuntimeViewsClientImpl.java b/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/StandbyVirtualMachinePoolRuntimeViewsClientImpl.java index 48c309ccc52c..8a567e99ab2b 100644 --- a/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/StandbyVirtualMachinePoolRuntimeViewsClientImpl.java +++ b/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/StandbyVirtualMachinePoolRuntimeViewsClientImpl.java @@ -72,7 +72,7 @@ Mono> get(@HostParam @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("standbyVirtualMachinePoolName") String standbyVirtualMachinePoolName, - @PathParam("runtimeView") String runtimeView, @HeaderParam("accept") String accept, Context context); + @PathParam("runtimeView") String runtimeView, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}/runtimeViews") @@ -83,7 +83,7 @@ Mono> listBySta @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("standbyVirtualMachinePoolName") String standbyVirtualMachinePoolName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -91,7 +91,7 @@ Mono> listBySta @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByStandbyPoolNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); } /** @@ -389,6 +389,8 @@ public PagedIterable listBySt } /** + * List StandbyVirtualMachinePoolRuntimeViewResource resources by StandbyVirtualMachinePoolResource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -418,6 +420,8 @@ public PagedIterable listBySt } /** + * List StandbyVirtualMachinePoolRuntimeViewResource resources by StandbyVirtualMachinePoolResource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/StandbyVirtualMachinePoolsClientImpl.java b/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/StandbyVirtualMachinePoolsClientImpl.java index ab113536a91d..6702480211cf 100644 --- a/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/StandbyVirtualMachinePoolsClientImpl.java +++ b/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/StandbyVirtualMachinePoolsClientImpl.java @@ -81,9 +81,8 @@ Mono> getByResourceGroup( @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("standbyVirtualMachinePoolName") String standbyVirtualMachinePoolName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) @@ -91,7 +90,7 @@ Mono>> createOrUpdate(@HostParam("endpoint") String en @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("standbyVirtualMachinePoolName") String standbyVirtualMachinePoolName, - @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") StandbyVirtualMachinePoolResourceInner resource, Context context); @Headers({ "Content-Type: application/json" }) @@ -102,9 +101,8 @@ Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("standbyVirtualMachinePoolName") String standbyVirtualMachinePoolName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) @@ -112,7 +110,7 @@ Mono> update(@HostParam("endpoi @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("standbyVirtualMachinePoolName") String standbyVirtualMachinePoolName, - @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") StandbyVirtualMachinePoolResourceUpdate properties, Context context); @Headers({ "Content-Type: application/json" }) @@ -122,7 +120,7 @@ Mono> update(@HostParam("endpoi Mono> listByResourceGroup( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -131,7 +129,7 @@ Mono> listByResourceGroup( @UnexpectedResponseExceptionType(ManagementException.class) Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -139,7 +137,7 @@ Mono> list(@HostParam("end @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -147,7 +145,7 @@ Mono> listByResourceGroupN @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); } /** @@ -308,11 +306,12 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, standbyVirtualMachinePoolName, accept, resource, - context)) + this.client.getSubscriptionId(), resourceGroupName, standbyVirtualMachinePoolName, contentType, accept, + resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -352,11 +351,12 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, standbyVirtualMachinePoolName, accept, resource, - context); + this.client.getSubscriptionId(), resourceGroupName, standbyVirtualMachinePoolName, contentType, accept, + resource, context); } /** @@ -758,11 +758,12 @@ private Mono> updateWithRespons } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, standbyVirtualMachinePoolName, accept, properties, - context)) + this.client.getSubscriptionId(), resourceGroupName, standbyVirtualMachinePoolName, contentType, accept, + properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -802,10 +803,11 @@ private Mono> updateWithRespons } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, standbyVirtualMachinePoolName, accept, properties, context); + resourceGroupName, standbyVirtualMachinePoolName, contentType, accept, properties, context); } /** @@ -1112,6 +1114,8 @@ public PagedIterable list(Context contex } /** + * List StandbyVirtualMachinePoolResource resources by resource group + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1141,6 +1145,8 @@ public PagedIterable list(Context contex } /** + * List StandbyVirtualMachinePoolResource resources by resource group + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1169,6 +1175,8 @@ public PagedIterable list(Context contex } /** + * List StandbyVirtualMachinePoolResource resources by subscription ID + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1198,6 +1206,8 @@ public PagedIterable list(Context contex } /** + * List StandbyVirtualMachinePoolResource resources by subscription ID + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/StandbyVirtualMachinesClientImpl.java b/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/StandbyVirtualMachinesClientImpl.java index f5798201851a..02da9f264ca3 100644 --- a/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/StandbyVirtualMachinesClientImpl.java +++ b/sdk/standbypool/azure-resourcemanager-standbypool/src/main/java/com/azure/resourcemanager/standbypool/implementation/StandbyVirtualMachinesClientImpl.java @@ -71,7 +71,7 @@ Mono> get(@HostParam("endpoint") St @PathParam("resourceGroupName") String resourceGroupName, @PathParam("standbyVirtualMachinePoolName") String standbyVirtualMachinePoolName, @PathParam("standbyVirtualMachineName") String standbyVirtualMachineName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}/standbyVirtualMachines") @@ -82,7 +82,7 @@ Mono> listByStandbyVirtualMach @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("standbyVirtualMachinePoolName") String standbyVirtualMachinePoolName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -90,7 +90,7 @@ Mono> listByStandbyVirtualMach @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByStandbyVirtualMachinePoolResourceNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); } /** @@ -392,6 +392,8 @@ public PagedIterable listByStandbyVirtualMac } /** + * List StandbyVirtualMachineResource resources by StandbyVirtualMachinePoolResource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -421,6 +423,8 @@ public PagedIterable listByStandbyVirtualMac } /** + * List StandbyVirtualMachineResource resources by StandbyVirtualMachinePoolResource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/implementation/DocumentTranslationClientImpl.java b/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/implementation/DocumentTranslationClientImpl.java index be5dfa0ea098..4678aa4aac27 100644 --- a/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/implementation/DocumentTranslationClientImpl.java +++ b/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/implementation/DocumentTranslationClientImpl.java @@ -178,9 +178,9 @@ public interface DocumentTranslationClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> startTranslation(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData startTranslationDetails, RequestOptions requestOptions, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData startTranslationDetails, + RequestOptions requestOptions, Context context); @Post("/document/batches") @ExpectedResponses({ 202 }) @@ -189,9 +189,9 @@ Mono> startTranslation(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response startTranslationSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData startTranslationDetails, RequestOptions requestOptions, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData startTranslationDetails, + RequestOptions requestOptions, Context context); @Get("/document/batches") @ExpectedResponses({ 200 }) @@ -200,7 +200,7 @@ Response startTranslationSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getTranslationsStatus(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/document/batches") @@ -210,7 +210,7 @@ Mono> getTranslationsStatus(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getTranslationsStatusSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/document/batches/{id}/documents/{documentId}") @@ -221,7 +221,7 @@ Response getTranslationsStatusSync(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getDocumentStatus(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("id") String id, - @PathParam("documentId") String documentId, @HeaderParam("accept") String accept, + @PathParam("documentId") String documentId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/document/batches/{id}/documents/{documentId}") @@ -232,7 +232,7 @@ Mono> getDocumentStatus(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(HttpResponseException.class) Response getDocumentStatusSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("id") String id, - @PathParam("documentId") String documentId, @HeaderParam("accept") String accept, + @PathParam("documentId") String documentId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/document/batches/{id}") @@ -243,7 +243,7 @@ Response getDocumentStatusSync(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getTranslationStatus(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("id") String id, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/document/batches/{id}") @ExpectedResponses({ 200 }) @@ -253,7 +253,7 @@ Mono> getTranslationStatus(@HostParam("endpoint") String en @UnexpectedResponseExceptionType(HttpResponseException.class) Response getTranslationStatusSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("id") String id, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/document/batches/{id}") @ExpectedResponses({ 200 }) @@ -263,7 +263,7 @@ Response getTranslationStatusSync(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> cancelTranslation(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("id") String id, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/document/batches/{id}") @ExpectedResponses({ 200 }) @@ -273,7 +273,7 @@ Mono> cancelTranslation(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(HttpResponseException.class) Response cancelTranslationSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("id") String id, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/document/batches/{id}/documents") @ExpectedResponses({ 200 }) @@ -283,7 +283,7 @@ Response cancelTranslationSync(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getDocumentsStatus(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("id") String id, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/document/batches/{id}/documents") @ExpectedResponses({ 200 }) @@ -293,7 +293,7 @@ Mono> getDocumentsStatus(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(HttpResponseException.class) Response getDocumentsStatusSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("id") String id, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/document/formats") @ExpectedResponses({ 200 }) @@ -302,7 +302,7 @@ Response getDocumentsStatusSync(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getSupportedFormats(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/document/formats") @@ -312,7 +312,7 @@ Mono> getSupportedFormats(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getSupportedFormatsSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -323,7 +323,7 @@ Response getSupportedFormatsSync(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getTranslationsStatusNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -333,7 +333,7 @@ Mono> getTranslationsStatusNext( @UnexpectedResponseExceptionType(HttpResponseException.class) Response getTranslationsStatusNextSync( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -343,7 +343,7 @@ Response getTranslationsStatusNextSync( @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getDocumentsStatusNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -352,7 +352,7 @@ Mono> getDocumentsStatusNext( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getDocumentsStatusNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -426,9 +426,11 @@ Response getDocumentsStatusNextSync(@PathParam(value = "nextLink", e @ServiceMethod(returns = ReturnType.SINGLE) private Mono> startTranslationWithResponseAsync(BinaryData startTranslationDetails, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.startTranslation(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, startTranslationDetails, requestOptions, context)); + return FluxUtil + .withContext(context -> service.startTranslation(this.getEndpoint(), this.getServiceVersion().getVersion(), + contentType, accept, startTranslationDetails, requestOptions, context)); } /** @@ -501,9 +503,10 @@ private Mono> startTranslationWithResponseAsync(BinaryData startT @ServiceMethod(returns = ReturnType.SINGLE) private Response startTranslationWithResponse(BinaryData startTranslationDetails, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.startTranslationSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, - startTranslationDetails, requestOptions, Context.NONE); + return service.startTranslationSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, + accept, startTranslationDetails, requestOptions, Context.NONE); } /** diff --git a/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/implementation/SingleDocumentTranslationClientImpl.java b/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/implementation/SingleDocumentTranslationClientImpl.java index 9402ef21f61f..93dddbb4fc2b 100644 --- a/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/implementation/SingleDocumentTranslationClientImpl.java +++ b/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/implementation/SingleDocumentTranslationClientImpl.java @@ -161,7 +161,7 @@ public interface SingleDocumentTranslationClientService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> documentTranslate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @QueryParam("targetLanguage") String targetLanguage, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData documentTranslateContent, RequestOptions requestOptions, Context context); @@ -174,7 +174,7 @@ Mono> documentTranslate(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(HttpResponseException.class) Response documentTranslateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @QueryParam("targetLanguage") String targetLanguage, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData documentTranslateContent, RequestOptions requestOptions, Context context); } @@ -220,7 +220,7 @@ Response documentTranslateSync(@HostParam("endpoint") String endpoin public Mono> documentTranslateWithResponseAsync(String targetLanguage, BinaryData documentTranslateContent, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/octet-stream, application/json"; + final String accept = "application/octet-stream"; return FluxUtil .withContext(context -> service.documentTranslate(this.getEndpoint(), this.getServiceVersion().getVersion(), targetLanguage, contentType, accept, documentTranslateContent, requestOptions, context)); @@ -267,7 +267,7 @@ public Mono> documentTranslateWithResponseAsync(String targ public Response documentTranslateWithResponse(String targetLanguage, BinaryData documentTranslateContent, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/octet-stream, application/json"; + final String accept = "application/octet-stream"; return service.documentTranslateSync(this.getEndpoint(), this.getServiceVersion().getVersion(), targetLanguage, contentType, accept, documentTranslateContent, requestOptions, Context.NONE); } diff --git a/sdk/translation/azure-ai-translation-document/src/main/resources/META-INF/azure-ai-translation-document_apiview_properties.json b/sdk/translation/azure-ai-translation-document/src/main/resources/META-INF/azure-ai-translation-document_apiview_properties.json index 38f421b4468a..c7c7e18a2e90 100644 --- a/sdk/translation/azure-ai-translation-document/src/main/resources/META-INF/azure-ai-translation-document_apiview_properties.json +++ b/sdk/translation/azure-ai-translation-document/src/main/resources/META-INF/azure-ai-translation-document_apiview_properties.json @@ -1,7 +1,7 @@ { "flavor": "azure", "CrossLanguageDefinitionId": { - "com.azure.ai.translation.document.DocumentTranslationAsyncClient": "DocumentTranslation.DocumentTranslationClient", + "com.azure.ai.translation.document.DocumentTranslationAsyncClient": "ClientCustomizations.DocumentTranslationClient", "com.azure.ai.translation.document.DocumentTranslationAsyncClient.beginStartTranslation": "ClientCustomizations.DocumentTranslationClient.startTranslation", "com.azure.ai.translation.document.DocumentTranslationAsyncClient.beginStartTranslationWithModel": "ClientCustomizations.DocumentTranslationClient.startTranslation", "com.azure.ai.translation.document.DocumentTranslationAsyncClient.cancelTranslation": "ClientCustomizations.DocumentTranslationClient.cancelTranslation", @@ -14,7 +14,7 @@ "com.azure.ai.translation.document.DocumentTranslationAsyncClient.getTranslationStatus": "ClientCustomizations.DocumentTranslationClient.getTranslationStatus", "com.azure.ai.translation.document.DocumentTranslationAsyncClient.getTranslationStatusWithResponse": "ClientCustomizations.DocumentTranslationClient.getTranslationStatus", "com.azure.ai.translation.document.DocumentTranslationAsyncClient.getTranslationsStatus": "ClientCustomizations.DocumentTranslationClient.getTranslationsStatus", - "com.azure.ai.translation.document.DocumentTranslationClient": "DocumentTranslation.DocumentTranslationClient", + "com.azure.ai.translation.document.DocumentTranslationClient": "ClientCustomizations.DocumentTranslationClient", "com.azure.ai.translation.document.DocumentTranslationClient.beginStartTranslation": "ClientCustomizations.DocumentTranslationClient.startTranslation", "com.azure.ai.translation.document.DocumentTranslationClient.beginStartTranslationWithModel": "ClientCustomizations.DocumentTranslationClient.startTranslation", "com.azure.ai.translation.document.DocumentTranslationClient.cancelTranslation": "ClientCustomizations.DocumentTranslationClient.cancelTranslation", @@ -27,14 +27,14 @@ "com.azure.ai.translation.document.DocumentTranslationClient.getTranslationStatus": "ClientCustomizations.DocumentTranslationClient.getTranslationStatus", "com.azure.ai.translation.document.DocumentTranslationClient.getTranslationStatusWithResponse": "ClientCustomizations.DocumentTranslationClient.getTranslationStatus", "com.azure.ai.translation.document.DocumentTranslationClient.getTranslationsStatus": "ClientCustomizations.DocumentTranslationClient.getTranslationsStatus", - "com.azure.ai.translation.document.DocumentTranslationClientBuilder": "DocumentTranslation.DocumentTranslationClient", - "com.azure.ai.translation.document.SingleDocumentTranslationAsyncClient": "DocumentTranslation.SingleDocumentTranslationClient", + "com.azure.ai.translation.document.DocumentTranslationClientBuilder": "ClientCustomizations.DocumentTranslationClient", + "com.azure.ai.translation.document.SingleDocumentTranslationAsyncClient": "ClientCustomizations.SingleDocumentTranslationClient", "com.azure.ai.translation.document.SingleDocumentTranslationAsyncClient.documentTranslate": "ClientCustomizations.SingleDocumentTranslationClient.documentTranslate", "com.azure.ai.translation.document.SingleDocumentTranslationAsyncClient.documentTranslateWithResponse": "ClientCustomizations.SingleDocumentTranslationClient.documentTranslate", - "com.azure.ai.translation.document.SingleDocumentTranslationClient": "DocumentTranslation.SingleDocumentTranslationClient", + "com.azure.ai.translation.document.SingleDocumentTranslationClient": "ClientCustomizations.SingleDocumentTranslationClient", "com.azure.ai.translation.document.SingleDocumentTranslationClient.documentTranslate": "ClientCustomizations.SingleDocumentTranslationClient.documentTranslate", "com.azure.ai.translation.document.SingleDocumentTranslationClient.documentTranslateWithResponse": "ClientCustomizations.SingleDocumentTranslationClient.documentTranslate", - "com.azure.ai.translation.document.SingleDocumentTranslationClientBuilder": "DocumentTranslation.SingleDocumentTranslationClient", + "com.azure.ai.translation.document.SingleDocumentTranslationClientBuilder": "ClientCustomizations.SingleDocumentTranslationClient", "com.azure.ai.translation.document.models.BatchRequest": "DocumentTranslation.BatchRequest", "com.azure.ai.translation.document.models.DocumentFileDetails": "null", "com.azure.ai.translation.document.models.DocumentFilter": "DocumentTranslation.DocumentFilter", diff --git a/sdk/translation/azure-ai-translation-text/src/main/java/com/azure/ai/translation/text/implementation/TextTranslationClientImpl.java b/sdk/translation/azure-ai-translation-text/src/main/java/com/azure/ai/translation/text/implementation/TextTranslationClientImpl.java index b300b4df26d4..8c55aae7d876 100644 --- a/sdk/translation/azure-ai-translation-text/src/main/java/com/azure/ai/translation/text/implementation/TextTranslationClientImpl.java +++ b/sdk/translation/azure-ai-translation-text/src/main/java/com/azure/ai/translation/text/implementation/TextTranslationClientImpl.java @@ -163,7 +163,7 @@ public interface TextTranslationClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getSupportedLanguages(@HostParam("Endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/languages") @@ -173,7 +173,7 @@ Mono> getSupportedLanguages(@HostParam("Endpoint") String e @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getSupportedLanguagesSync(@HostParam("Endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/translate") @@ -184,8 +184,9 @@ Response getSupportedLanguagesSync(@HostParam("Endpoint") String end @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> translate(@HostParam("Endpoint") String endpoint, @QueryParam(value = "to", multipleQueryParams = true) List targetLanguages, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/translate") @ExpectedResponses({ 200 }) @@ -195,8 +196,9 @@ Mono> translate(@HostParam("Endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response translateSync(@HostParam("Endpoint") String endpoint, @QueryParam(value = "to", multipleQueryParams = true) List targetLanguages, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/transliterate") @ExpectedResponses({ 200 }) @@ -207,8 +209,8 @@ Response translateSync(@HostParam("Endpoint") String endpoint, Mono> transliterate(@HostParam("Endpoint") String endpoint, @QueryParam("language") String language, @QueryParam("fromScript") String sourceLanguageScript, @QueryParam("toScript") String targetLanguageScript, @QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/transliterate") @ExpectedResponses({ 200 }) @@ -219,8 +221,8 @@ Mono> transliterate(@HostParam("Endpoint") String endpoint, Response transliterateSync(@HostParam("Endpoint") String endpoint, @QueryParam("language") String language, @QueryParam("fromScript") String sourceLanguageScript, @QueryParam("toScript") String targetLanguageScript, @QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/breaksentence") @ExpectedResponses({ 200 }) @@ -229,8 +231,9 @@ Response transliterateSync(@HostParam("Endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> findSentenceBoundaries(@HostParam("Endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/breaksentence") @ExpectedResponses({ 200 }) @@ -239,8 +242,9 @@ Mono> findSentenceBoundaries(@HostParam("Endpoint") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response findSentenceBoundariesSync(@HostParam("Endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/dictionary/lookup") @ExpectedResponses({ 200 }) @@ -250,8 +254,9 @@ Response findSentenceBoundariesSync(@HostParam("Endpoint") String en @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> lookupDictionaryEntries(@HostParam("Endpoint") String endpoint, @QueryParam("from") String sourceLanguage, @QueryParam("to") String targetLanguage, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/dictionary/lookup") @ExpectedResponses({ 200 }) @@ -261,8 +266,9 @@ Mono> lookupDictionaryEntries(@HostParam("Endpoint") String @UnexpectedResponseExceptionType(HttpResponseException.class) Response lookupDictionaryEntriesSync(@HostParam("Endpoint") String endpoint, @QueryParam("from") String sourceLanguage, @QueryParam("to") String targetLanguage, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/dictionary/examples") @ExpectedResponses({ 200 }) @@ -272,8 +278,9 @@ Response lookupDictionaryEntriesSync(@HostParam("Endpoint") String e @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> lookupDictionaryExamples(@HostParam("Endpoint") String endpoint, @QueryParam("from") String sourceLanguage, @QueryParam("to") String targetLanguage, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/dictionary/examples") @ExpectedResponses({ 200 }) @@ -283,8 +290,9 @@ Mono> lookupDictionaryExamples(@HostParam("Endpoint") Strin @UnexpectedResponseExceptionType(HttpResponseException.class) Response lookupDictionaryExamplesSync(@HostParam("Endpoint") String endpoint, @QueryParam("from") String sourceLanguage, @QueryParam("to") String targetLanguage, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -607,11 +615,12 @@ public Response getSupportedLanguagesWithResponse(RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Mono> translateWithResponseAsync(List targetLanguages, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; List targetLanguagesConverted = targetLanguages.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); return FluxUtil.withContext(context -> service.translate(this.getEndpoint(), targetLanguagesConverted, - this.getServiceVersion().getVersion(), accept, body, requestOptions, context)); + this.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, context)); } /** @@ -736,11 +745,12 @@ public Mono> translateWithResponseAsync(List target @ServiceMethod(returns = ReturnType.SINGLE) public Response translateWithResponse(List targetLanguages, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; List targetLanguagesConverted = targetLanguages.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); return service.translateSync(this.getEndpoint(), targetLanguagesConverted, - this.getServiceVersion().getVersion(), accept, body, requestOptions, Context.NONE); + this.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, Context.NONE); } /** @@ -794,9 +804,11 @@ public Response translateWithResponse(List targetLanguages, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> transliterateWithResponseAsync(String language, String sourceLanguageScript, String targetLanguageScript, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.transliterate(this.getEndpoint(), language, sourceLanguageScript, - targetLanguageScript, this.getServiceVersion().getVersion(), accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.transliterate(this.getEndpoint(), language, sourceLanguageScript, targetLanguageScript, + this.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, context)); } /** @@ -850,9 +862,10 @@ public Mono> transliterateWithResponseAsync(String language @ServiceMethod(returns = ReturnType.SINGLE) public Response transliterateWithResponse(String language, String sourceLanguageScript, String targetLanguageScript, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.transliterateSync(this.getEndpoint(), language, sourceLanguageScript, targetLanguageScript, - this.getServiceVersion().getVersion(), accept, body, requestOptions, Context.NONE); + this.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, Context.NONE); } /** @@ -912,9 +925,10 @@ public Response transliterateWithResponse(String language, String so @ServiceMethod(returns = ReturnType.SINGLE) public Mono> findSentenceBoundariesWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.findSentenceBoundaries(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, body, requestOptions, context)); + this.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, context)); } /** @@ -973,9 +987,10 @@ public Mono> findSentenceBoundariesWithResponseAsync(Binary */ @ServiceMethod(returns = ReturnType.SINGLE) public Response findSentenceBoundariesWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.findSentenceBoundariesSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, - body, requestOptions, Context.NONE); + return service.findSentenceBoundariesSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + contentType, accept, body, requestOptions, Context.NONE); } /** @@ -1041,9 +1056,10 @@ public Response findSentenceBoundariesWithResponse(BinaryData body, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> lookupDictionaryEntriesWithResponseAsync(String sourceLanguage, String targetLanguage, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.lookupDictionaryEntries(this.getEndpoint(), sourceLanguage, - targetLanguage, this.getServiceVersion().getVersion(), accept, body, requestOptions, context)); + targetLanguage, this.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, context)); } /** @@ -1109,9 +1125,10 @@ public Mono> lookupDictionaryEntriesWithResponseAsync(Strin @ServiceMethod(returns = ReturnType.SINGLE) public Response lookupDictionaryEntriesWithResponse(String sourceLanguage, String targetLanguage, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.lookupDictionaryEntriesSync(this.getEndpoint(), sourceLanguage, targetLanguage, - this.getServiceVersion().getVersion(), accept, body, requestOptions, Context.NONE); + this.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, Context.NONE); } /** @@ -1171,9 +1188,10 @@ public Response lookupDictionaryEntriesWithResponse(String sourceLan @ServiceMethod(returns = ReturnType.SINGLE) public Mono> lookupDictionaryExamplesWithResponseAsync(String sourceLanguage, String targetLanguage, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.lookupDictionaryExamples(this.getEndpoint(), sourceLanguage, - targetLanguage, this.getServiceVersion().getVersion(), accept, body, requestOptions, context)); + targetLanguage, this.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, context)); } /** @@ -1233,8 +1251,9 @@ public Mono> lookupDictionaryExamplesWithResponseAsync(Stri @ServiceMethod(returns = ReturnType.SINGLE) public Response lookupDictionaryExamplesWithResponse(String sourceLanguage, String targetLanguage, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.lookupDictionaryExamplesSync(this.getEndpoint(), sourceLanguage, targetLanguage, - this.getServiceVersion().getVersion(), accept, body, requestOptions, Context.NONE); + this.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, Context.NONE); } } From f04726d0f84e241d24ab0db33fbd4f8025705ede Mon Sep 17 00:00:00 2001 From: glenn Date: Wed, 28 Aug 2024 11:52:54 -0400 Subject: [PATCH 066/128] add customization to unfinalize base classes --- .../main/java/InferenceCustomizations.java | 28 ++++++++----------- ...azure-ai-inference_apiview_properties.json | 18 ++++++------ 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/sdk/ai/azure-ai-inference/customization/src/main/java/InferenceCustomizations.java b/sdk/ai/azure-ai-inference/customization/src/main/java/InferenceCustomizations.java index 422bb9a0e8a3..d9709773071b 100644 --- a/sdk/ai/azure-ai-inference/customization/src/main/java/InferenceCustomizations.java +++ b/sdk/ai/azure-ai-inference/customization/src/main/java/InferenceCustomizations.java @@ -5,6 +5,10 @@ import com.github.javaparser.ast.body.FieldDeclaration; import org.slf4j.Logger; +import java.lang.reflect.Modifier; +import java.util.Arrays; +import java.util.List; + /** * This class contains the customization code to customize the AutoRest generated code for Azure AI Inference. */ @@ -14,25 +18,17 @@ public class InferenceCustomizations extends Customization { public void customize(LibraryCustomization customization, Logger logger) { // remove unused class (no reference to them, after partial-update) customization.getRawEditor().removeFile("src/main/java/com/azure/ai/inference/implementation/models/CompleteOptions.java"); - //customizeEmbeddingEncodingFormatClass(customization, logger); - //customizeEmbeddingsOptions(customization, logger); - } - - /* - private void customizeEmbeddingEncodingFormatClass(LibraryCustomization customization, Logger logger) { - logger.info("Customizing the EmbeddingEncodingFormat class"); - ClassCustomization embeddingEncodingFormatClass = customization.getPackage("com.azure.ai.openai.models").getClass("EmbeddingEncodingFormat"); - embeddingEncodingFormatClass.getConstructor("EmbeddingEncodingFormat").setModifier(0); - embeddingEncodingFormatClass.setModifier(0); + customizeChatCompletionsBaseClasses(customization, logger); } - private void customizeEmbeddingsOptions(LibraryCustomization customization, Logger logger) { - logger.info("Customizing the EmbeddingsOptions class"); - ClassCustomization embeddingsOptionsClass = customization.getPackage("com.azure.ai.openai.models").getClass("EmbeddingsOptions"); - embeddingsOptionsClass.getMethod("getEncodingFormat").setModifier(0); - embeddingsOptionsClass.getMethod("setEncodingFormat").setModifier(0); + private void customizeChatCompletionsBaseClasses(LibraryCustomization customization, Logger logger) { + List classList = Arrays.asList("ChatCompletionsNamedToolSelection", "ChatCompletionsToolCall", "ChatCompletionsToolDefinition"); + for (String className : classList) { + logger.info("Customizing the {} class", className); + ClassCustomization namedToolSelectionClass = customization.getPackage("com.azure.ai.inference.models").getClass(className); + namedToolSelectionClass.setModifier(Modifier.PUBLIC); + } } - */ private static String joinWithNewline(String... lines) { return String.join("\n", lines); diff --git a/sdk/ai/azure-ai-inference/src/main/resources/META-INF/azure-ai-inference_apiview_properties.json b/sdk/ai/azure-ai-inference/src/main/resources/META-INF/azure-ai-inference_apiview_properties.json index b88e7d1bfc3d..47e99866372f 100644 --- a/sdk/ai/azure-ai-inference/src/main/resources/META-INF/azure-ai-inference_apiview_properties.json +++ b/sdk/ai/azure-ai-inference/src/main/resources/META-INF/azure-ai-inference_apiview_properties.json @@ -1,39 +1,39 @@ { "flavor": "azure", "CrossLanguageDefinitionId": { - "com.azure.ai.inference.ChatCompletionsAsyncClient": "AI.Model.ChatCompletionsClient", + "com.azure.ai.inference.ChatCompletionsAsyncClient": "Customizations.Client1", "com.azure.ai.inference.ChatCompletionsAsyncClient.complete": "Customizations.Client1.complete", "com.azure.ai.inference.ChatCompletionsAsyncClient.completeWithResponse": "Customizations.Client1.complete", "com.azure.ai.inference.ChatCompletionsAsyncClient.getModelInfo": "Customizations.Client1.getModelInfo", "com.azure.ai.inference.ChatCompletionsAsyncClient.getModelInfoWithResponse": "Customizations.Client1.getModelInfo", - "com.azure.ai.inference.ChatCompletionsClient": "AI.Model.ChatCompletionsClient", + "com.azure.ai.inference.ChatCompletionsClient": "Customizations.Client1", "com.azure.ai.inference.ChatCompletionsClient.complete": "Customizations.Client1.complete", "com.azure.ai.inference.ChatCompletionsClient.completeWithResponse": "Customizations.Client1.complete", "com.azure.ai.inference.ChatCompletionsClient.getModelInfo": "Customizations.Client1.getModelInfo", "com.azure.ai.inference.ChatCompletionsClient.getModelInfoWithResponse": "Customizations.Client1.getModelInfo", - "com.azure.ai.inference.ChatCompletionsClientBuilder": "AI.Model.ChatCompletionsClient", - "com.azure.ai.inference.EmbeddingsAsyncClient": "AI.Model.EmbeddingsClient", + "com.azure.ai.inference.ChatCompletionsClientBuilder": "Customizations.Client1", + "com.azure.ai.inference.EmbeddingsAsyncClient": "Customizations.Client2", "com.azure.ai.inference.EmbeddingsAsyncClient.embed": "Customizations.Client2.embed", "com.azure.ai.inference.EmbeddingsAsyncClient.embedWithResponse": "Customizations.Client2.embed", "com.azure.ai.inference.EmbeddingsAsyncClient.getModelInfo": "Customizations.Client2.getModelInfo", "com.azure.ai.inference.EmbeddingsAsyncClient.getModelInfoWithResponse": "Customizations.Client2.getModelInfo", - "com.azure.ai.inference.EmbeddingsClient": "AI.Model.EmbeddingsClient", + "com.azure.ai.inference.EmbeddingsClient": "Customizations.Client2", "com.azure.ai.inference.EmbeddingsClient.embed": "Customizations.Client2.embed", "com.azure.ai.inference.EmbeddingsClient.embedWithResponse": "Customizations.Client2.embed", "com.azure.ai.inference.EmbeddingsClient.getModelInfo": "Customizations.Client2.getModelInfo", "com.azure.ai.inference.EmbeddingsClient.getModelInfoWithResponse": "Customizations.Client2.getModelInfo", - "com.azure.ai.inference.EmbeddingsClientBuilder": "AI.Model.EmbeddingsClient", - "com.azure.ai.inference.ImageEmbeddingsAsyncClient": "AI.Model.ImageEmbeddingsClient", + "com.azure.ai.inference.EmbeddingsClientBuilder": "Customizations.Client2", + "com.azure.ai.inference.ImageEmbeddingsAsyncClient": "Customizations.Client3", "com.azure.ai.inference.ImageEmbeddingsAsyncClient.embed": "Customizations.Client3.embed", "com.azure.ai.inference.ImageEmbeddingsAsyncClient.embedWithResponse": "Customizations.Client3.embed", "com.azure.ai.inference.ImageEmbeddingsAsyncClient.getModelInfo": "Customizations.Client3.getModelInfo", "com.azure.ai.inference.ImageEmbeddingsAsyncClient.getModelInfoWithResponse": "Customizations.Client3.getModelInfo", - "com.azure.ai.inference.ImageEmbeddingsClient": "AI.Model.ImageEmbeddingsClient", + "com.azure.ai.inference.ImageEmbeddingsClient": "Customizations.Client3", "com.azure.ai.inference.ImageEmbeddingsClient.embed": "Customizations.Client3.embed", "com.azure.ai.inference.ImageEmbeddingsClient.embedWithResponse": "Customizations.Client3.embed", "com.azure.ai.inference.ImageEmbeddingsClient.getModelInfo": "Customizations.Client3.getModelInfo", "com.azure.ai.inference.ImageEmbeddingsClient.getModelInfoWithResponse": "Customizations.Client3.getModelInfo", - "com.azure.ai.inference.ImageEmbeddingsClientBuilder": "AI.Model.ImageEmbeddingsClient", + "com.azure.ai.inference.ImageEmbeddingsClientBuilder": "Customizations.Client3", "com.azure.ai.inference.implementation.models.CompleteOptions": "null", "com.azure.ai.inference.implementation.models.CompleteRequest": "Customizations.complete.Request.anonymous", "com.azure.ai.inference.implementation.models.EmbedRequest": "Customizations.embed.Request.anonymous", From dc8e8cd444e615a735281323ccb8f05598825cb8 Mon Sep 17 00:00:00 2001 From: glenn Date: Wed, 28 Aug 2024 11:57:00 -0400 Subject: [PATCH 067/128] more typespec syncs --- .../ai/inference/EmbeddingsAsyncClient.java | 1 - .../azure/ai/inference/EmbeddingsClient.java | 1 - .../inference/ImageEmbeddingsAsyncClient.java | 86 +++++++++---------- .../ai/inference/ImageEmbeddingsClient.java | 80 ++++++++--------- .../ChatCompletionsClientImpl.java | 32 ++++--- .../implementation/EmbeddingsClientImpl.java | 32 ++++--- .../ImageEmbeddingsClientImpl.java | 32 ++++--- 7 files changed, 137 insertions(+), 127 deletions(-) diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java index bf320aa92d77..65673cca9993 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java @@ -164,7 +164,6 @@ Mono> getModelInfoWithResponse(RequestOptions requestOption * Embeddings measure the relatedness of text strings and are commonly used for search, clustering, * recommendations, and other similar scenarios on successful completion of {@link Mono}. */ - @Generated @ServiceMethod(returns = ReturnType.SINGLE) Mono embed(List input, Integer dimensions, EmbeddingEncodingFormat encodingFormat, EmbeddingInputType inputType, String model, ExtraParameters extraParams) { diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java index a25da0d7ae57..f024926aeaf8 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java @@ -160,7 +160,6 @@ Response getModelInfoWithResponse(RequestOptions requestOptions) { * Embeddings measure the relatedness of text strings and are commonly used for search, clustering, * recommendations, and other similar scenarios. */ - @Generated @ServiceMethod(returns = ReturnType.SINGLE) EmbeddingsResult embed(List input, Integer dimensions, EmbeddingEncodingFormat encodingFormat, EmbeddingInputType inputType, String model, ExtraParameters extraParams) { diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java index 61f78fbc2e23..5f2178dbd970 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java @@ -147,19 +147,7 @@ Mono> getModelInfoWithResponse(RequestOptions requestOption * * @param input Input image to embed. To embed multiple inputs in a single request, pass an array. * The input must not exceed the max input tokens for the model. - * @param dimensions Optional. The number of dimensions the resulting output embeddings should have. - * Passing null causes the model to use its default value. - * Returns a 422 error if the model doesn't support the value or parameter. - * @param encodingFormat Optional. The number of dimensions the resulting output embeddings should have. - * Passing null causes the model to use its default value. - * Returns a 422 error if the model doesn't support the value or parameter. - * @param inputType Optional. The type of the input. - * Returns a 422 error if the model doesn't support the value or parameter. - * @param model ID of the specific AI model to use, if more than one model is available on the endpoint. - * @param extraParams Controls what happens if extra parameters, undefined by the REST API, - * are passed in the JSON request payload. - * This sets the HTTP request header `extra-parameters`. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @tException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. @@ -171,66 +159,78 @@ Mono> getModelInfoWithResponse(RequestOptions requestOption */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Mono embed(List input, Integer dimensions, EmbeddingEncodingFormat encodingFormat, - EmbeddingInputType inputType, String model, ExtraParameters extraParams) { + Mono embed(List input) { // Generated convenience method for embedWithResponse RequestOptions requestOptions = new RequestOptions(); - EmbedRequest1 embedRequest1Obj = new EmbedRequest1(input).setDimensions(dimensions) - .setEncodingFormat(encodingFormat) - .setInputType(inputType) - .setModel(model); + EmbedRequest1 embedRequest1Obj = new EmbedRequest1(input); BinaryData embedRequest1 = BinaryData.fromObject(embedRequest1Obj); - if (extraParams != null) { - requestOptions.setHeader(HttpHeaderName.fromString("extra-parameters"), extraParams.toString()); - } return embedWithResponse(embedRequest1, requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(EmbeddingsResult.class)); } /** - * Return the embedding vectors for given images. - * The method makes a REST API call to the `/images/embeddings` route on the given endpoint. + * Returns information about the AI model. + * The method makes a REST API call to the `/info` route on the given endpoint. * - * @param input Input image to embed. To embed multiple inputs in a single request, pass an array. - * The input must not exceed the max input tokens for the model. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return representation of the response data from an embeddings request. - * Embeddings measure the relatedness of text strings and are commonly used for search, clustering, - * recommendations, and other similar scenarios on successful completion of {@link Mono}. + * @return represents some basic information about the AI model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Mono embed(List input) { - // Generated convenience method for embedWithResponse + Mono getModelInfo() { + // Generated convenience method for getModelInfoWithResponse RequestOptions requestOptions = new RequestOptions(); - EmbedRequest1 embedRequest1Obj = new EmbedRequest1(input); - BinaryData embedRequest1 = BinaryData.fromObject(embedRequest1Obj); - return embedWithResponse(embedRequest1, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(EmbeddingsResult.class)); + return getModelInfoWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelInfo.class)); } /** - * Returns information about the AI model. - * The method makes a REST API call to the `/info` route on the given endpoint. + * Return the embedding vectors for given images. + * The method makes a REST API call to the `/images/embeddings` route on the given endpoint. * + * @param input Input image to embed. To embed multiple inputs in a single request, pass an array. + * The input must not exceed the max input tokens for the model. + * @param extraParams Controls what happens if extra parameters, undefined by the REST API, + * are passed in the JSON request payload. + * This sets the HTTP request header `extra-parameters`. + * @param dimensions Optional. The number of dimensions the resulting output embeddings should have. + * Passing null causes the model to use its default value. + * Returns a 422 error if the model doesn't support the value or parameter. + * @param encodingFormat Optional. The number of dimensions the resulting output embeddings should have. + * Passing null causes the model to use its default value. + * Returns a 422 error if the model doesn't support the value or parameter. + * @param inputType Optional. The type of the input. + * Returns a 422 error if the model doesn't support the value or parameter. + * @param model ID of the specific AI model to use, if more than one model is available on the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents some basic information about the AI model on successful completion of {@link Mono}. + * @return representation of the response data from an embeddings request. + * Embeddings measure the relatedness of text strings and are commonly used for search, clustering, + * recommendations, and other similar scenarios on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Mono getModelInfo() { - // Generated convenience method for getModelInfoWithResponse + Mono embed(List input, ExtraParameters extraParams, Integer dimensions, + EmbeddingEncodingFormat encodingFormat, EmbeddingInputType inputType, String model) { + // Generated convenience method for embedWithResponse RequestOptions requestOptions = new RequestOptions(); - return getModelInfoWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(ModelInfo.class)); + EmbedRequest1 embedRequest1Obj = new EmbedRequest1(input).setDimensions(dimensions) + .setEncodingFormat(encodingFormat) + .setInputType(inputType) + .setModel(model); + BinaryData embedRequest1 = BinaryData.fromObject(embedRequest1Obj); + if (extraParams != null) { + requestOptions.setHeader(HttpHeaderName.fromString("extra-parameters"), extraParams.toString()); + } + return embedWithResponse(embedRequest1, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(EmbeddingsResult.class)); } } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClient.java index 4cc4e8d5700f..c232a5c64a14 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClient.java @@ -143,18 +143,6 @@ Response getModelInfoWithResponse(RequestOptions requestOptions) { * * @param input Input image to embed. To embed multiple inputs in a single request, pass an array. * The input must not exceed the max input tokens for the model. - * @param dimensions Optional. The number of dimensions the resulting output embeddings should have. - * Passing null causes the model to use its default value. - * Returns a 422 error if the model doesn't support the value or parameter. - * @param encodingFormat Optional. The number of dimensions the resulting output embeddings should have. - * Passing null causes the model to use its default value. - * Returns a 422 error if the model doesn't support the value or parameter. - * @param inputType Optional. The type of the input. - * Returns a 422 error if the model doesn't support the value or parameter. - * @param model ID of the specific AI model to use, if more than one model is available on the endpoint. - * @param extraParams Controls what happens if extra parameters, undefined by the REST API, - * are passed in the JSON request payload. - * This sets the HTTP request header `extra-parameters`. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -167,63 +155,75 @@ Response getModelInfoWithResponse(RequestOptions requestOptions) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - EmbeddingsResult embed(List input, Integer dimensions, EmbeddingEncodingFormat encodingFormat, - EmbeddingInputType inputType, String model, ExtraParameters extraParams) { + EmbeddingsResult embed(List input) { // Generated convenience method for embedWithResponse RequestOptions requestOptions = new RequestOptions(); - EmbedRequest1 embedRequest1Obj = new EmbedRequest1(input).setDimensions(dimensions) - .setEncodingFormat(encodingFormat) - .setInputType(inputType) - .setModel(model); + EmbedRequest1 embedRequest1Obj = new EmbedRequest1(input); BinaryData embedRequest1 = BinaryData.fromObject(embedRequest1Obj); - if (extraParams != null) { - requestOptions.setHeader(HttpHeaderName.fromString("extra-parameters"), extraParams.toString()); - } return embedWithResponse(embedRequest1, requestOptions).getValue().toObject(EmbeddingsResult.class); } /** - * Return the embedding vectors for given images. - * The method makes a REST API call to the `/images/embeddings` route on the given endpoint. + * Returns information about the AI model. + * The method makes a REST API call to the `/info` route on the given endpoint. * - * @param input Input image to embed. To embed multiple inputs in a single request, pass an array. - * The input must not exceed the max input tokens for the model. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return representation of the response data from an embeddings request. - * Embeddings measure the relatedness of text strings and are commonly used for search, clustering, - * recommendations, and other similar scenarios. + * @return represents some basic information about the AI model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - EmbeddingsResult embed(List input) { - // Generated convenience method for embedWithResponse + ModelInfo getModelInfo() { + // Generated convenience method for getModelInfoWithResponse RequestOptions requestOptions = new RequestOptions(); - EmbedRequest1 embedRequest1Obj = new EmbedRequest1(input); - BinaryData embedRequest1 = BinaryData.fromObject(embedRequest1Obj); - return embedWithResponse(embedRequest1, requestOptions).getValue().toObject(EmbeddingsResult.class); + return getModelInfoWithResponse(requestOptions).getValue().toObject(ModelInfo.class); } /** - * Returns information about the AI model. - * The method makes a REST API call to the `/info` route on the given endpoint. + * Return the embedding vectors for given images. + * The method makes a REST API call to the `/images/embeddings` route on the given endpoint. * + * @param input Input image to embed. To embed multiple inputs in a single request, pass an array. + * The input must not exceed the max input tokens for the model. + * @param extraParams Controls what happens if extra parameters, undefined by the REST API, + * are passed in the JSON request payload. + * This sets the HTTP request header `extra-parameters`. + * @param dimensions Optional. The number of dimensions the resulting output embeddings should have. + * Passing null causes the model to use its default value. + * Returns a 422 error if the model doesn't support the value or parameter. + * @param encodingFormat Optional. The number of dimensions the resulting output embeddings should have. + * Passing null causes the model to use its default value. + * Returns a 422 error if the model doesn't support the value or parameter. + * @param inputType Optional. The type of the input. + * Returns a 422 error if the model doesn't support the value or parameter. + * @param model ID of the specific AI model to use, if more than one model is available on the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents some basic information about the AI model. + * @return representation of the response data from an embeddings request. + * Embeddings measure the relatedness of text strings and are commonly used for search, clustering, + * recommendations, and other similar scenarios. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - ModelInfo getModelInfo() { - // Generated convenience method for getModelInfoWithResponse + EmbeddingsResult embed(List input, ExtraParameters extraParams, Integer dimensions, + EmbeddingEncodingFormat encodingFormat, EmbeddingInputType inputType, String model) { + // Generated convenience method for embedWithResponse RequestOptions requestOptions = new RequestOptions(); - return getModelInfoWithResponse(requestOptions).getValue().toObject(ModelInfo.class); + EmbedRequest1 embedRequest1Obj = new EmbedRequest1(input).setDimensions(dimensions) + .setEncodingFormat(encodingFormat) + .setInputType(inputType) + .setModel(model); + BinaryData embedRequest1 = BinaryData.fromObject(embedRequest1Obj); + if (extraParams != null) { + requestOptions.setHeader(HttpHeaderName.fromString("extra-parameters"), extraParams.toString()); + } + return embedWithResponse(embedRequest1, requestOptions).getValue().toObject(EmbeddingsResult.class); } } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsClientImpl.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsClientImpl.java index 9654615ddb2d..41add2d08b40 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsClientImpl.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsClientImpl.java @@ -45,12 +45,12 @@ public final class ChatCompletionsClientImpl { private final ChatCompletionsClientService service; /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -103,7 +103,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of ChatCompletionsClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public ChatCompletionsClientImpl(String endpoint, ModelServiceVersion serviceVersion) { @@ -115,7 +115,7 @@ public ChatCompletionsClientImpl(String endpoint, ModelServiceVersion serviceVer * Initializes an instance of ChatCompletionsClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public ChatCompletionsClientImpl(HttpPipeline httpPipeline, String endpoint, ModelServiceVersion serviceVersion) { @@ -127,7 +127,7 @@ public ChatCompletionsClientImpl(HttpPipeline httpPipeline, String endpoint, Mod * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public ChatCompletionsClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, @@ -154,8 +154,9 @@ public interface ChatCompletionsClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> complete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData completeRequest, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData completeRequest, + RequestOptions requestOptions, Context context); @Post("/chat/completions") @ExpectedResponses({ 200 }) @@ -164,8 +165,9 @@ Mono> complete(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response completeSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData completeRequest, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData completeRequest, + RequestOptions requestOptions, Context context); @Get("/info") @ExpectedResponses({ 200 }) @@ -174,7 +176,7 @@ Response completeSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getModelInfo(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/info") @@ -184,7 +186,7 @@ Mono> getModelInfo(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getModelInfoSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -291,9 +293,10 @@ Response getModelInfoSync(@HostParam("endpoint") String endpoint, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> completeWithResponseAsync(BinaryData completeRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.complete(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, completeRequest, requestOptions, context)); + this.getServiceVersion().getVersion(), contentType, accept, completeRequest, requestOptions, context)); } /** @@ -398,9 +401,10 @@ public Mono> completeWithResponseAsync(BinaryData completeR */ @ServiceMethod(returns = ReturnType.SINGLE) public Response completeWithResponse(BinaryData completeRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.completeSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, completeRequest, - requestOptions, Context.NONE); + return service.completeSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, accept, + completeRequest, requestOptions, Context.NONE); } /** diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/EmbeddingsClientImpl.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/EmbeddingsClientImpl.java index d8033974f126..3982b0189cbc 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/EmbeddingsClientImpl.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/EmbeddingsClientImpl.java @@ -45,12 +45,12 @@ public final class EmbeddingsClientImpl { private final EmbeddingsClientService service; /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -103,7 +103,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of EmbeddingsClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public EmbeddingsClientImpl(String endpoint, ModelServiceVersion serviceVersion) { @@ -115,7 +115,7 @@ public EmbeddingsClientImpl(String endpoint, ModelServiceVersion serviceVersion) * Initializes an instance of EmbeddingsClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public EmbeddingsClientImpl(HttpPipeline httpPipeline, String endpoint, ModelServiceVersion serviceVersion) { @@ -127,7 +127,7 @@ public EmbeddingsClientImpl(HttpPipeline httpPipeline, String endpoint, ModelSer * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public EmbeddingsClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, @@ -153,8 +153,9 @@ public interface EmbeddingsClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> embed(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData embedRequest, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData embedRequest, + RequestOptions requestOptions, Context context); @Post("/embeddings") @ExpectedResponses({ 200 }) @@ -163,8 +164,9 @@ Mono> embed(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response embedSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData embedRequest, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData embedRequest, + RequestOptions requestOptions, Context context); @Get("/info") @ExpectedResponses({ 200 }) @@ -173,7 +175,7 @@ Response embedSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getModelInfo(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/info") @@ -183,7 +185,7 @@ Mono> getModelInfo(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getModelInfoSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -248,9 +250,10 @@ Response getModelInfoSync(@HostParam("endpoint") String endpoint, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> embedWithResponseAsync(BinaryData embedRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.embed(this.getEndpoint(), this.getServiceVersion().getVersion(), - accept, embedRequest, requestOptions, context)); + contentType, accept, embedRequest, requestOptions, context)); } /** @@ -313,9 +316,10 @@ public Mono> embedWithResponseAsync(BinaryData embedRequest */ @ServiceMethod(returns = ReturnType.SINGLE) public Response embedWithResponse(BinaryData embedRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.embedSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, embedRequest, - requestOptions, Context.NONE); + return service.embedSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, accept, + embedRequest, requestOptions, Context.NONE); } /** diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ImageEmbeddingsClientImpl.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ImageEmbeddingsClientImpl.java index c003b11b5b0e..ee5c60e02da9 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ImageEmbeddingsClientImpl.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ImageEmbeddingsClientImpl.java @@ -45,12 +45,12 @@ public final class ImageEmbeddingsClientImpl { private final ImageEmbeddingsClientService service; /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -103,7 +103,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of ImageEmbeddingsClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public ImageEmbeddingsClientImpl(String endpoint, ModelServiceVersion serviceVersion) { @@ -115,7 +115,7 @@ public ImageEmbeddingsClientImpl(String endpoint, ModelServiceVersion serviceVer * Initializes an instance of ImageEmbeddingsClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public ImageEmbeddingsClientImpl(HttpPipeline httpPipeline, String endpoint, ModelServiceVersion serviceVersion) { @@ -127,7 +127,7 @@ public ImageEmbeddingsClientImpl(HttpPipeline httpPipeline, String endpoint, Mod * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public ImageEmbeddingsClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, @@ -154,8 +154,9 @@ public interface ImageEmbeddingsClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> embed(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData embedRequest1, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData embedRequest1, + RequestOptions requestOptions, Context context); @Post("/images/embeddings") @ExpectedResponses({ 200 }) @@ -164,8 +165,9 @@ Mono> embed(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response embedSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData embedRequest1, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData embedRequest1, + RequestOptions requestOptions, Context context); @Get("/info") @ExpectedResponses({ 200 }) @@ -174,7 +176,7 @@ Response embedSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getModelInfo(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/info") @@ -184,7 +186,7 @@ Mono> getModelInfo(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getModelInfoSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -252,9 +254,10 @@ Response getModelInfoSync(@HostParam("endpoint") String endpoint, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> embedWithResponseAsync(BinaryData embedRequest1, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.embed(this.getEndpoint(), this.getServiceVersion().getVersion(), - accept, embedRequest1, requestOptions, context)); + contentType, accept, embedRequest1, requestOptions, context)); } /** @@ -320,9 +323,10 @@ public Mono> embedWithResponseAsync(BinaryData embedRequest */ @ServiceMethod(returns = ReturnType.SINGLE) public Response embedWithResponse(BinaryData embedRequest1, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.embedSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, embedRequest1, - requestOptions, Context.NONE); + return service.embedSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, accept, + embedRequest1, requestOptions, Context.NONE); } /** From dfd2b0a6dad8d9221317446c8e7b444bcd73209b Mon Sep 17 00:00:00 2001 From: glenn Date: Wed, 28 Aug 2024 12:18:00 -0400 Subject: [PATCH 068/128] correct doc comment --- .../customization/src/main/java/InferenceCustomizations.java | 2 -- .../java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/sdk/ai/azure-ai-inference/customization/src/main/java/InferenceCustomizations.java b/sdk/ai/azure-ai-inference/customization/src/main/java/InferenceCustomizations.java index d9709773071b..e9da4e489972 100644 --- a/sdk/ai/azure-ai-inference/customization/src/main/java/InferenceCustomizations.java +++ b/sdk/ai/azure-ai-inference/customization/src/main/java/InferenceCustomizations.java @@ -1,8 +1,6 @@ import com.azure.autorest.customization.ClassCustomization; import com.azure.autorest.customization.Customization; import com.azure.autorest.customization.LibraryCustomization; -import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; -import com.github.javaparser.ast.body.FieldDeclaration; import org.slf4j.Logger; import java.lang.reflect.Modifier; diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java index 5f2178dbd970..5c74a30a66d2 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java @@ -147,7 +147,7 @@ Mono> getModelInfoWithResponse(RequestOptions requestOption * * @param input Input image to embed. To embed multiple inputs in a single request, pass an array. * The input must not exceed the max input tokens for the model. - * @tException thrown if parameters fail the validation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. From 4e43f2c4f438f286613a9efd42b75468ff9397b0 Mon Sep 17 00:00:00 2001 From: glenn Date: Wed, 28 Aug 2024 13:35:42 -0400 Subject: [PATCH 069/128] make extra parameters public --- .../azure/ai/inference/ChatCompletionsAsyncClient.java | 3 ++- .../com/azure/ai/inference/ChatCompletionsClient.java | 3 ++- .../com/azure/ai/inference/EmbeddingsAsyncClient.java | 3 ++- .../java/com/azure/ai/inference/EmbeddingsClient.java | 3 ++- .../azure/ai/inference/ImageEmbeddingsAsyncClient.java | 3 ++- .../com/azure/ai/inference/ImageEmbeddingsClient.java | 3 ++- .../ai/inference/models/ChatCompletionsOptions.java | 1 + .../{implementation => }/models/ExtraParameters.java | 10 +++++----- .../azure-ai-inference_apiview_properties.json | 2 +- sdk/ai/azure-ai-inference/tsp-location.yaml | 2 +- 10 files changed, 20 insertions(+), 13 deletions(-) rename sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/{implementation => }/models/ExtraParameters.java (96%) diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java index 5effaabf2b3b..f0ae52fe371b 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java @@ -5,8 +5,8 @@ import com.azure.ai.inference.implementation.ChatCompletionsClientImpl; import com.azure.ai.inference.implementation.models.CompleteRequest; -import com.azure.ai.inference.implementation.models.ExtraParameters; import com.azure.ai.inference.models.ChatCompletions; +import com.azure.ai.inference.models.ExtraParameters; import com.azure.ai.inference.models.ModelInfo; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; @@ -23,6 +23,7 @@ import com.azure.core.util.FluxUtil; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import com.azure.ai.inference.implementation.models.ExtraParameters; import com.azure.ai.inference.implementation.InferenceServerSentEvents; import com.azure.ai.inference.implementation.ChatCompletionsUtils; import com.azure.ai.inference.models.ChatCompletionsOptions; diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java index fd9a5a0904ec..a93e13e40cd7 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java @@ -5,8 +5,8 @@ import com.azure.ai.inference.implementation.ChatCompletionsClientImpl; import com.azure.ai.inference.implementation.models.CompleteRequest; -import com.azure.ai.inference.implementation.models.ExtraParameters; import com.azure.ai.inference.models.ChatCompletions; +import com.azure.ai.inference.models.ExtraParameters; import com.azure.ai.inference.models.ModelInfo; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; @@ -20,6 +20,7 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; +import com.azure.ai.inference.implementation.models.ExtraParameters; import com.azure.ai.inference.implementation.InferenceServerSentEvents; import com.azure.ai.inference.models.ChatCompletionsOptions; import com.azure.ai.inference.implementation.ChatCompletionsUtils; diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java index 65673cca9993..57e0f1af3609 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java @@ -5,10 +5,10 @@ import com.azure.ai.inference.implementation.EmbeddingsClientImpl; import com.azure.ai.inference.implementation.models.EmbedRequest; -import com.azure.ai.inference.implementation.models.ExtraParameters; import com.azure.ai.inference.models.EmbeddingEncodingFormat; import com.azure.ai.inference.models.EmbeddingInputType; import com.azure.ai.inference.models.EmbeddingsResult; +import com.azure.ai.inference.models.ExtraParameters; import com.azure.ai.inference.models.ModelInfo; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; @@ -25,6 +25,7 @@ import com.azure.core.util.FluxUtil; import java.util.List; import reactor.core.publisher.Mono; +import com.azure.ai.inference.implementation.models.ExtraParameters; /** * Initializes a new instance of the asynchronous EmbeddingsClient type. diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java index f024926aeaf8..f63b48c9704d 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java @@ -5,10 +5,10 @@ import com.azure.ai.inference.implementation.EmbeddingsClientImpl; import com.azure.ai.inference.implementation.models.EmbedRequest; -import com.azure.ai.inference.implementation.models.ExtraParameters; import com.azure.ai.inference.models.EmbeddingEncodingFormat; import com.azure.ai.inference.models.EmbeddingInputType; import com.azure.ai.inference.models.EmbeddingsResult; +import com.azure.ai.inference.models.ExtraParameters; import com.azure.ai.inference.models.ModelInfo; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; @@ -23,6 +23,7 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import java.util.List; +import com.azure.ai.inference.implementation.models.ExtraParameters; /** * Initializes a new instance of the synchronous EmbeddingsClient type. diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java index 5c74a30a66d2..f2bf917547c1 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java @@ -5,11 +5,11 @@ import com.azure.ai.inference.implementation.ImageEmbeddingsClientImpl; import com.azure.ai.inference.implementation.models.EmbedRequest1; -import com.azure.ai.inference.implementation.models.ExtraParameters; import com.azure.ai.inference.models.EmbeddingEncodingFormat; import com.azure.ai.inference.models.EmbeddingInput; import com.azure.ai.inference.models.EmbeddingInputType; import com.azure.ai.inference.models.EmbeddingsResult; +import com.azure.ai.inference.models.ExtraParameters; import com.azure.ai.inference.models.ModelInfo; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; @@ -26,6 +26,7 @@ import com.azure.core.util.FluxUtil; import java.util.List; import reactor.core.publisher.Mono; +import com.azure.ai.inference.implementation.models.ExtraParameters; /** * Initializes a new instance of the asynchronous ImageEmbeddingsClient type. diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClient.java index c232a5c64a14..7f92cef2f4e7 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClient.java @@ -5,11 +5,11 @@ import com.azure.ai.inference.implementation.ImageEmbeddingsClientImpl; import com.azure.ai.inference.implementation.models.EmbedRequest1; -import com.azure.ai.inference.implementation.models.ExtraParameters; import com.azure.ai.inference.models.EmbeddingEncodingFormat; import com.azure.ai.inference.models.EmbeddingInput; import com.azure.ai.inference.models.EmbeddingInputType; import com.azure.ai.inference.models.EmbeddingsResult; +import com.azure.ai.inference.models.ExtraParameters; import com.azure.ai.inference.models.ModelInfo; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; @@ -24,6 +24,7 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import java.util.List; +import com.azure.ai.inference.implementation.models.ExtraParameters; /** * Initializes a new instance of the synchronous ImageEmbeddingsClient type. diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsOptions.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsOptions.java index f0aaac4349b9..bc4763bad763 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsOptions.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsOptions.java @@ -505,6 +505,7 @@ public ChatCompletionsOptions setExtraParams(ExtraParameters extraParams) { /** * {@inheritDoc} + * @throws IOException If an error occurs while writing fields to the ChatCompletionsOptions instance. */ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/ExtraParameters.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ExtraParameters.java similarity index 96% rename from sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/ExtraParameters.java rename to sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ExtraParameters.java index c7d93eb32281..9ef2a50db3a3 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/ExtraParameters.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ExtraParameters.java @@ -1,7 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.ai.inference.implementation.models; + +package com.azure.ai.inference.models; import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; @@ -11,7 +12,6 @@ * Controls what happens if extra parameters, undefined by the REST API, are passed in the JSON request payload. */ public final class ExtraParameters extends ExpandableStringEnum { - /** * The service will error if it detected extra parameters in the request payload. This is the service default. */ @@ -33,7 +33,7 @@ public final class ExtraParameters extends ExpandableStringEnum /** * Creates a new instance of ExtraParameters value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Generated @@ -43,7 +43,7 @@ public ExtraParameters() { /** * Creates or finds a ExtraParameters from its string representation. - * + * * @param name a name to look for. * @return the corresponding ExtraParameters. */ @@ -54,7 +54,7 @@ public static ExtraParameters fromString(String name) { /** * Gets known ExtraParameters values. - * + * * @return known ExtraParameters values. */ @Generated diff --git a/sdk/ai/azure-ai-inference/src/main/resources/META-INF/azure-ai-inference_apiview_properties.json b/sdk/ai/azure-ai-inference/src/main/resources/META-INF/azure-ai-inference_apiview_properties.json index 47e99866372f..01ba4716738e 100644 --- a/sdk/ai/azure-ai-inference/src/main/resources/META-INF/azure-ai-inference_apiview_properties.json +++ b/sdk/ai/azure-ai-inference/src/main/resources/META-INF/azure-ai-inference_apiview_properties.json @@ -38,7 +38,6 @@ "com.azure.ai.inference.implementation.models.CompleteRequest": "Customizations.complete.Request.anonymous", "com.azure.ai.inference.implementation.models.EmbedRequest": "Customizations.embed.Request.anonymous", "com.azure.ai.inference.implementation.models.EmbedRequest1": "Customizations.embed.Request.anonymous", - "com.azure.ai.inference.implementation.models.ExtraParameters": "AI.Model.ExtraParameters", "com.azure.ai.inference.models.ChatChoice": "AI.Model.ChatChoice", "com.azure.ai.inference.models.ChatCompletions": "AI.Model.ChatCompletions", "com.azure.ai.inference.models.ChatCompletionsFunctionToolSelection": "AI.Model.ChatCompletionsFunctionToolSelection", @@ -69,6 +68,7 @@ "com.azure.ai.inference.models.EmbeddingItem": "AI.Model.EmbeddingItem", "com.azure.ai.inference.models.EmbeddingsResult": "AI.Model.EmbeddingsResult", "com.azure.ai.inference.models.EmbeddingsUsage": "AI.Model.EmbeddingsUsage", + "com.azure.ai.inference.models.ExtraParameters": "AI.Model.ExtraParameters", "com.azure.ai.inference.models.FunctionCall": "AI.Model.FunctionCall", "com.azure.ai.inference.models.FunctionDefinition": "AI.Model.FunctionDefinition", "com.azure.ai.inference.models.ModelInfo": "AI.Model.ModelInfo", diff --git a/sdk/ai/azure-ai-inference/tsp-location.yaml b/sdk/ai/azure-ai-inference/tsp-location.yaml index 1c5d9634acb0..b4f13dd78be3 100644 --- a/sdk/ai/azure-ai-inference/tsp-location.yaml +++ b/sdk/ai/azure-ai-inference/tsp-location.yaml @@ -1,4 +1,4 @@ -commit: 69098f115bd7d8b0a27bc7f57b2fca2906982ae1 +commit: 016b80ae90f5fabc1e572efabd3ecb1030d444c0 additionalDirectories: [] repo: Azure/azure-rest-api-specs directory: specification/ai/ModelClient From 0e2de44c4ae1e2661c35f5367db4ac681650ee45 Mon Sep 17 00:00:00 2001 From: glenn Date: Wed, 28 Aug 2024 14:24:17 -0400 Subject: [PATCH 070/128] fix bad gen --- .../azure/ai/inference/ChatCompletionsAsyncClient.java | 10 +++++----- .../com/azure/ai/inference/ChatCompletionsClient.java | 10 +++++----- .../com/azure/ai/inference/EmbeddingsAsyncClient.java | 10 +++++----- .../java/com/azure/ai/inference/EmbeddingsClient.java | 10 +++++----- .../azure/ai/inference/ImageEmbeddingsAsyncClient.java | 10 +++++----- .../com/azure/ai/inference/ImageEmbeddingsClient.java | 10 +++++----- .../ai/inference/models/ChatCompletionsOptions.java | 2 +- 7 files changed, 31 insertions(+), 31 deletions(-) diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java index f0ae52fe371b..5079b75fdf91 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java @@ -23,7 +23,7 @@ import com.azure.core.util.FluxUtil; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -import com.azure.ai.inference.implementation.models.ExtraParameters; +import com.azure.ai.inference.models.ExtraParameters; import com.azure.ai.inference.implementation.InferenceServerSentEvents; import com.azure.ai.inference.implementation.ChatCompletionsUtils; import com.azure.ai.inference.models.ChatCompletionsOptions; @@ -65,7 +65,7 @@ public final class ChatCompletionsAsyncClient { * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

- * + * *
{@code
      * {
      *     messages (Required): [
@@ -103,9 +103,9 @@ public final class ChatCompletionsAsyncClient {
      *     }
      * }
      * }
- * + * *

Response Body Schema

- * + * *
{@code
      * {
      *     id: String (Required)
@@ -159,7 +159,7 @@ Mono> completeWithResponse(BinaryData completeRequest, Requ
      * Returns information about the AI model.
      * The method makes a REST API call to the `/info` route on the given endpoint.
      * 

Response Body Schema

- * + * *
{@code
      * {
      *     model_name: String (Required)
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java
index a93e13e40cd7..aa6150cceef0 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java
@@ -20,7 +20,7 @@
 import com.azure.core.http.rest.RequestOptions;
 import com.azure.core.http.rest.Response;
 import com.azure.core.util.BinaryData;
-import com.azure.ai.inference.implementation.models.ExtraParameters;
+import com.azure.ai.inference.models.ExtraParameters;
 import com.azure.ai.inference.implementation.InferenceServerSentEvents;
 import com.azure.ai.inference.models.ChatCompletionsOptions;
 import com.azure.ai.inference.implementation.ChatCompletionsUtils;
@@ -64,7 +64,7 @@ public final class ChatCompletionsClient {
      * 
      * You can add these to a request with {@link RequestOptions#addHeader}
      * 

Request Body Schema

- * + * *
{@code
      * {
      *     messages (Required): [
@@ -102,9 +102,9 @@ public final class ChatCompletionsClient {
      *     }
      * }
      * }
- * + * *

Response Body Schema

- * + * *
{@code
      * {
      *     id: String (Required)
@@ -158,7 +158,7 @@ Response completeWithResponse(BinaryData completeRequest, RequestOpt
      * Returns information about the AI model.
      * The method makes a REST API call to the `/info` route on the given endpoint.
      * 

Response Body Schema

- * + * *
{@code
      * {
      *     model_name: String (Required)
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java
index 57e0f1af3609..33eb2d4ee804 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java
@@ -25,7 +25,7 @@
 import com.azure.core.util.FluxUtil;
 import java.util.List;
 import reactor.core.publisher.Mono;
-import com.azure.ai.inference.implementation.models.ExtraParameters;
+import com.azure.ai.inference.models.ExtraParameters;
 
 /**
  * Initializes a new instance of the asynchronous EmbeddingsClient type.
@@ -60,7 +60,7 @@ public final class EmbeddingsAsyncClient {
      * 
      * You can add these to a request with {@link RequestOptions#addHeader}
      * 

Request Body Schema

- * + * *
{@code
      * {
      *     input (Required): [
@@ -75,9 +75,9 @@ public final class EmbeddingsAsyncClient {
      *     }
      * }
      * }
- * + * *

Response Body Schema

- * + * *
{@code
      * {
      *     data (Required): [
@@ -115,7 +115,7 @@ Mono> embedWithResponse(BinaryData embedRequest, RequestOpt
      * Returns information about the AI model.
      * The method makes a REST API call to the `/info` route on the given endpoint.
      * 

Response Body Schema

- * + * *
{@code
      * {
      *     model_name: String (Required)
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java
index f63b48c9704d..e82f3723ca87 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java
@@ -23,7 +23,7 @@
 import com.azure.core.http.rest.Response;
 import com.azure.core.util.BinaryData;
 import java.util.List;
-import com.azure.ai.inference.implementation.models.ExtraParameters;
+import com.azure.ai.inference.models.ExtraParameters;
 
 /**
  * Initializes a new instance of the synchronous EmbeddingsClient type.
@@ -58,7 +58,7 @@ public final class EmbeddingsClient {
      * 
      * You can add these to a request with {@link RequestOptions#addHeader}
      * 

Request Body Schema

- * + * *
{@code
      * {
      *     input (Required): [
@@ -73,9 +73,9 @@ public final class EmbeddingsClient {
      *     }
      * }
      * }
- * + * *

Response Body Schema

- * + * *
{@code
      * {
      *     data (Required): [
@@ -112,7 +112,7 @@ Response embedWithResponse(BinaryData embedRequest, RequestOptions r
      * Returns information about the AI model.
      * The method makes a REST API call to the `/info` route on the given endpoint.
      * 

Response Body Schema

- * + * *
{@code
      * {
      *     model_name: String (Required)
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java
index f2bf917547c1..c6d6d643683c 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java
@@ -26,7 +26,7 @@
 import com.azure.core.util.FluxUtil;
 import java.util.List;
 import reactor.core.publisher.Mono;
-import com.azure.ai.inference.implementation.models.ExtraParameters;
+import com.azure.ai.inference.models.ExtraParameters;
 
 /**
  * Initializes a new instance of the asynchronous ImageEmbeddingsClient type.
@@ -61,7 +61,7 @@ public final class ImageEmbeddingsAsyncClient {
      * 
      * You can add these to a request with {@link RequestOptions#addHeader}
      * 

Request Body Schema

- * + * *
{@code
      * {
      *     input (Required): [
@@ -79,9 +79,9 @@ public final class ImageEmbeddingsAsyncClient {
      *     }
      * }
      * }
- * + * *

Response Body Schema

- * + * *
{@code
      * {
      *     data (Required): [
@@ -119,7 +119,7 @@ Mono> embedWithResponse(BinaryData embedRequest1, RequestOp
      * Returns information about the AI model.
      * The method makes a REST API call to the `/info` route on the given endpoint.
      * 

Response Body Schema

- * + * *
{@code
      * {
      *     model_name: String (Required)
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClient.java
index 7f92cef2f4e7..23249e0d0573 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClient.java
@@ -24,7 +24,7 @@
 import com.azure.core.http.rest.Response;
 import com.azure.core.util.BinaryData;
 import java.util.List;
-import com.azure.ai.inference.implementation.models.ExtraParameters;
+import com.azure.ai.inference.models.ExtraParameters;
 
 /**
  * Initializes a new instance of the synchronous ImageEmbeddingsClient type.
@@ -59,7 +59,7 @@ public final class ImageEmbeddingsClient {
      * 
      * You can add these to a request with {@link RequestOptions#addHeader}
      * 

Request Body Schema

- * + * *
{@code
      * {
      *     input (Required): [
@@ -77,9 +77,9 @@ public final class ImageEmbeddingsClient {
      *     }
      * }
      * }
- * + * *

Response Body Schema

- * + * *
{@code
      * {
      *     data (Required): [
@@ -116,7 +116,7 @@ Response embedWithResponse(BinaryData embedRequest1, RequestOptions
      * Returns information about the AI model.
      * The method makes a REST API call to the `/info` route on the given endpoint.
      * 

Response Body Schema

- * + * *
{@code
      * {
      *     model_name: String (Required)
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsOptions.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsOptions.java
index bc4763bad763..d4cba40b01a0 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsOptions.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsOptions.java
@@ -4,7 +4,7 @@
 
 package com.azure.ai.inference.models;
 
-import com.azure.ai.inference.implementation.models.ExtraParameters;
+import com.azure.ai.inference.models.ExtraParameters;
 import com.azure.core.annotation.Fluent;
 import com.azure.core.annotation.Generated;
 import com.azure.core.util.BinaryData;

From eabceb939ac95419f049cee574bb9737ac495ded Mon Sep 17 00:00:00 2001
From: glenn 
Date: Wed, 28 Aug 2024 14:27:49 -0400
Subject: [PATCH 071/128] remove dupe imports

---
 .../azure/ai/inference/ChatCompletionsAsyncClient.java   | 9 ++++-----
 .../com/azure/ai/inference/ChatCompletionsClient.java    | 9 ++++-----
 .../com/azure/ai/inference/EmbeddingsAsyncClient.java    | 9 ++++-----
 .../java/com/azure/ai/inference/EmbeddingsClient.java    | 9 ++++-----
 .../azure/ai/inference/ImageEmbeddingsAsyncClient.java   | 9 ++++-----
 .../com/azure/ai/inference/ImageEmbeddingsClient.java    | 9 ++++-----
 .../com/azure/ai/inference/models/ExtraParameters.java   | 8 ++++----
 7 files changed, 28 insertions(+), 34 deletions(-)

diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java
index 5079b75fdf91..f661485e8fd5 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java
@@ -23,7 +23,6 @@
 import com.azure.core.util.FluxUtil;
 import reactor.core.publisher.Flux;
 import reactor.core.publisher.Mono;
-import com.azure.ai.inference.models.ExtraParameters;
 import com.azure.ai.inference.implementation.InferenceServerSentEvents;
 import com.azure.ai.inference.implementation.ChatCompletionsUtils;
 import com.azure.ai.inference.models.ChatCompletionsOptions;
@@ -65,7 +64,7 @@ public final class ChatCompletionsAsyncClient {
      * 
      * You can add these to a request with {@link RequestOptions#addHeader}
      * 

Request Body Schema

- * + * *
{@code
      * {
      *     messages (Required): [
@@ -103,9 +102,9 @@ public final class ChatCompletionsAsyncClient {
      *     }
      * }
      * }
- * + * *

Response Body Schema

- * + * *
{@code
      * {
      *     id: String (Required)
@@ -159,7 +158,7 @@ Mono> completeWithResponse(BinaryData completeRequest, Requ
      * Returns information about the AI model.
      * The method makes a REST API call to the `/info` route on the given endpoint.
      * 

Response Body Schema

- * + * *
{@code
      * {
      *     model_name: String (Required)
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java
index aa6150cceef0..e0c50f8dd1e4 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java
@@ -20,7 +20,6 @@
 import com.azure.core.http.rest.RequestOptions;
 import com.azure.core.http.rest.Response;
 import com.azure.core.util.BinaryData;
-import com.azure.ai.inference.models.ExtraParameters;
 import com.azure.ai.inference.implementation.InferenceServerSentEvents;
 import com.azure.ai.inference.models.ChatCompletionsOptions;
 import com.azure.ai.inference.implementation.ChatCompletionsUtils;
@@ -64,7 +63,7 @@ public final class ChatCompletionsClient {
      * 
      * You can add these to a request with {@link RequestOptions#addHeader}
      * 

Request Body Schema

- * + * *
{@code
      * {
      *     messages (Required): [
@@ -102,9 +101,9 @@ public final class ChatCompletionsClient {
      *     }
      * }
      * }
- * + * *

Response Body Schema

- * + * *
{@code
      * {
      *     id: String (Required)
@@ -158,7 +157,7 @@ Response completeWithResponse(BinaryData completeRequest, RequestOpt
      * Returns information about the AI model.
      * The method makes a REST API call to the `/info` route on the given endpoint.
      * 

Response Body Schema

- * + * *
{@code
      * {
      *     model_name: String (Required)
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java
index 33eb2d4ee804..24d24960e7ad 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java
@@ -25,7 +25,6 @@
 import com.azure.core.util.FluxUtil;
 import java.util.List;
 import reactor.core.publisher.Mono;
-import com.azure.ai.inference.models.ExtraParameters;
 
 /**
  * Initializes a new instance of the asynchronous EmbeddingsClient type.
@@ -60,7 +59,7 @@ public final class EmbeddingsAsyncClient {
      * 
      * You can add these to a request with {@link RequestOptions#addHeader}
      * 

Request Body Schema

- * + * *
{@code
      * {
      *     input (Required): [
@@ -75,9 +74,9 @@ public final class EmbeddingsAsyncClient {
      *     }
      * }
      * }
- * + * *

Response Body Schema

- * + * *
{@code
      * {
      *     data (Required): [
@@ -115,7 +114,7 @@ Mono> embedWithResponse(BinaryData embedRequest, RequestOpt
      * Returns information about the AI model.
      * The method makes a REST API call to the `/info` route on the given endpoint.
      * 

Response Body Schema

- * + * *
{@code
      * {
      *     model_name: String (Required)
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java
index e82f3723ca87..dfea2950e262 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java
@@ -23,7 +23,6 @@
 import com.azure.core.http.rest.Response;
 import com.azure.core.util.BinaryData;
 import java.util.List;
-import com.azure.ai.inference.models.ExtraParameters;
 
 /**
  * Initializes a new instance of the synchronous EmbeddingsClient type.
@@ -58,7 +57,7 @@ public final class EmbeddingsClient {
      * 
      * You can add these to a request with {@link RequestOptions#addHeader}
      * 

Request Body Schema

- * + * *
{@code
      * {
      *     input (Required): [
@@ -73,9 +72,9 @@ public final class EmbeddingsClient {
      *     }
      * }
      * }
- * + * *

Response Body Schema

- * + * *
{@code
      * {
      *     data (Required): [
@@ -112,7 +111,7 @@ Response embedWithResponse(BinaryData embedRequest, RequestOptions r
      * Returns information about the AI model.
      * The method makes a REST API call to the `/info` route on the given endpoint.
      * 

Response Body Schema

- * + * *
{@code
      * {
      *     model_name: String (Required)
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java
index c6d6d643683c..89703b235b53 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java
@@ -26,7 +26,6 @@
 import com.azure.core.util.FluxUtil;
 import java.util.List;
 import reactor.core.publisher.Mono;
-import com.azure.ai.inference.models.ExtraParameters;
 
 /**
  * Initializes a new instance of the asynchronous ImageEmbeddingsClient type.
@@ -61,7 +60,7 @@ public final class ImageEmbeddingsAsyncClient {
      * 
      * You can add these to a request with {@link RequestOptions#addHeader}
      * 

Request Body Schema

- * + * *
{@code
      * {
      *     input (Required): [
@@ -79,9 +78,9 @@ public final class ImageEmbeddingsAsyncClient {
      *     }
      * }
      * }
- * + * *

Response Body Schema

- * + * *
{@code
      * {
      *     data (Required): [
@@ -119,7 +118,7 @@ Mono> embedWithResponse(BinaryData embedRequest1, RequestOp
      * Returns information about the AI model.
      * The method makes a REST API call to the `/info` route on the given endpoint.
      * 

Response Body Schema

- * + * *
{@code
      * {
      *     model_name: String (Required)
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClient.java
index 23249e0d0573..fac96389eedc 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClient.java
@@ -24,7 +24,6 @@
 import com.azure.core.http.rest.Response;
 import com.azure.core.util.BinaryData;
 import java.util.List;
-import com.azure.ai.inference.models.ExtraParameters;
 
 /**
  * Initializes a new instance of the synchronous ImageEmbeddingsClient type.
@@ -59,7 +58,7 @@ public final class ImageEmbeddingsClient {
      * 
      * You can add these to a request with {@link RequestOptions#addHeader}
      * 

Request Body Schema

- * + * *
{@code
      * {
      *     input (Required): [
@@ -77,9 +76,9 @@ public final class ImageEmbeddingsClient {
      *     }
      * }
      * }
- * + * *

Response Body Schema

- * + * *
{@code
      * {
      *     data (Required): [
@@ -116,7 +115,7 @@ Response embedWithResponse(BinaryData embedRequest1, RequestOptions
      * Returns information about the AI model.
      * The method makes a REST API call to the `/info` route on the given endpoint.
      * 

Response Body Schema

- * + * *
{@code
      * {
      *     model_name: String (Required)
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ExtraParameters.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ExtraParameters.java
index 9ef2a50db3a3..721102625576 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ExtraParameters.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ExtraParameters.java
@@ -1,7 +1,6 @@
 // Copyright (c) Microsoft Corporation. All rights reserved.
 // Licensed under the MIT License.
 // Code generated by Microsoft (R) TypeSpec Code Generator.
-
 package com.azure.ai.inference.models;
 
 import com.azure.core.annotation.Generated;
@@ -12,6 +11,7 @@
  * Controls what happens if extra parameters, undefined by the REST API, are passed in the JSON request payload.
  */
 public final class ExtraParameters extends ExpandableStringEnum {
+
     /**
      * The service will error if it detected extra parameters in the request payload. This is the service default.
      */
@@ -33,7 +33,7 @@ public final class ExtraParameters extends ExpandableStringEnum
 
     /**
      * Creates a new instance of ExtraParameters value.
-     * 
+     *
      * @deprecated Use the {@link #fromString(String)} factory method.
      */
     @Generated
@@ -43,7 +43,7 @@ public ExtraParameters() {
 
     /**
      * Creates or finds a ExtraParameters from its string representation.
-     * 
+     *
      * @param name a name to look for.
      * @return the corresponding ExtraParameters.
      */
@@ -54,7 +54,7 @@ public static ExtraParameters fromString(String name) {
 
     /**
      * Gets known ExtraParameters values.
-     * 
+     *
      * @return known ExtraParameters values.
      */
     @Generated

From 096afa218765eb495d39f44fbacf880a8844fb3a Mon Sep 17 00:00:00 2001
From: glenn 
Date: Wed, 28 Aug 2024 14:48:27 -0400
Subject: [PATCH 072/128] sync with typespec

---
 .../azure/ai/inference/ChatCompletionsAsyncClient.java    | 8 ++++----
 .../azure/ai/inference/models/ChatCompletionsOptions.java | 1 -
 .../azure/ai/inference/models/ChatRequestUserMessage.java | 1 +
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java
index f661485e8fd5..f95fcdbb5b6e 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java
@@ -64,7 +64,7 @@ public final class ChatCompletionsAsyncClient {
      * 
      * You can add these to a request with {@link RequestOptions#addHeader}
      * 

Request Body Schema

- * + * *
{@code
      * {
      *     messages (Required): [
@@ -102,9 +102,9 @@ public final class ChatCompletionsAsyncClient {
      *     }
      * }
      * }
- * + * *

Response Body Schema

- * + * *
{@code
      * {
      *     id: String (Required)
@@ -158,7 +158,7 @@ Mono> completeWithResponse(BinaryData completeRequest, Requ
      * Returns information about the AI model.
      * The method makes a REST API call to the `/info` route on the given endpoint.
      * 

Response Body Schema

- * + * *
{@code
      * {
      *     model_name: String (Required)
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsOptions.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsOptions.java
index d4cba40b01a0..c8b39c03502c 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsOptions.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsOptions.java
@@ -4,7 +4,6 @@
 
 package com.azure.ai.inference.models;
 
-import com.azure.ai.inference.models.ExtraParameters;
 import com.azure.core.annotation.Fluent;
 import com.azure.core.annotation.Generated;
 import com.azure.core.util.BinaryData;
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java
index 391c3e615a18..e5a0fb04e938 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java
@@ -111,6 +111,7 @@ public static ChatRequestUserMessage fromJson(JsonReader jsonReader) throws IOEx
      * @param content the content value to set.
      * @return An instance of ChatRequestUserMessage if the JsonReader was pointing to an instance of it, or null if it
      * was pointing to JSON null.
+     * @throws RuntimeException If the deserialized JSON object was missing any required properties.
      */
     public static ChatRequestUserMessage fromString(String content) {
         String jsonPrompt = "{" + "\"content\":\"%s\"" + "}";

From 2d2c8b13d437e4f4bbf79837954a238ad630d73f Mon Sep 17 00:00:00 2001
From: glenn 
Date: Wed, 28 Aug 2024 15:14:57 -0400
Subject: [PATCH 073/128] add lint exception for PagedFlux

---
 .../src/main/resources/checkstyle/checkstyle-suppressions.xml   | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml
index 6a907a19a665..2650b791f334 100644
--- a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml
+++ b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml
@@ -286,6 +286,8 @@ the main ServiceBusClientBuilder. -->
   
   
   
+  
+  
 
   
   
Date: Wed, 28 Aug 2024 15:43:12 -0400
Subject: [PATCH 074/128] lint fixes

---
 .../azure/ai/inference/ChatCompletionsAsyncClientTest.java  | 3 +--
 .../com/azure/ai/inference/EmbeddingsAsyncClientTest.java   | 6 +-----
 .../com/azure/ai/inference/EmbeddingsSyncClientTest.java    | 5 -----
 3 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsAsyncClientTest.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsAsyncClientTest.java
index fcb3ee76621c..3517e9cac3ac 100644
--- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsAsyncClientTest.java
+++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsAsyncClientTest.java
@@ -9,7 +9,6 @@
 import reactor.test.StepVerifier;
 
 import java.util.ArrayList;
-import java.util.concurrent.TimeUnit;
 
 import static com.azure.ai.inference.TestUtils.DISPLAY_NAME_WITH_ARGUMENTS;
 import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -18,7 +17,7 @@
 public class ChatCompletionsAsyncClientTest extends ChatCompletionsClientTestBase {
     private ChatCompletionsAsyncClient client;
 
-    private ChatCompletionsAsyncClient getChatCompletionsAsyncClient (HttpClient httpClient) {
+    private ChatCompletionsAsyncClient getChatCompletionsAsyncClient(HttpClient httpClient) {
         return getChatCompletionsClientBuilder(
             interceptorManager.isPlaybackMode() ? interceptorManager.getPlaybackClient() : httpClient)
             .buildAsyncClient();
diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsAsyncClientTest.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsAsyncClientTest.java
index 840630e62845..7809f49f4f42 100644
--- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsAsyncClientTest.java
+++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsAsyncClientTest.java
@@ -2,22 +2,18 @@
 // Licensed under the MIT License.
 package com.azure.ai.inference;
 
-import com.azure.ai.inference.models.ChatCompletionsOptions;
 import com.azure.core.http.HttpClient;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.MethodSource;
 import reactor.test.StepVerifier;
 
-import java.util.ArrayList;
-
 import static com.azure.ai.inference.TestUtils.DISPLAY_NAME_WITH_ARGUMENTS;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class EmbeddingsAsyncClientTest extends EmbeddingsClientTestBase {
     private EmbeddingsAsyncClient client;
 
-    private EmbeddingsAsyncClient getEmbeddingsAsyncClient (HttpClient httpClient) {
+    private EmbeddingsAsyncClient getEmbeddingsAsyncClient(HttpClient httpClient) {
         return getEmbeddingsClientBuilder(
             interceptorManager.isPlaybackMode() ? interceptorManager.getPlaybackClient() : httpClient)
             .buildAsyncClient();
diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsSyncClientTest.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsSyncClientTest.java
index 0adee5408b10..ff0f1bdf6e01 100644
--- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsSyncClientTest.java
+++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/EmbeddingsSyncClientTest.java
@@ -4,15 +4,10 @@
 
 import com.azure.ai.inference.models.*;
 import com.azure.core.http.HttpClient;
-import com.azure.core.util.IterableStream;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.MethodSource;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import static com.azure.ai.inference.TestUtils.DISPLAY_NAME_WITH_ARGUMENTS;
-import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class EmbeddingsSyncClientTest extends EmbeddingsClientTestBase {
     private EmbeddingsClient client;

From 9eb929166ca1d91939e800d23b8f4b6ae5db76c6 Mon Sep 17 00:00:00 2001
From: Matthew Metcalf 
Date: Tue, 27 Aug 2024 09:58:08 -0700
Subject: [PATCH 075/128] App Config Correlation Context update + yaml hint fix
 (#41607)

* Updating correlation context to use pipeline context

* Fixing yaml hints

* Updating property docs from yaml

* removing unused imports
---
 sdk/ai/test-resources.json | 269 +++++++++++++++++++++++++++++++++++++
 1 file changed, 269 insertions(+)
 create mode 100644 sdk/ai/test-resources.json

diff --git a/sdk/ai/test-resources.json b/sdk/ai/test-resources.json
new file mode 100644
index 000000000000..2f4fe9027cec
--- /dev/null
+++ b/sdk/ai/test-resources.json
@@ -0,0 +1,269 @@
+{
+    "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
+    "contentVersion": "1.0.0.0",
+    "parameters": {
+        "name": {
+            "type": "string"
+        },
+        "location": {
+            "type": "string"
+        },
+        "sku": {
+            "type": "string"
+        },
+        "tagValues": {
+            "type": "object"
+        },
+        "virtualNetworkType": {
+            "type": "string"
+        },
+        "vnet": {
+            "type": "object"
+        },
+        "ipRules": {
+            "type": "array"
+        },
+        "privateEndpoints": {
+            "type": "array"
+        },
+        "privateDnsZone": {
+            "type": "string"
+        },
+        "resourceGroupName": {
+            "type": "string"
+        },
+        "resourceGroupId": {
+            "type": "string"
+        },
+        "uniqueId": {
+            "type": "string",
+            "defaultValue": "[newGuid()]"
+        }
+    },
+    "resources": [
+        {
+            "type": "Microsoft.Resources/deployments",
+            "apiVersion": "2017-05-10",
+            "name": "deployVnet",
+            "properties": {
+                "mode": "Incremental",
+                "template": {
+                    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
+                    "contentVersion": "1.0.0.0",
+                    "parameters": {},
+                    "variables": {},
+                    "resources": [
+                        {
+                            "type": "Microsoft.Network/virtualNetworks",
+                            "apiVersion": "2020-04-01",
+                            "name": "[if(equals(parameters('virtualNetworkType'), 'External'), parameters('vnet').name, variables('defaultVNetName'))]",
+                            "location": "[parameters('location')]",
+                            "properties": {
+                                "addressSpace": {
+                                    "addressPrefixes": "[if(equals(parameters('virtualNetworkType'), 'External'), parameters('vnet').addressPrefixes, json(concat('[{\"', variables('defaultAddressPrefix'),'\"}]')))]"
+                                },
+                                "subnets": [
+                                    {
+                                        "name": "[if(equals(parameters('virtualNetworkType'), 'External'), parameters('vnet').subnets.subnet.name, variables('defaultSubnetName'))]",
+                                        "properties": {
+                                            "serviceEndpoints": [
+                                                {
+                                                    "service": "Microsoft.CognitiveServices",
+                                                    "locations": [
+                                                        "[parameters('location')]"
+                                                    ]
+                                                }
+                                            ],
+                                            "addressPrefix": "[if(equals(parameters('virtualNetworkType'), 'External'), parameters('vnet').subnets.subnet.addressPrefix, variables('defaultAddressPrefix'))]"
+                                        }
+                                    }
+                                ]
+                            }
+                        }
+                    ]
+                },
+                "parameters": {}
+            },
+            "condition": "[and(and(not(empty(parameters('vnet'))), equals(parameters('vnet').newOrExisting, 'new')), equals(parameters('virtualNetworkType'), 'External'))]"
+        },
+        {
+            "apiVersion": "2022-03-01",
+            "name": "[parameters('name')]",
+            "location": "[parameters('location')]",
+            "type": "Microsoft.CognitiveServices/accounts",
+            "kind": "OpenAI",
+            "tags": "[if(contains(parameters('tagValues'), 'Microsoft.CognitiveServices/accounts'), parameters('tagValues')['Microsoft.CognitiveServices/accounts'], json('{}'))]",
+            "sku": {
+                "name": "[parameters('sku')]"
+            },
+            "properties": {
+                "customSubDomainName": "[toLower(parameters('name'))]",
+                "publicNetworkAccess": "[if(equals(parameters('virtualNetworkType'), 'Internal'), 'Disabled', 'Enabled')]",
+                "networkAcls": {
+                    "defaultAction": "[if(equals(parameters('virtualNetworkType'), 'External'), 'Deny', 'Allow')]",
+                    "virtualNetworkRules": "[if(equals(parameters('virtualNetworkType'), 'External'), json(concat('[{\"id\": \"', concat(subscription().id, '/resourceGroups/', parameters('vnet').resourceGroup, '/providers/Microsoft.Network/virtualNetworks/', parameters('vnet').name, '/subnets/', parameters('vnet').subnets.subnet.name), '\"}]')), json('[]'))]",
+                    "ipRules": "[if(or(empty(parameters('ipRules')), empty(parameters('ipRules')[0].value)), json('[]'), parameters('ipRules'))]"
+                }
+            },
+            "dependsOn": [
+                "[concat('Microsoft.Resources/deployments/', 'deployVnet')]"
+            ]
+        },
+        {
+            "apiVersion": "2018-05-01",
+            "name": "[concat('deployPrivateEndpoint-', parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.name)]",
+            "type": "Microsoft.Resources/deployments",
+            "resourceGroup": "[parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.resourceGroup.value.name]",
+            "subscriptionId": "[parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.subscription.subscriptionId]",
+            "dependsOn": [
+                "[concat('Microsoft.CognitiveServices/accounts/', parameters('name'))]"
+            ],
+            "condition": "[equals(parameters('virtualNetworkType'), 'Internal')]",
+            "copy": {
+                "name": "privateendpointscopy",
+                "count": "[length(parameters('privateEndpoints'))]"
+            },
+            "properties": {
+                "mode": "Incremental",
+                "template": {
+                    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
+                    "contentVersion": "1.0.0.0",
+                    "resources": [
+                        {
+                            "location": "[parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.location]",
+                            "name": "[parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.name]",
+                            "type": "Microsoft.Network/privateEndpoints",
+                            "apiVersion": "2021-05-01",
+                            "properties": {
+                                "subnet": {
+                                    "id": "[parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.properties.subnet.id]"
+                                },
+                                "privateLinkServiceConnections": [
+                                    {
+                                        "name": "[parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.name]",
+                                        "properties": {
+                                            "privateLinkServiceId": "[concat(parameters('resourceGroupId'), '/providers/Microsoft.CognitiveServices/accounts/', parameters('name'))]",
+                                            "groupIds": "[parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.properties.privateLinkServiceConnections[0].properties.groupIds]"
+                                        }
+                                    }
+                                ],
+                                "customNetworkInterfaceName": "[concat(parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.name, '-nic')]"
+                            },
+                            "tags": {}
+                        }
+                    ]
+                }
+            }
+        },
+        {
+            "apiVersion": "2018-05-01",
+            "name": "[concat('deployDnsZoneGroup-', parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.name)]",
+            "type": "Microsoft.Resources/deployments",
+            "resourceGroup": "[parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.resourceGroup.value.name]",
+            "subscriptionId": "[parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.subscription.subscriptionId]",
+            "dependsOn": [
+                "[concat('deployPrivateEndpoint-', parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.name)]"
+            ],
+            "condition": "[and(equals(parameters('virtualNetworkType'), 'Internal'), parameters('privateEndpoints')[copyIndex()].privateDnsZoneConfiguration.integrateWithPrivateDnsZone)]",
+            "copy": {
+                "name": "privateendpointdnscopy",
+                "count": "[length(parameters('privateEndpoints'))]"
+            },
+            "properties": {
+                "mode": "Incremental",
+                "template": {
+                    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
+                    "contentVersion": "1.0.0.0",
+                    "resources": [
+                        {
+                            "type": "Microsoft.Network/privateDnsZones",
+                            "apiVersion": "2018-09-01",
+                            "name": "[parameters('privateDnsZone')]",
+                            "location": "global",
+                            "tags": {},
+                            "properties": {}
+                        },
+                        {
+                            "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks",
+                            "apiVersion": "2018-09-01",
+                            "name": "[concat(parameters('privateDnsZone'), '/', replace(uniqueString(parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.properties.subnet.id), '/subnets/default', ''))]",
+                            "location": "global",
+                            "dependsOn": [
+                                "[parameters('privateDnsZone')]"
+                            ],
+                            "properties": {
+                                "virtualNetwork": {
+                                    "id": "[split(parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.properties.subnet.id, '/subnets/')[0]]"
+                                },
+                                "registrationEnabled": false
+                            }
+                        },
+                        {
+                            "apiVersion": "2017-05-10",
+                            "name": "[concat('EndpointDnsRecords-', parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.name)]",
+                            "type": "Microsoft.Resources/deployments",
+                            "dependsOn": [
+                                "[parameters('privateDnsZone')]"
+                            ],
+                            "properties": {
+                                "mode": "Incremental",
+                                "templatelink": {
+                                    "uri": "https://go.microsoft.com/fwlink/?linkid=2264916"
+                                },
+                                "parameters": {
+                                    "privateDnsName": {
+                                        "value": "[parameters('privateDnsZone')]"
+                                    },
+                                    "privateEndpointNicResourceId": {
+                                        "value": "[concat('/subscriptions/', parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.subscription.subscriptionId, '/resourceGroups/', parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.resourceGroup.value.name, '/providers/Microsoft.Network/networkInterfaces/', parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.name, '-nic')]"
+                                    },
+                                    "nicRecordsTemplateUri": {
+                                        "value": "https://go.microsoft.com/fwlink/?linkid=2264719"
+                                    },
+                                    "ipConfigRecordsTemplateUri": {
+                                        "value": "https://go.microsoft.com/fwlink/?linkid=2265018"
+                                    },
+                                    "uniqueId": {
+                                        "value": "[parameters('uniqueId')]"
+                                    },
+                                    "existingRecords": {
+                                        "value": {}
+                                    }
+                                }
+                            }
+                        },
+                        {
+                            "type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups",
+                            "apiVersion": "2020-03-01",
+                            "name": "[concat(parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.name, '/', 'default')]",
+                            "location": "[parameters('location')]",
+                            "dependsOn": [
+                                "[parameters('privateDnsZone')]"
+                            ],
+                            "properties": {
+                                "privateDnsZoneConfigs": [
+                                    {
+                                        "name": "privatelink-cognitiveservices",
+                                        "properties": {
+                                            "privateDnsZoneId": "[concat(parameters('resourceGroupId'), '/providers/Microsoft.Network/privateDnsZones/', parameters('privateDnsZone'))]"
+                                        }
+                                    }
+                                ]
+                            }
+                        }
+                    ]
+                }
+            }
+        }
+    ],
+    "outputs": {
+        "AZURE_CLIENT_SECRET": {
+            "type": "string",
+            "value": "['foo']"
+        },
+        "MODEL_ENDPOINT": {
+          "type": "string",
+          "value": "['https://java-glharper-aoai.openai.azure.com/openai/deployments/gpt-4o/']"
+        }
+    }
+}
\ No newline at end of file

From 0879248587cb01be601faf8a88db6ba66101127b Mon Sep 17 00:00:00 2001
From: Shawn Fang <45607042+mssfang@users.noreply.github.com>
Date: Wed, 28 Aug 2024 09:05:55 -0700
Subject: [PATCH 076/128] [OpenAI-Assistant] Added support for 2024-07-01
 (#41464)

* Added support 2024-07-01 service API version (#41473)
---
 .../azure-ai-openai-assistants/CHANGELOG.md   |  16 ++
 .../azure-ai-openai-assistants/README.md      |   3 +-
 .../azure-ai-openai-assistants/assets.json    |   4 +-
 .../assistants/AssistantsAsyncClient.java     |  59 +++++++
 .../openai/assistants/AssistantsClient.java   |  58 +++++++
 .../assistants/AssistantsServiceVersion.java  |   9 +-
 .../implementation/AssistantsClientImpl.java  |  54 +++++-
 .../CreateVectorStoreFileBatchRequest.java    |  44 ++++-
 .../models/CreateVectorStoreFileRequest.java  |  44 ++++-
 ...eSearchToolResourceVectorStoreOptions.java |  56 ++++--
 .../models/FileSearchToolDefinition.java      |  35 +++-
 .../FileSearchToolDefinitionDetails.java      | 103 +++++++++++
 ...ateCodeInterpreterToolResourceOptions.java |   4 +-
 ...ectorStoreAutoChunkingStrategyRequest.java |  80 +++++++++
 ...ctorStoreAutoChunkingStrategyResponse.java |  81 +++++++++
 .../VectorStoreChunkingStrategyRequest.java   | 110 ++++++++++++
 ...ectorStoreChunkingStrategyRequestType.java |  58 +++++++
 .../VectorStoreChunkingStrategyResponse.java  | 110 ++++++++++++
 ...ctorStoreChunkingStrategyResponseType.java |  58 +++++++
 .../assistants/models/VectorStoreFile.java    |  75 +++++---
 .../assistants/models/VectorStoreOptions.java |  35 ++++
 ...torStoreStaticChunkingStrategyOptions.java | 109 ++++++++++++
 ...torStoreStaticChunkingStrategyRequest.java | 105 ++++++++++++
 ...orStoreStaticChunkingStrategyResponse.java | 105 ++++++++++++
 ...-openai-assistants_apiview_properties.json |  10 ++
 .../assistants/FileSearchToolSample.java      |   3 +-
 .../ai/openai/assistants/ReadmeSamples.java   |   3 +-
 .../assistants/AssistantsClientTestBase.java  |  13 --
 .../assistants/AzureFileSearchAsyncTest.java  | 160 ++++++++++--------
 .../assistants/AzureFileSearchSyncTest.java   |  40 ++++-
 .../assistants/AzureStreamingSyncTest.java    |   1 +
 .../AzureVectorStoreAsyncTests.java           | 159 +++++++++++++----
 .../assistants/AzureVectorStoreSyncTests.java | 121 +++++++++++--
 .../assistants/FileSearchAsyncTest.java       |  36 +++-
 .../openai/assistants/FileSearchSyncTest.java |  36 +++-
 .../openai/assistants/FileSearchTestBase.java |  51 ++++++
 .../assistants/VectorStoreAsyncTests.java     | 131 +++++++++++---
 .../assistants/VectorStoreSyncTests.java      | 119 +++++++++++--
 .../assistants/VectorStoreTestBase.java       |  57 +++++++
 .../tsp-location.yaml                         |   2 +-
 40 files changed, 2114 insertions(+), 243 deletions(-)
 create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FileSearchToolDefinitionDetails.java
 create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreAutoChunkingStrategyRequest.java
 create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreAutoChunkingStrategyResponse.java
 create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreChunkingStrategyRequest.java
 create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreChunkingStrategyRequestType.java
 create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreChunkingStrategyResponse.java
 create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreChunkingStrategyResponseType.java
 create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreStaticChunkingStrategyOptions.java
 create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreStaticChunkingStrategyRequest.java
 create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreStaticChunkingStrategyResponse.java
 create mode 100644 sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/FileSearchTestBase.java
 create mode 100644 sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/VectorStoreTestBase.java

diff --git a/sdk/openai/azure-ai-openai-assistants/CHANGELOG.md b/sdk/openai/azure-ai-openai-assistants/CHANGELOG.md
index 95dc3d85282d..af4ea7a7465a 100644
--- a/sdk/openai/azure-ai-openai-assistants/CHANGELOG.md
+++ b/sdk/openai/azure-ai-openai-assistants/CHANGELOG.md
@@ -4,6 +4,22 @@
 
 ### Features Added
 
+- `file_search` tool definitions now have the ability to configure `max_num_results` via the matching, named inner options object
+   Previously, only a stubbed `{ "type": "file_search" }` was valid. Now, e.g.: `{ "type": "file_search", "file_search": { "max_num_results": 20 } }`
+  - Added a new property `FileSearchToolDefinitionDetails fileSearch` to `FileSearchToolDefinition` model.
+  - Added new class `FileSearchToolDefinitionDetails` to represent the details of a file search tool.
+
+- `chunking_strategy` is added as a new optional property when creating a vector store (either via the vector store creation operation
+  or the helper when creating an assistant) -- this allows customization of the chunk size and overlap used when ingesting data.
+  See the OpenAI reference for full details.
+  - Added a new property `VectorStoreChunkingStrategyRequest chunkingStrategy` to `VectorStoreOptions` model.
+  - Added a new property `VectorStoreChunkingStrategyResponse chunkingStrategy` to `VectorStoreFile` model.
+  - Added new enum `VectorStoreChunkingStrategyRequestType` and `VectorStoreChunkingStrategyResponseType` to represent the chunking strategy `type` for vector stores.
+  - Added new class `VectorStoreChunkingStrategyRequest` and `VectorStoreChunkingStrategyResponse` to represent the chunking strategy for vector stores.
+  - Added new class `VectorStoreAutoChunkingStrategyRequest` and `VectorStoreAutoChunkingStrategyResponse` to represent the `auto` chunking strategy for vector stores.
+  - Added new class `VectorStoreStaticChunkingStrategyOptions`, `VectorStoreStaticChunkingStrategyRequest` and `VectorStoreStaticChunkingStrategyResponse` 
+    to represent the `static` chunking strategy for vector stores.
+
 ### Breaking Changes
 
 ### Bugs Fixed
diff --git a/sdk/openai/azure-ai-openai-assistants/README.md b/sdk/openai/azure-ai-openai-assistants/README.md
index 2167db2e0ed0..b3301c2bef63 100644
--- a/sdk/openai/azure-ai-openai-assistants/README.md
+++ b/sdk/openai/azure-ai-openai-assistants/README.md
@@ -168,7 +168,8 @@ CreateToolResourcesOptions createToolResourcesOptions = new CreateToolResourcesO
 createToolResourcesOptions.setFileSearch(
     new CreateFileSearchToolResourceOptions(
         new CreateFileSearchToolResourceVectorStoreOptionsList(
-            Arrays.asList(new CreateFileSearchToolResourceVectorStoreOptions(Arrays.asList(openAIFile.getId()))))));
+            Arrays.asList(new CreateFileSearchToolResourceVectorStoreOptions(
+                Arrays.asList(openAIFile.getId()))))));
 
 Assistant assistant = client.createAssistant(
     new AssistantCreationOptions(deploymentOrModelId)
diff --git a/sdk/openai/azure-ai-openai-assistants/assets.json b/sdk/openai/azure-ai-openai-assistants/assets.json
index bb5b7fab51bf..7de07bd5a222 100644
--- a/sdk/openai/azure-ai-openai-assistants/assets.json
+++ b/sdk/openai/azure-ai-openai-assistants/assets.json
@@ -2,5 +2,5 @@
   "AssetsRepo" : "Azure/azure-sdk-assets",
   "AssetsRepoPrefixPath" : "java",
   "TagPrefix" : "java/assistants/azure-ai-openai-assistants",
-  "Tag" : "java/assistants/azure-ai-openai-assistants_868e5c86d0"
-}
\ No newline at end of file
+  "Tag" : "java/assistants/azure-ai-openai-assistants_19cb2164a3"
+}
diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsAsyncClient.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsAsyncClient.java
index 872a1f436733..5e1a26b677ed 100644
--- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsAsyncClient.java
+++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsAsyncClient.java
@@ -39,6 +39,7 @@
 import com.azure.ai.openai.assistants.models.UpdateAssistantOptions;
 import com.azure.ai.openai.assistants.models.UpdateAssistantThreadOptions;
 import com.azure.ai.openai.assistants.models.VectorStore;
+import com.azure.ai.openai.assistants.models.VectorStoreChunkingStrategyRequest;
 import com.azure.ai.openai.assistants.models.VectorStoreDeletionStatus;
 import com.azure.ai.openai.assistants.models.VectorStoreFile;
 import com.azure.ai.openai.assistants.models.VectorStoreFileBatch;
@@ -3751,4 +3752,62 @@ public Mono> listVectorStoreFileBatchFiles(String
             .map(vectorStoreFileList -> PageableListAccessHelper.create(vectorStoreFileList.getData(),
                 vectorStoreFileList.getFirstId(), vectorStoreFileList.getLastId(), vectorStoreFileList.isHasMore()));
     }
+
+    /**
+     * Create a vector store file by attaching a file to a vector store.
+     *
+     * @param vectorStoreId The ID of the vector store for which to create a File.
+     * @param fileId A File ID that the vector store should use. Useful for tools like `file_search` that can access
+     * files.
+     * @param chunkingStrategy The chunking strategy used to chunk the file(s). If not set, will use the auto strategy.
+     * @throws IllegalArgumentException thrown if parameters fail the validation.
+     * @throws HttpResponseException thrown if the request is rejected by server.
+     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+     * @return description of a file attached to a vector store on successful completion of {@link Mono}.
+     */
+    @Generated
+    @ServiceMethod(returns = ReturnType.SINGLE)
+    public Mono createVectorStoreFile(String vectorStoreId, String fileId,
+        VectorStoreChunkingStrategyRequest chunkingStrategy) {
+        // Generated convenience method for createVectorStoreFileWithResponse
+        RequestOptions requestOptions = new RequestOptions();
+        CreateVectorStoreFileRequest createVectorStoreFileRequestObj
+            = new CreateVectorStoreFileRequest(fileId).setChunkingStrategy(chunkingStrategy);
+        BinaryData createVectorStoreFileRequest = BinaryData.fromObject(createVectorStoreFileRequestObj);
+        return createVectorStoreFileWithResponse(vectorStoreId, createVectorStoreFileRequest, requestOptions)
+            .flatMap(FluxUtil::toMono)
+            .map(protocolMethodData -> protocolMethodData.toObject(VectorStoreFile.class));
+    }
+
+    /**
+     * Create a vector store file batch.
+     *
+     * @param vectorStoreId The ID of the vector store for which to create a File Batch.
+     * @param fileIds A list of File IDs that the vector store should use. Useful for tools like `file_search` that can
+     * access files.
+     * @param chunkingStrategy The chunking strategy used to chunk the file(s). If not set, will use the auto strategy.
+     * @throws IllegalArgumentException thrown if parameters fail the validation.
+     * @throws HttpResponseException thrown if the request is rejected by server.
+     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+     * @return a batch of files attached to a vector store on successful completion of {@link Mono}.
+     */
+    @Generated
+    @ServiceMethod(returns = ReturnType.SINGLE)
+    public Mono createVectorStoreFileBatch(String vectorStoreId, List fileIds,
+        VectorStoreChunkingStrategyRequest chunkingStrategy) {
+        // Generated convenience method for createVectorStoreFileBatchWithResponse
+        RequestOptions requestOptions = new RequestOptions();
+        CreateVectorStoreFileBatchRequest createVectorStoreFileBatchRequestObj
+            = new CreateVectorStoreFileBatchRequest(fileIds).setChunkingStrategy(chunkingStrategy);
+        BinaryData createVectorStoreFileBatchRequest = BinaryData.fromObject(createVectorStoreFileBatchRequestObj);
+        return createVectorStoreFileBatchWithResponse(vectorStoreId, createVectorStoreFileBatchRequest, requestOptions)
+            .flatMap(FluxUtil::toMono)
+            .map(protocolMethodData -> protocolMethodData.toObject(VectorStoreFileBatch.class));
+    }
 }
diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsClient.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsClient.java
index 7b8f04ed9f74..b7f1ab2fd9fe 100644
--- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsClient.java
+++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsClient.java
@@ -39,6 +39,7 @@
 import com.azure.ai.openai.assistants.models.UpdateAssistantOptions;
 import com.azure.ai.openai.assistants.models.UpdateAssistantThreadOptions;
 import com.azure.ai.openai.assistants.models.VectorStore;
+import com.azure.ai.openai.assistants.models.VectorStoreChunkingStrategyRequest;
 import com.azure.ai.openai.assistants.models.VectorStoreDeletionStatus;
 import com.azure.ai.openai.assistants.models.VectorStoreFile;
 import com.azure.ai.openai.assistants.models.VectorStoreFileBatch;
@@ -3765,4 +3766,61 @@ public PageableList listVectorStoreFileBatchFiles(String vector
         return PageableListAccessHelper.create(vectorStoreFileList.getData(), vectorStoreFileList.getFirstId(),
             vectorStoreFileList.getLastId(), vectorStoreFileList.isHasMore());
     }
+
+    /**
+     * Create a vector store file by attaching a file to a vector store.
+     *
+     * @param vectorStoreId The ID of the vector store for which to create a File.
+     * @param fileId A File ID that the vector store should use. Useful for tools like `file_search` that can access
+     * files.
+     * @param chunkingStrategy The chunking strategy used to chunk the file(s). If not set, will use the auto strategy.
+     * @throws IllegalArgumentException thrown if parameters fail the validation.
+     * @throws HttpResponseException thrown if the request is rejected by server.
+     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+     * @return description of a file attached to a vector store.
+     */
+    @Generated
+    @ServiceMethod(returns = ReturnType.SINGLE)
+    public VectorStoreFile createVectorStoreFile(String vectorStoreId, String fileId,
+        VectorStoreChunkingStrategyRequest chunkingStrategy) {
+        // Generated convenience method for createVectorStoreFileWithResponse
+        RequestOptions requestOptions = new RequestOptions();
+        CreateVectorStoreFileRequest createVectorStoreFileRequestObj
+            = new CreateVectorStoreFileRequest(fileId).setChunkingStrategy(chunkingStrategy);
+        BinaryData createVectorStoreFileRequest = BinaryData.fromObject(createVectorStoreFileRequestObj);
+        return createVectorStoreFileWithResponse(vectorStoreId, createVectorStoreFileRequest, requestOptions).getValue()
+            .toObject(VectorStoreFile.class);
+    }
+
+    /**
+     * Create a vector store file batch.
+     *
+     * @param vectorStoreId The ID of the vector store for which to create a File Batch.
+     * @param fileIds A list of File IDs that the vector store should use. Useful for tools like `file_search` that can
+     * access files.
+     * @param chunkingStrategy The chunking strategy used to chunk the file(s). If not set, will use the auto strategy.
+     * @throws IllegalArgumentException thrown if parameters fail the validation.
+     * @throws HttpResponseException thrown if the request is rejected by server.
+     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+     * @return a batch of files attached to a vector store.
+     */
+    @Generated
+    @ServiceMethod(returns = ReturnType.SINGLE)
+    public VectorStoreFileBatch createVectorStoreFileBatch(String vectorStoreId, List fileIds,
+        VectorStoreChunkingStrategyRequest chunkingStrategy) {
+        // Generated convenience method for createVectorStoreFileBatchWithResponse
+        RequestOptions requestOptions = new RequestOptions();
+        CreateVectorStoreFileBatchRequest createVectorStoreFileBatchRequestObj
+            = new CreateVectorStoreFileBatchRequest(fileIds).setChunkingStrategy(chunkingStrategy);
+        BinaryData createVectorStoreFileBatchRequest = BinaryData.fromObject(createVectorStoreFileBatchRequestObj);
+        return createVectorStoreFileBatchWithResponse(vectorStoreId, createVectorStoreFileBatchRequest, requestOptions)
+            .getValue()
+            .toObject(VectorStoreFileBatch.class);
+    }
 }
diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsServiceVersion.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsServiceVersion.java
index a715a01de4e4..9e9fadb08ff1 100644
--- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsServiceVersion.java
+++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsServiceVersion.java
@@ -18,7 +18,12 @@ public enum AssistantsServiceVersion implements ServiceVersion {
     /**
      * Enum value 2024-05-01-preview.
      */
-    V2024_05_01_PREVIEW("2024-05-01-preview");
+    V2024_05_01_PREVIEW("2024-05-01-preview"),
+
+    /**
+     * Enum value 2024-07-01-preview.
+     */
+    V2024_07_01_PREVIEW("2024-07-01-preview");
 
     private final String version;
 
@@ -40,6 +45,6 @@ public String getVersion() {
      * @return The latest {@link AssistantsServiceVersion}.
      */
     public static AssistantsServiceVersion getLatest() {
-        return V2024_05_01_PREVIEW;
+        return V2024_07_01_PREVIEW;
     }
 }
diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/AssistantsClientImpl.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/AssistantsClientImpl.java
index 2574bcdd978c..d1e2ade5c274 100644
--- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/AssistantsClientImpl.java
+++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/AssistantsClientImpl.java
@@ -1437,7 +1437,7 @@ public Response getAssistantWithResponse(String assistantId, Request
      *     ]
      *     tool_resources (Optional): {
      *         code_interpreter (Optional): {
-     *             fileIds (Optional): [
+     *             file_ids (Optional): [
      *                 String (Optional)
      *             ]
      *         }
@@ -1529,7 +1529,7 @@ public Mono> updateAssistantWithResponseAsync(String assist
      *     ]
      *     tool_resources (Optional): {
      *         code_interpreter (Optional): {
-     *             fileIds (Optional): [
+     *             file_ids (Optional): [
      *                 String (Optional)
      *             ]
      *         }
@@ -1909,7 +1909,7 @@ public Response getThreadWithResponse(String threadId, RequestOption
      * {
      *     tool_resources (Optional): {
      *         code_interpreter (Optional): {
-     *             fileIds (Optional): [
+     *             file_ids (Optional): [
      *                 String (Optional)
      *             ]
      *         }
@@ -1977,7 +1977,7 @@ public Mono> updateThreadWithResponseAsync(String threadId,
      * {
      *     tool_resources (Optional): {
      *         code_interpreter (Optional): {
-     *             fileIds (Optional): [
+     *             file_ids (Optional): [
      *                 String (Optional)
      *             ]
      *         }
@@ -3767,7 +3767,7 @@ public Response cancelRunWithResponse(String threadId, String runId,
      *     ]
      *     tool_resources (Optional): {
      *         code_interpreter (Optional): {
-     *             fileIds (Optional): [
+     *             file_ids (Optional): [
      *                 String (Optional)
      *             ]
      *         }
@@ -3909,7 +3909,7 @@ public Mono> createThreadAndRunWithResponseAsync(BinaryData
      *     ]
      *     tool_resources (Optional): {
      *         code_interpreter (Optional): {
-     *             fileIds (Optional): [
+     *             file_ids (Optional): [
      *                 String (Optional)
      *             ]
      *         }
@@ -4740,6 +4740,9 @@ public Response listVectorStoresWithResponse(RequestOptions requestO
      *         anchor: String(last_active_at) (Required)
      *         days: int (Required)
      *     }
+     *     chunking_strategy (Optional): {
+     *         type: String(auto/static) (Required)
+     *     }
      *     metadata (Optional): {
      *         String: String (Required)
      *     }
@@ -4807,6 +4810,9 @@ public Mono> createVectorStoreWithResponseAsync(BinaryData
      *         anchor: String(last_active_at) (Required)
      *         days: int (Required)
      *     }
+     *     chunking_strategy (Optional): {
+     *         type: String(auto/static) (Required)
+     *     }
      *     metadata (Optional): {
      *         String: String (Required)
      *     }
@@ -5177,6 +5183,9 @@ public Response deleteVectorStoreWithResponse(String vectorStoreId,
      *                 code: String(internal_error/file_not_found/parsing_error/unhandled_mime_type) (Required)
      *                 message: String (Required)
      *             }
+     *             chunking_strategy (Required): {
+     *                 type: String(other/static) (Required)
+     *             }
      *         }
      *     ]
      *     first_id: String (Required)
@@ -5240,6 +5249,9 @@ public Mono> listVectorStoreFilesWithResponseAsync(String v
      *                 code: String(internal_error/file_not_found/parsing_error/unhandled_mime_type) (Required)
      *                 message: String (Required)
      *             }
+     *             chunking_strategy (Required): {
+     *                 type: String(other/static) (Required)
+     *             }
      *         }
      *     ]
      *     first_id: String (Required)
@@ -5270,6 +5282,9 @@ public Response listVectorStoreFilesWithResponse(String vectorStoreI
      * 
{@code
      * {
      *     file_id: String (Required)
+     *     chunking_strategy (Optional): {
+     *         type: String(auto/static) (Required)
+     *     }
      * }
      * }
* @@ -5287,6 +5302,9 @@ public Response listVectorStoreFilesWithResponse(String vectorStoreI * code: String(internal_error/file_not_found/parsing_error/unhandled_mime_type) (Required) * message: String (Required) * } + * chunking_strategy (Required): { + * type: String(other/static) (Required) + * } * } * }
* @@ -5316,6 +5334,9 @@ public Mono> createVectorStoreFileWithResponseAsync(String *
{@code
      * {
      *     file_id: String (Required)
+     *     chunking_strategy (Optional): {
+     *         type: String(auto/static) (Required)
+     *     }
      * }
      * }
* @@ -5333,6 +5354,9 @@ public Mono> createVectorStoreFileWithResponseAsync(String * code: String(internal_error/file_not_found/parsing_error/unhandled_mime_type) (Required) * message: String (Required) * } + * chunking_strategy (Required): { + * type: String(other/static) (Required) + * } * } * }
* @@ -5370,6 +5394,9 @@ public Response createVectorStoreFileWithResponse(String vectorStore * code: String(internal_error/file_not_found/parsing_error/unhandled_mime_type) (Required) * message: String (Required) * } + * chunking_strategy (Required): { + * type: String(other/static) (Required) + * } * } * }
* @@ -5407,6 +5434,9 @@ public Mono> getVectorStoreFileWithResponseAsync(String vec * code: String(internal_error/file_not_found/parsing_error/unhandled_mime_type) (Required) * message: String (Required) * } + * chunking_strategy (Required): { + * type: String(other/static) (Required) + * } * } * }
* @@ -5499,6 +5529,9 @@ public Response deleteVectorStoreFileWithResponse(String vectorStore * file_ids (Required): [ * String (Required) * ] + * chunking_strategy (Optional): { + * type: String(auto/static) (Required) + * } * } * }
* @@ -5549,6 +5582,9 @@ public Mono> createVectorStoreFileBatchWithResponseAsync(St * file_ids (Required): [ * String (Required) * ] + * chunking_strategy (Optional): { + * type: String(auto/static) (Required) + * } * } * }
* @@ -5783,6 +5819,9 @@ public Response cancelVectorStoreFileBatchWithResponse(String vector * code: String(internal_error/file_not_found/parsing_error/unhandled_mime_type) (Required) * message: String (Required) * } + * chunking_strategy (Required): { + * type: String(other/static) (Required) + * } * } * ] * first_id: String (Required) @@ -5847,6 +5886,9 @@ public Mono> listVectorStoreFileBatchFilesWithResponseAsync * code: String(internal_error/file_not_found/parsing_error/unhandled_mime_type) (Required) * message: String (Required) * } + * chunking_strategy (Required): { + * type: String(other/static) (Required) + * } * } * ] * first_id: String (Required) diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/models/CreateVectorStoreFileBatchRequest.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/models/CreateVectorStoreFileBatchRequest.java index ef39d1f4bd26..129ffd6a0013 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/models/CreateVectorStoreFileBatchRequest.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/models/CreateVectorStoreFileBatchRequest.java @@ -3,8 +3,9 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.openai.assistants.implementation.models; +import com.azure.ai.openai.assistants.models.VectorStoreChunkingStrategyRequest; +import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +16,7 @@ /** * The CreateVectorStoreFileBatchRequest model. */ -@Immutable +@Fluent public final class CreateVectorStoreFileBatchRequest implements JsonSerializable { /* @@ -53,6 +54,7 @@ public List getFileIds() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("file_ids", this.fileIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("chunking_strategy", this.chunkingStrategy); return jsonWriter.writeEndObject(); } @@ -69,16 +71,52 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { public static CreateVectorStoreFileBatchRequest fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { List fileIds = null; + VectorStoreChunkingStrategyRequest chunkingStrategy = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("file_ids".equals(fieldName)) { fileIds = reader.readArray(reader1 -> reader1.getString()); + } else if ("chunking_strategy".equals(fieldName)) { + chunkingStrategy = VectorStoreChunkingStrategyRequest.fromJson(reader); } else { reader.skipChildren(); } } - return new CreateVectorStoreFileBatchRequest(fileIds); + CreateVectorStoreFileBatchRequest deserializedCreateVectorStoreFileBatchRequest + = new CreateVectorStoreFileBatchRequest(fileIds); + deserializedCreateVectorStoreFileBatchRequest.chunkingStrategy = chunkingStrategy; + return deserializedCreateVectorStoreFileBatchRequest; }); } + + /* + * The chunking strategy used to chunk the file(s). If not set, will use the auto strategy. + */ + @Generated + private VectorStoreChunkingStrategyRequest chunkingStrategy; + + /** + * Get the chunkingStrategy property: The chunking strategy used to chunk the file(s). If not set, will use the auto + * strategy. + * + * @return the chunkingStrategy value. + */ + @Generated + public VectorStoreChunkingStrategyRequest getChunkingStrategy() { + return this.chunkingStrategy; + } + + /** + * Set the chunkingStrategy property: The chunking strategy used to chunk the file(s). If not set, will use the auto + * strategy. + * + * @param chunkingStrategy the chunkingStrategy value to set. + * @return the CreateVectorStoreFileBatchRequest object itself. + */ + @Generated + public CreateVectorStoreFileBatchRequest setChunkingStrategy(VectorStoreChunkingStrategyRequest chunkingStrategy) { + this.chunkingStrategy = chunkingStrategy; + return this; + } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/models/CreateVectorStoreFileRequest.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/models/CreateVectorStoreFileRequest.java index 1ce2d4c1a4c7..895c186508a4 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/models/CreateVectorStoreFileRequest.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/models/CreateVectorStoreFileRequest.java @@ -3,8 +3,9 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.openai.assistants.implementation.models; +import com.azure.ai.openai.assistants.models.VectorStoreChunkingStrategyRequest; +import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +15,7 @@ /** * The CreateVectorStoreFileRequest model. */ -@Immutable +@Fluent public final class CreateVectorStoreFileRequest implements JsonSerializable { /* @@ -52,6 +53,7 @@ public String getFileId() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("file_id", this.fileId); + jsonWriter.writeJsonField("chunking_strategy", this.chunkingStrategy); return jsonWriter.writeEndObject(); } @@ -68,16 +70,52 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { public static CreateVectorStoreFileRequest fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String fileId = null; + VectorStoreChunkingStrategyRequest chunkingStrategy = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("file_id".equals(fieldName)) { fileId = reader.getString(); + } else if ("chunking_strategy".equals(fieldName)) { + chunkingStrategy = VectorStoreChunkingStrategyRequest.fromJson(reader); } else { reader.skipChildren(); } } - return new CreateVectorStoreFileRequest(fileId); + CreateVectorStoreFileRequest deserializedCreateVectorStoreFileRequest + = new CreateVectorStoreFileRequest(fileId); + deserializedCreateVectorStoreFileRequest.chunkingStrategy = chunkingStrategy; + return deserializedCreateVectorStoreFileRequest; }); } + + /* + * The chunking strategy used to chunk the file(s). If not set, will use the auto strategy. + */ + @Generated + private VectorStoreChunkingStrategyRequest chunkingStrategy; + + /** + * Get the chunkingStrategy property: The chunking strategy used to chunk the file(s). If not set, will use the auto + * strategy. + * + * @return the chunkingStrategy value. + */ + @Generated + public VectorStoreChunkingStrategyRequest getChunkingStrategy() { + return this.chunkingStrategy; + } + + /** + * Set the chunkingStrategy property: The chunking strategy used to chunk the file(s). If not set, will use the auto + * strategy. + * + * @param chunkingStrategy the chunkingStrategy value to set. + * @return the CreateVectorStoreFileRequest object itself. + */ + @Generated + public CreateVectorStoreFileRequest setChunkingStrategy(VectorStoreChunkingStrategyRequest chunkingStrategy) { + this.chunkingStrategy = chunkingStrategy; + return this; + } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateFileSearchToolResourceVectorStoreOptions.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateFileSearchToolResourceVectorStoreOptions.java index 164d842b2109..df7e514a8323 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateFileSearchToolResourceVectorStoreOptions.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateFileSearchToolResourceVectorStoreOptions.java @@ -34,16 +34,6 @@ public final class CreateFileSearchToolResourceVectorStoreOptions @Generated private Map metadata; - /** - * Creates an instance of CreateFileSearchToolResourceVectorStoreOptions class. - * - * @param fileIds the fileIds value to set. - */ - @Generated - public CreateFileSearchToolResourceVectorStoreOptions(List fileIds) { - this.fileIds = fileIds; - } - /** * Get the fileIds property: A list of file IDs to add to the vector store. There can be a maximum of 10000 files in * a vector store. @@ -89,6 +79,7 @@ public CreateFileSearchToolResourceVectorStoreOptions setMetadata(Map writer.writeString(element)); + jsonWriter.writeJsonField("chunking_strategy", this.chunkingStrategy); jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -106,12 +97,15 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { public static CreateFileSearchToolResourceVectorStoreOptions fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { List fileIds = null; + VectorStoreChunkingStrategyRequest chunkingStrategy = null; Map metadata = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("file_ids".equals(fieldName)) { fileIds = reader.readArray(reader1 -> reader1.getString()); + } else if ("chunking_strategy".equals(fieldName)) { + chunkingStrategy = VectorStoreChunkingStrategyRequest.fromJson(reader); } else if ("metadata".equals(fieldName)) { metadata = reader.readMap(reader1 -> reader1.getString()); } else { @@ -119,9 +113,49 @@ public static CreateFileSearchToolResourceVectorStoreOptions fromJson(JsonReader } } CreateFileSearchToolResourceVectorStoreOptions deserializedCreateFileSearchToolResourceVectorStoreOptions - = new CreateFileSearchToolResourceVectorStoreOptions(fileIds); + = new CreateFileSearchToolResourceVectorStoreOptions(fileIds, chunkingStrategy); deserializedCreateFileSearchToolResourceVectorStoreOptions.metadata = metadata; return deserializedCreateFileSearchToolResourceVectorStoreOptions; }); } + + /* + * The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. + */ + @Generated + private final VectorStoreChunkingStrategyRequest chunkingStrategy; + + /** + * Creates an instance of CreateFileSearchToolResourceVectorStoreOptions class. + * + * @param fileIds the fileIds value to set. + */ + public CreateFileSearchToolResourceVectorStoreOptions(List fileIds) { + this.fileIds = fileIds; + this.chunkingStrategy = null; + } + + /** + * Creates an instance of CreateFileSearchToolResourceVectorStoreOptions class. + * + * @param fileIds the fileIds value to set. + * @param chunkingStrategy the chunkingStrategy value to set. + */ + @Generated + public CreateFileSearchToolResourceVectorStoreOptions(List fileIds, + VectorStoreChunkingStrategyRequest chunkingStrategy) { + this.fileIds = fileIds; + this.chunkingStrategy = chunkingStrategy; + } + + /** + * Get the chunkingStrategy property: The chunking strategy used to chunk the file(s). If not set, will use the + * `auto` strategy. + * + * @return the chunkingStrategy value. + */ + @Generated + public VectorStoreChunkingStrategyRequest getChunkingStrategy() { + return this.chunkingStrategy; + } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FileSearchToolDefinition.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FileSearchToolDefinition.java index ce59229776ca..8a4833151fe6 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FileSearchToolDefinition.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FileSearchToolDefinition.java @@ -3,8 +3,8 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.openai.assistants.models; +import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -13,7 +13,7 @@ /** * The input definition information for a file search tool as used to configure an assistant. */ -@Immutable +@Fluent public final class FileSearchToolDefinition extends ToolDefinition { /* @@ -48,6 +48,7 @@ public String getType() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("type", this.type); + jsonWriter.writeJsonField("file_search", this.fileSearch); return jsonWriter.writeEndObject(); } @@ -68,6 +69,8 @@ public static FileSearchToolDefinition fromJson(JsonReader jsonReader) throws IO reader.nextToken(); if ("type".equals(fieldName)) { deserializedFileSearchToolDefinition.type = reader.getString(); + } else if ("file_search".equals(fieldName)) { + deserializedFileSearchToolDefinition.fileSearch = FileSearchToolDefinitionDetails.fromJson(reader); } else { reader.skipChildren(); } @@ -75,4 +78,32 @@ public static FileSearchToolDefinition fromJson(JsonReader jsonReader) throws IO return deserializedFileSearchToolDefinition; }); } + + /* + * Options overrides for the file search tool. + */ + @Generated + private FileSearchToolDefinitionDetails fileSearch; + + /** + * Get the fileSearch property: Options overrides for the file search tool. + * + * @return the fileSearch value. + */ + @Generated + public FileSearchToolDefinitionDetails getFileSearch() { + return this.fileSearch; + } + + /** + * Set the fileSearch property: Options overrides for the file search tool. + * + * @param fileSearch the fileSearch value to set. + * @return the FileSearchToolDefinition object itself. + */ + @Generated + public FileSearchToolDefinition setFileSearch(FileSearchToolDefinitionDetails fileSearch) { + this.fileSearch = fileSearch; + return this; + } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FileSearchToolDefinitionDetails.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FileSearchToolDefinitionDetails.java new file mode 100644 index 000000000000..5210d26ab7c1 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FileSearchToolDefinitionDetails.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Options overrides for the file search tool. + */ +@Fluent +public final class FileSearchToolDefinitionDetails implements JsonSerializable { + + /* + * The maximum number of results the file search tool should output. The default is 20 for gpt-4* models and 5 for + * gpt-3.5-turbo. This number should be between 1 and 50 inclusive. + * + * Note that the file search tool may output fewer than `max_num_results` results. See the file search tool + * documentation for more information. + */ + @Generated + private Integer maxNumResults; + + /** + * Creates an instance of FileSearchToolDefinitionDetails class. + */ + @Generated + public FileSearchToolDefinitionDetails() { + } + + /** + * Get the maxNumResults property: The maximum number of results the file search tool should output. The default is + * 20 for gpt-4* models and 5 for gpt-3.5-turbo. This number should be between 1 and 50 inclusive. + * + * Note that the file search tool may output fewer than `max_num_results` results. See the file search tool + * documentation for more information. + * + * @return the maxNumResults value. + */ + @Generated + public Integer getMaxNumResults() { + return this.maxNumResults; + } + + /** + * Set the maxNumResults property: The maximum number of results the file search tool should output. The default is + * 20 for gpt-4* models and 5 for gpt-3.5-turbo. This number should be between 1 and 50 inclusive. + * + * Note that the file search tool may output fewer than `max_num_results` results. See the file search tool + * documentation for more information. + * + * @param maxNumResults the maxNumResults value to set. + * @return the FileSearchToolDefinitionDetails object itself. + */ + @Generated + public FileSearchToolDefinitionDetails setMaxNumResults(Integer maxNumResults) { + this.maxNumResults = maxNumResults; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("max_num_results", this.maxNumResults); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileSearchToolDefinitionDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileSearchToolDefinitionDetails if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FileSearchToolDefinitionDetails. + */ + @Generated + public static FileSearchToolDefinitionDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileSearchToolDefinitionDetails deserializedFileSearchToolDefinitionDetails + = new FileSearchToolDefinitionDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("max_num_results".equals(fieldName)) { + deserializedFileSearchToolDefinitionDetails.maxNumResults = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + return deserializedFileSearchToolDefinitionDetails; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/UpdateCodeInterpreterToolResourceOptions.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/UpdateCodeInterpreterToolResourceOptions.java index 14ec574ec84c..9ace038ac79d 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/UpdateCodeInterpreterToolResourceOptions.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/UpdateCodeInterpreterToolResourceOptions.java @@ -61,7 +61,7 @@ public UpdateCodeInterpreterToolResourceOptions setFileIds(List fileIds) @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("fileIds", this.fileIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("file_ids", this.fileIds, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -81,7 +81,7 @@ public static UpdateCodeInterpreterToolResourceOptions fromJson(JsonReader jsonR while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("fileIds".equals(fieldName)) { + if ("file_ids".equals(fieldName)) { List fileIds = reader.readArray(reader1 -> reader1.getString()); deserializedUpdateCodeInterpreterToolResourceOptions.fileIds = fileIds; } else { diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreAutoChunkingStrategyRequest.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreAutoChunkingStrategyRequest.java new file mode 100644 index 000000000000..84522040310e --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreAutoChunkingStrategyRequest.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The default strategy. This strategy currently uses a max_chunk_size_tokens of 800 and chunk_overlap_tokens of 400. + */ +@Immutable +public final class VectorStoreAutoChunkingStrategyRequest extends VectorStoreChunkingStrategyRequest { + + /* + * The object type. + */ + @Generated + private VectorStoreChunkingStrategyRequestType type = VectorStoreChunkingStrategyRequestType.AUTO; + + /** + * Creates an instance of VectorStoreAutoChunkingStrategyRequest class. + */ + @Generated + public VectorStoreAutoChunkingStrategyRequest() { + } + + /** + * Get the type property: The object type. + * + * @return the type value. + */ + @Generated + @Override + public VectorStoreChunkingStrategyRequestType getType() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VectorStoreAutoChunkingStrategyRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VectorStoreAutoChunkingStrategyRequest if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VectorStoreAutoChunkingStrategyRequest. + */ + @Generated + public static VectorStoreAutoChunkingStrategyRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VectorStoreAutoChunkingStrategyRequest deserializedVectorStoreAutoChunkingStrategyRequest + = new VectorStoreAutoChunkingStrategyRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("type".equals(fieldName)) { + deserializedVectorStoreAutoChunkingStrategyRequest.type + = VectorStoreChunkingStrategyRequestType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return deserializedVectorStoreAutoChunkingStrategyRequest; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreAutoChunkingStrategyResponse.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreAutoChunkingStrategyResponse.java new file mode 100644 index 000000000000..73e65c62979f --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreAutoChunkingStrategyResponse.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * This is returned when the chunking strategy is unknown. Typically, this is because the file was indexed before the + * chunking_strategy concept was introduced in the API. + */ +@Immutable +public final class VectorStoreAutoChunkingStrategyResponse extends VectorStoreChunkingStrategyResponse { + + /* + * The object type. + */ + @Generated + private VectorStoreChunkingStrategyResponseType type = VectorStoreChunkingStrategyResponseType.OTHER; + + /** + * Creates an instance of VectorStoreAutoChunkingStrategyResponse class. + */ + @Generated + private VectorStoreAutoChunkingStrategyResponse() { + } + + /** + * Get the type property: The object type. + * + * @return the type value. + */ + @Generated + @Override + public VectorStoreChunkingStrategyResponseType getType() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VectorStoreAutoChunkingStrategyResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VectorStoreAutoChunkingStrategyResponse if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VectorStoreAutoChunkingStrategyResponse. + */ + @Generated + public static VectorStoreAutoChunkingStrategyResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VectorStoreAutoChunkingStrategyResponse deserializedVectorStoreAutoChunkingStrategyResponse + = new VectorStoreAutoChunkingStrategyResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("type".equals(fieldName)) { + deserializedVectorStoreAutoChunkingStrategyResponse.type + = VectorStoreChunkingStrategyResponseType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return deserializedVectorStoreAutoChunkingStrategyResponse; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreChunkingStrategyRequest.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreChunkingStrategyRequest.java new file mode 100644 index 000000000000..b8f2ce389b63 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreChunkingStrategyRequest.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An abstract representation of a vector store chunking strategy configuration. + */ +@Immutable +public class VectorStoreChunkingStrategyRequest implements JsonSerializable { + + /* + * The object type. + */ + @Generated + private VectorStoreChunkingStrategyRequestType type + = VectorStoreChunkingStrategyRequestType.fromString("VectorStoreChunkingStrategyRequest"); + + /** + * Creates an instance of VectorStoreChunkingStrategyRequest class. + */ + @Generated + public VectorStoreChunkingStrategyRequest() { + } + + /** + * Get the type property: The object type. + * + * @return the type value. + */ + @Generated + public VectorStoreChunkingStrategyRequestType getType() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VectorStoreChunkingStrategyRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VectorStoreChunkingStrategyRequest if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VectorStoreChunkingStrategyRequest. + */ + @Generated + public static VectorStoreChunkingStrategyRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + // Prepare for reading + readerToUse.nextToken(); + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("type".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("auto".equals(discriminatorValue)) { + return VectorStoreAutoChunkingStrategyRequest.fromJson(readerToUse.reset()); + } else if ("static".equals(discriminatorValue)) { + return VectorStoreStaticChunkingStrategyRequest.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static VectorStoreChunkingStrategyRequest fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VectorStoreChunkingStrategyRequest deserializedVectorStoreChunkingStrategyRequest + = new VectorStoreChunkingStrategyRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("type".equals(fieldName)) { + deserializedVectorStoreChunkingStrategyRequest.type + = VectorStoreChunkingStrategyRequestType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return deserializedVectorStoreChunkingStrategyRequest; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreChunkingStrategyRequestType.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreChunkingStrategyRequestType.java new file mode 100644 index 000000000000..e88ccc2cb1cc --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreChunkingStrategyRequestType.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of chunking strategy. + */ +public final class VectorStoreChunkingStrategyRequestType + extends ExpandableStringEnum { + + /** + * Static value auto for VectorStoreChunkingStrategyRequestType. + */ + @Generated + public static final VectorStoreChunkingStrategyRequestType AUTO = fromString("auto"); + + /** + * Static value static for VectorStoreChunkingStrategyRequestType. + */ + @Generated + public static final VectorStoreChunkingStrategyRequestType STATIC = fromString("static"); + + /** + * Creates a new instance of VectorStoreChunkingStrategyRequestType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public VectorStoreChunkingStrategyRequestType() { + } + + /** + * Creates or finds a VectorStoreChunkingStrategyRequestType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VectorStoreChunkingStrategyRequestType. + */ + @Generated + public static VectorStoreChunkingStrategyRequestType fromString(String name) { + return fromString(name, VectorStoreChunkingStrategyRequestType.class); + } + + /** + * Gets known VectorStoreChunkingStrategyRequestType values. + * + * @return known VectorStoreChunkingStrategyRequestType values. + */ + @Generated + public static Collection values() { + return values(VectorStoreChunkingStrategyRequestType.class); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreChunkingStrategyResponse.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreChunkingStrategyResponse.java new file mode 100644 index 000000000000..005650ac2275 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreChunkingStrategyResponse.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An abstract representation of a vector store chunking strategy configuration. + */ +@Immutable +public class VectorStoreChunkingStrategyResponse implements JsonSerializable { + + /* + * The object type. + */ + @Generated + private VectorStoreChunkingStrategyResponseType type + = VectorStoreChunkingStrategyResponseType.fromString("VectorStoreChunkingStrategyResponse"); + + /** + * Creates an instance of VectorStoreChunkingStrategyResponse class. + */ + @Generated + protected VectorStoreChunkingStrategyResponse() { + } + + /** + * Get the type property: The object type. + * + * @return the type value. + */ + @Generated + public VectorStoreChunkingStrategyResponseType getType() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VectorStoreChunkingStrategyResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VectorStoreChunkingStrategyResponse if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VectorStoreChunkingStrategyResponse. + */ + @Generated + public static VectorStoreChunkingStrategyResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + // Prepare for reading + readerToUse.nextToken(); + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("type".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("other".equals(discriminatorValue)) { + return VectorStoreAutoChunkingStrategyResponse.fromJson(readerToUse.reset()); + } else if ("static".equals(discriminatorValue)) { + return VectorStoreStaticChunkingStrategyResponse.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static VectorStoreChunkingStrategyResponse fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VectorStoreChunkingStrategyResponse deserializedVectorStoreChunkingStrategyResponse + = new VectorStoreChunkingStrategyResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("type".equals(fieldName)) { + deserializedVectorStoreChunkingStrategyResponse.type + = VectorStoreChunkingStrategyResponseType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return deserializedVectorStoreChunkingStrategyResponse; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreChunkingStrategyResponseType.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreChunkingStrategyResponseType.java new file mode 100644 index 000000000000..e3927a360621 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreChunkingStrategyResponseType.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of chunking strategy. + */ +public final class VectorStoreChunkingStrategyResponseType + extends ExpandableStringEnum { + + /** + * Static value other for VectorStoreChunkingStrategyResponseType. + */ + @Generated + public static final VectorStoreChunkingStrategyResponseType OTHER = fromString("other"); + + /** + * Static value static for VectorStoreChunkingStrategyResponseType. + */ + @Generated + public static final VectorStoreChunkingStrategyResponseType STATIC = fromString("static"); + + /** + * Creates a new instance of VectorStoreChunkingStrategyResponseType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public VectorStoreChunkingStrategyResponseType() { + } + + /** + * Creates or finds a VectorStoreChunkingStrategyResponseType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VectorStoreChunkingStrategyResponseType. + */ + @Generated + public static VectorStoreChunkingStrategyResponseType fromString(String name) { + return fromString(name, VectorStoreChunkingStrategyResponseType.class); + } + + /** + * Gets known VectorStoreChunkingStrategyResponseType values. + * + * @return known VectorStoreChunkingStrategyResponseType values. + */ + @Generated + public static Collection values() { + return values(VectorStoreChunkingStrategyResponseType.class); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFile.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFile.java index 9c8a971c1010..37e803429edf 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFile.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFile.java @@ -64,31 +64,6 @@ public final class VectorStoreFile implements JsonSerializable @Generated private final VectorStoreFileError lastError; - /** - * Creates an instance of VectorStoreFile class. - * - * @param id the id value to set. - * @param usageBytes the usageBytes value to set. - * @param createdAt the createdAt value to set. - * @param vectorStoreId the vectorStoreId value to set. - * @param status the status value to set. - * @param lastError the lastError value to set. - */ - @Generated - private VectorStoreFile(String id, int usageBytes, OffsetDateTime createdAt, String vectorStoreId, - VectorStoreFileStatus status, VectorStoreFileError lastError) { - this.id = id; - this.usageBytes = usageBytes; - if (createdAt == null) { - this.createdAt = 0L; - } else { - this.createdAt = createdAt.toEpochSecond(); - } - this.vectorStoreId = vectorStoreId; - this.status = status; - this.lastError = lastError; - } - /** * Get the id property: The identifier, which can be referenced in API endpoints. * @@ -177,6 +152,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("vector_store_id", this.vectorStoreId); jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); jsonWriter.writeJsonField("last_error", this.lastError); + jsonWriter.writeJsonField("chunking_strategy", this.chunkingStrategy); return jsonWriter.writeEndObject(); } @@ -198,6 +174,7 @@ public static VectorStoreFile fromJson(JsonReader jsonReader) throws IOException String vectorStoreId = null; VectorStoreFileStatus status = null; VectorStoreFileError lastError = null; + VectorStoreChunkingStrategyResponse chunkingStrategy = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -213,11 +190,57 @@ public static VectorStoreFile fromJson(JsonReader jsonReader) throws IOException status = VectorStoreFileStatus.fromString(reader.getString()); } else if ("last_error".equals(fieldName)) { lastError = VectorStoreFileError.fromJson(reader); + } else if ("chunking_strategy".equals(fieldName)) { + chunkingStrategy = VectorStoreChunkingStrategyResponse.fromJson(reader); } else { reader.skipChildren(); } } - return new VectorStoreFile(id, usageBytes, createdAt, vectorStoreId, status, lastError); + return new VectorStoreFile(id, usageBytes, createdAt, vectorStoreId, status, lastError, chunkingStrategy); }); } + + /* + * The strategy used to chunk the file. + */ + @Generated + private final VectorStoreChunkingStrategyResponse chunkingStrategy; + + /** + * Creates an instance of VectorStoreFile class. + * + * @param id the id value to set. + * @param usageBytes the usageBytes value to set. + * @param createdAt the createdAt value to set. + * @param vectorStoreId the vectorStoreId value to set. + * @param status the status value to set. + * @param lastError the lastError value to set. + * @param chunkingStrategy the chunkingStrategy value to set. + */ + @Generated + private VectorStoreFile(String id, int usageBytes, OffsetDateTime createdAt, String vectorStoreId, + VectorStoreFileStatus status, VectorStoreFileError lastError, + VectorStoreChunkingStrategyResponse chunkingStrategy) { + this.id = id; + this.usageBytes = usageBytes; + if (createdAt == null) { + this.createdAt = 0L; + } else { + this.createdAt = createdAt.toEpochSecond(); + } + this.vectorStoreId = vectorStoreId; + this.status = status; + this.lastError = lastError; + this.chunkingStrategy = chunkingStrategy; + } + + /** + * Get the chunkingStrategy property: The strategy used to chunk the file. + * + * @return the chunkingStrategy value. + */ + @Generated + public VectorStoreChunkingStrategyResponse getChunkingStrategy() { + return this.chunkingStrategy; + } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreOptions.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreOptions.java index e8a4ed8505f4..b0e6cfd133c5 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreOptions.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreOptions.java @@ -156,6 +156,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeArrayField("file_ids", this.fileIds, (writer, element) -> writer.writeString(element)); jsonWriter.writeStringField("name", this.name); jsonWriter.writeJsonField("expires_after", this.expiresAfter); + jsonWriter.writeJsonField("chunking_strategy", this.chunkingStrategy); jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -182,6 +183,9 @@ public static VectorStoreOptions fromJson(JsonReader jsonReader) throws IOExcept deserializedVectorStoreOptions.name = reader.getString(); } else if ("expires_after".equals(fieldName)) { deserializedVectorStoreOptions.expiresAfter = VectorStoreExpirationPolicy.fromJson(reader); + } else if ("chunking_strategy".equals(fieldName)) { + deserializedVectorStoreOptions.chunkingStrategy + = VectorStoreChunkingStrategyRequest.fromJson(reader); } else if ("metadata".equals(fieldName)) { Map metadata = reader.readMap(reader1 -> reader1.getString()); deserializedVectorStoreOptions.metadata = metadata; @@ -192,4 +196,35 @@ public static VectorStoreOptions fromJson(JsonReader jsonReader) throws IOExcept return deserializedVectorStoreOptions; }); } + + /* + * The chunking strategy used to chunk the file(s). If not set, will use the auto strategy. Only applicable if + * file_ids is non-empty. + */ + @Generated + private VectorStoreChunkingStrategyRequest chunkingStrategy; + + /** + * Get the chunkingStrategy property: The chunking strategy used to chunk the file(s). If not set, will use the auto + * strategy. Only applicable if file_ids is non-empty. + * + * @return the chunkingStrategy value. + */ + @Generated + public VectorStoreChunkingStrategyRequest getChunkingStrategy() { + return this.chunkingStrategy; + } + + /** + * Set the chunkingStrategy property: The chunking strategy used to chunk the file(s). If not set, will use the auto + * strategy. Only applicable if file_ids is non-empty. + * + * @param chunkingStrategy the chunkingStrategy value to set. + * @return the VectorStoreOptions object itself. + */ + @Generated + public VectorStoreOptions setChunkingStrategy(VectorStoreChunkingStrategyRequest chunkingStrategy) { + this.chunkingStrategy = chunkingStrategy; + return this; + } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreStaticChunkingStrategyOptions.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreStaticChunkingStrategyOptions.java new file mode 100644 index 000000000000..a222b1243bac --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreStaticChunkingStrategyOptions.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Options to configure a vector store static chunking strategy. + */ +@Immutable +public final class VectorStoreStaticChunkingStrategyOptions + implements JsonSerializable { + + /* + * The maximum number of tokens in each chunk. The default value is 800. The minimum value is 100 and the maximum + * value is 4096. + */ + @Generated + private final int maxChunkSizeTokens; + + /* + * The number of tokens that overlap between chunks. The default value is 400. + * Note that the overlap must not exceed half of max_chunk_size_tokens. * + */ + @Generated + private final int chunkOverlapTokens; + + /** + * Creates an instance of VectorStoreStaticChunkingStrategyOptions class. + * + * @param maxChunkSizeTokens the maxChunkSizeTokens value to set. + * @param chunkOverlapTokens the chunkOverlapTokens value to set. + */ + @Generated + public VectorStoreStaticChunkingStrategyOptions(int maxChunkSizeTokens, int chunkOverlapTokens) { + this.maxChunkSizeTokens = maxChunkSizeTokens; + this.chunkOverlapTokens = chunkOverlapTokens; + } + + /** + * Get the maxChunkSizeTokens property: The maximum number of tokens in each chunk. The default value is 800. The + * minimum value is 100 and the maximum value is 4096. + * + * @return the maxChunkSizeTokens value. + */ + @Generated + public int getMaxChunkSizeTokens() { + return this.maxChunkSizeTokens; + } + + /** + * Get the chunkOverlapTokens property: The number of tokens that overlap between chunks. The default value is 400. + * Note that the overlap must not exceed half of max_chunk_size_tokens. *. + * + * @return the chunkOverlapTokens value. + */ + @Generated + public int getChunkOverlapTokens() { + return this.chunkOverlapTokens; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("max_chunk_size_tokens", this.maxChunkSizeTokens); + jsonWriter.writeIntField("chunk_overlap_tokens", this.chunkOverlapTokens); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VectorStoreStaticChunkingStrategyOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VectorStoreStaticChunkingStrategyOptions if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VectorStoreStaticChunkingStrategyOptions. + */ + @Generated + public static VectorStoreStaticChunkingStrategyOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int maxChunkSizeTokens = 0; + int chunkOverlapTokens = 0; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("max_chunk_size_tokens".equals(fieldName)) { + maxChunkSizeTokens = reader.getInt(); + } else if ("chunk_overlap_tokens".equals(fieldName)) { + chunkOverlapTokens = reader.getInt(); + } else { + reader.skipChildren(); + } + } + return new VectorStoreStaticChunkingStrategyOptions(maxChunkSizeTokens, chunkOverlapTokens); + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreStaticChunkingStrategyRequest.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreStaticChunkingStrategyRequest.java new file mode 100644 index 000000000000..7a4e14cc13bc --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreStaticChunkingStrategyRequest.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A statically configured chunking strategy. + */ +@Immutable +public final class VectorStoreStaticChunkingStrategyRequest extends VectorStoreChunkingStrategyRequest { + + /* + * The object type. + */ + @Generated + private VectorStoreChunkingStrategyRequestType type = VectorStoreChunkingStrategyRequestType.STATIC; + + /* + * The options for the static chunking strategy. + */ + @Generated + private final VectorStoreStaticChunkingStrategyOptions staticProperty; + + /** + * Creates an instance of VectorStoreStaticChunkingStrategyRequest class. + * + * @param staticProperty the staticProperty value to set. + */ + @Generated + public VectorStoreStaticChunkingStrategyRequest(VectorStoreStaticChunkingStrategyOptions staticProperty) { + this.staticProperty = staticProperty; + } + + /** + * Get the type property: The object type. + * + * @return the type value. + */ + @Generated + @Override + public VectorStoreChunkingStrategyRequestType getType() { + return this.type; + } + + /** + * Get the staticProperty property: The options for the static chunking strategy. + * + * @return the staticProperty value. + */ + @Generated + public VectorStoreStaticChunkingStrategyOptions getStaticProperty() { + return this.staticProperty; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("static", this.staticProperty); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VectorStoreStaticChunkingStrategyRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VectorStoreStaticChunkingStrategyRequest if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VectorStoreStaticChunkingStrategyRequest. + */ + @Generated + public static VectorStoreStaticChunkingStrategyRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VectorStoreStaticChunkingStrategyOptions staticProperty = null; + VectorStoreChunkingStrategyRequestType type = VectorStoreChunkingStrategyRequestType.STATIC; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("static".equals(fieldName)) { + staticProperty = VectorStoreStaticChunkingStrategyOptions.fromJson(reader); + } else if ("type".equals(fieldName)) { + type = VectorStoreChunkingStrategyRequestType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + VectorStoreStaticChunkingStrategyRequest deserializedVectorStoreStaticChunkingStrategyRequest + = new VectorStoreStaticChunkingStrategyRequest(staticProperty); + deserializedVectorStoreStaticChunkingStrategyRequest.type = type; + return deserializedVectorStoreStaticChunkingStrategyRequest; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreStaticChunkingStrategyResponse.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreStaticChunkingStrategyResponse.java new file mode 100644 index 000000000000..a1cdffa771cd --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreStaticChunkingStrategyResponse.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A statically configured chunking strategy. + */ +@Immutable +public final class VectorStoreStaticChunkingStrategyResponse extends VectorStoreChunkingStrategyResponse { + + /* + * The object type. + */ + @Generated + private VectorStoreChunkingStrategyResponseType type = VectorStoreChunkingStrategyResponseType.STATIC; + + /* + * The options for the static chunking strategy. + */ + @Generated + private final VectorStoreStaticChunkingStrategyOptions staticProperty; + + /** + * Creates an instance of VectorStoreStaticChunkingStrategyResponse class. + * + * @param staticProperty the staticProperty value to set. + */ + @Generated + private VectorStoreStaticChunkingStrategyResponse(VectorStoreStaticChunkingStrategyOptions staticProperty) { + this.staticProperty = staticProperty; + } + + /** + * Get the type property: The object type. + * + * @return the type value. + */ + @Generated + @Override + public VectorStoreChunkingStrategyResponseType getType() { + return this.type; + } + + /** + * Get the staticProperty property: The options for the static chunking strategy. + * + * @return the staticProperty value. + */ + @Generated + public VectorStoreStaticChunkingStrategyOptions getStaticProperty() { + return this.staticProperty; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("static", this.staticProperty); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VectorStoreStaticChunkingStrategyResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VectorStoreStaticChunkingStrategyResponse if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VectorStoreStaticChunkingStrategyResponse. + */ + @Generated + public static VectorStoreStaticChunkingStrategyResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VectorStoreStaticChunkingStrategyOptions staticProperty = null; + VectorStoreChunkingStrategyResponseType type = VectorStoreChunkingStrategyResponseType.STATIC; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("static".equals(fieldName)) { + staticProperty = VectorStoreStaticChunkingStrategyOptions.fromJson(reader); + } else if ("type".equals(fieldName)) { + type = VectorStoreChunkingStrategyResponseType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + VectorStoreStaticChunkingStrategyResponse deserializedVectorStoreStaticChunkingStrategyResponse + = new VectorStoreStaticChunkingStrategyResponse(staticProperty); + deserializedVectorStoreStaticChunkingStrategyResponse.type = type; + return deserializedVectorStoreStaticChunkingStrategyResponse; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/resources/META-INF/azure-ai-openai-assistants_apiview_properties.json b/sdk/openai/azure-ai-openai-assistants/src/main/resources/META-INF/azure-ai-openai-assistants_apiview_properties.json index f6f87d9cbb93..c84db9f9d029 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/resources/META-INF/azure-ai-openai-assistants_apiview_properties.json +++ b/sdk/openai/azure-ai-openai-assistants/src/main/resources/META-INF/azure-ai-openai-assistants_apiview_properties.json @@ -202,6 +202,7 @@ "com.azure.ai.openai.assistants.models.FileDetails": "null", "com.azure.ai.openai.assistants.models.FilePurpose": "Azure.AI.OpenAI.Assistants.FilePurpose", "com.azure.ai.openai.assistants.models.FileSearchToolDefinition": "Azure.AI.OpenAI.Assistants.FileSearchToolDefinition", + "com.azure.ai.openai.assistants.models.FileSearchToolDefinitionDetails": "Azure.AI.OpenAI.Assistants.FileSearchToolDefinitionDetails", "com.azure.ai.openai.assistants.models.FileSearchToolResource": "Azure.AI.OpenAI.Assistants.FileSearchToolResource", "com.azure.ai.openai.assistants.models.FileState": "Azure.AI.OpenAI.Assistants.FileState", "com.azure.ai.openai.assistants.models.FunctionDefinition": "Azure.AI.OpenAI.Assistants.FunctionDefinition", @@ -301,6 +302,12 @@ "com.azure.ai.openai.assistants.models.UpdateFileSearchToolResourceOptions": "Azure.AI.OpenAI.Assistants.UpdateFileSearchToolResourceOptions", "com.azure.ai.openai.assistants.models.UpdateToolResourcesOptions": "Azure.AI.OpenAI.Assistants.UpdateToolResourcesOptions", "com.azure.ai.openai.assistants.models.VectorStore": "Azure.AI.OpenAI.Assistants.VectorStore", + "com.azure.ai.openai.assistants.models.VectorStoreAutoChunkingStrategyRequest": "Azure.AI.OpenAI.Assistants.VectorStoreAutoChunkingStrategyRequest", + "com.azure.ai.openai.assistants.models.VectorStoreAutoChunkingStrategyResponse": "Azure.AI.OpenAI.Assistants.VectorStoreAutoChunkingStrategyResponse", + "com.azure.ai.openai.assistants.models.VectorStoreChunkingStrategyRequest": "Azure.AI.OpenAI.Assistants.VectorStoreChunkingStrategyRequest", + "com.azure.ai.openai.assistants.models.VectorStoreChunkingStrategyRequestType": "Azure.AI.OpenAI.Assistants.VectorStoreChunkingStrategyRequestType", + "com.azure.ai.openai.assistants.models.VectorStoreChunkingStrategyResponse": "Azure.AI.OpenAI.Assistants.VectorStoreChunkingStrategyResponse", + "com.azure.ai.openai.assistants.models.VectorStoreChunkingStrategyResponseType": "Azure.AI.OpenAI.Assistants.VectorStoreChunkingStrategyResponseType", "com.azure.ai.openai.assistants.models.VectorStoreDeletionStatus": "Azure.AI.OpenAI.Assistants.VectorStoreDeletionStatus", "com.azure.ai.openai.assistants.models.VectorStoreExpirationPolicy": "Azure.AI.OpenAI.Assistants.VectorStoreExpirationPolicy", "com.azure.ai.openai.assistants.models.VectorStoreExpirationPolicyAnchor": "Azure.AI.OpenAI.Assistants.VectorStoreExpirationPolicyAnchor", @@ -314,6 +321,9 @@ "com.azure.ai.openai.assistants.models.VectorStoreFileStatus": "Azure.AI.OpenAI.Assistants.VectorStoreFileStatus", "com.azure.ai.openai.assistants.models.VectorStoreFileStatusFilter": "Azure.AI.OpenAI.Assistants.VectorStoreFileStatusFilter", "com.azure.ai.openai.assistants.models.VectorStoreOptions": "Azure.AI.OpenAI.Assistants.VectorStoreOptions", + "com.azure.ai.openai.assistants.models.VectorStoreStaticChunkingStrategyOptions": "Azure.AI.OpenAI.Assistants.VectorStoreStaticChunkingStrategyOptions", + "com.azure.ai.openai.assistants.models.VectorStoreStaticChunkingStrategyRequest": "Azure.AI.OpenAI.Assistants.VectorStoreStaticChunkingStrategyRequest", + "com.azure.ai.openai.assistants.models.VectorStoreStaticChunkingStrategyResponse": "Azure.AI.OpenAI.Assistants.VectorStoreStaticChunkingStrategyResponse", "com.azure.ai.openai.assistants.models.VectorStoreStatus": "Azure.AI.OpenAI.Assistants.VectorStoreStatus", "com.azure.ai.openai.assistants.models.VectorStoreUpdateOptions": "Azure.AI.OpenAI.Assistants.VectorStoreUpdateOptions" } diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/FileSearchToolSample.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/FileSearchToolSample.java index fa327e745afb..8560a9c6679d 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/FileSearchToolSample.java +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/FileSearchToolSample.java @@ -63,7 +63,8 @@ public static void main(String[] args) throws InterruptedException { createToolResourcesOptions.setFileSearch( new CreateFileSearchToolResourceOptions( new CreateFileSearchToolResourceVectorStoreOptionsList( - Arrays.asList(new CreateFileSearchToolResourceVectorStoreOptions(Arrays.asList(openAIFile.getId())))))); + Arrays.asList(new CreateFileSearchToolResourceVectorStoreOptions( + Arrays.asList(openAIFile.getId())))))); // Create assistant passing the file ID Assistant assistant = client.createAssistant( diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/ReadmeSamples.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/ReadmeSamples.java index 9140b9d01ee1..202e1e26195a 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/ReadmeSamples.java +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/ReadmeSamples.java @@ -183,7 +183,8 @@ public void simpleRetrievalOperation() throws InterruptedException { createToolResourcesOptions.setFileSearch( new CreateFileSearchToolResourceOptions( new CreateFileSearchToolResourceVectorStoreOptionsList( - Arrays.asList(new CreateFileSearchToolResourceVectorStoreOptions(Arrays.asList(openAIFile.getId())))))); + Arrays.asList(new CreateFileSearchToolResourceVectorStoreOptions( + Arrays.asList(openAIFile.getId())))))); Assistant assistant = client.createAssistant( new AssistantCreationOptions(deploymentOrModelId) diff --git a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AssistantsClientTestBase.java b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AssistantsClientTestBase.java index 65b6f371b404..99600264e206 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AssistantsClientTestBase.java +++ b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AssistantsClientTestBase.java @@ -17,7 +17,6 @@ import com.azure.ai.openai.assistants.models.FileDeletionStatus; import com.azure.ai.openai.assistants.models.FileDetails; import com.azure.ai.openai.assistants.models.FilePurpose; -import com.azure.ai.openai.assistants.models.FileSearchToolDefinition; import com.azure.ai.openai.assistants.models.FunctionDefinition; import com.azure.ai.openai.assistants.models.FunctionToolDefinition; import com.azure.ai.openai.assistants.models.MessageRole; @@ -214,18 +213,6 @@ void createRunRunner(Consumer testRunner, String assistantId) testRunner.accept(new CreateRunOptions(assistantId)); } - void createRetrievalRunner(BiConsumer testRunner) { - FileDetails fileDetails = new FileDetails( - BinaryData.fromFile(openResourceFile("java_sdk_tests_assistants.txt")), "java_sdk_tests_assistants.txt"); - - AssistantCreationOptions assistantOptions = new AssistantCreationOptions(GPT_4_1106_PREVIEW) - .setName("Java SDK Retrieval Sample") - .setInstructions("You are a helpful assistant that can help fetch data from files you know about.") - .setTools(Arrays.asList(new FileSearchToolDefinition())); - - testRunner.accept(fileDetails, assistantOptions); - } - void createFunctionToolCallRunner(BiConsumer testRunner) { FunctionsToolCallHelper functionsToolCallHelper = new FunctionsToolCallHelper(); List toolDefinition = Arrays.asList( diff --git a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureFileSearchAsyncTest.java b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureFileSearchAsyncTest.java index dc5ca7c7223c..7e516b15b089 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureFileSearchAsyncTest.java +++ b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureFileSearchAsyncTest.java @@ -3,6 +3,7 @@ package com.azure.ai.openai.assistants; +import com.azure.ai.openai.assistants.implementation.AsyncUtils; import com.azure.ai.openai.assistants.models.Assistant; import com.azure.ai.openai.assistants.models.AssistantThread; import com.azure.ai.openai.assistants.models.AssistantThreadCreationOptions; @@ -18,9 +19,8 @@ import com.azure.ai.openai.assistants.models.ThreadMessage; import com.azure.ai.openai.assistants.models.ThreadMessageOptions; import com.azure.ai.openai.assistants.models.ThreadRun; -import com.azure.ai.openai.assistants.implementation.AsyncUtils; +import com.azure.core.exception.HttpResponseException; import com.azure.core.http.HttpClient; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import reactor.core.publisher.Mono; @@ -32,20 +32,104 @@ import static com.azure.ai.openai.assistants.TestUtils.DISPLAY_NAME_WITH_ARGUMENTS; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -public class AzureFileSearchAsyncTest extends AssistantsClientTestBase { +public class AzureFileSearchAsyncTest extends FileSearchTestBase { AssistantsAsyncClient client; - @Disabled("file_search tools are not supported in Azure") @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") public void basicFileSearch(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { client = getAssistantsAsyncClient(httpClient, serviceVersion); - createRetrievalRunner((fileDetails, assistantCreationOptions) -> { + fileSearchRunner((fileDetails, assistantCreationOptions) -> { + // Upload file + StepVerifier.create(client.uploadFile(fileDetails, FilePurpose.ASSISTANTS) + .flatMap(openAIFile -> { + // Create assistant + AsyncUtils cleanUp = new AsyncUtils(); + CreateToolResourcesOptions createToolResourcesOptions = new CreateToolResourcesOptions(); + createToolResourcesOptions.setFileSearch( + new CreateFileSearchToolResourceOptions( + new CreateFileSearchToolResourceVectorStoreOptionsList( + Arrays.asList(new CreateFileSearchToolResourceVectorStoreOptions( + Arrays.asList(openAIFile.getId())))))); + assistantCreationOptions.setToolResources(createToolResourcesOptions); + cleanUp.setFile(openAIFile); + return client.createAssistant(assistantCreationOptions).zipWith(Mono.just(cleanUp)); + }).flatMap(tuple -> { + Assistant assistant = tuple.getT1(); + AsyncUtils cleanUp = tuple.getT2(); + cleanUp.setAssistant(assistant); + + return client.createThread(new AssistantThreadCreationOptions()) + .zipWith(Mono.just(cleanUp)); + }).flatMap(tuple -> { + AssistantThread thread = tuple.getT1(); + AsyncUtils cleanUp = tuple.getT2(); + cleanUp.setThread(thread); + + return client.createMessage( + thread.getId(), + new ThreadMessageOptions( + MessageRole.USER, + "Can you give me the documented codes for 'banana' and 'orange'?" + )).flatMap(_message -> + client.createRun(cleanUp.getThread(), cleanUp.getAssistant()) + .flatMap(createdRun -> + client.getRun(cleanUp.getThread().getId(), createdRun.getId()).zipWith(Mono.just(cleanUp)) + .repeatWhen(completed -> completed.delayElements(Duration.ofMillis(1000))) + .takeUntil(tuple2 -> { + ThreadRun run = tuple2.getT1(); + + return run.getStatus() != RunStatus.IN_PROGRESS + && run.getStatus() != RunStatus.QUEUED; + }) + .last() + ) + ); + }).flatMap(tuple -> { + ThreadRun run = tuple.getT1(); + AsyncUtils cleanUp = tuple.getT2(); + + assertEquals(RunStatus.COMPLETED, run.getStatus()); + assertEquals(cleanUp.getAssistant().getId(), run.getAssistantId()); + + return client.listMessages(cleanUp.getThread().getId()).zipWith(Mono.just(cleanUp)); + }).map(tuple -> { + PageableList messageList = tuple.getT1(); + AsyncUtils cleanUp = tuple.getT2(); + + assertEquals(2, messageList.getData().size()); + ThreadMessage firstMessage = messageList.getData().get(0); + + assertEquals(MessageRole.ASSISTANT, firstMessage.getRole()); + assertFalse(firstMessage.getContent().isEmpty()); + + MessageTextContent firstMessageContent = (MessageTextContent) firstMessage.getContent().get(0); + assertNotNull(firstMessageContent); + assertTrue(firstMessageContent.getText().getValue().contains("232323")); + + return cleanUp; + }) + .flatMap(cleanUp -> client.deleteAssistant(cleanUp.getAssistant().getId()) + .flatMap(_unused -> client.deleteFile(cleanUp.getFile().getId())) + .flatMap(_unused -> client.deleteThread(cleanUp.getThread().getId())))) + // last deletion asserted + .assertNext(threadDeletionStatus -> assertTrue(threadDeletionStatus.isDeleted())) + .verifyComplete(); + }); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") + public void fileSearchWithMaxNumberResult(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { + client = getAssistantsAsyncClient(httpClient, serviceVersion); + + fileSearchWithMaxNumberResultRunner((fileDetails, assistantCreationOptions) -> { // Upload file StepVerifier.create(client.uploadFile(fileDetails, FilePurpose.ASSISTANTS) .flatMap(openAIFile -> { @@ -55,71 +139,15 @@ public void basicFileSearch(HttpClient httpClient, AssistantsServiceVersion serv createToolResourcesOptions.setFileSearch( new CreateFileSearchToolResourceOptions( new CreateFileSearchToolResourceVectorStoreOptionsList( - Arrays.asList(new CreateFileSearchToolResourceVectorStoreOptions(Arrays.asList(openAIFile.getId())))))); + Arrays.asList(new CreateFileSearchToolResourceVectorStoreOptions( + Arrays.asList(openAIFile.getId())))))); assistantCreationOptions.setToolResources(createToolResourcesOptions); - cleanUp.setFile(openAIFile); - return client.createAssistant(assistantCreationOptions).zipWith(Mono.just(cleanUp)); - }).flatMap(tuple -> { - Assistant assistant = tuple.getT1(); - AsyncUtils cleanUp = tuple.getT2(); - cleanUp.setAssistant(assistant); - return client.createThread(new AssistantThreadCreationOptions()) + cleanUp.setFile(openAIFile); + return client.createAssistant(assistantCreationOptions) .zipWith(Mono.just(cleanUp)); - }).flatMap(tuple -> { - AssistantThread thread = tuple.getT1(); - AsyncUtils cleanUp = tuple.getT2(); - cleanUp.setThread(thread); - - return client.createMessage( - thread.getId(), - new ThreadMessageOptions( - MessageRole.USER, - "Can you give me the documented codes for 'banana' and 'orange'?" - )).flatMap(_message -> - client.createRun(cleanUp.getThread(), cleanUp.getAssistant()) - .flatMap(createdRun -> - client.getRun(cleanUp.getThread().getId(), createdRun.getId()).zipWith(Mono.just(cleanUp)) - .repeatWhen(completed -> completed.delayElements(Duration.ofMillis(1000))) - .takeUntil(tuple2 -> { - ThreadRun run = tuple2.getT1(); - - return run.getStatus() != RunStatus.IN_PROGRESS - && run.getStatus() != RunStatus.QUEUED; - }) - .last() - ) - ); - }).flatMap(tuple -> { - ThreadRun run = tuple.getT1(); - AsyncUtils cleanUp = tuple.getT2(); - - assertEquals(RunStatus.COMPLETED, run.getStatus()); - assertEquals(cleanUp.getAssistant().getId(), run.getAssistantId()); - - return client.listMessages(cleanUp.getThread().getId()).zipWith(Mono.just(cleanUp)); - }).map(tuple -> { - PageableList messageList = tuple.getT1(); - AsyncUtils cleanUp = tuple.getT2(); - - assertEquals(2, messageList.getData().size()); - ThreadMessage firstMessage = messageList.getData().get(0); - - assertEquals(MessageRole.ASSISTANT, firstMessage.getRole()); - assertFalse(firstMessage.getContent().isEmpty()); - - MessageTextContent firstMessageContent = (MessageTextContent) firstMessage.getContent().get(0); - assertNotNull(firstMessageContent); - assertTrue(firstMessageContent.getText().getValue().contains("232323")); - - return cleanUp; }) - .flatMap(cleanUp -> client.deleteAssistant(cleanUp.getAssistant().getId()) - .flatMap(_unused -> client.deleteFile(cleanUp.getFile().getId())) - .flatMap(_unused -> client.deleteThread(cleanUp.getThread().getId())))) - // last deletion asserted - .assertNext(threadDeletionStatus -> assertTrue(threadDeletionStatus.isDeleted())) - .verifyComplete(); + ).verifyErrorSatisfies(error -> assertInstanceOf(HttpResponseException.class, error)); }); } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureFileSearchSyncTest.java b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureFileSearchSyncTest.java index 3b3d10e4a0ee..ca08129690c4 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureFileSearchSyncTest.java +++ b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureFileSearchSyncTest.java @@ -19,8 +19,8 @@ import com.azure.ai.openai.assistants.models.ThreadMessage; import com.azure.ai.openai.assistants.models.ThreadMessageOptions; import com.azure.ai.openai.assistants.models.ThreadRun; +import com.azure.core.exception.HttpResponseException; import com.azure.core.http.HttpClient; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -30,19 +30,19 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; -public class AzureFileSearchSyncTest extends AssistantsClientTestBase { +public class AzureFileSearchSyncTest extends FileSearchTestBase { AssistantsClient client; - @Disabled("Retrieval tools are not supported in Azure") @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") - public void basicRetrieval(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { + public void basicFileSearch(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { client = getAssistantsClient(httpClient, serviceVersion); - createRetrievalRunner((fileDetails, assistantCreationOptions) -> { + fileSearchRunner((fileDetails, assistantCreationOptions) -> { // Upload file for assistant OpenAIFile openAIFile = client.uploadFile(fileDetails, FilePurpose.ASSISTANTS); @@ -51,7 +51,8 @@ public void basicRetrieval(HttpClient httpClient, AssistantsServiceVersion servi createToolResourcesOptions.setFileSearch( new CreateFileSearchToolResourceOptions( new CreateFileSearchToolResourceVectorStoreOptionsList( - Arrays.asList(new CreateFileSearchToolResourceVectorStoreOptions(Arrays.asList(openAIFile.getId())))))); + Arrays.asList(new CreateFileSearchToolResourceVectorStoreOptions( + Arrays.asList(openAIFile.getId())))))); assistantCreationOptions.setToolResources(createToolResourcesOptions); Assistant assistant = client.createAssistant(assistantCreationOptions); @@ -97,5 +98,32 @@ public void basicRetrieval(HttpClient httpClient, AssistantsServiceVersion servi }); } + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") + public void fileSearchWithMaxNumberResult(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { + client = getAssistantsClient(httpClient, serviceVersion); + + fileSearchWithMaxNumberResultRunner((fileDetails, assistantCreationOptions) -> { + // Upload file for assistant + OpenAIFile openAIFile = client.uploadFile(fileDetails, FilePurpose.ASSISTANTS); + + // Create assistant + CreateToolResourcesOptions createToolResourcesOptions = new CreateToolResourcesOptions(); + createToolResourcesOptions.setFileSearch( + new CreateFileSearchToolResourceOptions( + new CreateFileSearchToolResourceVectorStoreOptionsList( + Arrays.asList( + new CreateFileSearchToolResourceVectorStoreOptions( + Arrays.asList(openAIFile.getId())))))); + assistantCreationOptions.setToolResources(createToolResourcesOptions); + + assertThrows(HttpResponseException.class, () -> { + Assistant assistant = client.createAssistant(assistantCreationOptions); + client.deleteAssistant(assistant.getId()); + }); + // cleanup + client.deleteFile(openAIFile.getId()); + }); + } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureStreamingSyncTest.java b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureStreamingSyncTest.java index e6d6e2b2d0a1..40d9cc30cb3e 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureStreamingSyncTest.java +++ b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureStreamingSyncTest.java @@ -43,6 +43,7 @@ public void runThreadSimpleTest(HttpClient httpClient, AssistantsServiceVersion streamEvents.forEach(AssistantsClientTestBase::assertStreamUpdate); }, mathTutorAssistantId); } + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") public void runThreadWithTools(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { diff --git a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureVectorStoreAsyncTests.java b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureVectorStoreAsyncTests.java index c886ea4cc1a6..3c4cad887fbf 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureVectorStoreAsyncTests.java +++ b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureVectorStoreAsyncTests.java @@ -4,10 +4,15 @@ package com.azure.ai.openai.assistants; import com.azure.ai.openai.assistants.models.VectorStore; +import com.azure.ai.openai.assistants.models.VectorStoreAutoChunkingStrategyRequest; +import com.azure.ai.openai.assistants.models.VectorStoreExpirationPolicy; import com.azure.ai.openai.assistants.models.VectorStoreFile; import com.azure.ai.openai.assistants.models.VectorStoreFileBatch; import com.azure.ai.openai.assistants.models.VectorStoreFileBatchStatus; import com.azure.ai.openai.assistants.models.VectorStoreOptions; +import com.azure.ai.openai.assistants.models.VectorStoreStaticChunkingStrategyOptions; +import com.azure.ai.openai.assistants.models.VectorStoreStaticChunkingStrategyRequest; +import com.azure.core.exception.HttpResponseException; import com.azure.core.http.HttpClient; import com.azure.core.util.logging.ClientLogger; import org.junit.jupiter.api.Disabled; @@ -21,31 +26,37 @@ import static com.azure.ai.openai.assistants.TestUtils.DISPLAY_NAME_WITH_ARGUMENTS; import static com.azure.ai.openai.assistants.models.FilePurpose.ASSISTANTS; +import static com.azure.ai.openai.assistants.models.VectorStoreExpirationPolicyAnchor.LAST_ACTIVE_AT; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -public class AzureVectorStoreAsyncTests extends AssistantsClientTestBase { +public class AzureVectorStoreAsyncTests extends VectorStoreTestBase { private static final ClientLogger LOGGER = new ClientLogger(AzureVectorStoreAsyncTests.class); private AssistantsAsyncClient client; private VectorStore vectorStore; private List fileIds = new ArrayList<>(); + protected void beforeTest(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { client = getAssistantsAsyncClient(httpClient, serviceVersion); - fileIds.add(uploadFileAsync(client, "20210203_alphabet_10K.pdf", ASSISTANTS)); + addFile(ALPHABET_FINANCIAL_STATEMENT); VectorStoreOptions vectorStoreOptions = new VectorStoreOptions() - .setName("Financial Statements") - .setFileIds(fileIds); - + .setName("Financial Statements") + .setExpiresAfter(new VectorStoreExpirationPolicy(LAST_ACTIVE_AT, 1)); StepVerifier.create(client.createVectorStore(vectorStoreOptions)) - .assertNext(vectorStore -> { - this.vectorStore = vectorStore; - assertNotNull(vectorStore); - assertNotNull(vectorStore.getId()); - }) - .verifyComplete(); + .assertNext(vectorStore -> { + this.vectorStore = vectorStore; + assertNotNull(vectorStore); + assertNotNull(vectorStore.getId()); + }) + .verifyComplete(); + } + + private void addFile(String fileId) { + fileIds.add(uploadFileAsync(client, fileId, ASSISTANTS)); } @Override @@ -110,13 +121,52 @@ public void listVectorStore(HttpClient httpClient, AssistantsServiceVersion serv @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") public void createVectorStoreFile(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { beforeTest(httpClient, serviceVersion); - String storeId = vectorStore.getId(); - StepVerifier.create(client.createVectorStoreFile(storeId, fileIds.get(0))) - .assertNext(vectorStoreFile -> { - assertNotNull(vectorStoreFile); - assertNotNull(vectorStoreFile.getId()); - }) - .verifyComplete(); + StepVerifier.create(client.createVectorStoreFile(vectorStore.getId(), fileIds.get(0))) + .assertNext(this::assertVectorStoreFile) + .verifyComplete(); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") + public void createVectorStoreFileWithAutoChunkingStrategy(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { + beforeTest(httpClient, serviceVersion); + StepVerifier.create(client.createVectorStoreFile(vectorStore.getId(), fileIds.get(0), + new VectorStoreAutoChunkingStrategyRequest())) + .assertNext(vectorStoreFile -> { + assertVectorStoreFile(vectorStoreFile); + assertStaticChunkingStrategy(vectorStoreFile, 800, 400); + }) + .verifyComplete(); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") + public void createVectorStoreFileWithStaticChunkingStrategy(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { + beforeTest(httpClient, serviceVersion); + int maxChunkSizeTokens = 101; + int chunkOverlapTokens = 50; + StepVerifier.create(client.createVectorStoreFile(vectorStore.getId(), fileIds.get(0), + new VectorStoreStaticChunkingStrategyRequest( + new VectorStoreStaticChunkingStrategyOptions(maxChunkSizeTokens, chunkOverlapTokens)))) + .assertNext(vectorStoreFile -> { + assertVectorStoreFile(vectorStoreFile); + assertStaticChunkingStrategy(vectorStoreFile, maxChunkSizeTokens, chunkOverlapTokens); + }) + .verifyComplete(); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") + public void throwExceptionWhenOverrideExistChunkStrategy(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { + beforeTest(httpClient, serviceVersion); + StepVerifier.create(client.createVectorStoreFile(vectorStore.getId(), fileIds.get(0), + new VectorStoreAutoChunkingStrategyRequest())) + .assertNext(this::assertVectorStoreFile) + .verifyComplete(); + StepVerifier.create(client.createVectorStoreFile(vectorStore.getId(), fileIds.get(0), + new VectorStoreStaticChunkingStrategyRequest( + new VectorStoreStaticChunkingStrategyOptions(101, 50)))) + .verifyErrorSatisfies(error -> assertInstanceOf(HttpResponseException.class, error)); } @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @@ -169,13 +219,17 @@ public void deleteVectorStoreFile(HttpClient httpClient, AssistantsServiceVersio beforeTest(httpClient, serviceVersion); String storeId = vectorStore.getId(); String fileId = fileIds.get(0); + // Create Vector Store File + StepVerifier.create(client.createVectorStoreFile(vectorStore.getId(), fileIds.get(0))) + .assertNext(this::assertVectorStoreFile) + .verifyComplete(); // Delete Vector Store File StepVerifier.create(client.deleteVectorStoreFile(storeId, fileId)) - .assertNext(deletionStatus -> { - assertTrue(deletionStatus.isDeleted()); - assertEquals(fileId, deletionStatus.getId()); - }) - .verifyComplete(); + .assertNext(deletionStatus -> { + assertTrue(deletionStatus.isDeleted()); + assertEquals(fileId, deletionStatus.getId()); + }) + .verifyComplete(); } // Vector Store File Batch @@ -183,18 +237,55 @@ public void deleteVectorStoreFile(HttpClient httpClient, AssistantsServiceVersio @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") public void createVectorStoreFileBatch(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { beforeTest(httpClient, serviceVersion); - String storeId = vectorStore.getId(); - String fileId = fileIds.get(0); - String fileId2 = uploadFileAsync(client, "20220924_aapl_10k.pdf", ASSISTANTS); - fileIds.add(fileId2); + addFile(APPLE_FINANCIAL_STATEMENT); + StepVerifier.create(client.createVectorStoreFileBatch(vectorStore.getId(), + Arrays.asList(fileIds.get(0), fileIds.get(1)))) + .assertNext(vectorStoreFileBatch -> assertVectorStoreFileBatch(vectorStoreFileBatch, 2)) + .verifyComplete(); + } - StepVerifier.create(client.createVectorStoreFileBatch(storeId, Arrays.asList(fileId, fileId2))) - .assertNext(vectorStoreFileBatch -> { - assertNotNull(vectorStoreFileBatch); - assertNotNull(vectorStoreFileBatch.getId()); - assertEquals(2, vectorStoreFileBatch.getFileCounts().getTotal()); - }) - .verifyComplete(); + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") + public void createVectorStoreFileBatchWithAutoChunkingStrategy(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { + beforeTest(httpClient, serviceVersion); + addFile(APPLE_FINANCIAL_STATEMENT); + StepVerifier.create(client.createVectorStoreFileBatch(vectorStore.getId(), + Arrays.asList(fileIds.get(0), fileIds.get(1)), + new VectorStoreAutoChunkingStrategyRequest())) + .assertNext(vectorStoreFileBatch -> assertVectorStoreFileBatch(vectorStoreFileBatch, 2)) + .verifyComplete(); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") + public void createVectorStoreFileBatchWithStaticChunkingStrategy(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { + beforeTest(httpClient, serviceVersion); + addFile(APPLE_FINANCIAL_STATEMENT); + StepVerifier.create(client.createVectorStoreFileBatch(vectorStore.getId(), + Arrays.asList(fileIds.get(0), fileIds.get(1)), + new VectorStoreStaticChunkingStrategyRequest( + new VectorStoreStaticChunkingStrategyOptions(101, 50)))) + .assertNext(vectorStoreFileBatch -> assertVectorStoreFileBatch(vectorStoreFileBatch, 2)) + .verifyComplete(); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") + public void throwExceptionWhenOverrideExistChunkStrategyInBatch(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { + beforeTest(httpClient, serviceVersion); + addFile(APPLE_FINANCIAL_STATEMENT); + + StepVerifier.create(client.createVectorStoreFileBatch(vectorStore.getId(), + Arrays.asList(fileIds.get(0), fileIds.get(1)), + new VectorStoreStaticChunkingStrategyRequest( + new VectorStoreStaticChunkingStrategyOptions(101, 50)))) + .assertNext(vectorStoreFileBatch -> assertVectorStoreFileBatch(vectorStoreFileBatch, 2)) + .verifyComplete(); + + StepVerifier.create(client.createVectorStoreFileBatch(vectorStore.getId(), + Arrays.asList(fileIds.get(0), fileIds.get(1)), + new VectorStoreAutoChunkingStrategyRequest())) + .verifyErrorSatisfies(error -> assertInstanceOf(HttpResponseException.class, error)); } @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) diff --git a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureVectorStoreSyncTests.java b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureVectorStoreSyncTests.java index b104b3b3f9f5..f370b1a88049 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureVectorStoreSyncTests.java +++ b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureVectorStoreSyncTests.java @@ -5,12 +5,17 @@ import com.azure.ai.openai.assistants.models.PageableList; import com.azure.ai.openai.assistants.models.VectorStore; +import com.azure.ai.openai.assistants.models.VectorStoreAutoChunkingStrategyRequest; +import com.azure.ai.openai.assistants.models.VectorStoreExpirationPolicy; import com.azure.ai.openai.assistants.models.VectorStoreFile; import com.azure.ai.openai.assistants.models.VectorStoreFileBatch; import com.azure.ai.openai.assistants.models.VectorStoreFileBatchStatus; import com.azure.ai.openai.assistants.models.VectorStoreFileDeletionStatus; import com.azure.ai.openai.assistants.models.VectorStoreFileStatus; import com.azure.ai.openai.assistants.models.VectorStoreOptions; +import com.azure.ai.openai.assistants.models.VectorStoreStaticChunkingStrategyOptions; +import com.azure.ai.openai.assistants.models.VectorStoreStaticChunkingStrategyRequest; +import com.azure.core.exception.HttpResponseException; import com.azure.core.http.HttpClient; import com.azure.core.util.logging.ClientLogger; import org.junit.jupiter.api.Disabled; @@ -23,12 +28,14 @@ import static com.azure.ai.openai.assistants.TestUtils.DISPLAY_NAME_WITH_ARGUMENTS; import static com.azure.ai.openai.assistants.models.FilePurpose.ASSISTANTS; +import static com.azure.ai.openai.assistants.models.VectorStoreExpirationPolicyAnchor.LAST_ACTIVE_AT; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; -public class AzureVectorStoreSyncTests extends AssistantsClientTestBase { +public class AzureVectorStoreSyncTests extends VectorStoreTestBase { private static final ClientLogger LOGGER = new ClientLogger(AzureVectorStoreSyncTests.class); private AssistantsClient client; @@ -37,16 +44,19 @@ public class AzureVectorStoreSyncTests extends AssistantsClientTestBase { protected void beforeTest(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { client = getAssistantsClient(httpClient, serviceVersion); - fileIds.add(uploadFile(client, "20210203_alphabet_10K.pdf", ASSISTANTS)); + addFile(ALPHABET_FINANCIAL_STATEMENT); VectorStoreOptions vectorStoreOptions = new VectorStoreOptions() - .setName("Financial Statements") - .setFileIds(fileIds); + .setName("Financial Statements") + .setExpiresAfter(new VectorStoreExpirationPolicy(LAST_ACTIVE_AT, 1)); vectorStore = client.createVectorStore(vectorStoreOptions); - assertNotNull(vectorStore); assertNotNull(vectorStore.getId()); } + private void addFile(String fileId) { + fileIds.add(uploadFile(client, fileId, ASSISTANTS)); + } + @Override protected void afterTest() { LOGGER.info("Cleaning up created resources."); @@ -102,11 +112,48 @@ public void listVectorStore(HttpClient httpClient, AssistantsServiceVersion serv @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") public void createVectorStoreFile(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { beforeTest(httpClient, serviceVersion); + VectorStoreFile vectorStoreFile = client.createVectorStoreFile(vectorStore.getId(), fileIds.get(0)); + assertVectorStoreFile(vectorStoreFile); + } - String storeId = vectorStore.getId(); - VectorStoreFile vectorStoreFile = client.createVectorStoreFile(storeId, fileIds.get(0)); - assertNotNull(vectorStoreFile); - assertNotNull(vectorStoreFile.getId()); + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") + public void createVectorStoreFileWithAutoChunkingStrategy(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { + beforeTest(httpClient, serviceVersion); + VectorStoreFile vectorStoreFile = client.createVectorStoreFile(vectorStore.getId(), fileIds.get(0), + new VectorStoreAutoChunkingStrategyRequest()); + assertVectorStoreFile(vectorStoreFile); + assertStaticChunkingStrategy(vectorStoreFile, 800, 400); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") + public void createVectorStoreFileWithStaticChunkingStrategy(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { + beforeTest(httpClient, serviceVersion); + int maxChunkSizeTokens = 101; + int chunkOverlapTokens = 50; + VectorStoreFile vectorStoreFile = client.createVectorStoreFile(vectorStore.getId(), fileIds.get(0), + new VectorStoreStaticChunkingStrategyRequest( + new VectorStoreStaticChunkingStrategyOptions(maxChunkSizeTokens, chunkOverlapTokens)) + ); + + assertVectorStoreFile(vectorStoreFile); + assertStaticChunkingStrategy(vectorStoreFile, maxChunkSizeTokens, chunkOverlapTokens); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") + public void throwExceptionWhenOverrideExistChunkStrategy(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { + beforeTest(httpClient, serviceVersion); + VectorStoreFile vectorStoreFile = client.createVectorStoreFile(vectorStore.getId(), fileIds.get(0), + new VectorStoreAutoChunkingStrategyRequest()); + + assertVectorStoreFile(vectorStoreFile); + + assertThrows(HttpResponseException.class, () -> client.createVectorStoreFile(vectorStore.getId(), fileIds.get(0), + new VectorStoreStaticChunkingStrategyRequest( + new VectorStoreStaticChunkingStrategyOptions(101, 50)) + )); } @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @@ -156,10 +203,11 @@ public void listVectorStoreFiles(HttpClient httpClient, AssistantsServiceVersion @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") public void deleteVectorStoreFile(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { beforeTest(httpClient, serviceVersion); - String storeId = vectorStore.getId(); String fileId = fileIds.get(0); - + // Create Vector Store File + VectorStoreFile vectorStoreFile = client.createVectorStoreFile(storeId, fileId); + assertVectorStoreFile(vectorStoreFile); // Delete Vector Store File VectorStoreFileDeletionStatus deletionStatus = client.deleteVectorStoreFile(storeId, fileId); assertTrue(deletionStatus.isDeleted()); @@ -171,15 +219,52 @@ public void deleteVectorStoreFile(HttpClient httpClient, AssistantsServiceVersio @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") public void createVectorStoreFileBatch(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { beforeTest(httpClient, serviceVersion); + addFile(APPLE_FINANCIAL_STATEMENT); + VectorStoreFileBatch vectorStoreFileBatch = client.createVectorStoreFileBatch(vectorStore.getId(), + Arrays.asList(fileIds.get(0), fileIds.get(1))); + assertVectorStoreFileBatch(vectorStoreFileBatch, 2); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") + public void createVectorStoreFileBatchWithAutoChunkingStrategy(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { + beforeTest(httpClient, serviceVersion); + addFile(APPLE_FINANCIAL_STATEMENT); + VectorStoreFileBatch vectorStoreFileBatch = client.createVectorStoreFileBatch(vectorStore.getId(), + Arrays.asList(fileIds.get(0), fileIds.get(1)), + new VectorStoreAutoChunkingStrategyRequest()); + assertVectorStoreFileBatch(vectorStoreFileBatch, 2); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") + public void createVectorStoreFileBatchWithStaticChunkingStrategy(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { + beforeTest(httpClient, serviceVersion); + addFile(APPLE_FINANCIAL_STATEMENT); + VectorStoreFileBatch vectorStoreFileBatch = client.createVectorStoreFileBatch(vectorStore.getId(), + Arrays.asList(fileIds.get(0), fileIds.get(1)), + new VectorStoreStaticChunkingStrategyRequest( + new VectorStoreStaticChunkingStrategyOptions(101, 50))); + assertVectorStoreFileBatch(vectorStoreFileBatch, 2); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") + public void throwExceptionWhenOverrideExistChunkStrategyInBatch(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { + beforeTest(httpClient, serviceVersion); + addFile(APPLE_FINANCIAL_STATEMENT); + + VectorStoreFileBatch vectorStoreFileBatch = client.createVectorStoreFileBatch(vectorStore.getId(), + Arrays.asList(fileIds.get(0), fileIds.get(1)), + new VectorStoreStaticChunkingStrategyRequest( + new VectorStoreStaticChunkingStrategyOptions(101, 50))); - String storeId = vectorStore.getId(); - String fileId = fileIds.get(0); - String fileId2 = uploadFile(client, "20220924_aapl_10k.pdf", ASSISTANTS); - fileIds.add(fileId2); - VectorStoreFileBatch vectorStoreFileBatch = client.createVectorStoreFileBatch(storeId, Arrays.asList(fileId, fileId2)); assertNotNull(vectorStoreFileBatch); - assertNotNull(vectorStoreFileBatch.getId()); - assertEquals(2, vectorStoreFileBatch.getFileCounts().getTotal()); + + assertThrows(HttpResponseException.class, () -> client.createVectorStoreFileBatch(vectorStore.getId(), + Arrays.asList(fileIds.get(0), fileIds.get(1)), + new VectorStoreAutoChunkingStrategyRequest() + )); } @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) diff --git a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/FileSearchAsyncTest.java b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/FileSearchAsyncTest.java index 176961001b62..82a46bc01a80 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/FileSearchAsyncTest.java +++ b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/FileSearchAsyncTest.java @@ -19,6 +19,7 @@ import com.azure.ai.openai.assistants.models.ThreadMessageOptions; import com.azure.ai.openai.assistants.models.ThreadRun; import com.azure.ai.openai.assistants.implementation.AsyncUtils; +import com.azure.core.exception.HttpResponseException; import com.azure.core.http.HttpClient; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -31,10 +32,11 @@ import static com.azure.ai.openai.assistants.TestUtils.DISPLAY_NAME_WITH_ARGUMENTS; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -public class FileSearchAsyncTest extends AssistantsClientTestBase { +public class FileSearchAsyncTest extends FileSearchTestBase { AssistantsAsyncClient client; @@ -43,7 +45,7 @@ public class FileSearchAsyncTest extends AssistantsClientTestBase { public void basicFileSearch(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { client = getAssistantsAsyncClient(httpClient); - createRetrievalRunner((fileDetails, assistantCreationOptions) -> { + fileSearchRunner((fileDetails, assistantCreationOptions) -> { // Upload file StepVerifier.create(client.uploadFile(fileDetails, FilePurpose.ASSISTANTS) .flatMap(openAIFile -> { @@ -53,7 +55,8 @@ public void basicFileSearch(HttpClient httpClient, AssistantsServiceVersion serv createToolResourcesOptions.setFileSearch( new CreateFileSearchToolResourceOptions( new CreateFileSearchToolResourceVectorStoreOptionsList( - Arrays.asList(new CreateFileSearchToolResourceVectorStoreOptions(Arrays.asList(openAIFile.getId())))))); + Arrays.asList(new CreateFileSearchToolResourceVectorStoreOptions( + Arrays.asList(openAIFile.getId())))))); assistantCreationOptions.setToolResources(createToolResourcesOptions); cleanUp.setFile(openAIFile); return client.createAssistant(assistantCreationOptions).zipWith(Mono.just(cleanUp)); @@ -120,4 +123,31 @@ public void basicFileSearch(HttpClient httpClient, AssistantsServiceVersion serv .verifyComplete(); }); } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") + public void fileSearchWithMaxNumberResult(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { + client = getAssistantsAsyncClient(httpClient); + + fileSearchWithMaxNumberResultRunner((fileDetails, assistantCreationOptions) -> { + // Upload file + StepVerifier.create(client.uploadFile(fileDetails, FilePurpose.ASSISTANTS) + .flatMap(openAIFile -> { + // Create assistant + AsyncUtils cleanUp = new AsyncUtils(); + CreateToolResourcesOptions createToolResourcesOptions = new CreateToolResourcesOptions(); + createToolResourcesOptions.setFileSearch( + new CreateFileSearchToolResourceOptions( + new CreateFileSearchToolResourceVectorStoreOptionsList( + Arrays.asList(new CreateFileSearchToolResourceVectorStoreOptions( + Arrays.asList(openAIFile.getId())))))); + assistantCreationOptions.setToolResources(createToolResourcesOptions); + + cleanUp.setFile(openAIFile); + return client.createAssistant(assistantCreationOptions) + .zipWith(Mono.just(cleanUp)); + }) + ).verifyErrorSatisfies(error -> assertInstanceOf(HttpResponseException.class, error)); + }); + } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/FileSearchSyncTest.java b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/FileSearchSyncTest.java index 3af04468b770..7d9acc1cb310 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/FileSearchSyncTest.java +++ b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/FileSearchSyncTest.java @@ -19,6 +19,7 @@ import com.azure.ai.openai.assistants.models.ThreadMessage; import com.azure.ai.openai.assistants.models.ThreadMessageOptions; import com.azure.ai.openai.assistants.models.ThreadRun; +import com.azure.core.exception.HttpResponseException; import com.azure.core.http.HttpClient; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -29,9 +30,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; -public class FileSearchSyncTest extends AssistantsClientTestBase { +public class FileSearchSyncTest extends FileSearchTestBase { AssistantsClient client; @@ -40,7 +42,7 @@ public class FileSearchSyncTest extends AssistantsClientTestBase { public void basicFileSearch(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { client = getAssistantsClient(httpClient); - createRetrievalRunner((fileDetails, assistantCreationOptions) -> { + fileSearchRunner((fileDetails, assistantCreationOptions) -> { // Upload file for assistant OpenAIFile openAIFile = client.uploadFile(fileDetails, FilePurpose.ASSISTANTS); @@ -49,7 +51,8 @@ public void basicFileSearch(HttpClient httpClient, AssistantsServiceVersion serv createToolResourcesOptions.setFileSearch( new CreateFileSearchToolResourceOptions( new CreateFileSearchToolResourceVectorStoreOptionsList( - Arrays.asList(new CreateFileSearchToolResourceVectorStoreOptions(Arrays.asList(openAIFile.getId())))))); + Arrays.asList(new CreateFileSearchToolResourceVectorStoreOptions( + Arrays.asList(openAIFile.getId())))))); assistantCreationOptions.setToolResources(createToolResourcesOptions); Assistant assistant = client.createAssistant(assistantCreationOptions); @@ -95,5 +98,32 @@ public void basicFileSearch(HttpClient httpClient, AssistantsServiceVersion serv }); } + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") + public void fileSearchWithMaxNumberResult(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { + client = getAssistantsClient(httpClient); + + fileSearchWithMaxNumberResultRunner((fileDetails, assistantCreationOptions) -> { + // Upload file for assistant + OpenAIFile openAIFile = client.uploadFile(fileDetails, FilePurpose.ASSISTANTS); + + // Create assistant + CreateToolResourcesOptions createToolResourcesOptions = new CreateToolResourcesOptions(); + createToolResourcesOptions.setFileSearch( + new CreateFileSearchToolResourceOptions( + new CreateFileSearchToolResourceVectorStoreOptionsList( + Arrays.asList( + new CreateFileSearchToolResourceVectorStoreOptions( + Arrays.asList(openAIFile.getId())))))); + assistantCreationOptions.setToolResources(createToolResourcesOptions); + + assertThrows(HttpResponseException.class, () -> { + Assistant assistant = client.createAssistant(assistantCreationOptions); + client.deleteAssistant(assistant.getId()); + }); + // cleanup + client.deleteFile(openAIFile.getId()); + }); + } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/FileSearchTestBase.java b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/FileSearchTestBase.java new file mode 100644 index 000000000000..effa720358bc --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/FileSearchTestBase.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.openai.assistants; + +import com.azure.ai.openai.assistants.models.AssistantCreationOptions; +import com.azure.ai.openai.assistants.models.FileDetails; +import com.azure.ai.openai.assistants.models.FileSearchToolDefinition; +import com.azure.ai.openai.assistants.models.FileSearchToolDefinitionDetails; +import com.azure.core.http.HttpClient; +import com.azure.core.util.BinaryData; + +import java.util.Arrays; +import java.util.function.BiConsumer; + +public abstract class FileSearchTestBase extends AssistantsClientTestBase { + private static final String JAVA_SDK_TESTS_ASSISTANTS_TXT = "java_sdk_tests_assistants.txt"; + private static final String GPT_4_TURBO = "gpt-4-turbo"; + + public abstract void basicFileSearch(HttpClient httpClient, AssistantsServiceVersion serviceVersion); + public abstract void fileSearchWithMaxNumberResult(HttpClient httpClient, AssistantsServiceVersion serviceVersion); + + void fileSearchRunner(BiConsumer testRunner) { + FileDetails fileDetails = new FileDetails( + BinaryData.fromFile(openResourceFile(JAVA_SDK_TESTS_ASSISTANTS_TXT)), + JAVA_SDK_TESTS_ASSISTANTS_TXT); + + AssistantCreationOptions assistantOptions = new AssistantCreationOptions(GPT_4_TURBO) + .setName("Java SDK Retrieval Sample") + .setInstructions("You are a helpful assistant that can help fetch data from files you know about.") + .setTools(Arrays.asList(new FileSearchToolDefinition())); + + testRunner.accept(fileDetails, assistantOptions); + } + + void fileSearchWithMaxNumberResultRunner(BiConsumer testRunner) { + FileDetails fileDetails = new FileDetails( + BinaryData.fromFile(openResourceFile(JAVA_SDK_TESTS_ASSISTANTS_TXT)), + JAVA_SDK_TESTS_ASSISTANTS_TXT); + + AssistantCreationOptions assistantOptions = new AssistantCreationOptions(GPT_4_1106_PREVIEW) + .setName("Java SDK Retrieval Sample") + .setInstructions("You are a helpful assistant that can help fetch data from files you know about.") + .setTools(Arrays.asList( + new FileSearchToolDefinition().setFileSearch( + new FileSearchToolDefinitionDetails().setMaxNumResults(0) + ))); + + testRunner.accept(fileDetails, assistantOptions); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/VectorStoreAsyncTests.java b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/VectorStoreAsyncTests.java index 24b5e2db774d..da30cb00ee24 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/VectorStoreAsyncTests.java +++ b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/VectorStoreAsyncTests.java @@ -4,10 +4,14 @@ package com.azure.ai.openai.assistants; import com.azure.ai.openai.assistants.models.VectorStore; +import com.azure.ai.openai.assistants.models.VectorStoreAutoChunkingStrategyRequest; import com.azure.ai.openai.assistants.models.VectorStoreExpirationPolicy; import com.azure.ai.openai.assistants.models.VectorStoreFile; import com.azure.ai.openai.assistants.models.VectorStoreFileBatch; import com.azure.ai.openai.assistants.models.VectorStoreOptions; +import com.azure.ai.openai.assistants.models.VectorStoreStaticChunkingStrategyOptions; +import com.azure.ai.openai.assistants.models.VectorStoreStaticChunkingStrategyRequest; +import com.azure.core.exception.HttpResponseException; import com.azure.core.http.HttpClient; import com.azure.core.util.logging.ClientLogger; import org.junit.jupiter.params.ParameterizedTest; @@ -23,10 +27,11 @@ import static com.azure.ai.openai.assistants.models.VectorStoreExpirationPolicyAnchor.LAST_ACTIVE_AT; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -public class VectorStoreAsyncTests extends AssistantsClientTestBase { +public class VectorStoreAsyncTests extends VectorStoreTestBase { private static final ClientLogger LOGGER = new ClientLogger(VectorStoreSyncTests.class); private AssistantsAsyncClient client; @@ -34,12 +39,10 @@ public class VectorStoreAsyncTests extends AssistantsClientTestBase { private List fileIds = new ArrayList<>(); protected void beforeTest(HttpClient httpClient) { client = getAssistantsAsyncClient(httpClient); - fileIds.add(uploadFileAsync(client, "20210203_alphabet_10K.pdf", ASSISTANTS)); + addFile(ALPHABET_FINANCIAL_STATEMENT); VectorStoreOptions vectorStoreOptions = new VectorStoreOptions() .setName("Financial Statements") - .setExpiresAfter(new VectorStoreExpirationPolicy(LAST_ACTIVE_AT, 1)) - .setFileIds(fileIds); - + .setExpiresAfter(new VectorStoreExpirationPolicy(LAST_ACTIVE_AT, 1)); StepVerifier.create(client.createVectorStore(vectorStoreOptions)) .assertNext(vectorStore -> { this.vectorStore = vectorStore; @@ -49,6 +52,10 @@ protected void beforeTest(HttpClient httpClient) { .verifyComplete(); } + private void addFile(String fileId) { + fileIds.add(uploadFileAsync(client, fileId, ASSISTANTS)); + } + @Override protected void afterTest() { LOGGER.info("Cleaning up created resources."); @@ -111,15 +118,54 @@ public void listVectorStore(HttpClient httpClient, AssistantsServiceVersion serv @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") public void createVectorStoreFile(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { beforeTest(httpClient); - String storeId = vectorStore.getId(); - StepVerifier.create(client.createVectorStoreFile(storeId, fileIds.get(0))) - .assertNext(vectorStoreFile -> { - assertNotNull(vectorStoreFile); - assertNotNull(vectorStoreFile.getId()); - }) + StepVerifier.create(client.createVectorStoreFile(vectorStore.getId(), fileIds.get(0))) + .assertNext(this::assertVectorStoreFile) .verifyComplete(); } + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") + public void createVectorStoreFileWithAutoChunkingStrategy(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { + beforeTest(httpClient); + StepVerifier.create(client.createVectorStoreFile(vectorStore.getId(), fileIds.get(0), + new VectorStoreAutoChunkingStrategyRequest())) + .assertNext(vectorStoreFile -> { + assertVectorStoreFile(vectorStoreFile); + assertStaticChunkingStrategy(vectorStoreFile, 800, 400); + }) + .verifyComplete(); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") + public void createVectorStoreFileWithStaticChunkingStrategy(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { + beforeTest(httpClient); + int maxChunkSizeTokens = 101; + int chunkOverlapTokens = 50; + StepVerifier.create(client.createVectorStoreFile(vectorStore.getId(), fileIds.get(0), + new VectorStoreStaticChunkingStrategyRequest( + new VectorStoreStaticChunkingStrategyOptions(maxChunkSizeTokens, chunkOverlapTokens)))) + .assertNext(vectorStoreFile -> { + assertVectorStoreFile(vectorStoreFile); + assertStaticChunkingStrategy(vectorStoreFile, maxChunkSizeTokens, chunkOverlapTokens); + }) + .verifyComplete(); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") + public void throwExceptionWhenOverrideExistChunkStrategy(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { + beforeTest(httpClient); + StepVerifier.create(client.createVectorStoreFile(vectorStore.getId(), fileIds.get(0), + new VectorStoreAutoChunkingStrategyRequest())) + .assertNext(this::assertVectorStoreFile) + .verifyComplete(); + StepVerifier.create(client.createVectorStoreFile(vectorStore.getId(), fileIds.get(0), + new VectorStoreStaticChunkingStrategyRequest( + new VectorStoreStaticChunkingStrategyOptions(101, 50)))) + .verifyErrorSatisfies(error -> assertInstanceOf(HttpResponseException.class, error)); + } + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") public void getVectorStoreFile(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { @@ -170,6 +216,10 @@ public void deleteVectorStoreFile(HttpClient httpClient, AssistantsServiceVersio beforeTest(httpClient); String storeId = vectorStore.getId(); String fileId = fileIds.get(0); + // Create Vector Store File + StepVerifier.create(client.createVectorStoreFile(vectorStore.getId(), fileIds.get(0))) + .assertNext(this::assertVectorStoreFile) + .verifyComplete(); // Delete Vector Store File StepVerifier.create(client.deleteVectorStoreFile(storeId, fileId)) .assertNext(deletionStatus -> { @@ -184,20 +234,57 @@ public void deleteVectorStoreFile(HttpClient httpClient, AssistantsServiceVersio @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") public void createVectorStoreFileBatch(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { beforeTest(httpClient); - String storeId = vectorStore.getId(); - String fileId = fileIds.get(0); - String fileId2 = uploadFileAsync(client, "20220924_aapl_10k.pdf", ASSISTANTS); - fileIds.add(fileId2); - - StepVerifier.create(client.createVectorStoreFileBatch(storeId, Arrays.asList(fileId, fileId2))) - .assertNext(vectorStoreFileBatch -> { - assertNotNull(vectorStoreFileBatch); - assertNotNull(vectorStoreFileBatch.getId()); - assertEquals(2, vectorStoreFileBatch.getFileCounts().getTotal()); - }) + addFile(APPLE_FINANCIAL_STATEMENT); + StepVerifier.create(client.createVectorStoreFileBatch(vectorStore.getId(), + Arrays.asList(fileIds.get(0), fileIds.get(1)))) + .assertNext(vectorStoreFileBatch -> assertVectorStoreFileBatch(vectorStoreFileBatch, 2)) .verifyComplete(); } + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") + public void createVectorStoreFileBatchWithAutoChunkingStrategy(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { + beforeTest(httpClient); + addFile(APPLE_FINANCIAL_STATEMENT); + StepVerifier.create(client.createVectorStoreFileBatch(vectorStore.getId(), + Arrays.asList(fileIds.get(0), fileIds.get(1)), + new VectorStoreAutoChunkingStrategyRequest())) + .assertNext(vectorStoreFileBatch -> assertVectorStoreFileBatch(vectorStoreFileBatch, 2)) + .verifyComplete(); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") + public void createVectorStoreFileBatchWithStaticChunkingStrategy(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { + beforeTest(httpClient); + addFile(APPLE_FINANCIAL_STATEMENT); + StepVerifier.create(client.createVectorStoreFileBatch(vectorStore.getId(), + Arrays.asList(fileIds.get(0), fileIds.get(1)), + new VectorStoreStaticChunkingStrategyRequest( + new VectorStoreStaticChunkingStrategyOptions(101, 50)))) + .assertNext(vectorStoreFileBatch -> assertVectorStoreFileBatch(vectorStoreFileBatch, 2)) + .verifyComplete(); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") + public void throwExceptionWhenOverrideExistChunkStrategyInBatch(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { + beforeTest(httpClient); + addFile(APPLE_FINANCIAL_STATEMENT); + + StepVerifier.create(client.createVectorStoreFileBatch(vectorStore.getId(), + Arrays.asList(fileIds.get(0), fileIds.get(1)), + new VectorStoreStaticChunkingStrategyRequest( + new VectorStoreStaticChunkingStrategyOptions(101, 50)))) + .assertNext(vectorStoreFileBatch -> assertVectorStoreFileBatch(vectorStoreFileBatch, 2)) + .verifyComplete(); + + StepVerifier.create(client.createVectorStoreFileBatch(vectorStore.getId(), + Arrays.asList(fileIds.get(0), fileIds.get(1)), + new VectorStoreAutoChunkingStrategyRequest())) + .verifyErrorSatisfies(error -> assertInstanceOf(HttpResponseException.class, error)); + } + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") public void getVectorStoreFileBatch(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { diff --git a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/VectorStoreSyncTests.java b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/VectorStoreSyncTests.java index 53509a3e1b66..2cc3792b8956 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/VectorStoreSyncTests.java +++ b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/VectorStoreSyncTests.java @@ -5,6 +5,7 @@ import com.azure.ai.openai.assistants.models.PageableList; import com.azure.ai.openai.assistants.models.VectorStore; +import com.azure.ai.openai.assistants.models.VectorStoreAutoChunkingStrategyRequest; import com.azure.ai.openai.assistants.models.VectorStoreExpirationPolicy; import com.azure.ai.openai.assistants.models.VectorStoreFile; import com.azure.ai.openai.assistants.models.VectorStoreFileBatch; @@ -12,6 +13,9 @@ import com.azure.ai.openai.assistants.models.VectorStoreFileDeletionStatus; import com.azure.ai.openai.assistants.models.VectorStoreFileStatus; import com.azure.ai.openai.assistants.models.VectorStoreOptions; +import com.azure.ai.openai.assistants.models.VectorStoreStaticChunkingStrategyOptions; +import com.azure.ai.openai.assistants.models.VectorStoreStaticChunkingStrategyRequest; +import com.azure.core.exception.HttpResponseException; import com.azure.core.http.HttpClient; import com.azure.core.util.logging.ClientLogger; import org.junit.jupiter.params.ParameterizedTest; @@ -27,9 +31,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; -public class VectorStoreSyncTests extends AssistantsClientTestBase { +public class VectorStoreSyncTests extends VectorStoreTestBase { private static final ClientLogger LOGGER = new ClientLogger(VectorStoreSyncTests.class); private AssistantsClient client; @@ -38,17 +43,19 @@ public class VectorStoreSyncTests extends AssistantsClientTestBase { protected void beforeTest(HttpClient httpClient) { client = getAssistantsClient(httpClient); - fileIds.add(uploadFile(client, "20210203_alphabet_10K.pdf", ASSISTANTS)); + addFile(ALPHABET_FINANCIAL_STATEMENT); VectorStoreOptions vectorStoreOptions = new VectorStoreOptions() .setName("Financial Statements") - .setExpiresAfter(new VectorStoreExpirationPolicy(LAST_ACTIVE_AT, 1)) - .setFileIds(fileIds); + .setExpiresAfter(new VectorStoreExpirationPolicy(LAST_ACTIVE_AT, 1)); vectorStore = client.createVectorStore(vectorStoreOptions); - assertNotNull(vectorStore); assertNotNull(vectorStore.getId()); } + private void addFile(String fileId) { + fileIds.add(uploadFile(client, fileId, ASSISTANTS)); + } + @Override protected void afterTest() { LOGGER.info("Cleaning up created resources."); @@ -102,10 +109,48 @@ public void listVectorStore(HttpClient httpClient, AssistantsServiceVersion serv @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") public void createVectorStoreFile(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { beforeTest(httpClient); - String storeId = vectorStore.getId(); - VectorStoreFile vectorStoreFile = client.createVectorStoreFile(storeId, fileIds.get(0)); - assertNotNull(vectorStoreFile); - assertNotNull(vectorStoreFile.getId()); + VectorStoreFile vectorStoreFile = client.createVectorStoreFile(vectorStore.getId(), fileIds.get(0)); + assertVectorStoreFile(vectorStoreFile); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") + public void createVectorStoreFileWithAutoChunkingStrategy(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { + beforeTest(httpClient); + VectorStoreFile vectorStoreFile = client.createVectorStoreFile(vectorStore.getId(), fileIds.get(0), + new VectorStoreAutoChunkingStrategyRequest()); + assertVectorStoreFile(vectorStoreFile); + assertStaticChunkingStrategy(vectorStoreFile, 800, 400); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") + public void createVectorStoreFileWithStaticChunkingStrategy(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { + beforeTest(httpClient); + int maxChunkSizeTokens = 101; + int chunkOverlapTokens = 50; + VectorStoreFile vectorStoreFile = client.createVectorStoreFile(vectorStore.getId(), fileIds.get(0), + new VectorStoreStaticChunkingStrategyRequest( + new VectorStoreStaticChunkingStrategyOptions(maxChunkSizeTokens, chunkOverlapTokens)) + ); + + assertVectorStoreFile(vectorStoreFile); + assertStaticChunkingStrategy(vectorStoreFile, maxChunkSizeTokens, chunkOverlapTokens); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") + public void throwExceptionWhenOverrideExistChunkStrategy(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { + beforeTest(httpClient); + VectorStoreFile vectorStoreFile = client.createVectorStoreFile(vectorStore.getId(), fileIds.get(0), + new VectorStoreAutoChunkingStrategyRequest()); + + assertVectorStoreFile(vectorStoreFile); + + assertThrows(HttpResponseException.class, () -> client.createVectorStoreFile(vectorStore.getId(), fileIds.get(0), + new VectorStoreStaticChunkingStrategyRequest( + new VectorStoreStaticChunkingStrategyOptions(101, 50)) + )); } @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @@ -156,7 +201,9 @@ public void deleteVectorStoreFile(HttpClient httpClient, AssistantsServiceVersio beforeTest(httpClient); String storeId = vectorStore.getId(); String fileId = fileIds.get(0); - + // Create Vector Store File + VectorStoreFile vectorStoreFile = client.createVectorStoreFile(storeId, fileId); + assertVectorStoreFile(vectorStoreFile); // Delete Vector Store File VectorStoreFileDeletionStatus deletionStatus = client.deleteVectorStoreFile(storeId, fileId); assertTrue(deletionStatus.isDeleted()); @@ -168,14 +215,52 @@ public void deleteVectorStoreFile(HttpClient httpClient, AssistantsServiceVersio @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") public void createVectorStoreFileBatch(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { beforeTest(httpClient); - String storeId = vectorStore.getId(); - String fileId = fileIds.get(0); - String fileId2 = uploadFile(client, "20220924_aapl_10k.pdf", ASSISTANTS); - fileIds.add(fileId2); - VectorStoreFileBatch vectorStoreFileBatch = client.createVectorStoreFileBatch(storeId, Arrays.asList(fileId, fileId2)); + addFile(APPLE_FINANCIAL_STATEMENT); + VectorStoreFileBatch vectorStoreFileBatch = client.createVectorStoreFileBatch(vectorStore.getId(), + Arrays.asList(fileIds.get(0), fileIds.get(1))); + assertVectorStoreFileBatch(vectorStoreFileBatch, 2); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") + public void createVectorStoreFileBatchWithAutoChunkingStrategy(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { + beforeTest(httpClient); + addFile(APPLE_FINANCIAL_STATEMENT); + VectorStoreFileBatch vectorStoreFileBatch = client.createVectorStoreFileBatch(vectorStore.getId(), + Arrays.asList(fileIds.get(0), fileIds.get(1)), + new VectorStoreAutoChunkingStrategyRequest()); + assertVectorStoreFileBatch(vectorStoreFileBatch, 2); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") + public void createVectorStoreFileBatchWithStaticChunkingStrategy(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { + beforeTest(httpClient); + addFile(APPLE_FINANCIAL_STATEMENT); + VectorStoreFileBatch vectorStoreFileBatch = client.createVectorStoreFileBatch(vectorStore.getId(), + Arrays.asList(fileIds.get(0), fileIds.get(1)), + new VectorStoreStaticChunkingStrategyRequest( + new VectorStoreStaticChunkingStrategyOptions(101, 50))); + assertVectorStoreFileBatch(vectorStoreFileBatch, 2); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.openai.assistants.TestUtils#getTestParameters") + public void throwExceptionWhenOverrideExistChunkStrategyInBatch(HttpClient httpClient, AssistantsServiceVersion serviceVersion) { + beforeTest(httpClient); + addFile(APPLE_FINANCIAL_STATEMENT); + + VectorStoreFileBatch vectorStoreFileBatch = client.createVectorStoreFileBatch(vectorStore.getId(), + Arrays.asList(fileIds.get(0), fileIds.get(1)), + new VectorStoreStaticChunkingStrategyRequest( + new VectorStoreStaticChunkingStrategyOptions(101, 50))); + assertNotNull(vectorStoreFileBatch); - assertNotNull(vectorStoreFileBatch.getId()); - assertEquals(2, vectorStoreFileBatch.getFileCounts().getTotal()); + + assertThrows(HttpResponseException.class, () -> client.createVectorStoreFileBatch(vectorStore.getId(), + Arrays.asList(fileIds.get(0), fileIds.get(1)), + new VectorStoreAutoChunkingStrategyRequest() + )); } @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) diff --git a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/VectorStoreTestBase.java b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/VectorStoreTestBase.java new file mode 100644 index 000000000000..85a8e953f2f1 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/VectorStoreTestBase.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.openai.assistants; + +import com.azure.ai.openai.assistants.models.VectorStoreFile; +import com.azure.ai.openai.assistants.models.VectorStoreFileBatch; +import com.azure.ai.openai.assistants.models.VectorStoreStaticChunkingStrategyOptions; +import com.azure.ai.openai.assistants.models.VectorStoreStaticChunkingStrategyResponse; +import com.azure.core.http.HttpClient; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +public abstract class VectorStoreTestBase extends AssistantsClientTestBase { + static final String APPLE_FINANCIAL_STATEMENT = "20220924_aapl_10k.pdf"; + static final String ALPHABET_FINANCIAL_STATEMENT = "20210203_alphabet_10K.pdf"; + + public abstract void updateVectorStoreName(HttpClient httpClient, AssistantsServiceVersion serviceVersion); + public abstract void getVectorStore(HttpClient httpClient, AssistantsServiceVersion serviceVersion); + public abstract void listVectorStore(HttpClient httpClient, AssistantsServiceVersion serviceVersion); + public abstract void createVectorStoreFile(HttpClient httpClient, AssistantsServiceVersion serviceVersion); + public abstract void createVectorStoreFileWithAutoChunkingStrategy(HttpClient httpClient, AssistantsServiceVersion serviceVersion); + public abstract void createVectorStoreFileWithStaticChunkingStrategy(HttpClient httpClient, AssistantsServiceVersion serviceVersion); + public abstract void throwExceptionWhenOverrideExistChunkStrategy(HttpClient httpClient, AssistantsServiceVersion serviceVersion); + public abstract void getVectorStoreFile(HttpClient httpClient, AssistantsServiceVersion serviceVersion); + public abstract void listVectorStoreFiles(HttpClient httpClient, AssistantsServiceVersion serviceVersion); + public abstract void deleteVectorStoreFile(HttpClient httpClient, AssistantsServiceVersion serviceVersion); + public abstract void createVectorStoreFileBatch(HttpClient httpClient, AssistantsServiceVersion serviceVersion); + public abstract void createVectorStoreFileBatchWithAutoChunkingStrategy(HttpClient httpClient, AssistantsServiceVersion serviceVersion); + public abstract void createVectorStoreFileBatchWithStaticChunkingStrategy(HttpClient httpClient, AssistantsServiceVersion serviceVersion); + public abstract void throwExceptionWhenOverrideExistChunkStrategyInBatch(HttpClient httpClient, AssistantsServiceVersion serviceVersion); + public abstract void getVectorStoreFileBatch(HttpClient httpClient, AssistantsServiceVersion serviceVersion); + public abstract void listVectorStoreFilesBatch(HttpClient httpClient, AssistantsServiceVersion serviceVersion); + public abstract void cancelVectorStoreFileBatch(HttpClient httpClient, AssistantsServiceVersion serviceVersion); + + + void assertVectorStoreFile(VectorStoreFile vectorStoreFile) { + assertNotNull(vectorStoreFile); + assertNotNull(vectorStoreFile.getId()); + } + + void assertVectorStoreFileBatch(VectorStoreFileBatch vectorStoreFileBatch, int fileCounts) { + assertNotNull(vectorStoreFileBatch); + assertNotNull(vectorStoreFileBatch.getId()); + assertEquals(fileCounts, vectorStoreFileBatch.getFileCounts().getTotal()); + } + + void assertStaticChunkingStrategy(VectorStoreFile vectorStoreFile, int maxChunkSizeTokens, int chunkOverlapTokens) { + VectorStoreStaticChunkingStrategyResponse chunkingStrategy = (VectorStoreStaticChunkingStrategyResponse) + vectorStoreFile.getChunkingStrategy(); + VectorStoreStaticChunkingStrategyOptions staticProperty = chunkingStrategy.getStaticProperty(); + assertNotNull(staticProperty); + assertEquals(maxChunkSizeTokens, staticProperty.getMaxChunkSizeTokens()); + assertEquals(chunkOverlapTokens, staticProperty.getChunkOverlapTokens()); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/tsp-location.yaml b/sdk/openai/azure-ai-openai-assistants/tsp-location.yaml index 1bd9d1e99302..c6f8abad0641 100644 --- a/sdk/openai/azure-ai-openai-assistants/tsp-location.yaml +++ b/sdk/openai/azure-ai-openai-assistants/tsp-location.yaml @@ -1,3 +1,3 @@ directory: specification/ai/OpenAI.Assistants -commit: 46de0ae3b0fef1f322b5a14b2fa5b6a65da435a2 +commit: cd41ba31a6af51dae34b0a5930eeb2e77a04b481 repo: Azure/azure-rest-api-specs From 099ab207ce0ffb3f83390a27f6ec9e86880440d4 Mon Sep 17 00:00:00 2001 From: Ben Broderick Phillips Date: Wed, 28 Aug 2024 15:33:11 -0400 Subject: [PATCH 077/128] Default to sub config file paths/svc connection for public + sovereign live tests (#41267) --- .../templates/stages/archetype-sdk-tests.yml | 13 ++++++++----- sdk/documentintelligence/tests.native.yml | 1 - sdk/documentintelligence/tests.yml | 11 +++++------ sdk/formrecognizer/tests.native.yml | 6 +++--- sdk/formrecognizer/tests.yml | 6 +++--- sdk/keyvault/tests-jca.yml | 17 ++++++++++++----- sdk/keyvault/tests.yml | 12 +++++++----- sdk/search/tests.yml | 9 ++++++--- sdk/servicebus/tests.yml | 1 - ...tests-supported-spring-versions-template.yml | 7 ++++--- sdk/storage/tests-template.yml | 3 ++- 11 files changed, 50 insertions(+), 36 deletions(-) diff --git a/eng/pipelines/templates/stages/archetype-sdk-tests.yml b/eng/pipelines/templates/stages/archetype-sdk-tests.yml index a6cad4dd6333..09d4db61b94a 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-tests.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-tests.yml @@ -60,23 +60,26 @@ parameters: type: object default: Public: - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) ServiceConnection: azure-sdk-tests SubscriptionConfigurationFilePaths: - eng/common/TestResources/sub-config/AzurePublicMsft.json Preview: - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources-preview) ServiceConnection: azure-sdk-tests-preview + SubscriptionConfigurationFilePaths: + - eng/common/TestResources/sub-config/AzurePreviewMsft.json Canary: - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) ServiceConnection: azure-sdk-tests + SubscriptionConfigurationFilePaths: + - eng/common/TestResources/sub-config/AzurePublicMsft.json Location: 'centraluseuap' UsGov: - SubscriptionConfiguration: $(sub-config-gov-test-resources) ServiceConnection: usgov_azure-sdk-tests + SubscriptionConfigurationFilePaths: + - eng/common/TestResources/sub-config/AzureUsGovMsft.json China: - SubscriptionConfiguration: $(sub-config-cn-test-resources) ServiceConnection: china_azure-sdk-tests + SubscriptionConfigurationFilePaths: + - eng/common/TestResources/sub-config/AzureChinaMsft.json - name: MatrixConfigs type: object default: diff --git a/sdk/documentintelligence/tests.native.yml b/sdk/documentintelligence/tests.native.yml index a940be13ad4f..25bd28e73cf9 100644 --- a/sdk/documentintelligence/tests.native.yml +++ b/sdk/documentintelligence/tests.native.yml @@ -11,7 +11,6 @@ extends: safeName: azureaidocumentintelligence CloudConfig: Public: - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) ServiceConnection: azure-sdk-tests SubscriptionConfigurationFilePaths: - eng/common/TestResources/sub-config/AzurePublicMsft.json diff --git a/sdk/documentintelligence/tests.yml b/sdk/documentintelligence/tests.yml index e02a4d600c97..48abae511009 100644 --- a/sdk/documentintelligence/tests.yml +++ b/sdk/documentintelligence/tests.yml @@ -10,11 +10,10 @@ extends: groupId: com.azure safeName: azureaidocumentintelligence CloudConfig: - CanaryPreview: - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources-preview) - ServiceConnection: azure-sdk-tests + Preview: + ServiceConnection: azure-sdk-tests-preview SubscriptionConfigurationFilePaths: - - eng/common/TestResources/sub-config/AzurePublicMsft.json + - eng/common/TestResources/sub-config/AzurePreviewMsft.json Location: 'eastus' - Clouds: 'CanaryPreview' - SupportedClouds: 'CanaryPreview' + Clouds: 'Preview' + SupportedClouds: 'Preview' diff --git a/sdk/formrecognizer/tests.native.yml b/sdk/formrecognizer/tests.native.yml index d9c9e473005d..76c34289a991 100644 --- a/sdk/formrecognizer/tests.native.yml +++ b/sdk/formrecognizer/tests.native.yml @@ -11,8 +11,8 @@ extends: safeName: azureaiformrecognizer CloudConfig: Public: - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) - Location: 'eastus' ServiceConnection: azure-sdk-tests - SubscriptionConfigurationFilePath: eng/common/TestResources/sub-config/AzurePublicMsft.json + SubscriptionConfigurationFilePaths: + - eng/common/TestResources/sub-config/AzurePublicMsft.json + Location: 'eastus' SupportedClouds: 'Public' diff --git a/sdk/formrecognizer/tests.yml b/sdk/formrecognizer/tests.yml index 7ae5d47f3495..6949b578beb7 100644 --- a/sdk/formrecognizer/tests.yml +++ b/sdk/formrecognizer/tests.yml @@ -11,8 +11,8 @@ extends: safeName: azureaiformrecognizer CloudConfig: Public: - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) - Location: 'centraluseuap' ServiceConnection: azure-sdk-tests - SubscriptionConfigurationFilePath: eng/common/TestResources/sub-config/AzurePublicMsft.json + SubscriptionConfigurationFilePaths: + - eng/common/TestResources/sub-config/AzurePublicMsft.json + Location: 'centraluseuap' SupportedClouds: 'Public' diff --git a/sdk/keyvault/tests-jca.yml b/sdk/keyvault/tests-jca.yml index 77f9cbf88c4f..37fb253b55bf 100644 --- a/sdk/keyvault/tests-jca.yml +++ b/sdk/keyvault/tests-jca.yml @@ -12,22 +12,29 @@ extends: AZURE_LOG_LEVEL: 2 CloudConfig: Public: - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) + ServiceConnection: azure-sdk-tests + SubscriptionConfigurationFilePaths: + - eng/common/TestResources/sub-config/AzurePublicMsft.json ${{ if not(contains(variables['Build.DefinitionName'], 'tests-weekly')) }}: MatrixFilters: - ArmTemplateParameters=^(?!.*enableHsm.*true) UsGov: - SubscriptionConfiguration: $(sub-config-gov-test-resources) + ServiceConnection: usgov_azure-sdk-tests + SubscriptionConfigurationFilePaths: + - eng/common/TestResources/sub-config/AzureUsGovMsft.json MatrixFilters: - ArmTemplateParameters=^(?!.*enableHsm.*true) China: - SubscriptionConfiguration: $(sub-config-cn-test-resources) + ServiceConnection: china_azure-sdk-tests + SubscriptionConfigurationFilePaths: + - eng/common/TestResources/sub-config/AzureChinaMsft.json MatrixFilters: - ArmTemplateParameters=^(?!.*enableHsm.*true) Canary: - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) - Location: 'centraluseuap' ServiceConnection: azure-sdk-tests + SubscriptionConfigurationFilePaths: + - eng/common/TestResources/sub-config/AzurePublicMsft.json + Location: 'centraluseuap' # Managed HSM test resources are expensive and provisioning has not been reliable. # Given test coverage of non-canary regions we probably don't need to test in canary. MatrixFilters: diff --git a/sdk/keyvault/tests.yml b/sdk/keyvault/tests.yml index 6828621ef180..c9ee547124f8 100644 --- a/sdk/keyvault/tests.yml +++ b/sdk/keyvault/tests.yml @@ -15,24 +15,26 @@ extends: ServiceConnection: azure-sdk-tests SubscriptionConfigurationFilePaths: - eng/common/TestResources/sub-config/AzurePublicMsft.json - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) ${{ if not(contains(variables['Build.DefinitionName'], 'tests-weekly')) }}: MatrixFilters: - ArmTemplateParameters=^(?!.*enableHsm.*true) UsGov: - SubscriptionConfiguration: $(sub-config-gov-test-resources) ServiceConnection: usgov_azure-sdk-tests + SubscriptionConfigurationFilePaths: + - eng/common/TestResources/sub-config/AzureUsGovMsft.json MatrixFilters: - ArmTemplateParameters=^(?!.*enableHsm.*true) China: - SubscriptionConfiguration: $(sub-config-cn-test-resources) ServiceConnection: china_azure-sdk-tests + SubscriptionConfigurationFilePaths: + - eng/common/TestResources/sub-config/AzureChinaMsft.json MatrixFilters: - ArmTemplateParameters=^(?!.*enableHsm.*true) Canary: - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) - Location: 'centraluseuap' ServiceConnection: azure-sdk-tests + SubscriptionConfigurationFilePaths: + - eng/common/TestResources/sub-config/AzurePublicMsft.json + Location: 'centraluseuap' # Managed HSM test resources are expensive and provisioning has not been reliable. # Given test coverage of non-canary regions we probably don't need to test in canary. MatrixFilters: diff --git a/sdk/search/tests.yml b/sdk/search/tests.yml index cde839faa490..3fc225594f65 100644 --- a/sdk/search/tests.yml +++ b/sdk/search/tests.yml @@ -9,15 +9,18 @@ extends: TimeoutInMinutes: 60 CloudConfig: Public: - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) ServiceConnection: azure-sdk-tests + SubscriptionConfigurationFilePaths: + - eng/common/TestResources/sub-config/AzurePublicMsft.json Location: eastus UsGov: - SubscriptionConfiguration: $(sub-config-gov-test-resources) ServiceConnection: usgov_azure-sdk-tests + SubscriptionConfigurationFilePaths: + - eng/common/TestResources/sub-config/AzureUsGovMsft.json China: - SubscriptionConfiguration: $(sub-config-cn-test-resources) ServiceConnection: china_azure-sdk-tests + SubscriptionConfigurationFilePaths: + - eng/common/TestResources/sub-config/AzureChinaMsft.json EnvVars: AZURE_SEARCH_TEST_MODE: Live Artifacts: diff --git a/sdk/servicebus/tests.yml b/sdk/servicebus/tests.yml index fb27e1db3671..4fc1387295c2 100644 --- a/sdk/servicebus/tests.yml +++ b/sdk/servicebus/tests.yml @@ -12,7 +12,6 @@ extends: ServiceConnection: azure-sdk-tests SubscriptionConfigurationFilePaths: - eng/common/TestResources/sub-config/AzurePublicMsft.json - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) EnvVars: AZURE_LOG_LEVEL: 1 AdditionalMatrixConfigs: diff --git a/sdk/spring/pipeline/tests-supported-spring-versions-template.yml b/sdk/spring/pipeline/tests-supported-spring-versions-template.yml index d6f2d503b694..0c10f204d3bd 100644 --- a/sdk/spring/pipeline/tests-supported-spring-versions-template.yml +++ b/sdk/spring/pipeline/tests-supported-spring-versions-template.yml @@ -44,16 +44,17 @@ stages: Clouds: "Public" CloudConfig: Public: - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) ServiceConnection: azure-sdk-tests SubscriptionConfigurationFilePaths: - eng/common/TestResources/sub-config/AzurePublicMsft.json UsGov: - SubscriptionConfiguration: $(sub-config-gov-test-resources) ServiceConnection: usgov_azure-sdk-tests + SubscriptionConfigurationFilePaths: + - eng/common/TestResources/sub-config/AzureUsGovMsft.json China: - SubscriptionConfiguration: $(sub-config-cn-test-resources) ServiceConnection: china_azure-sdk-tests + SubscriptionConfigurationFilePaths: + - eng/common/TestResources/sub-config/AzureChinaMsft.json Location: "chinanorth3" TestResourceDirectories: ${{ parameters.TestResourceDirectories }} Artifacts: ${{ parameters.Artifacts }} diff --git a/sdk/storage/tests-template.yml b/sdk/storage/tests-template.yml index 7d53c0c368fe..02d580c6269e 100644 --- a/sdk/storage/tests-template.yml +++ b/sdk/storage/tests-template.yml @@ -48,8 +48,9 @@ stages: Location: canadacentral CloudConfig: Preview: - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources-preview) ServiceConnection: azure-sdk-tests-preview + SubscriptionConfigurationFilePaths: + - eng/common/TestResources/sub-config/AzurePreviewMsft.json PrivatePreview: SubscriptionConfiguration: $(sub-config-storage-test-resources) Clouds: Preview From ed57d25806ef46a596be0d8797e554a95ae91315 Mon Sep 17 00:00:00 2001 From: Glenn Harper Date: Tue, 3 Sep 2024 08:22:35 -0700 Subject: [PATCH 078/128] remove azure.xml dependency --- sdk/ai/azure-ai-inference/pom.xml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sdk/ai/azure-ai-inference/pom.xml b/sdk/ai/azure-ai-inference/pom.xml index 999f03324541..f9dd609102a7 100644 --- a/sdk/ai/azure-ai-inference/pom.xml +++ b/sdk/ai/azure-ai-inference/pom.xml @@ -50,11 +50,6 @@ azure-json 1.2.0 - - com.azure - azure-xml - 1.1.0 - com.azure azure-core From 889af92ee7af9102c421214ae7ec5d081d3e89ff Mon Sep 17 00:00:00 2001 From: Glenn Harper Date: Wed, 4 Sep 2024 12:20:26 -0700 Subject: [PATCH 079/128] make completeWithResponse public --- .../ai/inference/ChatCompletionsClient.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java index e0c50f8dd1e4..8d3287fb0f80 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java @@ -19,6 +19,7 @@ import com.azure.core.http.HttpHeaderName; import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.BinaryData; import com.azure.ai.inference.implementation.InferenceServerSentEvents; import com.azure.ai.inference.models.ChatCompletionsOptions; @@ -26,7 +27,10 @@ import com.azure.ai.inference.models.StreamingChatCompletionsUpdate; import com.azure.core.util.IterableStream; import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + import java.nio.ByteBuffer; +import java.util.Objects; /** * Initializes a new instance of the synchronous ChatCompletionsClient type. @@ -63,7 +67,7 @@ public final class ChatCompletionsClient { * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

- * + * *
{@code
      * {
      *     messages (Required): [
@@ -101,9 +105,9 @@ public final class ChatCompletionsClient {
      *     }
      * }
      * }
- * + * *

Response Body Schema

- * + * *
{@code
      * {
      *     id: String (Required)
@@ -147,17 +151,17 @@ public final class ChatCompletionsClient {
      * Completions support a wide variety of tasks and generate text that continues from or "completes"
      * provided prompt data along with {@link Response}.
      */
-    @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
-    Response completeWithResponse(BinaryData completeRequest, RequestOptions requestOptions) {
-        return this.serviceClient.completeWithResponse(completeRequest, requestOptions);
+    public Mono> completeWithResponse(BinaryData completeRequest, RequestOptions requestOptions) {
+        Response response = serviceClient.completeWithResponse(completeRequest, requestOptions);
+        return Mono.just(new SimpleResponse<>(response, response.getValue().toObject(ChatCompletions.class)));
     }
 
     /**
      * Returns information about the AI model.
      * The method makes a REST API call to the `/info` route on the given endpoint.
      * 

Response Body Schema

- * + * *
{@code
      * {
      *     model_name: String (Required)
@@ -218,7 +222,7 @@ ChatCompletions complete(ChatCompletionsOptions options) {
         if (extraParams != null) {
             requestOptions.setHeader(HttpHeaderName.fromString("extra-parameters"), extraParams.toString());
         }
-        return completeWithResponse(completeRequest, requestOptions).getValue().toObject(ChatCompletions.class);
+        return Objects.requireNonNull(completeWithResponse(completeRequest, requestOptions).block()).getValue();
     }
 
     /**

From c6422852a93efb614693ced8d99526a2b302da5b Mon Sep 17 00:00:00 2001
From: Glenn Harper 
Date: Wed, 4 Sep 2024 13:33:05 -0700
Subject: [PATCH 080/128] make complete with options public

---
 .../main/java/com/azure/ai/inference/ChatCompletionsClient.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java
index 8d3287fb0f80..5f1c59b71409 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java
@@ -201,7 +201,7 @@ Response getModelInfoWithResponse(RequestOptions requestOptions) {
      * provided prompt data.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
-    ChatCompletions complete(ChatCompletionsOptions options) {
+    public ChatCompletions complete(ChatCompletionsOptions options) {
         // Generated convenience method for completeWithResponse
         RequestOptions requestOptions = new RequestOptions();
         CompleteRequest completeRequestObj

From 579db68cee21a617c13a9f5f05f230f5a36f68e3 Mon Sep 17 00:00:00 2001
From: Glenn Harper 
Date: Wed, 4 Sep 2024 13:59:23 -0700
Subject: [PATCH 081/128] add string constructor for ChatRequestUserMessage

---
 sdk/ai/azure-ai-inference/README.md              |  8 ++++----
 sdk/ai/azure-ai-inference/TROUBLESHOOTING.md     |  4 ++--
 .../implementation/ChatCompletionsUtils.java     |  2 +-
 .../inference/models/ChatRequestUserMessage.java | 10 ++++++++++
 .../com/azure/ai/inference/ReadmeSamples.java    | 16 ++++++++--------
 .../ai/inference/usage/StreamingChatSample.java  |  4 ++--
 .../usage/StreamingChatSampleAsync.java          |  4 ++--
 .../inference/ChatCompletionsClientTestBase.java |  4 ++--
 .../inference/ChatCompletionsSyncClientTest.java |  2 +-
 9 files changed, 32 insertions(+), 22 deletions(-)

diff --git a/sdk/ai/azure-ai-inference/README.md b/sdk/ai/azure-ai-inference/README.md
index a6c6e2458bb4..61b3cc3fd8db 100644
--- a/sdk/ai/azure-ai-inference/README.md
+++ b/sdk/ai/azure-ai-inference/README.md
@@ -107,9 +107,9 @@ The following sections provide several code snippets covering some of the most c
 ```java readme-sample-getChatCompletions
 List chatMessages = new ArrayList<>();
 chatMessages.add(new ChatRequestSystemMessage("You are a helpful assistant. You will talk like a pirate."));
-chatMessages.add(ChatRequestUserMessage.fromString("Can you help me?"));
+chatMessages.add(new ChatRequestUserMessage("Can you help me?"));
 chatMessages.add(new ChatRequestAssistantMessage("Of course, me hearty! What can I do for ye?"));
-chatMessages.add(ChatRequestUserMessage.fromString("What's the best way to train a parrot?"));
+chatMessages.add(new ChatRequestUserMessage("What's the best way to train a parrot?"));
 
 ChatCompletions chatCompletions = client.complete(new ChatCompletionsOptions(chatMessages));
 
@@ -130,9 +130,9 @@ Please refer to the service documentation for a conceptual discussion of [text c
 ```java readme-sample-getChatCompletionsStream
 List chatMessages = new ArrayList<>();
 chatMessages.add(new ChatRequestSystemMessage("You are a helpful assistant. You will talk like a pirate."));
-chatMessages.add(ChatRequestUserMessage.fromString("Can you help me?"));
+chatMessages.add(new ChatRequestUserMessage("Can you help me?"));
 chatMessages.add(new ChatRequestAssistantMessage("Of course, me hearty! What can I do for ye?"));
-chatMessages.add(ChatRequestUserMessage.fromString("What's the best way to train a parrot?"));
+chatMessages.add(new ChatRequestUserMessage("What's the best way to train a parrot?"));
 
 client.completeStreaming(new ChatCompletionsOptions(chatMessages))
     .forEach(chatCompletions -> {
diff --git a/sdk/ai/azure-ai-inference/TROUBLESHOOTING.md b/sdk/ai/azure-ai-inference/TROUBLESHOOTING.md
index 7cdd4555a68c..7eba94893407 100644
--- a/sdk/ai/azure-ai-inference/TROUBLESHOOTING.md
+++ b/sdk/ai/azure-ai-inference/TROUBLESHOOTING.md
@@ -82,9 +82,9 @@ Here's the example of how to catch it with synchronous client
 ```java readme-sample-troubleshootingExceptions
 List chatMessages = new ArrayList<>();
 chatMessages.add(new ChatRequestSystemMessage("You are a helpful assistant. You will talk like a pirate."));
-chatMessages.add(ChatRequestUserMessage.fromString("Can you help me?"));
+chatMessages.add(new ChatRequestUserMessage("Can you help me?"));
 chatMessages.add(new ChatRequestAssistantMessage("Of course, me hearty! What can I do for ye?"));
-chatMessages.add(ChatRequestUserMessage.fromString("What's the best way to train a parrot?"));
+chatMessages.add(new ChatRequestUserMessage("What's the best way to train a parrot?"));
 
 try {
         ChatCompletions chatCompletions = client.complete(new ChatCompletionsOptions(chatMessages));
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsUtils.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsUtils.java
index 566028346470..72a7b387a107 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsUtils.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/ChatCompletionsUtils.java
@@ -26,7 +26,7 @@ private ChatCompletionsUtils() {
      * */
     public static ChatCompletionsOptions defaultCompleteOptions(String prompt) {
         List messages = new ArrayList<>();
-        messages.add(ChatRequestUserMessage.fromString(prompt));
+        messages.add(new ChatRequestUserMessage(prompt));
         return new ChatCompletionsOptions(messages);
     }
 
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java
index e5a0fb04e938..03450a83befa 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java
@@ -41,6 +41,16 @@ public ChatRequestUserMessage(BinaryData content) {
         this.content = content;
     }
 
+    /**
+     * Creates an instance of ChatRequestUserMessage class.
+     *
+     * @param content the string content value to set.
+     */
+    public ChatRequestUserMessage(String content) {
+        String jsonPrompt = "{" + "\"content\":\"%s\"" + "}";
+        String contentString = String.format(jsonPrompt, content);
+        this.content = BinaryData.fromString(contentString);
+    }
     /**
      * Get the role property: The chat role associated with this message.
      *
diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/ReadmeSamples.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/ReadmeSamples.java
index a04c12476732..2da5dc6312b1 100644
--- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/ReadmeSamples.java
+++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/ReadmeSamples.java
@@ -59,9 +59,9 @@ public void getChatCompletions() {
         // BEGIN: readme-sample-getChatCompletions
         List chatMessages = new ArrayList<>();
         chatMessages.add(new ChatRequestSystemMessage("You are a helpful assistant. You will talk like a pirate."));
-        chatMessages.add(ChatRequestUserMessage.fromString("Can you help me?"));
+        chatMessages.add(new ChatRequestUserMessage("Can you help me?"));
         chatMessages.add(new ChatRequestAssistantMessage("Of course, me hearty! What can I do for ye?"));
-        chatMessages.add(ChatRequestUserMessage.fromString("What's the best way to train a parrot?"));
+        chatMessages.add(new ChatRequestUserMessage("What's the best way to train a parrot?"));
 
         ChatCompletions chatCompletions = client.complete(new ChatCompletionsOptions(chatMessages));
 
@@ -79,9 +79,9 @@ public void getChatCompletionsStream() {
         // BEGIN: readme-sample-getChatCompletionsStream
         List chatMessages = new ArrayList<>();
         chatMessages.add(new ChatRequestSystemMessage("You are a helpful assistant. You will talk like a pirate."));
-        chatMessages.add(ChatRequestUserMessage.fromString("Can you help me?"));
+        chatMessages.add(new ChatRequestUserMessage("Can you help me?"));
         chatMessages.add(new ChatRequestAssistantMessage("Of course, me hearty! What can I do for ye?"));
-        chatMessages.add(ChatRequestUserMessage.fromString("What's the best way to train a parrot?"));
+        chatMessages.add(new ChatRequestUserMessage("What's the best way to train a parrot?"));
 
         client.completeStreaming(new ChatCompletionsOptions(chatMessages))
             .forEach(chatCompletions -> {
@@ -126,9 +126,9 @@ public void troubleshootingExceptions() {
         // BEGIN: readme-sample-troubleshootingExceptions
         List chatMessages = new ArrayList<>();
         chatMessages.add(new ChatRequestSystemMessage("You are a helpful assistant. You will talk like a pirate."));
-        chatMessages.add(ChatRequestUserMessage.fromString("Can you help me?"));
+        chatMessages.add(new ChatRequestUserMessage("Can you help me?"));
         chatMessages.add(new ChatRequestAssistantMessage("Of course, me hearty! What can I do for ye?"));
-        chatMessages.add(ChatRequestUserMessage.fromString("What's the best way to train a parrot?"));
+        chatMessages.add(new ChatRequestUserMessage("What's the best way to train a parrot?"));
 
         try {
                 ChatCompletions chatCompletions = client.complete(new ChatCompletionsOptions(chatMessages));
@@ -147,9 +147,9 @@ public void troubleshootingExceptionsAsync() {
 
         List chatMessages = new ArrayList<>();
         chatMessages.add(new ChatRequestSystemMessage("You are a helpful assistant. You will talk like a pirate."));
-        chatMessages.add(ChatRequestUserMessage.fromString("Can you help me?"));
+        chatMessages.add(new ChatRequestUserMessage("Can you help me?"));
         chatMessages.add(new ChatRequestAssistantMessage("Of course, me hearty! What can I do for ye?"));
-        chatMessages.add(ChatRequestUserMessage.fromString("What's the best way to train a parrot?"));
+        chatMessages.add(new ChatRequestUserMessage("What's the best way to train a parrot?"));
 
         // BEGIN: readme-sample-troubleshootingExceptions-async
         asyncClient.complete(new ChatCompletionsOptions(chatMessages))
diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java
index b77f87331c33..6061960c5716 100644
--- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java
+++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java
@@ -30,9 +30,9 @@ public static void main(String[] args) {
 
         List chatMessages = new ArrayList<>();
         chatMessages.add(new ChatRequestSystemMessage("You are a helpful assistant. You will talk like a pirate."));
-        chatMessages.add(ChatRequestUserMessage.fromString("Can you help me?"));
+        chatMessages.add(new ChatRequestUserMessage("Can you help me?"));
         chatMessages.add(new ChatRequestAssistantMessage("Of course, me hearty! What can I do for ye?"));
-        chatMessages.add(ChatRequestUserMessage.fromString("What's the best way to train a parrot?"));
+        chatMessages.add(new ChatRequestUserMessage("What's the best way to train a parrot?"));
 
         IterableStream chatCompletionsStream = client.completeStreaming(
             new ChatCompletionsOptions(chatMessages));
diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSampleAsync.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSampleAsync.java
index 5927cd945472..f35601a27621 100644
--- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSampleAsync.java
+++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSampleAsync.java
@@ -29,9 +29,9 @@ public static void main(String[] args) throws InterruptedException {
 
         List chatMessages = new ArrayList<>();
         chatMessages.add(new ChatRequestSystemMessage("You are a helpful assistant. You will talk like a pirate."));
-        chatMessages.add(ChatRequestUserMessage.fromString("Can you help me?"));
+        chatMessages.add(new ChatRequestUserMessage("Can you help me?"));
         chatMessages.add(new ChatRequestAssistantMessage("Of course, me hearty! What can I do for ye?"));
-        chatMessages.add(ChatRequestUserMessage.fromString("What's the best way to train a parrot?"));
+        chatMessages.add(new ChatRequestUserMessage("What's the best way to train a parrot?"));
 
 
         client.completeStreaming(new ChatCompletionsOptions(chatMessages))
diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java
index b00610f4e6fc..b4fab82ae3a2 100644
--- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java
+++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java
@@ -125,9 +125,9 @@ static void assertChoice(int index, ChatChoice actual) {
     private List getChatMessages() {
         List chatMessages = new ArrayList<>();
         chatMessages.add(new ChatRequestSystemMessage("You are a helpful assistant. You will talk like a pirate."));
-        chatMessages.add(ChatRequestUserMessage.fromString("Can you help me?"));
+        chatMessages.add(new ChatRequestUserMessage("Can you help me?"));
         chatMessages.add(new ChatRequestAssistantMessage("Of course, me hearty! What can I do for ye?"));
-        chatMessages.add(ChatRequestUserMessage.fromString("What's the best way to train a parrot?"));
+        chatMessages.add(new ChatRequestUserMessage("What's the best way to train a parrot?"));
         return chatMessages;
     }
 }
diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java
index 0851252756f0..43415dad6a07 100644
--- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java
+++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java
@@ -40,7 +40,7 @@ public void testGetCompletionsStream(HttpClient httpClient) {
         client = getChatCompletionsClient(httpClient);
         getChatCompletionsRunner((prompt) -> {
             List chatMessages = new ArrayList<>();
-            chatMessages.add(ChatRequestUserMessage.fromString(prompt));
+            chatMessages.add(new ChatRequestUserMessage(prompt));
             IterableStream resultCompletions = client.completeStreaming(new ChatCompletionsOptions(chatMessages));
             assertTrue(resultCompletions.stream().toArray().length > 1);
             resultCompletions.forEach(ChatCompletionsClientTestBase::assertCompletionsStream);

From 16173db47dc1f22b58116b40292a04283b92c951 Mon Sep 17 00:00:00 2001
From: glenn 
Date: Fri, 6 Sep 2024 14:12:54 -0400
Subject: [PATCH 082/128] add scopes to ClientBuilders, change parameters in
 FunctionDefinition to BinaryData type

---
 .../inference/ChatCompletionsClientBuilder.java  | 10 ++++------
 .../ai/inference/EmbeddingsClientBuilder.java    | 16 +++++++++++++++-
 .../ai/inference/models/FunctionDefinition.java  | 14 ++++++--------
 .../ai/inference/usage/BasicChatAADSample.java   |  4 ++--
 4 files changed, 27 insertions(+), 17 deletions(-)

diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClientBuilder.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClientBuilder.java
index af937872ca02..791faad356a0 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClientBuilder.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClientBuilder.java
@@ -202,14 +202,12 @@ public ChatCompletionsClientBuilder credential(TokenCredential tokenCredential)
     }
 
     /**
-     * Sets credential for client authentication.
+     * Sets auth domain scopes for client authentication.
      *
-     * @param tokenCredential credential to authenticate with.
-     * @param scopes scope to authenticate against.
+     * @param scopes domain scope to authenticate against.
      * @return the ChatCompletionsClientBuilder.
      */
-    public ChatCompletionsClientBuilder credential(TokenCredential tokenCredential, String[] scopes) {
-        this.tokenCredential = tokenCredential;
+    public ChatCompletionsClientBuilder scopes(String[] scopes) {
         this.scopes = scopes;
         return this;
     }
@@ -332,7 +330,7 @@ private HttpPipeline createHttpPipeline() {
             policies.add(new KeyCredentialPolicy("api-key", keyCredential));
         }
         if (tokenCredential != null) {
-            policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES));
+            policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, this.scopes));
         }
         this.pipelinePolicies.stream()
             .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClientBuilder.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClientBuilder.java
index cd001d53dd23..8754aee02910 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClientBuilder.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClientBuilder.java
@@ -65,6 +65,8 @@ public final class EmbeddingsClientBuilder implements HttpTrait pipelinePolicies;
 
+    private String[] scopes = DEFAULT_SCOPES;
+
     /**
      * Create an instance of the EmbeddingsClientBuilder.
      */
@@ -199,6 +201,18 @@ public EmbeddingsClientBuilder credential(TokenCredential tokenCredential) {
         return this;
     }
 
+    /**
+     * Sets auth domain scopes for client authentication.
+     *
+     * @param scopes domain scope to authenticate against.
+     * @return the ChatCompletionsClientBuilder.
+     */
+    public EmbeddingsClientBuilder scopes(String[] scopes) {
+        this.scopes = scopes;
+        return this;
+    }
+
+
     /*
      * The KeyCredential used for authentication.
      */
@@ -317,7 +331,7 @@ private HttpPipeline createHttpPipeline() {
             policies.add(new KeyCredentialPolicy("api-key", keyCredential));
         }
         if (tokenCredential != null) {
-            policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES));
+            policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, this.scopes));
         }
         this.pipelinePolicies.stream()
             .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java
index b63fd4e910cc..0da710bd9c23 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java
@@ -5,6 +5,7 @@
 
 import com.azure.core.annotation.Fluent;
 import com.azure.core.annotation.Generated;
+import com.azure.core.util.BinaryData;
 import com.azure.json.JsonReader;
 import com.azure.json.JsonSerializable;
 import com.azure.json.JsonToken;
@@ -33,8 +34,7 @@ public final class FunctionDefinition implements JsonSerializable {
             String name = null;
             String description = null;
-            Object parameters = null;
+            BinaryData parameters = null;
             while (reader.nextToken() != JsonToken.END_OBJECT) {
                 String fieldName = reader.getFieldName();
                 reader.nextToken();
@@ -140,7 +138,7 @@ public static FunctionDefinition fromJson(JsonReader jsonReader) throws IOExcept
                 } else if ("description".equals(fieldName)) {
                     description = reader.getString();
                 } else if ("parameters".equals(fieldName)) {
-                    parameters = reader.readUntyped();
+                    parameters = BinaryData.fromObject(reader.readUntyped());
                 } else {
                     reader.skipChildren();
                 }
diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatAADSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatAADSample.java
index 6309995bdf79..835f8cb0f85f 100644
--- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatAADSample.java
+++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatAADSample.java
@@ -26,8 +26,8 @@ public static void main(String[] args) {
         String[] scopes = new String[] { "https://cognitiveservices.azure.com/.default" };
         String endpoint = Configuration.getGlobalConfiguration().get("MODEL_ENDPOINT");
         ChatCompletionsClient client = new ChatCompletionsClientBuilder()
-    	    .credential(defaultCredential, scopes)
-            //.credential(defaultCredential) // For non-Azure OpenAI models (such as Cohere, Mistral, Llama, or Phi)
+            .scopes(scopes)
+    	    .credential(defaultCredential)
             .endpoint(endpoint)
             .buildClient();
 

From 68c21cf203f86e88c5f66b5ff80178406ea23585 Mon Sep 17 00:00:00 2001
From: glenn 
Date: Mon, 9 Sep 2024 11:07:42 -0400
Subject: [PATCH 083/128] update comment

---
 .../java/com/azure/ai/inference/usage/BasicChatAADSample.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatAADSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatAADSample.java
index 835f8cb0f85f..93db0d1decb8 100644
--- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatAADSample.java
+++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatAADSample.java
@@ -26,7 +26,7 @@ public static void main(String[] args) {
         String[] scopes = new String[] { "https://cognitiveservices.azure.com/.default" };
         String endpoint = Configuration.getGlobalConfiguration().get("MODEL_ENDPOINT");
         ChatCompletionsClient client = new ChatCompletionsClientBuilder()
-            .scopes(scopes)
+            .scopes(scopes) // remove for non-Azure OpenAI models
     	    .credential(defaultCredential)
             .endpoint(endpoint)
             .buildClient();

From 6277444c5e97ad7a09393b58fe8390b36404062f Mon Sep 17 00:00:00 2001
From: glenn 
Date: Mon, 9 Sep 2024 11:42:41 -0400
Subject: [PATCH 084/128] correct string constructor for ChatRequestUserMessage

---
 .../com/azure/ai/inference/models/ChatRequestUserMessage.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java
index 03450a83befa..734840964b0c 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java
@@ -47,7 +47,7 @@ public ChatRequestUserMessage(BinaryData content) {
      * @param content the string content value to set.
      */
     public ChatRequestUserMessage(String content) {
-        String jsonPrompt = "{" + "\"content\":\"%s\"" + "}";
+        String jsonPrompt = "\"%s\"";
         String contentString = String.format(jsonPrompt, content);
         this.content = BinaryData.fromString(contentString);
     }

From 9f3a3c347884e63f5f28500405e3c5303b764c89 Mon Sep 17 00:00:00 2001
From: glenn 
Date: Mon, 9 Sep 2024 11:45:38 -0400
Subject: [PATCH 085/128] formatting

---
 .../com/azure/ai/inference/models/ChatRequestUserMessage.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java
index 734840964b0c..285ec3eb0931 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java
@@ -47,10 +47,10 @@ public ChatRequestUserMessage(BinaryData content) {
      * @param content the string content value to set.
      */
     public ChatRequestUserMessage(String content) {
-        String jsonPrompt = "\"%s\"";
-        String contentString = String.format(jsonPrompt, content);
+        String contentString = String.format("\"%s\"", content);
         this.content = BinaryData.fromString(contentString);
     }
+
     /**
      * Get the role property: The chat role associated with this message.
      *

From b47d61132ea8c96285c10fe153072e9f0879c6e7 Mon Sep 17 00:00:00 2001
From: glenn 
Date: Mon, 9 Sep 2024 14:10:40 -0400
Subject: [PATCH 086/128] add streaming tool call sample

---
 .../ChatCompletionsFunctionToolCall.java      |   1 +
 ...ChatCompletionsFunctionToolDefinition.java |   9 +-
 .../inference/models/FunctionDefinition.java  |   2 +-
 .../ai/inference/usage/ToolCallSample.java    | 190 ++++++++++++++++++
 4 files changed, 197 insertions(+), 5 deletions(-)
 create mode 100644 sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ToolCallSample.java

diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolCall.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolCall.java
index 81136c842b7b..c92f98c54145 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolCall.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolCall.java
@@ -38,6 +38,7 @@ public final class ChatCompletionsFunctionToolCall extends ChatCompletionsToolCa
      */
     public ChatCompletionsFunctionToolCall(String id, FunctionCall function) {
         super(id, function);
+        this.function = function;
     }
 
     /**
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolDefinition.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolDefinition.java
index 8ec73693738d..32f2bfe0a2ff 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolDefinition.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolDefinition.java
@@ -30,17 +30,18 @@ public final class ChatCompletionsFunctionToolDefinition extends ChatCompletions
 
     /**
      * Creates an instance of ChatCompletionsFunctionToolDefinition class.
-     * 
+     *
      * @param function the function value to set.
      */
     @Generated
     public ChatCompletionsFunctionToolDefinition(FunctionDefinition function) {
         super(function);
+        this.function = function;
     }
 
     /**
      * Get the type property: The object type.
-     * 
+     *
      * @return the type value.
      */
     @Generated
@@ -51,7 +52,7 @@ public String getType() {
 
     /**
      * Get the function property: The function definition details for the function tool.
-     * 
+     *
      * @return the function value.
      */
     @Generated
@@ -73,7 +74,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
 
     /**
      * Reads an instance of ChatCompletionsFunctionToolDefinition from the JsonReader.
-     * 
+     *
      * @param jsonReader The JsonReader being read.
      * @return An instance of ChatCompletionsFunctionToolDefinition if the JsonReader was pointing to an instance of it,
      * or null if it was pointing to JSON null.
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java
index 0da710bd9c23..d0f0d3ef2e8b 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java
@@ -111,7 +111,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
         jsonWriter.writeStartObject();
         jsonWriter.writeStringField("name", this.name);
         jsonWriter.writeStringField("description", this.description);
-        jsonWriter.writeUntypedField("parameters", this.parameters);
+        jsonWriter.writeRawField("parameters", this.parameters.toString());
         return jsonWriter.writeEndObject();
     }
 
diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ToolCallSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ToolCallSample.java
new file mode 100644
index 000000000000..6a49bb6aa2dd
--- /dev/null
+++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ToolCallSample.java
@@ -0,0 +1,190 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.inference.usage;
+
+import com.azure.ai.inference.ChatCompletionsClient;
+import com.azure.ai.inference.ChatCompletionsClientBuilder;
+import com.azure.ai.inference.models.*;
+import com.azure.core.credential.TokenCredential;
+import com.azure.core.util.BinaryData;
+import com.azure.core.util.Configuration;
+import com.azure.core.util.IterableStream;
+import com.azure.identity.DefaultAzureCredentialBuilder;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.util.Arrays;
+import java.util.List;
+
+public final class ToolCallSample {
+     /**
+     * @param args Unused. Arguments to the program.
+     */
+    public static void main(String[] args) {
+        TokenCredential defaultCredential = new DefaultAzureCredentialBuilder().build();
+        // Currently the auth scope needs to be set as below for Azure OpenAI resources using EntraID.
+        // For non-Azure OpenAI models (such as Cohere, Mistral, Llama, or Phi), comment out the line below.
+        String[] scopes = new String[] { "https://cognitiveservices.azure.com/.default" };
+        String endpoint = Configuration.getGlobalConfiguration().get("MODEL_ENDPOINT");
+        ChatCompletionsClient client = new ChatCompletionsClientBuilder()
+            .scopes(scopes) // remove for non-Azure OpenAI models
+    	    .credential(defaultCredential)
+            .endpoint(endpoint)
+            .buildClient();
+
+        List chatMessages = Arrays.asList(
+            new ChatRequestSystemMessage("You are a helpful assistant."),
+            new ChatRequestUserMessage("What sort of clothing should I wear today in Berlin?")
+        );
+
+        ChatCompletionsFunctionToolDefinition toolDefinition = new ChatCompletionsFunctionToolDefinition(
+            getFutureTemperatureFunctionDefinition());
+
+        ChatCompletionsOptions chatCompletionsOptions = new ChatCompletionsOptions(chatMessages);
+        chatCompletionsOptions.setTools(Arrays.asList(toolDefinition));
+
+        IterableStream chatCompletionsStream = client.completeStreaming(chatCompletionsOptions);
+
+        String toolCallId = null;
+        String functionName = null;
+        StringBuilder functionArguments = new StringBuilder();
+        CompletionsFinishReason finishReason = null;
+        for (StreamingChatCompletionsUpdate chatCompletions : chatCompletionsStream) {
+            // In the case of Azure, the 1st message will contain filter information but no choices sometimes
+            if (chatCompletions.getChoices().isEmpty()) {
+                continue;
+            }
+            StreamingChatChoiceUpdate choice = chatCompletions.getChoices().get(0);
+            if (choice.getFinishReason() != null) {
+                finishReason = choice.getFinishReason();
+            }
+            List toolCalls = choice.getDelta().getToolCalls();
+            // We take the functionName when it's available, and we aggregate the arguments.
+            // We also monitor FinishReason for TOOL_CALL. That's the LLM signaling we should
+            // call our function
+            if (toolCalls != null) {
+                StreamingChatResponseToolCallUpdate toolCall = toolCalls.get(0);
+                if (toolCall != null) {
+                    functionArguments.append(toolCall.getFunction().getArguments());
+                    if (toolCall.getId() != null) {
+                        toolCallId = toolCall.getId();
+                    }
+
+                    if (toolCall.getFunction().getName() != null) {
+                        functionName = toolCall.getFunction().getName();
+                    }
+                }
+            }
+        }
+
+        System.out.println("Tool Call Id: " + toolCallId);
+        System.out.println("Function Name: " + functionName);
+        System.out.println("Function Arguments: " + functionArguments);
+        System.out.println("Finish Reason: " + finishReason);
+
+        // We verify that the LLM wants us to call the function we advertised in the original request
+        // Preparation for follow-up with the service we add:
+        // - All the messages we sent
+        // - The ChatCompletionsFunctionToolCall from the service as part of a ChatRequestAssistantMessage
+        // - The result of function tool as part of a ChatRequestToolMessage
+        if (finishReason == CompletionsFinishReason.TOOL_CALLS) {
+            // Here the "content" can be null if used in non-Azure OpenAI
+            // We prepare the assistant message reminding the LLM of the context of this request. We provide:
+            // - The tool call id
+            // - The function description
+            FunctionCall functionCall = new FunctionCall(functionName, functionArguments.toString());
+            ChatCompletionsFunctionToolCall functionToolCall = new ChatCompletionsFunctionToolCall(toolCallId, functionCall);
+            ChatRequestAssistantMessage assistantRequestMessage = new ChatRequestAssistantMessage("");
+            assistantRequestMessage.setToolCalls(Arrays.asList(functionToolCall));
+
+            // As an additional step, you may want to deserialize the parameters, so you can call your function
+            FunctionArguments parameters = BinaryData.fromString(functionArguments.toString()).toObject(FunctionArguments.class);
+            System.out.println("Location Name: " + parameters.locationName);
+            System.out.println("Date: " + parameters.date);
+            String functionCallResult = futureTemperature(parameters.locationName, parameters.date);
+
+            // This message contains the information that will allow the LLM to resume the text generation
+            ChatRequestToolMessage toolRequestMessage = new ChatRequestToolMessage(functionCallResult, toolCallId);
+            List followUpMessages = Arrays.asList(
+                // We add the original messages from the request
+                chatMessages.get(0),
+                chatMessages.get(1),
+                assistantRequestMessage,
+                toolRequestMessage
+            );
+
+            IterableStream followUpChatCompletionsStream = client.completeStreaming(
+                new ChatCompletionsOptions(followUpMessages));
+
+            StringBuilder finalResult = new StringBuilder();
+            CompletionsFinishReason finalFinishReason = null;
+            for (StreamingChatCompletionsUpdate chatCompletions : followUpChatCompletionsStream) {
+                if (chatCompletions.getChoices().isEmpty()) {
+                    continue;
+                }
+                StreamingChatChoiceUpdate choice = chatCompletions.getChoices().get(0);
+                if (choice.getFinishReason() != null) {
+                    finalFinishReason = choice.getFinishReason();
+                }
+                if (choice.getDelta().getContent() != null) {
+                    finalResult.append(choice.getDelta().getContent());
+                }
+            }
+
+            // We verify that the LLM has STOPPED as a finishing reason
+            if (finalFinishReason == CompletionsFinishReason.STOPPED) {
+                System.out.println("Final Result: " + finalResult);
+            }
+        }
+    }
+
+    // In this example we ignore the parameters for our tool function
+    private static String futureTemperature(String locationName, String data) {
+        return "-7 C";
+    }
+
+    private static FunctionDefinition getFutureTemperatureFunctionDefinition() {
+        FunctionDefinition functionDefinition = new FunctionDefinition("FutureTemperature");
+        functionDefinition.setDescription("Get the future temperature for a given location and date.");
+        FutureTemperatureParameters parameters = new FutureTemperatureParameters();
+        functionDefinition.setParameters(BinaryData.fromObject(parameters));
+        return functionDefinition;
+    }
+
+    private static class FunctionArguments {
+        @JsonProperty(value = "location_name")
+        private String locationName;
+
+        @JsonProperty(value = "date")
+        private String date;
+    }
+
+    private static class FutureTemperatureParameters {
+        @JsonProperty(value = "type")
+        private String type = "object";
+
+        @JsonProperty(value = "properties")
+        private FutureTemperatureProperties properties = new FutureTemperatureProperties();
+    }
+
+    private static class FutureTemperatureProperties {
+        @JsonProperty(value = "unit") StringField unit = new StringField("Temperature unit. Can be either Celsius or Fahrenheit. Defaults to Celsius.");
+        @JsonProperty(value = "location_name") StringField locationName = new StringField("The name of the location to get the future temperature for.");
+        @JsonProperty(value = "date") StringField date = new StringField("The date to get the future temperature for. The format is YYYY-MM-DD.");
+    }
+
+    private static class StringField {
+        @JsonProperty(value = "type")
+        private final String type = "string";
+
+        @JsonProperty(value = "description")
+        private String description;
+
+        @JsonCreator
+        StringField(@JsonProperty(value = "description") String description) {
+            this.description = description;
+        }
+    }
+}

From 37271ccce292d95c75c17c7a2443b7a53ab6729f Mon Sep 17 00:00:00 2001
From: glenn 
Date: Mon, 9 Sep 2024 15:57:53 -0400
Subject: [PATCH 087/128] add Mono> completeWithResponse API to
 AsyncClient

---
 .../inference/ChatCompletionsAsyncClient.java | 29 ++++++++++++++++---
 .../ai/inference/ChatCompletionsClient.java   |  6 ++--
 2 files changed, 28 insertions(+), 7 deletions(-)

diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java
index f95fcdbb5b6e..ed866e5142a5 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java
@@ -19,6 +19,7 @@
 import com.azure.core.http.HttpHeaderName;
 import com.azure.core.http.rest.RequestOptions;
 import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.SimpleResponse;
 import com.azure.core.util.BinaryData;
 import com.azure.core.util.FluxUtil;
 import reactor.core.publisher.Flux;
@@ -148,12 +149,32 @@ public final class ChatCompletionsAsyncClient {
      * Completions support a wide variety of tasks and generate text that continues from or "completes"
      * provided prompt data along with {@link Response} on successful completion of {@link Mono}.
      */
-    @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
-    Mono> completeWithResponse(BinaryData completeRequest, RequestOptions requestOptions) {
+    private Mono> completeWithBinaryResponse(BinaryData completeRequest, RequestOptions requestOptions) {
         return this.serviceClient.completeWithResponseAsync(completeRequest, requestOptions);
     }
 
+    /**
+     * Gets chat completions for the provided chat messages.
+     * Completions support a wide variety of tasks and generate text that continues from or "completes"
+     * provided prompt data. The method makes a REST API call to the `/chat/completions` route
+     * on the given endpoint.
+     * @param completeRequest The completeRequest parameter.
+     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+     * @throws HttpResponseException thrown if the request is rejected by server.
+     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+     * @return chat completions for the provided chat messages.
+     * Completions support a wide variety of tasks and generate text that continues from or "completes"
+     * provided prompt data along with {@link Response} on successful completion of {@link Mono}.
+     */
+    @ServiceMethod(returns = ReturnType.SINGLE)
+    public Mono> completeWithResponse(BinaryData completeRequest, RequestOptions requestOptions) {
+        Response response = serviceClient.completeWithResponseAsync(completeRequest, requestOptions).block();
+        return Mono.just(new SimpleResponse<>(response, response.getValue().toObject(ChatCompletions.class)));
+    }
+
     /**
      * Returns information about the AI model.
      * The method makes a REST API call to the `/info` route on the given endpoint.
@@ -200,7 +221,7 @@ Mono> getModelInfoWithResponse(RequestOptions requestOption
     public Flux completeStreaming(ChatCompletionsOptions options) {
         options.setStream(true);
         RequestOptions requestOptions = new RequestOptions();
-        Flux responseStream = completeWithResponse(BinaryData.fromObject(options), requestOptions)
+        Flux responseStream = completeWithBinaryResponse(BinaryData.fromObject(options), requestOptions)
             .flatMapMany(response -> response.getValue().toFluxByteBuffer());
         InferenceServerSentEvents chatCompletionsStream
             = new InferenceServerSentEvents<>(responseStream, StreamingChatCompletionsUpdate.class);
@@ -265,7 +286,7 @@ public Mono complete(ChatCompletionsOptions options) {
         if (extraParams != null) {
             requestOptions.setHeader(HttpHeaderName.fromString("extra-parameters"), extraParams.toString());
         }
-        return completeWithResponse(completeRequest, requestOptions).flatMap(FluxUtil::toMono)
+        return completeWithBinaryResponse(completeRequest, requestOptions).flatMap(FluxUtil::toMono)
             .map(protocolMethodData -> protocolMethodData.toObject(ChatCompletions.class));
     }
 
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java
index 5f1c59b71409..951b587da3db 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java
@@ -152,9 +152,9 @@ public final class ChatCompletionsClient {
      * provided prompt data along with {@link Response}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
-    public Mono> completeWithResponse(BinaryData completeRequest, RequestOptions requestOptions) {
+    public Response completeWithResponse(BinaryData completeRequest, RequestOptions requestOptions) {
         Response response = serviceClient.completeWithResponse(completeRequest, requestOptions);
-        return Mono.just(new SimpleResponse<>(response, response.getValue().toObject(ChatCompletions.class)));
+        return new SimpleResponse<>(response, response.getValue().toObject(ChatCompletions.class));
     }
 
     /**
@@ -222,7 +222,7 @@ public ChatCompletions complete(ChatCompletionsOptions options) {
         if (extraParams != null) {
             requestOptions.setHeader(HttpHeaderName.fromString("extra-parameters"), extraParams.toString());
         }
-        return Objects.requireNonNull(completeWithResponse(completeRequest, requestOptions).block()).getValue();
+        return Objects.requireNonNull(completeWithResponse(completeRequest, requestOptions)).getValue();
     }
 
     /**

From f0904b3ac33eb3c8be835d42851b89a50b12fadf Mon Sep 17 00:00:00 2001
From: Glenn Harper 
Date: Tue, 10 Sep 2024 06:40:27 -0700
Subject: [PATCH 088/128] better implementation of completeWithResponse

---
 .../inference/ChatCompletionsAsyncClient.java | 31 ++++++++++++++++---
 1 file changed, 26 insertions(+), 5 deletions(-)

diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java
index ed866e5142a5..f060fbbf0011 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java
@@ -159,20 +159,41 @@ private Mono> completeWithBinaryResponse(BinaryData complet
      * Completions support a wide variety of tasks and generate text that continues from or "completes"
      * provided prompt data. The method makes a REST API call to the `/chat/completions` route
      * on the given endpoint.
-     * @param completeRequest The completeRequest parameter.
-     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+     * @param options The configuration information for a chat completions request. Completions support a
+     * @throws IllegalArgumentException thrown if parameters fail the validation.
      * @throws HttpResponseException thrown if the request is rejected by server.
      * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
      * @return chat completions for the provided chat messages.
      * Completions support a wide variety of tasks and generate text that continues from or "completes"
      * provided prompt data along with {@link Response} on successful completion of {@link Mono}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
-    public Mono> completeWithResponse(BinaryData completeRequest, RequestOptions requestOptions) {
-        Response response = serviceClient.completeWithResponseAsync(completeRequest, requestOptions).block();
-        return Mono.just(new SimpleResponse<>(response, response.getValue().toObject(ChatCompletions.class)));
+    public Mono> completeWithResponse(ChatCompletionsOptions options) {
+        RequestOptions requestOptions = new RequestOptions();
+        CompleteRequest completeRequestObj
+            = new CompleteRequest(options.getMessages()).setFrequencyPenalty(options.getFrequencyPenalty())
+            .setStream(options.isStream())
+            .setPresencePenalty(options.getPresencePenalty())
+            .setTemperature(options.getTemperature())
+            .setTopP(options.getTopP())
+            .setMaxTokens(options.getMaxTokens())
+            .setResponseFormat(options.getResponseFormat())
+            .setStop(options.getStop())
+            .setTools(options.getTools())
+            .setToolChoice(options.getToolChoice())
+            .setSeed(options.getSeed())
+            .setModel(options.getModel());
+        BinaryData completeRequest = BinaryData.fromObject(completeRequestObj);
+        ExtraParameters extraParams = options.getExtraParams();
+        if (extraParams != null) {
+            requestOptions.setHeader(HttpHeaderName.fromString("extra-parameters"), extraParams.toString());
+        }
+
+        return completeWithBinaryResponse(completeRequest, requestOptions).map(
+            methodDataResponse -> new SimpleResponse<>(methodDataResponse, methodDataResponse.getValue().toObject(ChatCompletions.class)));
     }
 
     /**

From 68a60da0097664128c8bb803884ea07612978f7b Mon Sep 17 00:00:00 2001
From: glenn 
Date: Tue, 10 Sep 2024 09:47:43 -0400
Subject: [PATCH 089/128] remove unused import

---
 .../main/java/com/azure/ai/inference/ChatCompletionsClient.java  | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java
index 951b587da3db..840cbd33b61e 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java
@@ -27,7 +27,6 @@
 import com.azure.ai.inference.models.StreamingChatCompletionsUpdate;
 import com.azure.core.util.IterableStream;
 import reactor.core.publisher.Flux;
-import reactor.core.publisher.Mono;
 
 import java.nio.ByteBuffer;
 import java.util.Objects;

From 4da0b99b4a240f64ded1a7b4a759d53bfc36025b Mon Sep 17 00:00:00 2001
From: glenn 
Date: Tue, 10 Sep 2024 10:13:10 -0400
Subject: [PATCH 090/128] add embedWithResponse API to embeddings clients

---
 .../ai/inference/EmbeddingsAsyncClient.java   | 80 +++++++++++++++++--
 .../azure/ai/inference/EmbeddingsClient.java  | 80 +++++++++++++++++--
 2 files changed, 150 insertions(+), 10 deletions(-)

diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java
index 24d24960e7ad..da030b631e27 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java
@@ -21,6 +21,7 @@
 import com.azure.core.http.HttpHeaderName;
 import com.azure.core.http.rest.RequestOptions;
 import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.SimpleResponse;
 import com.azure.core.util.BinaryData;
 import com.azure.core.util.FluxUtil;
 import java.util.List;
@@ -59,7 +60,7 @@ public final class EmbeddingsAsyncClient {
      * 
      * You can add these to a request with {@link RequestOptions#addHeader}
      * 

Request Body Schema

- * + * *
{@code
      * {
      *     input (Required): [
@@ -74,9 +75,9 @@ public final class EmbeddingsAsyncClient {
      *     }
      * }
      * }
- * + * *

Response Body Schema

- * + * *
{@code
      * {
      *     data (Required): [
@@ -114,7 +115,7 @@ Mono> embedWithResponse(BinaryData embedRequest, RequestOpt
      * Returns information about the AI model.
      * The method makes a REST API call to the `/info` route on the given endpoint.
      * 

Response Body Schema

- * + * *
{@code
      * {
      *     model_name: String (Required)
@@ -165,7 +166,50 @@ Mono> getModelInfoWithResponse(RequestOptions requestOption
      * recommendations, and other similar scenarios on successful completion of {@link Mono}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
-    Mono embed(List input, Integer dimensions, EmbeddingEncodingFormat encodingFormat,
+    public Mono> embedWithResponse(List input, Integer dimensions, EmbeddingEncodingFormat encodingFormat,
+                                        EmbeddingInputType inputType, String model, ExtraParameters extraParams) {
+        RequestOptions requestOptions = new RequestOptions();
+        EmbedRequest embedRequestObj = new EmbedRequest(input).setDimensions(dimensions)
+            .setEncodingFormat(encodingFormat)
+            .setInputType(inputType)
+            .setModel(model);
+        BinaryData embedRequest = BinaryData.fromObject(embedRequestObj);
+        if (extraParams != null) {
+            requestOptions.setHeader(HttpHeaderName.fromString("extra-parameters"), extraParams.toString());
+        }
+        return embedWithResponse(embedRequest, requestOptions).map(
+            protocolMethodData -> new SimpleResponse<>(protocolMethodData, protocolMethodData.getValue().toObject(EmbeddingsResult.class)));
+    }
+
+    /**
+     * Return the embedding vectors for given text prompts.
+     * The method makes a REST API call to the `/embeddings` route on the given endpoint.
+     *
+     * @param input Input text to embed, encoded as a string or array of tokens.
+     * To embed multiple inputs in a single request, pass an array
+     * of strings or array of token arrays.
+     * @param dimensions Optional. The number of dimensions the resulting output embeddings should have.
+     * Passing null causes the model to use its default value.
+     * Returns a 422 error if the model doesn't support the value or parameter.
+     * @param encodingFormat Optional. The desired format for the returned embeddings.
+     * @param inputType Optional. The type of the input.
+     * Returns a 422 error if the model doesn't support the value or parameter.
+     * @param model ID of the specific AI model to use, if more than one model is available on the endpoint.
+     * @param extraParams Controls what happens if extra parameters, undefined by the REST API,
+     * are passed in the JSON request payload.
+     * This sets the HTTP request header `extra-parameters`.
+     * @throws IllegalArgumentException thrown if parameters fail the validation.
+     * @throws HttpResponseException thrown if the request is rejected by server.
+     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+     * @return representation of the response data from an embeddings request.
+     * Embeddings measure the relatedness of text strings and are commonly used for search, clustering,
+     * recommendations, and other similar scenarios on successful completion of {@link Mono}.
+     */
+    @ServiceMethod(returns = ReturnType.SINGLE)
+    public Mono embed(List input, Integer dimensions, EmbeddingEncodingFormat encodingFormat,
         EmbeddingInputType inputType, String model, ExtraParameters extraParams) {
         // Generated convenience method for embedWithResponse
         RequestOptions requestOptions = new RequestOptions();
@@ -181,6 +225,32 @@ Mono embed(List input, Integer dimensions, EmbeddingEn
             .map(protocolMethodData -> protocolMethodData.toObject(EmbeddingsResult.class));
     }
 
+    /**
+     * Return the embedding vectors for given text prompts.
+     * The method makes a REST API call to the `/embeddings` route on the given endpoint.
+     *
+     * @param input Input text to embed, encoded as a string or array of tokens.
+     * To embed multiple inputs in a single request, pass an array
+     * of strings or array of token arrays.
+     * @throws IllegalArgumentException thrown if parameters fail the validation.
+     * @throws HttpResponseException thrown if the request is rejected by server.
+     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+     * @return representation of the response data from an embeddings request.
+     * Embeddings measure the relatedness of text strings and are commonly used for search, clustering,
+     * recommendations, and other similar scenarios on successful completion of {@link Mono}.
+     */
+    @ServiceMethod(returns = ReturnType.SINGLE)
+    public Mono> embedWithResponse(List input) {
+        RequestOptions requestOptions = new RequestOptions();
+        EmbedRequest embedRequestObj = new EmbedRequest(input);
+        BinaryData embedRequest = BinaryData.fromObject(embedRequestObj);
+        return embedWithResponse(embedRequest, requestOptions).map(
+            protocolMethodData -> new SimpleResponse<>(protocolMethodData, protocolMethodData.getValue().toObject(EmbeddingsResult.class)));
+    }
+
     /**
      * Return the embedding vectors for given text prompts.
      * The method makes a REST API call to the `/embeddings` route on the given endpoint.
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java
index dfea2950e262..817deef58bed 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java
@@ -21,6 +21,7 @@
 import com.azure.core.http.HttpHeaderName;
 import com.azure.core.http.rest.RequestOptions;
 import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.SimpleResponse;
 import com.azure.core.util.BinaryData;
 import java.util.List;
 
@@ -57,7 +58,7 @@ public final class EmbeddingsClient {
      * 
      * You can add these to a request with {@link RequestOptions#addHeader}
      * 

Request Body Schema

- * + * *
{@code
      * {
      *     input (Required): [
@@ -72,9 +73,9 @@ public final class EmbeddingsClient {
      *     }
      * }
      * }
- * + * *

Response Body Schema

- * + * *
{@code
      * {
      *     data (Required): [
@@ -111,7 +112,7 @@ Response embedWithResponse(BinaryData embedRequest, RequestOptions r
      * Returns information about the AI model.
      * The method makes a REST API call to the `/info` route on the given endpoint.
      * 

Response Body Schema

- * + * *
{@code
      * {
      *     model_name: String (Required)
@@ -133,6 +134,49 @@ Response getModelInfoWithResponse(RequestOptions requestOptions) {
         return this.serviceClient.getModelInfoWithResponse(requestOptions);
     }
 
+    /**
+     * Return the embedding vectors for given text prompts.
+     * The method makes a REST API call to the `/embeddings` route on the given endpoint.
+     *
+     * @param input Input text to embed, encoded as a string or array of tokens.
+     * To embed multiple inputs in a single request, pass an array
+     * of strings or array of token arrays.
+     * @param dimensions Optional. The number of dimensions the resulting output embeddings should have.
+     * Passing null causes the model to use its default value.
+     * Returns a 422 error if the model doesn't support the value or parameter.
+     * @param encodingFormat Optional. The desired format for the returned embeddings.
+     * @param inputType Optional. The type of the input.
+     * Returns a 422 error if the model doesn't support the value or parameter.
+     * @param model ID of the specific AI model to use, if more than one model is available on the endpoint.
+     * @param extraParams Controls what happens if extra parameters, undefined by the REST API,
+     * are passed in the JSON request payload.
+     * This sets the HTTP request header `extra-parameters`.
+     * @throws IllegalArgumentException thrown if parameters fail the validation.
+     * @throws HttpResponseException thrown if the request is rejected by server.
+     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+     * @return representation of the response data from an embeddings request.
+     * Embeddings measure the relatedness of text strings and are commonly used for search, clustering,
+     * recommendations, and other similar scenarios.
+     */
+    public Response embedWithResponse(List input, Integer dimensions, EmbeddingEncodingFormat encodingFormat,
+                                  EmbeddingInputType inputType, String model, ExtraParameters extraParams) {
+        // Generated convenience method for embedWithResponse
+        RequestOptions requestOptions = new RequestOptions();
+        EmbedRequest embedRequestObj = new EmbedRequest(input).setDimensions(dimensions)
+            .setEncodingFormat(encodingFormat)
+            .setInputType(inputType)
+            .setModel(model);
+        BinaryData embedRequest = BinaryData.fromObject(embedRequestObj);
+        if (extraParams != null) {
+            requestOptions.setHeader(HttpHeaderName.fromString("extra-parameters"), extraParams.toString());
+        }
+        Response response = embedWithResponse(embedRequest, requestOptions);
+        return new SimpleResponse<>(response, response.getValue().toObject(EmbeddingsResult.class));
+    }
+
     /**
      * Return the embedding vectors for given text prompts.
      * The method makes a REST API call to the `/embeddings` route on the given endpoint.
@@ -161,7 +205,7 @@ Response getModelInfoWithResponse(RequestOptions requestOptions) {
      * recommendations, and other similar scenarios.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
-    EmbeddingsResult embed(List input, Integer dimensions, EmbeddingEncodingFormat encodingFormat,
+    public EmbeddingsResult embed(List input, Integer dimensions, EmbeddingEncodingFormat encodingFormat,
         EmbeddingInputType inputType, String model, ExtraParameters extraParams) {
         // Generated convenience method for embedWithResponse
         RequestOptions requestOptions = new RequestOptions();
@@ -202,6 +246,32 @@ public EmbeddingsResult embed(List input) {
         return embedWithResponse(embedRequest, requestOptions).getValue().toObject(EmbeddingsResult.class);
     }
 
+    /**
+     * Return the embedding vectors for given text prompts.
+     * The method makes a REST API call to the `/embeddings` route on the given endpoint.
+     *
+     * @param input Input text to embed, encoded as a string or array of tokens.
+     * To embed multiple inputs in a single request, pass an array
+     * of strings or array of token arrays.
+     * @throws IllegalArgumentException thrown if parameters fail the validation.
+     * @throws HttpResponseException thrown if the request is rejected by server.
+     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+     * @return representation of the response data from an embeddings request.
+     * Embeddings measure the relatedness of text strings and are commonly used for search, clustering,
+     * recommendations, and other similar scenarios.
+     */
+    public Response embedWithResponse(List input) {
+        // Generated convenience method for embedWithResponse
+        RequestOptions requestOptions = new RequestOptions();
+        EmbedRequest embedRequestObj = new EmbedRequest(input);
+        BinaryData embedRequest = BinaryData.fromObject(embedRequestObj);
+        Response response = embedWithResponse(embedRequest, requestOptions);
+        return new SimpleResponse<>(response, response.getValue().toObject(EmbeddingsResult.class));
+    }
+
     /**
      * Returns information about the AI model.
      * The method makes a REST API call to the `/info` route on the given endpoint.

From e19add0acf7aac6ca13a177dca50981c524dfcaf Mon Sep 17 00:00:00 2001
From: glenn 
Date: Wed, 11 Sep 2024 09:50:39 -0400
Subject: [PATCH 091/128] add tests for complete(options) and
 completeWithResponse APIs

---
 .../ChatCompletionsAsyncClientTest.java       | 33 ++++++++++++++++++-
 .../ChatCompletionsClientTestBase.java        | 11 ++++++-
 .../ChatCompletionsSyncClientTest.java        | 30 +++++++++--------
 3 files changed, 58 insertions(+), 16 deletions(-)

diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsAsyncClientTest.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsAsyncClientTest.java
index 3517e9cac3ac..9d9b44e028fc 100644
--- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsAsyncClientTest.java
+++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsAsyncClientTest.java
@@ -4,6 +4,8 @@
 
 import com.azure.ai.inference.models.*;
 import com.azure.core.http.HttpClient;
+import com.azure.core.http.rest.RequestOptions;
+import com.azure.core.util.BinaryData;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.MethodSource;
 import reactor.test.StepVerifier;
@@ -37,11 +39,25 @@ public void testGetChatCompletions(HttpClient httpClient) {
         });
     }
 
+    @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS)
+    @MethodSource("com.azure.ai.inference.TestUtils#getTestParameters")
+    public void testGetChatCompletionsFromOptions(HttpClient httpClient) {
+        client = getChatCompletionsAsyncClient(httpClient);
+        getChatCompletionsFromOptionsRunner((options) -> {
+            StepVerifier.create(client.complete(options))
+                .assertNext(resultCompletions -> {
+                    assertNotNull(resultCompletions.getUsage());
+                    assertCompletions(1, resultCompletions);
+                })
+                .verifyComplete();
+        });
+    }
+
     @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS)
     @MethodSource("com.azure.ai.inference.TestUtils#getTestParameters")
     public void testGetCompletionsStream(HttpClient httpClient) {
         client = getChatCompletionsAsyncClient(httpClient);
-        getStreamingChatCompletionsRunner((chatMessages) -> {
+        getChatCompletionsFromMessagesRunner((chatMessages) -> {
             StepVerifier.create(client.completeStreaming(new ChatCompletionsOptions(chatMessages)))
                 .recordWith(ArrayList::new)
                 .thenConsumeWhile(chatCompletions -> {
@@ -52,4 +68,19 @@ public void testGetCompletionsStream(HttpClient httpClient) {
                 .verifyComplete();
         });
     }
+    @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS)
+    @MethodSource("com.azure.ai.inference.TestUtils#getTestParameters")
+    public void testGetChatCompletionsFromResponse(HttpClient httpClient) {
+        client = getChatCompletionsAsyncClient(httpClient);
+        getChatCompletionsFromOptionsRunner((options) -> {
+            StepVerifier.create(
+                client.completeWithResponse(options))
+                .assertNext(resultCompletionsResponse -> {
+                    assertNotNull(resultCompletionsResponse.getValue().getUsage());
+                    assertCompletions(1, resultCompletionsResponse.getValue());
+                })
+                .verifyComplete();
+        });
+    }
+
 }
diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java
index b4fab82ae3a2..08c4a745866c 100644
--- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java
+++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java
@@ -89,7 +89,16 @@ void getChatCompletionsRunner(Consumer testRunner) {
         testRunner.accept("Say this is a test");
     }
 
-    void getStreamingChatCompletionsRunner(Consumer> testRunner) {
+    void getChatCompletionsFromOptionsRunner(Consumer testRunner) {
+        List chatMessages = Arrays.asList(
+            new ChatRequestSystemMessage("You are a helpful assistant."),
+            new ChatRequestUserMessage("What sort of clothing should I wear today in Berlin?")
+        );
+        ChatCompletionsOptions options = new ChatCompletionsOptions(chatMessages);
+        testRunner.accept(options);
+    }
+
+    void getChatCompletionsFromMessagesRunner(Consumer> testRunner) {
         testRunner.accept(getChatMessages());
     }
 
diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java
index 43415dad6a07..fc871af6bc9a 100644
--- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java
+++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java
@@ -5,6 +5,9 @@
 import com.azure.ai.inference.models.*;
 import com.azure.core.http.HttpClient;
 
+import com.azure.core.http.rest.RequestOptions;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.BinaryData;
 import com.azure.core.util.IterableStream;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.MethodSource;
@@ -47,29 +50,28 @@ public void testGetCompletionsStream(HttpClient httpClient) {
         });
     }
 
-/*
     @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS)
-    @MethodSource("com.azure.ai.openai.TestUtils#getTestParameters")
-    public void testGetCompletionsFromPrompt(HttpClient httpClient, OpenAIServiceVersion serviceVersion) {
-        client = getModelClient(httpClient);
-        getCompletionsFromSinglePromptRunner((deploymentId, prompts) -> {
-            Completions completions = client.getCompletions(deploymentId, prompts);
+    @MethodSource("com.azure.ai.inference.TestUtils#getTestParameters")
+    public void testGetCompletionsFromOptions(HttpClient httpClient) {
+        client = getChatCompletionsClient(httpClient);
+        getChatCompletionsFromOptionsRunner((options) -> {
+            ChatCompletions completions = client.complete(options);
             assertCompletions(1, completions);
         });
     }
 
     @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS)
-    @MethodSource("com.azure.ai.openai.TestUtils#getTestParameters")
-    public void testGetCompletionsWithResponse(HttpClient httpClient, OpenAIServiceVersion serviceVersion) {
-        client = getModelClient(httpClient);
-        getCompletionsRunner((deploymentId, prompt) -> {
-            Response response = client.getCompletionsWithResponse(deploymentId,
-                BinaryData.fromObject(new CompletionsOptions(prompt)), new RequestOptions());
-            Completions resultCompletions = assertAndGetValueFromResponse(response, Completions.class, 200);
-            assertCompletions(1, resultCompletions);
+    @MethodSource("com.azure.ai.inference.TestUtils#getTestParameters")
+    public void testGetCompletionsWithResponse(HttpClient httpClient) {
+        client = getChatCompletionsClient(httpClient);
+        getChatCompletionsFromOptionsRunner((options) -> {
+            Response response = client.completeWithResponse(
+                BinaryData.fromObject(options), new RequestOptions());
+            assertCompletions(1, response.getValue());
         });
     }
 
+/*
     @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS)
     @MethodSource("com.azure.ai.openai.TestUtils#getTestParameters")
     public void testGetCompletionsWithResponseBadDeployment(HttpClient httpClient, OpenAIServiceVersion serviceVersion) {

From a117bcb35385268ab3deaca58e46d66cab2d62a2 Mon Sep 17 00:00:00 2001
From: glenn 
Date: Wed, 11 Sep 2024 10:13:45 -0400
Subject: [PATCH 092/128] more sync tests

---
 .../ChatCompletionsSyncClientTest.java        | 90 ++++++-------------
 1 file changed, 26 insertions(+), 64 deletions(-)

diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java
index fc871af6bc9a..8c7000bee482 100644
--- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java
+++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java
@@ -16,7 +16,7 @@
 import java.util.List;
 
 import static com.azure.ai.inference.TestUtils.DISPLAY_NAME_WITH_ARGUMENTS;
-import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.*;
 
 public class ChatCompletionsSyncClientTest extends ChatCompletionsClientTestBase {
     private ChatCompletionsClient client;
@@ -71,34 +71,17 @@ public void testGetCompletionsWithResponse(HttpClient httpClient) {
         });
     }
 
-/*
     @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS)
-    @MethodSource("com.azure.ai.openai.TestUtils#getTestParameters")
-    public void testGetCompletionsWithResponseBadDeployment(HttpClient httpClient, OpenAIServiceVersion serviceVersion) {
-        client = getModelClient(httpClient);
-        getCompletionsRunner((_deploymentId, prompt) -> {
-            String deploymentId = "BAD_DEPLOYMENT_ID";
-            ResourceNotFoundException exception = assertThrows(ResourceNotFoundException.class,
-                () -> client.getCompletionsWithResponse(deploymentId,
-                    BinaryData.fromObject(new CompletionsOptions(prompt)), new RequestOptions()));
-            assertEquals(404, exception.getResponse().getStatusCode());
-        });
-    }
-
-    @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS)
-    @MethodSource("com.azure.ai.openai.TestUtils#getTestParameters")
-    public void testGetCompletionsUsageField(HttpClient httpClient, OpenAIServiceVersion serviceVersion) {
-        client = getModelClient(httpClient);
-        getCompletionsRunner((modelId, prompt) -> {
-            CompletionsOptions completionsOptions = new CompletionsOptions(prompt);
-            completionsOptions.setMaxTokens(1024);
-            completionsOptions.setN(3);
-            completionsOptions.setLogprobs(1);
+    @MethodSource("com.azure.ai.inference.TestUtils#getTestParameters")
+    public void testGetCompletionsUsageField(HttpClient httpClient) {
+        client = getChatCompletionsClient(httpClient);
+        getChatCompletionsFromOptionsRunner((options) -> {
+            options.setMaxTokens(1024);
 
-            Completions resultCompletions = client.getCompletions(modelId, completionsOptions);
+            ChatCompletions resultCompletions = client.complete(options);
 
             CompletionsUsage usage = resultCompletions.getUsage();
-            assertCompletions(completionsOptions.getN() * completionsOptions.getPrompt().size(), resultCompletions);
+            assertCompletions(1, resultCompletions);
             assertNotNull(usage);
             assertTrue(usage.getTotalTokens() > 0);
             assertEquals(usage.getCompletionTokens() + usage.getPromptTokens(), usage.getTotalTokens());
@@ -106,42 +89,33 @@ public void testGetCompletionsUsageField(HttpClient httpClient, OpenAIServiceVer
     }
 
     @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS)
-    @MethodSource("com.azure.ai.openai.TestUtils#getTestParameters")
-    public void testGetCompletionsTokenCutoff(HttpClient httpClient, OpenAIServiceVersion serviceVersion) {
-        client = getModelClient(httpClient);
-        getCompletionsRunner((modelId, prompt) -> {
-            CompletionsOptions completionsOptions = new CompletionsOptions(prompt);
-            completionsOptions.setMaxTokens(3);
-            Completions resultCompletions = client.getCompletions(modelId, completionsOptions);
+    @MethodSource("com.azure.ai.inference.TestUtils#getTestParameters")
+    public void testGetCompletionsTokenCutoff(HttpClient httpClient) {
+        client = getChatCompletionsClient(httpClient);
+        getChatCompletionsFromOptionsRunner((options) -> {
+            options.setMaxTokens(3);
+            ChatCompletions resultCompletions = client.complete(options);
             assertCompletions(1, resultCompletions);
         });
     }
-
-    @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS)
-    @MethodSource("com.azure.ai.openai.TestUtils#getTestParameters")
-    public void testGetChatCompletions(HttpClient httpClient, OpenAIServiceVersion serviceVersion) {
-        client = getModelClient(httpClient);
-        getChatCompletionsRunner((deploymentId, chatMessages) -> {
-            ChatCompletions resultChatCompletions = client.getChatCompletions(deploymentId, new ChatCompletionsOptions(chatMessages));
-            assertChatCompletions(1, resultChatCompletions);
-        });
-    }
-
+/*
     @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS)
     @MethodSource("com.azure.ai.openai.TestUtils#getTestParameters")
-    public void testGetChatCompletionsStream(HttpClient httpClient, OpenAIServiceVersion serviceVersion) {
-        client = getModelClient(httpClient);
-        getChatCompletionsRunner((deploymentId, chatMessages) -> {
-            IterableStream resultChatCompletions = client.getChatCompletionsStream(deploymentId, new ChatCompletionsOptions(chatMessages));
-            assertTrue(resultChatCompletions.stream().toArray().length > 1);
-            resultChatCompletions.forEach(OpenAIClientTestBase::assertChatCompletionsStream);
+    public void testGetCompletionsWithResponseBadDeployment(HttpClient httpClient, OpenAIServiceVersion serviceVersion) {
+        client = getChatCompletionsClient(httpClient);
+        getCompletionsRunner((_deploymentId, prompt) -> {
+            String deploymentId = "BAD_DEPLOYMENT_ID";
+            ResourceNotFoundException exception = assertThrows(ResourceNotFoundException.class,
+                () -> client.getCompletionsWithResponse(deploymentId,
+                    BinaryData.fromObject(new CompletionsOptions(prompt)), new RequestOptions()));
+            assertEquals(404, exception.getResponse().getStatusCode());
         });
     }
 
     @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS)
-    @MethodSource("com.azure.ai.openai.TestUtils#getTestParameters")
-    public void testGetChatCompletionsStreamWithResponse(HttpClient httpClient, OpenAIServiceVersion serviceVersion) {
-        client = getModelClient(httpClient);
+    @MethodSource("com.azure.ai.inference.TestUtils#getTestParameters")
+    public void testGetChatCompletionsStreamWithResponse(HttpClient httpClient) {
+        client = getChatCompletionsClient(httpClient);
         getChatCompletionsWithResponseRunner(deploymentId -> chatMessages -> requestOptions -> {
             Response> response = client.getChatCompletionsStreamWithResponse(
                     deploymentId, new ChatCompletionsOptions(chatMessages), requestOptions);
@@ -151,18 +125,6 @@ public void testGetChatCompletionsStreamWithResponse(HttpClient httpClient, Open
             value.forEach(OpenAIClientTestBase::assertChatCompletionsStream);
         });
     }
-
-    @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS)
-    @MethodSource("com.azure.ai.openai.TestUtils#getTestParameters")
-    public void testGetChatCompletionsWithResponse(HttpClient httpClient, OpenAIServiceVersion serviceVersion) {
-        client = getModelClient(httpClient);
-        getChatCompletionsRunner((deploymentId, chatMessages) -> {
-            Response response = client.getChatCompletionsWithResponse(deploymentId,
-                BinaryData.fromObject(new ChatCompletionsOptions(chatMessages)), new RequestOptions());
-            ChatCompletions resultChatCompletions = assertAndGetValueFromResponse(response, ChatCompletions.class, 200);
-            assertChatCompletions(1, resultChatCompletions);
-        });
-    }
 */
 
 }

From 4f40215fdd2a80ae2d4f21b762017e04745c5167 Mon Sep 17 00:00:00 2001
From: glenn 
Date: Wed, 11 Sep 2024 11:19:50 -0400
Subject: [PATCH 093/128] add stream response test

---
 .../ChatCompletionsClientTestBase.java        | 18 +++++++++++
 .../ChatCompletionsSyncClientTest.java        | 32 ++++++++-----------
 2 files changed, 31 insertions(+), 19 deletions(-)

diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java
index 08c4a745866c..88aa73b7047a 100644
--- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java
+++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsClientTestBase.java
@@ -11,6 +11,7 @@
 import com.azure.ai.inference.models.*;
 import com.azure.core.credential.AzureKeyCredential;
 import com.azure.core.http.HttpClient;
+import com.azure.core.http.HttpRequest;
 import com.azure.core.test.TestMode;
 import com.azure.core.test.TestProxyTestBase;
 import com.azure.core.test.models.CustomMatcher;
@@ -131,6 +132,23 @@ static void assertChoice(int index, ChatChoice actual) {
         assertNotNull(actual.getFinishReason());
     }
 
+    static void assertResponseRequestHeader(HttpRequest request) {
+        request.getHeaders().stream().filter(header -> {
+            String name = header.getName();
+            return "my-header1".equals(name) || "my-header2".equals(name) || "my-header3".equals(name);
+        }).forEach(header -> {
+            if (header.getName().equals("my-header1")) {
+                assertEquals("my-header1-value", header.getValue());
+            } else if (header.getName().equals("my-header2")) {
+                assertEquals("my-header2-value", header.getValue());
+            } else if (header.getName().equals("my-header3")) {
+                assertEquals("my-header3-value", header.getValue());
+            } else {
+                assertFalse(true);
+            }
+        });
+    }
+
     private List getChatMessages() {
         List chatMessages = new ArrayList<>();
         chatMessages.add(new ChatRequestSystemMessage("You are a helpful assistant. You will talk like a pirate."));
diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java
index 8c7000bee482..9c4cb757b0f1 100644
--- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java
+++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java
@@ -2,6 +2,7 @@
 // Licensed under the MIT License.
 package com.azure.ai.inference;
 
+import com.azure.ai.inference.implementation.InferenceServerSentEvents;
 import com.azure.ai.inference.models.*;
 import com.azure.core.http.HttpClient;
 
@@ -11,7 +12,9 @@
 import com.azure.core.util.IterableStream;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.MethodSource;
+import reactor.core.publisher.Flux;
 
+import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -98,33 +101,24 @@ public void testGetCompletionsTokenCutoff(HttpClient httpClient) {
             assertCompletions(1, resultCompletions);
         });
     }
-/*
-    @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS)
-    @MethodSource("com.azure.ai.openai.TestUtils#getTestParameters")
-    public void testGetCompletionsWithResponseBadDeployment(HttpClient httpClient, OpenAIServiceVersion serviceVersion) {
-        client = getChatCompletionsClient(httpClient);
-        getCompletionsRunner((_deploymentId, prompt) -> {
-            String deploymentId = "BAD_DEPLOYMENT_ID";
-            ResourceNotFoundException exception = assertThrows(ResourceNotFoundException.class,
-                () -> client.getCompletionsWithResponse(deploymentId,
-                    BinaryData.fromObject(new CompletionsOptions(prompt)), new RequestOptions()));
-            assertEquals(404, exception.getResponse().getStatusCode());
-        });
-    }
 
     @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS)
     @MethodSource("com.azure.ai.inference.TestUtils#getTestParameters")
     public void testGetChatCompletionsStreamWithResponse(HttpClient httpClient) {
         client = getChatCompletionsClient(httpClient);
-        getChatCompletionsWithResponseRunner(deploymentId -> chatMessages -> requestOptions -> {
-            Response> response = client.getChatCompletionsStreamWithResponse(
-                    deploymentId, new ChatCompletionsOptions(chatMessages), requestOptions);
+        getChatCompletionsFromOptionsRunner(options -> {
+            options.setStream(true);
+            Response response = client.completeStreamingWithResponse(
+                BinaryData.fromObject(options), new RequestOptions());
             assertResponseRequestHeader(response.getRequest());
-            IterableStream value = response.getValue();
+            Flux responseStream
+                = response.getValue().toFluxByteBuffer();
+            InferenceServerSentEvents chatCompletionsStream
+                = new InferenceServerSentEvents<>(responseStream, StreamingChatCompletionsUpdate.class);
+            IterableStream value = new IterableStream<>(chatCompletionsStream.getEvents());
             assertTrue(value.stream().toArray().length > 1);
-            value.forEach(OpenAIClientTestBase::assertChatCompletionsStream);
+            value.forEach(ChatCompletionsClientTestBase::assertCompletionsStream);
         });
     }
-*/
 
 }

From 6d9f94c256a650a9853d32515521d8190163280d Mon Sep 17 00:00:00 2001
From: glenn 
Date: Wed, 11 Sep 2024 11:28:55 -0400
Subject: [PATCH 094/128] add completeStreamWithResponse test, change
 completeStreaming to completeStream

---
 sdk/ai/azure-ai-inference/README.md                       | 2 +-
 .../azure/ai/inference/ChatCompletionsAsyncClient.java    | 2 +-
 .../com/azure/ai/inference/ChatCompletionsClient.java     | 8 ++++----
 .../java/com/azure/ai/inference/ReadmeSamples.java        | 7 +------
 .../com/azure/ai/inference/usage/StreamingChatSample.java | 2 +-
 .../ai/inference/usage/StreamingChatSampleAsync.java      | 2 +-
 .../java/com/azure/ai/inference/usage/ToolCallSample.java | 4 ++--
 .../ai/inference/ChatCompletionsAsyncClientTest.java      | 4 +---
 .../azure/ai/inference/ChatCompletionsSyncClientTest.java | 4 ++--
 9 files changed, 14 insertions(+), 21 deletions(-)

diff --git a/sdk/ai/azure-ai-inference/README.md b/sdk/ai/azure-ai-inference/README.md
index 61b3cc3fd8db..a2e434839455 100644
--- a/sdk/ai/azure-ai-inference/README.md
+++ b/sdk/ai/azure-ai-inference/README.md
@@ -134,7 +134,7 @@ 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?"));
 
-client.completeStreaming(new ChatCompletionsOptions(chatMessages))
+client.completeStream(new ChatCompletionsOptions(chatMessages))
     .forEach(chatCompletions -> {
         if (CoreUtils.isNullOrEmpty(chatCompletions.getChoices())) {
             return;
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java
index f060fbbf0011..a4703f2594ba 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java
@@ -239,7 +239,7 @@ Mono> getModelInfoWithResponse(RequestOptions requestOption
      * generate text that continues from or "completes" provided prompt data.
      */
     @ServiceMethod(returns = ReturnType.COLLECTION)
-    public Flux completeStreaming(ChatCompletionsOptions options) {
+    public Flux completeStream(ChatCompletionsOptions options) {
         options.setStream(true);
         RequestOptions requestOptions = new RequestOptions();
         Flux responseStream = completeWithBinaryResponse(BinaryData.fromObject(options), requestOptions)
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java
index 840cbd33b61e..f2b06cf31a62 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java
@@ -260,7 +260,7 @@ public ChatCompletions complete(String prompt) {
      * generate text that continues from or "completes" provided prompt data.
      */
     @ServiceMethod(returns = ReturnType.COLLECTION)
-    public IterableStream completeStreaming(ChatCompletionsOptions options) {
+    public IterableStream completeStream(ChatCompletionsOptions options) {
         options.setStream(true);
         RequestOptions requestOptions = new RequestOptions();
         CompleteRequest completeRequestObj
@@ -282,7 +282,7 @@ public IterableStream completeStreaming(ChatComp
             requestOptions.setHeader(HttpHeaderName.fromString("extra-parameters"), extraParams.toString());
         }
         Flux responseStream
-            = completeStreamingWithResponse(completeRequest, requestOptions).getValue().toFluxByteBuffer();
+            = completeStreamWithResponse(completeRequest, requestOptions).getValue().toFluxByteBuffer();
         InferenceServerSentEvents chatCompletionsStream
             = new InferenceServerSentEvents<>(responseStream, StreamingChatCompletionsUpdate.class);
         return new IterableStream<>(chatCompletionsStream.getEvents());
@@ -363,8 +363,8 @@ public IterableStream completeStreaming(ChatComp
      * text that continues from or "completes" provided prompt data along with {@link Response}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
-    public Response completeStreamingWithResponse(BinaryData chatCompletionsOptions,
-        RequestOptions requestOptions) {
+    public Response completeStreamWithResponse(BinaryData chatCompletionsOptions,
+                                                           RequestOptions requestOptions) {
         return serviceClient.completeWithResponse(chatCompletionsOptions, requestOptions);
     }
 
diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/ReadmeSamples.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/ReadmeSamples.java
index 2da5dc6312b1..5c5a58cb3e84 100644
--- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/ReadmeSamples.java
+++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/ReadmeSamples.java
@@ -4,8 +4,6 @@
 
 package com.azure.ai.inference;
 
-import com.azure.ai.inference.ChatCompletionsClient;
-import com.azure.ai.inference.ChatCompletionsClientBuilder;
 import com.azure.ai.inference.models.ChatCompletionsOptions;
 import com.azure.ai.inference.models.*;
 import com.azure.core.credential.AzureKeyCredential;
@@ -14,14 +12,11 @@
 import com.azure.core.exception.ResourceNotFoundException;
 import com.azure.core.http.policy.HttpLogDetailLevel;
 import com.azure.core.http.policy.HttpLogOptions;
-import com.azure.core.util.Configuration;
 import com.azure.core.util.CoreUtils;
-import com.azure.core.util.IterableStream;
 import com.azure.identity.DefaultAzureCredential;
 import com.azure.identity.DefaultAzureCredentialBuilder;
 
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.List;
 
 public final class ReadmeSamples {
@@ -83,7 +78,7 @@ public void getChatCompletionsStream() {
         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?"));
 
-        client.completeStreaming(new ChatCompletionsOptions(chatMessages))
+        client.completeStream(new ChatCompletionsOptions(chatMessages))
             .forEach(chatCompletions -> {
                 if (CoreUtils.isNullOrEmpty(chatCompletions.getChoices())) {
                     return;
diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java
index 6061960c5716..1ce322bc800b 100644
--- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java
+++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java
@@ -34,7 +34,7 @@ public static void main(String[] args) {
         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?"));
 
-        IterableStream chatCompletionsStream = client.completeStreaming(
+        IterableStream chatCompletionsStream = client.completeStream(
             new ChatCompletionsOptions(chatMessages));
 
         // The delta is the message content for a streaming response.
diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSampleAsync.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSampleAsync.java
index f35601a27621..e6a28ffc9846 100644
--- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSampleAsync.java
+++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSampleAsync.java
@@ -34,7 +34,7 @@ public static void main(String[] args) throws InterruptedException {
         chatMessages.add(new ChatRequestUserMessage("What's the best way to train a parrot?"));
 
 
-        client.completeStreaming(new ChatCompletionsOptions(chatMessages))
+        client.completeStream(new ChatCompletionsOptions(chatMessages))
             .map(chatCompletions -> {
                 /* The delta is the message content for a streaming response.
                  * Subsequence of streaming delta will be like:
diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ToolCallSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ToolCallSample.java
index 6a49bb6aa2dd..c53e4b819601 100644
--- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ToolCallSample.java
+++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ToolCallSample.java
@@ -45,7 +45,7 @@ public static void main(String[] args) {
         ChatCompletionsOptions chatCompletionsOptions = new ChatCompletionsOptions(chatMessages);
         chatCompletionsOptions.setTools(Arrays.asList(toolDefinition));
 
-        IterableStream chatCompletionsStream = client.completeStreaming(chatCompletionsOptions);
+        IterableStream chatCompletionsStream = client.completeStream(chatCompletionsOptions);
 
         String toolCallId = null;
         String functionName = null;
@@ -115,7 +115,7 @@ public static void main(String[] args) {
                 toolRequestMessage
             );
 
-            IterableStream followUpChatCompletionsStream = client.completeStreaming(
+            IterableStream followUpChatCompletionsStream = client.completeStream(
                 new ChatCompletionsOptions(followUpMessages));
 
             StringBuilder finalResult = new StringBuilder();
diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsAsyncClientTest.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsAsyncClientTest.java
index 9d9b44e028fc..bee632bcacf7 100644
--- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsAsyncClientTest.java
+++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsAsyncClientTest.java
@@ -4,8 +4,6 @@
 
 import com.azure.ai.inference.models.*;
 import com.azure.core.http.HttpClient;
-import com.azure.core.http.rest.RequestOptions;
-import com.azure.core.util.BinaryData;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.MethodSource;
 import reactor.test.StepVerifier;
@@ -58,7 +56,7 @@ public void testGetChatCompletionsFromOptions(HttpClient httpClient) {
     public void testGetCompletionsStream(HttpClient httpClient) {
         client = getChatCompletionsAsyncClient(httpClient);
         getChatCompletionsFromMessagesRunner((chatMessages) -> {
-            StepVerifier.create(client.completeStreaming(new ChatCompletionsOptions(chatMessages)))
+            StepVerifier.create(client.completeStream(new ChatCompletionsOptions(chatMessages)))
                 .recordWith(ArrayList::new)
                 .thenConsumeWhile(chatCompletions -> {
                     assertCompletionsStream(chatCompletions);
diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java
index 9c4cb757b0f1..ae16cc4128c7 100644
--- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java
+++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java
@@ -47,7 +47,7 @@ public void testGetCompletionsStream(HttpClient httpClient) {
         getChatCompletionsRunner((prompt) -> {
             List chatMessages = new ArrayList<>();
             chatMessages.add(new ChatRequestUserMessage(prompt));
-            IterableStream resultCompletions = client.completeStreaming(new ChatCompletionsOptions(chatMessages));
+            IterableStream resultCompletions = client.completeStream(new ChatCompletionsOptions(chatMessages));
             assertTrue(resultCompletions.stream().toArray().length > 1);
             resultCompletions.forEach(ChatCompletionsClientTestBase::assertCompletionsStream);
         });
@@ -108,7 +108,7 @@ public void testGetChatCompletionsStreamWithResponse(HttpClient httpClient) {
         client = getChatCompletionsClient(httpClient);
         getChatCompletionsFromOptionsRunner(options -> {
             options.setStream(true);
-            Response response = client.completeStreamingWithResponse(
+            Response response = client.completeStreamWithResponse(
                 BinaryData.fromObject(options), new RequestOptions());
             assertResponseRequestHeader(response.getRequest());
             Flux responseStream

From 6687aff79f79d0ebd9c5b95435f3d71e79da65fc Mon Sep 17 00:00:00 2001
From: glenn 
Date: Wed, 11 Sep 2024 15:17:20 -0400
Subject: [PATCH 095/128] new test recordings

---
 sdk/ai/azure-ai-inference/assets.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sdk/ai/azure-ai-inference/assets.json b/sdk/ai/azure-ai-inference/assets.json
index 17d0d146c96c..40e1348f85d3 100644
--- a/sdk/ai/azure-ai-inference/assets.json
+++ b/sdk/ai/azure-ai-inference/assets.json
@@ -2,5 +2,5 @@
   "AssetsRepo" : "Azure/azure-sdk-assets",
   "AssetsRepoPrefixPath" : "java",
   "TagPrefix" : "java/ai/azure-ai-inference",
-  "Tag" : "java/ai/azure-ai-inference_865a982f7d"
+  "Tag" : "java/ai/azure-ai-inference_afe7d4c15e"
 }
\ No newline at end of file

From 870f73a4d20c42286f936180b19ff4d3483bc3a3 Mon Sep 17 00:00:00 2001
From: glenn 
Date: Thu, 12 Sep 2024 15:06:24 -0400
Subject: [PATCH 096/128] changes for TypeSpec sync

---
 .../com/azure/ai/inference/ChatCompletionsClientBuilder.java  | 1 -
 .../java/com/azure/ai/inference/EmbeddingsClientBuilder.java  | 1 -
 .../com/azure/ai/inference/models/FunctionDefinition.java     | 4 +---
 3 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClientBuilder.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClientBuilder.java
index 791faad356a0..edd061ac8379 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClientBuilder.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClientBuilder.java
@@ -303,7 +303,6 @@ private void validateClient() {
         Objects.requireNonNull(endpoint, "'endpoint' cannot be null.");
     }
 
-    @Generated
     private HttpPipeline createHttpPipeline() {
         Configuration buildConfiguration
             = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration;
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClientBuilder.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClientBuilder.java
index 8754aee02910..f5b62ad9cf7b 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClientBuilder.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClientBuilder.java
@@ -304,7 +304,6 @@ private void validateClient() {
         Objects.requireNonNull(endpoint, "'endpoint' cannot be null.");
     }
 
-    @Generated
     private HttpPipeline createHttpPipeline() {
         Configuration buildConfiguration
             = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration;
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java
index d0f0d3ef2e8b..20755d99d839 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/FunctionDefinition.java
@@ -5,12 +5,12 @@
 
 import com.azure.core.annotation.Fluent;
 import com.azure.core.annotation.Generated;
-import com.azure.core.util.BinaryData;
 import com.azure.json.JsonReader;
 import com.azure.json.JsonSerializable;
 import com.azure.json.JsonToken;
 import com.azure.json.JsonWriter;
 import java.io.IOException;
+import com.azure.core.util.BinaryData;
 
 /**
  * The definition of a caller-specified function that chat completions may invoke in response to matching user input.
@@ -105,7 +105,6 @@ public FunctionDefinition setParameters(BinaryData parameters) {
     /**
      * {@inheritDoc}
      */
-    @Generated
     @Override
     public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
         jsonWriter.writeStartObject();
@@ -124,7 +123,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
      * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
      * @throws IOException If an error occurs while reading the FunctionDefinition.
      */
-    @Generated
     public static FunctionDefinition fromJson(JsonReader jsonReader) throws IOException {
         return jsonReader.readObject(reader -> {
             String name = null;

From be46f17f79cc7aa5f19860ccfdddd6aac7dbed43 Mon Sep 17 00:00:00 2001
From: glenn 
Date: Thu, 12 Sep 2024 15:33:07 -0400
Subject: [PATCH 097/128] fix pom error

---
 sdk/ai/azure-ai-inference/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sdk/ai/azure-ai-inference/pom.xml b/sdk/ai/azure-ai-inference/pom.xml
index f9dd609102a7..fb4c69b384bc 100644
--- a/sdk/ai/azure-ai-inference/pom.xml
+++ b/sdk/ai/azure-ai-inference/pom.xml
@@ -48,7 +48,7 @@
     
       com.azure
       azure-json
-      1.2.0 
+      1.3.0 
     
     
       com.azure

From 67e2a8b598fbd2f32364c8da2edec9d889217406 Mon Sep 17 00:00:00 2001
From: glenn 
Date: Thu, 12 Sep 2024 16:09:25 -0400
Subject: [PATCH 098/128] add deleted file

---
 ...tionConfigurationRuleDefinitionsTests.java | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/test/java/com/azure/resourcemanager/applicationinsights/generated/ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitionsTests.java

diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/test/java/com/azure/resourcemanager/applicationinsights/generated/ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitionsTests.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/test/java/com/azure/resourcemanager/applicationinsights/generated/ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitionsTests.java
new file mode 100644
index 000000000000..2efe99b14245
--- /dev/null
+++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/test/java/com/azure/resourcemanager/applicationinsights/generated/ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitionsTests.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.applicationinsights.generated;
+
+import com.azure.core.util.BinaryData;
+import com.azure.resourcemanager.applicationinsights.models.ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions;
+import org.junit.jupiter.api.Assertions;
+
+public final class ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitionsTests {
+    @org.junit.jupiter.api.Test
+    public void testDeserialize() throws Exception {
+        ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions model =
+            BinaryData
+                .fromString(
+                    "{\"Name\":\"nmoc\",\"DisplayName\":\"ysh\",\"Description\":\"zafb\",\"HelpUrl\":\"j\",\"IsHidden\":true,\"IsEnabledByDefault\":false,\"IsInPreview\":false,\"SupportsEmailNotifications\":false}")
+                .toObject(ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions.class);
+        Assertions.assertEquals("nmoc", model.name());
+        Assertions.assertEquals("ysh", model.displayName());
+        Assertions.assertEquals("zafb", model.description());
+        Assertions.assertEquals("j", model.helpUrl());
+        Assertions.assertEquals(true, model.isHidden());
+        Assertions.assertEquals(false, model.isEnabledByDefault());
+        Assertions.assertEquals(false, model.isInPreview());
+        Assertions.assertEquals(false, model.supportsEmailNotifications());
+    }
+
+    @org.junit.jupiter.api.Test
+    public void testSerialize() throws Exception {
+        ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions model =
+            new ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions()
+                .withName("nmoc")
+                .withDisplayName("ysh")
+                .withDescription("zafb")
+                .withHelpUrl("j")
+                .withIsHidden(true)
+                .withIsEnabledByDefault(false)
+                .withIsInPreview(false)
+                .withSupportsEmailNotifications(false);
+        model =
+            BinaryData
+                .fromObject(model)
+                .toObject(ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions.class);
+        Assertions.assertEquals("nmoc", model.name());
+        Assertions.assertEquals("ysh", model.displayName());
+        Assertions.assertEquals("zafb", model.description());
+        Assertions.assertEquals("j", model.helpUrl());
+        Assertions.assertEquals(true, model.isHidden());
+        Assertions.assertEquals(false, model.isEnabledByDefault());
+        Assertions.assertEquals(false, model.isInPreview());
+        Assertions.assertEquals(false, model.supportsEmailNotifications());
+    }
+}

From 3b452811c31414d484b00248ddac1ae337e9e6d1 Mon Sep 17 00:00:00 2001
From: glenn 
Date: Thu, 12 Sep 2024 16:25:03 -0400
Subject: [PATCH 099/128] restore deleted files

---
 ...tByResourceGroupWithResponseMockTests.java |   84 ++
 ...ntApplicationXWwwFormUrlencodedSchema.java |  220 ++++
 ...eckProvisioningServiceNameAvailabilit.java |   26 +
 ...eateOrUpdatePrivateEndpointConnection.java |   35 +
 ...eletePrivateEndpointConnectionSamples.java |   26 +
 ...ResourcesListByCloudHsmClusterSamples.java |   26 +
 ...onnectionsCreateWithResponseMockTests.java |   71 +
 ...ntConnectionsGetWithResponseMockTests.java |   64 +
 ...istByInformaticaOrganizationResourceS.java |   26 +
 ...rverlessRuntimesWithResponseMockTests.java |   78 ++
 ...rtFailedServerlessRuntimeWitMockTests.java |   34 +
 ...eNpbStaticRouteBfdAdministrativeState.java |   32 +
 .../implementation/OpenAIClientImpl.java      | 1165 +----------------
 ...LocationsExecuteWithResponseMockTests.java |   45 +
 ...eckNameAvailabilityResponseModelInner.java |  102 ++
 ...heckNameAvailabilityResponseModelImpl.java |   43 +
 ...rotectedItemOperationStatusClientImpl.java |  254 ++++
 ...oAzStackHciEventModelCustomProperties.java |  110 ++
 ...oAzStackHciPlannedFailoverCustomProps.java |   56 +
 ...AzStackHciPolicyModelCustomProperties.java |  118 ++
 ...temModelPropertiesLastTestFailoverJob.java |   25 +
 ...rCleanupWorkflowModelCustomProperties.java |   45 +
 ...oAzStackHciPlannedFailoverCustomProps.java |   56 +
 ...AzStackHciPolicyModelCustomProperties.java |  118 ++
 ...rotectedItemOperationStatusGetSamples.java |   24 +
 ...esourceProviderCheckNameAvailabilityS.java |   28 +
 ...esourceProviderDeploymentPreflightSam.java |   39 +
 27 files changed, 1838 insertions(+), 1112 deletions(-)
 create mode 100644 sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalStorageInstancesGetByResourceGroupWithResponseMockTests.java
 create mode 100644 sdk/containerregistry/azure-containers-containerregistry/src/main/java/com/azure/containers/containerregistry/implementation/models/Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema.java
 create mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceCheckProvisioningServiceNameAvailabilit.java
 create mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceCreateOrUpdatePrivateEndpointConnection.java
 create mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceDeletePrivateEndpointConnectionSamples.java
 create mode 100644 sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSamples.java
 create mode 100644 sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsCreateWithResponseMockTests.java
 create mode 100644 sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsGetWithResponseMockTests.java
 create mode 100644 sdk/informaticadatamanagement/azure-resourcemanager-informaticadatamanagement/src/samples/java/com/azure/resourcemanager/informaticadatamanagement/generated/ServerlessRuntimesListByInformaticaOrganizationResourceS.java
 create mode 100644 sdk/informaticadatamanagement/azure-resourcemanager-informaticadatamanagement/src/test/java/com/azure/resourcemanager/informaticadatamanagement/generated/OrganizationsGetAllServerlessRuntimesWithResponseMockTests.java
 create mode 100644 sdk/informaticadatamanagement/azure-resourcemanager-informaticadatamanagement/src/test/java/com/azure/resourcemanager/informaticadatamanagement/generated/ServerlessRuntimesStartFailedServerlessRuntimeWitMockTests.java
 create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsUpdateNpbStaticRouteBfdAdministrativeState.java
 create mode 100644 sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityWithLocationsExecuteWithResponseMockTests.java
 create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/CheckNameAvailabilityResponseModelInner.java
 create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/CheckNameAvailabilityResponseModelImpl.java
 create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ProtectedItemOperationStatusClientImpl.java
 create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciEventModelCustomProperties.java
 create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciPlannedFailoverCustomProps.java
 create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciPolicyModelCustomProperties.java
 create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelPropertiesLastTestFailoverJob.java
 create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TestFailoverCleanupWorkflowModelCustomProperties.java
 create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciPlannedFailoverCustomProps.java
 create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciPolicyModelCustomProperties.java
 create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemOperationStatusGetSamples.java
 create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ResourceProviderCheckNameAvailabilityS.java
 create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ResourceProviderDeploymentPreflightSam.java

diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalStorageInstancesGetByResourceGroupWithResponseMockTests.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalStorageInstancesGetByResourceGroupWithResponseMockTests.java
new file mode 100644
index 000000000000..7cfcddcf6bea
--- /dev/null
+++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalStorageInstancesGetByResourceGroupWithResponseMockTests.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.baremetalinfrastructure.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.baremetalinfrastructure.BareMetalInfrastructureManager;
+import com.azure.resourcemanager.baremetalinfrastructure.models.AzureBareMetalStorageInstance;
+import com.azure.resourcemanager.baremetalinfrastructure.models.ProvisioningState;
+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 AzureBareMetalStorageInstancesGetByResourceGroupWithResponseMockTests {
+    @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 =
+            "{\"properties\":{\"azureBareMetalStorageInstanceUniqueIdentifier\":\"unmmq\",\"storageProperties\":{\"provisioningState\":\"Creating\",\"offeringType\":\"konocu\",\"storageType\":\"klyaxuconu\",\"generation\":\"zf\",\"hardwareType\":\"eyp\",\"workloadType\":\"rmjmwvvjektc\",\"storageBillingProperties\":{\"billingMode\":\"nhwlrsffrzpwvl\",\"azureBareMetalStorageInstanceSize\":\"q\"}}},\"location\":\"iqylihkaetck\",\"tags\":{\"jf\":\"civfsnkymuctq\",\"fuwutttxf\":\"ebrjcxe\",\"hfnljkyq\":\"jrbirphxepcyv\"},\"id\":\"j\",\"name\":\"uujqgidokgjljyo\",\"type\":\"gvcl\"}";
+
+        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);
+                        }));
+
+        BareMetalInfrastructureManager manager =
+            BareMetalInfrastructureManager
+                .configure()
+                .withHttpClient(httpClient)
+                .authenticate(
+                    tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)),
+                    new AzureProfile("", "", AzureEnvironment.AZURE));
+
+        AzureBareMetalStorageInstance response =
+            manager
+                .azureBareMetalStorageInstances()
+                .getByResourceGroupWithResponse("qnwvlrya", "w", com.azure.core.util.Context.NONE)
+                .getValue();
+
+        Assertions.assertEquals("iqylihkaetck", response.location());
+        Assertions.assertEquals("civfsnkymuctq", response.tags().get("jf"));
+        Assertions.assertEquals("unmmq", response.azureBareMetalStorageInstanceUniqueIdentifier());
+        Assertions.assertEquals(ProvisioningState.CREATING, response.storageProperties().provisioningState());
+        Assertions.assertEquals("konocu", response.storageProperties().offeringType());
+        Assertions.assertEquals("klyaxuconu", response.storageProperties().storageType());
+        Assertions.assertEquals("zf", response.storageProperties().generation());
+        Assertions.assertEquals("eyp", response.storageProperties().hardwareType());
+        Assertions.assertEquals("rmjmwvvjektc", response.storageProperties().workloadType());
+        Assertions
+            .assertEquals("nhwlrsffrzpwvl", response.storageProperties().storageBillingProperties().billingMode());
+        Assertions
+            .assertEquals(
+                "q", response.storageProperties().storageBillingProperties().azureBareMetalStorageInstanceSize());
+    }
+}
diff --git a/sdk/containerregistry/azure-containers-containerregistry/src/main/java/com/azure/containers/containerregistry/implementation/models/Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema.java b/sdk/containerregistry/azure-containers-containerregistry/src/main/java/com/azure/containers/containerregistry/implementation/models/Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema.java
new file mode 100644
index 000000000000..2d87eef19115
--- /dev/null
+++ b/sdk/containerregistry/azure-containers-containerregistry/src/main/java/com/azure/containers/containerregistry/implementation/models/Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema.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.containers.containerregistry.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;
+import java.util.Objects;
+
+/** The Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema model. */
+@Fluent
+public final class Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema
+        implements JsonSerializable<
+                Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema> {
+    /*
+     * Can take a value of access_token_refresh_token, or access_token, or refresh_token
+     */
+    private PostContentSchemaGrantType grantType;
+
+    /*
+     * Indicates the name of your Azure container registry.
+     */
+    private String service;
+
+    /*
+     * AAD tenant associated to the AAD credentials.
+     */
+    private String tenant;
+
+    /*
+     * AAD refresh token, mandatory when grant_type is access_token_refresh_token or refresh_token
+     */
+    private String refreshToken;
+
+    /*
+     * AAD access token, mandatory when grant_type is access_token_refresh_token or access_token.
+     */
+    private String aadAccessToken;
+
+    /**
+     * Creates an instance of Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema class.
+     */
+    public Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema() {}
+
+    /**
+     * Get the grantType property: Can take a value of access_token_refresh_token, or access_token, or refresh_token.
+     *
+     * @return the grantType value.
+     */
+    public PostContentSchemaGrantType getGrantType() {
+        return this.grantType;
+    }
+
+    /**
+     * Set the grantType property: Can take a value of access_token_refresh_token, or access_token, or refresh_token.
+     *
+     * @param grantType the grantType value to set.
+     * @return the Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema object itself.
+     */
+    public Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema setGrantType(
+            PostContentSchemaGrantType grantType) {
+        this.grantType = grantType;
+        return this;
+    }
+
+    /**
+     * Get the service property: Indicates the name of your Azure container registry.
+     *
+     * @return the service value.
+     */
+    public String getService() {
+        return this.service;
+    }
+
+    /**
+     * Set the service property: Indicates the name of your Azure container registry.
+     *
+     * @param service the service value to set.
+     * @return the Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema object itself.
+     */
+    public Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema setService(
+            String service) {
+        this.service = service;
+        return this;
+    }
+
+    /**
+     * Get the tenant property: AAD tenant associated to the AAD credentials.
+     *
+     * @return the tenant value.
+     */
+    public String getTenant() {
+        return this.tenant;
+    }
+
+    /**
+     * Set the tenant property: AAD tenant associated to the AAD credentials.
+     *
+     * @param tenant the tenant value to set.
+     * @return the Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema object itself.
+     */
+    public Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema setTenant(
+            String tenant) {
+        this.tenant = tenant;
+        return this;
+    }
+
+    /**
+     * Get the refreshToken property: AAD refresh token, mandatory when grant_type is access_token_refresh_token or
+     * refresh_token.
+     *
+     * @return the refreshToken value.
+     */
+    public String getRefreshToken() {
+        return this.refreshToken;
+    }
+
+    /**
+     * Set the refreshToken property: AAD refresh token, mandatory when grant_type is access_token_refresh_token or
+     * refresh_token.
+     *
+     * @param refreshToken the refreshToken value to set.
+     * @return the Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema object itself.
+     */
+    public Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema setRefreshToken(
+            String refreshToken) {
+        this.refreshToken = refreshToken;
+        return this;
+    }
+
+    /**
+     * Get the aadAccessToken property: AAD access token, mandatory when grant_type is access_token_refresh_token or
+     * access_token.
+     *
+     * @return the aadAccessToken value.
+     */
+    public String getAadAccessToken() {
+        return this.aadAccessToken;
+    }
+
+    /**
+     * Set the aadAccessToken property: AAD access token, mandatory when grant_type is access_token_refresh_token or
+     * access_token.
+     *
+     * @param aadAccessToken the aadAccessToken value to set.
+     * @return the Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema object itself.
+     */
+    public Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema setAadAccessToken(
+            String aadAccessToken) {
+        this.aadAccessToken = aadAccessToken;
+        return this;
+    }
+
+    @Override
+    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+        jsonWriter.writeStartObject();
+        jsonWriter.writeStringField("grant_type", Objects.toString(this.grantType, null));
+        jsonWriter.writeStringField("service", this.service);
+        jsonWriter.writeStringField("tenant", this.tenant);
+        jsonWriter.writeStringField("refresh_token", this.refreshToken);
+        jsonWriter.writeStringField("access_token", this.aadAccessToken);
+        return jsonWriter.writeEndObject();
+    }
+
+    /**
+     * Reads an instance of Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema from the
+     * JsonReader.
+     *
+     * @param jsonReader The JsonReader being read.
+     * @return An instance of Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema if the
+     *     JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
+     * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+     * @throws IOException If an error occurs while reading the
+     *     Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema.
+     */
+    public static Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema fromJson(
+            JsonReader jsonReader) throws IOException {
+        return jsonReader.readObject(
+                reader -> {
+                    Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema
+                            deserializedPaths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema =
+                                    new Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema();
+                    while (reader.nextToken() != JsonToken.END_OBJECT) {
+                        String fieldName = reader.getFieldName();
+                        reader.nextToken();
+
+                        if ("grant_type".equals(fieldName)) {
+                            deserializedPaths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema
+                                            .grantType =
+                                    PostContentSchemaGrantType.fromString(reader.getString());
+                        } else if ("service".equals(fieldName)) {
+                            deserializedPaths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema
+                                            .service =
+                                    reader.getString();
+                        } else if ("tenant".equals(fieldName)) {
+                            deserializedPaths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema
+                                            .tenant =
+                                    reader.getString();
+                        } else if ("refresh_token".equals(fieldName)) {
+                            deserializedPaths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema
+                                            .refreshToken =
+                                    reader.getString();
+                        } else if ("access_token".equals(fieldName)) {
+                            deserializedPaths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema
+                                            .aadAccessToken =
+                                    reader.getString();
+                        } else {
+                            reader.skipChildren();
+                        }
+                    }
+
+                    return deserializedPaths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema;
+                });
+    }
+}
diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceCheckProvisioningServiceNameAvailabilit.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceCheckProvisioningServiceNameAvailabilit.java
new file mode 100644
index 000000000000..43b776b1fb96
--- /dev/null
+++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceCheckProvisioningServiceNameAvailabilit.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.deviceprovisioningservices.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.deviceprovisioningservices.models.OperationInputs;
+
+/** Samples for IotDpsResource CheckProvisioningServiceNameAvailability. */
+public final class IotDpsResourceCheckProvisioningServiceNameAvailabilit {
+    /*
+     * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSCheckNameAvailability.json
+     */
+    /**
+     * Sample code: DPSCheckName.
+     *
+     * @param manager Entry point to IotDpsManager.
+     */
+    public static void dPSCheckName(com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) {
+        manager
+            .iotDpsResources()
+            .checkProvisioningServiceNameAvailabilityWithResponse(
+                new OperationInputs().withName("test213123"), Context.NONE);
+    }
+}
diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceCreateOrUpdatePrivateEndpointConnection.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceCreateOrUpdatePrivateEndpointConnection.java
new file mode 100644
index 000000000000..5728f23ed58d
--- /dev/null
+++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceCreateOrUpdatePrivateEndpointConnection.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.deviceprovisioningservices.generated;
+
+import com.azure.resourcemanager.deviceprovisioningservices.models.PrivateEndpointConnectionProperties;
+import com.azure.resourcemanager.deviceprovisioningservices.models.PrivateLinkServiceConnectionState;
+import com.azure.resourcemanager.deviceprovisioningservices.models.PrivateLinkServiceConnectionStatus;
+
+/** Samples for IotDpsResource CreateOrUpdatePrivateEndpointConnection. */
+public final class IotDpsResourceCreateOrUpdatePrivateEndpointConnection {
+    /*
+     * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSCreateOrUpdatePrivateEndpointConnection.json
+     */
+    /**
+     * Sample code: PrivateEndpointConnection_CreateOrUpdate.
+     *
+     * @param manager Entry point to IotDpsManager.
+     */
+    public static void privateEndpointConnectionCreateOrUpdate(
+        com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) {
+        manager
+            .iotDpsResources()
+            .definePrivateEndpointConnection("myPrivateEndpointConnection")
+            .withExistingProvisioningService("myResourceGroup", "myFirstProvisioningService")
+            .withProperties(
+                new PrivateEndpointConnectionProperties()
+                    .withPrivateLinkServiceConnectionState(
+                        new PrivateLinkServiceConnectionState()
+                            .withStatus(PrivateLinkServiceConnectionStatus.APPROVED)
+                            .withDescription("Approved by johndoe@contoso.com")))
+            .create();
+    }
+}
diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceDeletePrivateEndpointConnectionSamples.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceDeletePrivateEndpointConnectionSamples.java
new file mode 100644
index 000000000000..1301de34dae8
--- /dev/null
+++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceDeletePrivateEndpointConnectionSamples.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.deviceprovisioningservices.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for IotDpsResource DeletePrivateEndpointConnection. */
+public final class IotDpsResourceDeletePrivateEndpointConnectionSamples {
+    /*
+     * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSDeletePrivateEndpointConnection.json
+     */
+    /**
+     * Sample code: PrivateEndpointConnection_Delete.
+     *
+     * @param manager Entry point to IotDpsManager.
+     */
+    public static void privateEndpointConnectionDelete(
+        com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) {
+        manager
+            .iotDpsResources()
+            .deletePrivateEndpointConnection(
+                "myResourceGroup", "myFirstProvisioningService", "myPrivateEndpointConnection", Context.NONE);
+    }
+}
diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSamples.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSamples.java
new file mode 100644
index 000000000000..f4ec1ee01bdf
--- /dev/null
+++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSamples.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.hardwaresecuritymodules.generated;
+
+/**
+ * Samples for CloudHsmClusterPrivateLinkResources ListByCloudHsmCluster.
+ */
+public final class CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSamples {
+    /*
+     * x-ms-original-file:
+     * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-
+     * preview/examples/CloudHsmClusterPrivateLinkResource_ListByCloudHsmCluster_MaximumSet_Gen.json
+     */
+    /**
+     * Sample code: CloudHsmClusterPrivateLinkResources_ListByResource_MaximumSet_Gen.
+     * 
+     * @param manager Entry point to HardwareSecurityModulesManager.
+     */
+    public static void cloudHsmClusterPrivateLinkResourcesListByResourceMaximumSetGen(
+        com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) {
+        manager.cloudHsmClusterPrivateLinkResources().listByCloudHsmClusterWithResponse("rgcloudhsm", "chsm1",
+            com.azure.core.util.Context.NONE);
+    }
+}
diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsCreateWithResponseMockTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsCreateWithResponseMockTests.java
new file mode 100644
index 000000000000..5b209c4ea124
--- /dev/null
+++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsCreateWithResponseMockTests.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.hardwaresecuritymodules.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.hardwaresecuritymodules.HardwareSecurityModulesManager;
+import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpoint;
+import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointConnection;
+import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointConnectionProperties;
+import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointServiceConnectionStatus;
+import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateLinkServiceConnectionState;
+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 CloudHsmClusterPrivateEndpointConnectionsCreateWithResponseMockTests {
+    @Test
+    public void testCreateWithResponse() throws Exception {
+        HttpClient httpClient = Mockito.mock(HttpClient.class);
+        HttpResponse httpResponse = Mockito.mock(HttpResponse.class);
+        ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class);
+
+        String responseStr
+            = "{\"properties\":{\"privateEndpoint\":{\"id\":\"gaifmvik\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"vkhbejdznx\",\"actionsRequired\":\"dsrhnjiv\"},\"provisioningState\":\"Canceled\",\"groupIds\":[\"ovqfzge\",\"jdftuljltd\"]},\"etag\":\"eamtmcz\",\"id\":\"m\",\"name\":\"jw\",\"type\":\"w\"}";
+
+        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);
+        }));
+
+        HardwareSecurityModulesManager manager = HardwareSecurityModulesManager.configure().withHttpClient(httpClient)
+            .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)),
+                new AzureProfile("", "", AzureEnvironment.AZURE));
+
+        PrivateEndpointConnection response
+            = manager.cloudHsmClusterPrivateEndpointConnections().define("qhih")
+                .withExistingCloudHsmCluster("gxmrhublwp", "esutrgjupauutpw")
+                .withProperties(new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint())
+                    .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState()
+                        .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED).withDescription("qntcypsxjvfoimwk")
+                        .withActionsRequired("ircizjxvy")))
+                .withEtag("slbi").create();
+
+        Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING,
+            response.properties().privateLinkServiceConnectionState().status());
+        Assertions.assertEquals("vkhbejdznx", response.properties().privateLinkServiceConnectionState().description());
+        Assertions.assertEquals("dsrhnjiv",
+            response.properties().privateLinkServiceConnectionState().actionsRequired());
+        Assertions.assertEquals("eamtmcz", response.etag());
+    }
+}
diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsGetWithResponseMockTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsGetWithResponseMockTests.java
new file mode 100644
index 000000000000..22e51b1798fa
--- /dev/null
+++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsGetWithResponseMockTests.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.hardwaresecuritymodules.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.hardwaresecuritymodules.HardwareSecurityModulesManager;
+import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointConnection;
+import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointServiceConnectionStatus;
+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 CloudHsmClusterPrivateEndpointConnectionsGetWithResponseMockTests {
+    @Test
+    public void testGetWithResponse() throws Exception {
+        HttpClient httpClient = Mockito.mock(HttpClient.class);
+        HttpResponse httpResponse = Mockito.mock(HttpResponse.class);
+        ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class);
+
+        String responseStr
+            = "{\"properties\":{\"privateEndpoint\":{\"id\":\"iylwdshfssnr\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"frymsgaojfmwnc\",\"actionsRequired\":\"mrfhirctymox\"},\"provisioningState\":\"Failed\",\"groupIds\":[\"piwyczuhxacpqjl\",\"h\"]},\"etag\":\"usps\",\"id\":\"sdvlmfwdgzxulucv\",\"name\":\"amrsreuzv\",\"type\":\"urisjnhnytxifqj\"}";
+
+        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);
+        }));
+
+        HardwareSecurityModulesManager manager = HardwareSecurityModulesManager.configure().withHttpClient(httpClient)
+            .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)),
+                new AzureProfile("", "", AzureEnvironment.AZURE));
+
+        PrivateEndpointConnection response = manager.cloudHsmClusterPrivateEndpointConnections()
+            .getWithResponse("cluyovwxnbkf", "zzxscyhwzdgiruj", "zbomvzzbtdcqvpni", com.azure.core.util.Context.NONE)
+            .getValue();
+
+        Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING,
+            response.properties().privateLinkServiceConnectionState().status());
+        Assertions.assertEquals("frymsgaojfmwnc",
+            response.properties().privateLinkServiceConnectionState().description());
+        Assertions.assertEquals("mrfhirctymox",
+            response.properties().privateLinkServiceConnectionState().actionsRequired());
+        Assertions.assertEquals("usps", response.etag());
+    }
+}
diff --git a/sdk/informaticadatamanagement/azure-resourcemanager-informaticadatamanagement/src/samples/java/com/azure/resourcemanager/informaticadatamanagement/generated/ServerlessRuntimesListByInformaticaOrganizationResourceS.java b/sdk/informaticadatamanagement/azure-resourcemanager-informaticadatamanagement/src/samples/java/com/azure/resourcemanager/informaticadatamanagement/generated/ServerlessRuntimesListByInformaticaOrganizationResourceS.java
new file mode 100644
index 000000000000..93cd37651dad
--- /dev/null
+++ b/sdk/informaticadatamanagement/azure-resourcemanager-informaticadatamanagement/src/samples/java/com/azure/resourcemanager/informaticadatamanagement/generated/ServerlessRuntimesListByInformaticaOrganizationResourceS.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.informaticadatamanagement.generated;
+
+/**
+ * Samples for ServerlessRuntimes ListByInformaticaOrganizationResource.
+ */
+public final class ServerlessRuntimesListByInformaticaOrganizationResourceS {
+    /*
+     * x-ms-original-file:
+     * specification/informatica/resource-manager/Informatica.DataManagement/stable/2024-05-08/examples/
+     * ServerlessRuntimes_ListByInformaticaOrganizationResource_MaximumSet_Gen.json
+     */
+    /**
+     * Sample code: ServerlessRuntimes_ListByInformaticaOrganizationResource.
+     * 
+     * @param manager Entry point to InformaticaDataManagementManager.
+     */
+    public static void serverlessRuntimesListByInformaticaOrganizationResource(
+        com.azure.resourcemanager.informaticadatamanagement.InformaticaDataManagementManager manager) {
+        manager.serverlessRuntimes()
+            .listByInformaticaOrganizationResource("rgopenapi", "orgName", com.azure.core.util.Context.NONE);
+    }
+}
diff --git a/sdk/informaticadatamanagement/azure-resourcemanager-informaticadatamanagement/src/test/java/com/azure/resourcemanager/informaticadatamanagement/generated/OrganizationsGetAllServerlessRuntimesWithResponseMockTests.java b/sdk/informaticadatamanagement/azure-resourcemanager-informaticadatamanagement/src/test/java/com/azure/resourcemanager/informaticadatamanagement/generated/OrganizationsGetAllServerlessRuntimesWithResponseMockTests.java
new file mode 100644
index 000000000000..85e179300f05
--- /dev/null
+++ b/sdk/informaticadatamanagement/azure-resourcemanager-informaticadatamanagement/src/test/java/com/azure/resourcemanager/informaticadatamanagement/generated/OrganizationsGetAllServerlessRuntimesWithResponseMockTests.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.informaticadatamanagement.generated;
+
+import com.azure.core.credential.AccessToken;
+import com.azure.core.http.HttpClient;
+import com.azure.core.management.AzureEnvironment;
+import com.azure.core.management.profile.AzureProfile;
+import com.azure.core.test.http.MockHttpResponse;
+import com.azure.resourcemanager.informaticadatamanagement.InformaticaDataManagementManager;
+import com.azure.resourcemanager.informaticadatamanagement.models.InformaticaServerlessRuntimeResourceList;
+import com.azure.resourcemanager.informaticadatamanagement.models.RuntimeType;
+import java.nio.charset.StandardCharsets;
+import java.time.OffsetDateTime;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import reactor.core.publisher.Mono;
+
+public final class OrganizationsGetAllServerlessRuntimesWithResponseMockTests {
+    @Test
+    public void testGetAllServerlessRuntimesWithResponse() throws Exception {
+        String responseStr
+            = "{\"informaticaRuntimeResources\":[{\"name\":\"tkfa\",\"createdTime\":\"nopqgikyzirtx\",\"updatedTime\":\"yuxzejntpsewgi\",\"createdBy\":\"ilqu\",\"updatedBy\":\"rydxtqm\",\"id\":\"eoxorggufhyao\",\"type\":\"SERVERLESS\",\"status\":\"bghhavgrvkf\",\"statusLocalized\":\"ovjzhpjbibgjmfx\",\"statusMessage\":\"mv\",\"serverlessConfigProperties\":{\"subnet\":\"luyovwxnbkfezzx\",\"applicationType\":\"yhwzdgiruj\",\"resourceGroupName\":\"bomvzzbtdcqv\",\"advancedCustomProperties\":\"iyujviylwdshfs\",\"supplementaryFileLocation\":\"rbgyefry\",\"platform\":\"gaojf\",\"tags\":\"nc\",\"vnet\":\"mrfhirctymox\",\"executionTimeout\":\"tpipiwyczuhx\",\"computeUnits\":\"pqjlihhyusps\",\"tenantId\":\"sdvlmfwdgzxulucv\",\"subscriptionId\":\"mrsreuzvxurisjnh\",\"region\":\"txifqj\",\"serverlessArmResourceId\":\"xmrhu\"},\"description\":\"wp\"},{\"name\":\"esutrgjupauutpw\",\"createdTime\":\"qhih\",\"updatedTime\":\"jqgwzp\",\"createdBy\":\"fqntcyp\",\"updatedBy\":\"xjvfoimwksl\",\"id\":\"rcizjxvyd\",\"type\":\"SERVERLESS\",\"status\":\"eacvl\",\"statusLocalized\":\"vygdyft\",\"statusMessage\":\"mrtwna\",\"serverlessConfigProperties\":{\"subnet\":\"slbi\",\"applicationType\":\"ojgcyzt\",\"resourceGroupName\":\"mznbaeqphch\",\"advancedCustomProperties\":\"rn\",\"supplementaryFileLocation\":\"x\",\"platform\":\"uwrykqgaifmvikl\",\"tags\":\"dvk\",\"vnet\":\"ejd\",\"executionTimeout\":\"xcv\",\"computeUnits\":\"rhnj\",\"tenantId\":\"olvtnovqfzge\",\"subscriptionId\":\"dftuljltduce\",\"region\":\"tmczuomejwcwwqi\",\"serverlessArmResourceId\":\"nssxmojmsvpk\"},\"description\":\"rvkwc\"},{\"name\":\"zqljyxgtczh\",\"createdTime\":\"ydbsd\",\"updatedTime\":\"hmkxmaehvbb\",\"createdBy\":\"uripltfnhtba\",\"updatedBy\":\"kgxywr\",\"id\":\"kpyklyhp\",\"type\":\"SERVERLESS\",\"status\":\"odpvruudlgzib\",\"statusLocalized\":\"hostgktstvdxecl\",\"statusMessage\":\"edqbc\",\"serverlessConfigProperties\":{\"subnet\":\"zlhp\",\"applicationType\":\"dqkdlwwqfbu\",\"resourceGroupName\":\"kxtrq\",\"advancedCustomProperties\":\"smlmbtxhwgfwsrta\",\"supplementaryFileLocation\":\"oezbrhubsk\",\"platform\":\"dyg\",\"tags\":\"okkqfqjbvleo\",\"vnet\":\"ml\",\"executionTimeout\":\"qtqzfavyv\",\"computeUnits\":\"qybaryeua\",\"tenantId\":\"kq\",\"subscriptionId\":\"qgzsles\",\"region\":\"bhernntiew\",\"serverlessArmResourceId\":\"cv\"},\"description\":\"uwrbehwagoh\"}]}";
+
+        HttpClient httpClient
+            = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8)));
+        InformaticaDataManagementManager manager = InformaticaDataManagementManager.configure()
+            .withHttpClient(httpClient)
+            .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)),
+                new AzureProfile("", "", AzureEnvironment.AZURE));
+
+        InformaticaServerlessRuntimeResourceList response = manager.organizations()
+            .getAllServerlessRuntimesWithResponse("z", "ybycnunvj", com.azure.core.util.Context.NONE)
+            .getValue();
+
+        Assertions.assertEquals("tkfa", response.informaticaRuntimeResources().get(0).name());
+        Assertions.assertEquals("nopqgikyzirtx", response.informaticaRuntimeResources().get(0).createdTime());
+        Assertions.assertEquals("yuxzejntpsewgi", response.informaticaRuntimeResources().get(0).updatedTime());
+        Assertions.assertEquals("ilqu", response.informaticaRuntimeResources().get(0).createdBy());
+        Assertions.assertEquals("rydxtqm", response.informaticaRuntimeResources().get(0).updatedBy());
+        Assertions.assertEquals("eoxorggufhyao", response.informaticaRuntimeResources().get(0).id());
+        Assertions.assertEquals(RuntimeType.SERVERLESS, response.informaticaRuntimeResources().get(0).type());
+        Assertions.assertEquals("bghhavgrvkf", response.informaticaRuntimeResources().get(0).status());
+        Assertions.assertEquals("ovjzhpjbibgjmfx", response.informaticaRuntimeResources().get(0).statusLocalized());
+        Assertions.assertEquals("mv", response.informaticaRuntimeResources().get(0).statusMessage());
+        Assertions.assertEquals("luyovwxnbkfezzx",
+            response.informaticaRuntimeResources().get(0).serverlessConfigProperties().subnet());
+        Assertions.assertEquals("yhwzdgiruj",
+            response.informaticaRuntimeResources().get(0).serverlessConfigProperties().applicationType());
+        Assertions.assertEquals("bomvzzbtdcqv",
+            response.informaticaRuntimeResources().get(0).serverlessConfigProperties().resourceGroupName());
+        Assertions.assertEquals("iyujviylwdshfs",
+            response.informaticaRuntimeResources().get(0).serverlessConfigProperties().advancedCustomProperties());
+        Assertions.assertEquals("rbgyefry",
+            response.informaticaRuntimeResources().get(0).serverlessConfigProperties().supplementaryFileLocation());
+        Assertions.assertEquals("gaojf",
+            response.informaticaRuntimeResources().get(0).serverlessConfigProperties().platform());
+        Assertions.assertEquals("nc",
+            response.informaticaRuntimeResources().get(0).serverlessConfigProperties().tags());
+        Assertions.assertEquals("mrfhirctymox",
+            response.informaticaRuntimeResources().get(0).serverlessConfigProperties().vnet());
+        Assertions.assertEquals("tpipiwyczuhx",
+            response.informaticaRuntimeResources().get(0).serverlessConfigProperties().executionTimeout());
+        Assertions.assertEquals("pqjlihhyusps",
+            response.informaticaRuntimeResources().get(0).serverlessConfigProperties().computeUnits());
+        Assertions.assertEquals("sdvlmfwdgzxulucv",
+            response.informaticaRuntimeResources().get(0).serverlessConfigProperties().tenantId());
+        Assertions.assertEquals("mrsreuzvxurisjnh",
+            response.informaticaRuntimeResources().get(0).serverlessConfigProperties().subscriptionId());
+        Assertions.assertEquals("txifqj",
+            response.informaticaRuntimeResources().get(0).serverlessConfigProperties().region());
+        Assertions.assertEquals("xmrhu",
+            response.informaticaRuntimeResources().get(0).serverlessConfigProperties().serverlessArmResourceId());
+        Assertions.assertEquals("wp", response.informaticaRuntimeResources().get(0).description());
+    }
+}
diff --git a/sdk/informaticadatamanagement/azure-resourcemanager-informaticadatamanagement/src/test/java/com/azure/resourcemanager/informaticadatamanagement/generated/ServerlessRuntimesStartFailedServerlessRuntimeWitMockTests.java b/sdk/informaticadatamanagement/azure-resourcemanager-informaticadatamanagement/src/test/java/com/azure/resourcemanager/informaticadatamanagement/generated/ServerlessRuntimesStartFailedServerlessRuntimeWitMockTests.java
new file mode 100644
index 000000000000..4c2f3b33e0f2
--- /dev/null
+++ b/sdk/informaticadatamanagement/azure-resourcemanager-informaticadatamanagement/src/test/java/com/azure/resourcemanager/informaticadatamanagement/generated/ServerlessRuntimesStartFailedServerlessRuntimeWitMockTests.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.informaticadatamanagement.generated;
+
+import com.azure.core.credential.AccessToken;
+import com.azure.core.http.HttpClient;
+import com.azure.core.management.AzureEnvironment;
+import com.azure.core.management.profile.AzureProfile;
+import com.azure.core.test.http.MockHttpResponse;
+import com.azure.resourcemanager.informaticadatamanagement.InformaticaDataManagementManager;
+import java.nio.charset.StandardCharsets;
+import java.time.OffsetDateTime;
+import org.junit.jupiter.api.Test;
+import reactor.core.publisher.Mono;
+
+public final class ServerlessRuntimesStartFailedServerlessRuntimeWitMockTests {
+    @Test
+    public void testStartFailedServerlessRuntimeWithResponse() throws Exception {
+        String responseStr = "{}";
+
+        HttpClient httpClient
+            = response -> Mono.just(new MockHttpResponse(response, 204, responseStr.getBytes(StandardCharsets.UTF_8)));
+        InformaticaDataManagementManager manager = InformaticaDataManagementManager.configure()
+            .withHttpClient(httpClient)
+            .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)),
+                new AzureProfile("", "", AzureEnvironment.AZURE));
+
+        manager.serverlessRuntimes()
+            .startFailedServerlessRuntimeWithResponse("epgfew", "twly", "gncxykxhdj", com.azure.core.util.Context.NONE);
+
+    }
+}
diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsUpdateNpbStaticRouteBfdAdministrativeState.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsUpdateNpbStaticRouteBfdAdministrativeState.java
new file mode 100644
index 000000000000..78721ecefc51
--- /dev/null
+++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsUpdateNpbStaticRouteBfdAdministrativeState.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.managednetworkfabric.generated;
+
+import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableState;
+import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState;
+import java.util.Arrays;
+
+/** Samples for NetworkToNetworkInterconnects UpdateNpbStaticRouteBfdAdministrativeState. */
+public final class NetworkToNetworkInterconnectsUpdateNpbStaticRouteBfdAdministrativeState {
+    /*
+     * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_updateNpbStaticRouteBfdAdministrativeState_MaximumSet_Gen.json
+     */
+    /**
+     * Sample code: NetworkToNetworkInterconnects_updateNpbStaticRouteBfdAdministrativeState_MaximumSet_Gen.
+     *
+     * @param manager Entry point to ManagedNetworkFabricManager.
+     */
+    public static void networkToNetworkInterconnectsUpdateNpbStaticRouteBfdAdministrativeStateMaximumSetGen(
+        com.azure.resourcemanager.managednetworkfabric.ManagedNetworkFabricManager manager) {
+        manager
+            .networkToNetworkInterconnects()
+            .updateNpbStaticRouteBfdAdministrativeState(
+                "example-rg",
+                "example-fabric",
+                "example-nni",
+                new UpdateAdministrativeState().withResourceIds(Arrays.asList("")).withState(EnableDisableState.ENABLE),
+                com.azure.core.util.Context.NONE);
+    }
+}
diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/OpenAIClientImpl.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/OpenAIClientImpl.java
index 6a66a59528df..48b58a1ad600 100644
--- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/OpenAIClientImpl.java
+++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/OpenAIClientImpl.java
@@ -6,9 +6,7 @@
 
 import com.azure.ai.openai.OpenAIServiceVersion;
 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.Host;
 import com.azure.core.annotation.HostParam;
@@ -161,7 +159,7 @@ public interface OpenAIClientService {
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getAudioTranscriptionAsPlainText(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName,
-            @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept,
+            @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept,
             @BodyParam("multipart/form-data") BinaryData audioTranscriptionOptions, RequestOptions requestOptions,
             Context context);
 
@@ -174,7 +172,7 @@ Mono> getAudioTranscriptionAsPlainText(@HostParam("endpoint
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response getAudioTranscriptionAsPlainTextSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName,
-            @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept,
+            @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept,
             @BodyParam("multipart/form-data") BinaryData audioTranscriptionOptions, RequestOptions requestOptions,
             Context context);
 
@@ -187,7 +185,7 @@ Response getAudioTranscriptionAsPlainTextSync(@HostParam("endpoint")
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getAudioTranscriptionAsResponseObject(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName,
-            @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept,
+            @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept,
             @BodyParam("multipart/form-data") BinaryData audioTranscriptionOptions, RequestOptions requestOptions,
             Context context);
 
@@ -200,7 +198,7 @@ Mono> getAudioTranscriptionAsResponseObject(@HostParam("end
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response getAudioTranscriptionAsResponseObjectSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName,
-            @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept,
+            @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept,
             @BodyParam("multipart/form-data") BinaryData audioTranscriptionOptions, RequestOptions requestOptions,
             Context context);
 
@@ -213,7 +211,7 @@ Response getAudioTranscriptionAsResponseObjectSync(@HostParam("endpo
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getAudioTranslationAsPlainText(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName,
-            @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept,
+            @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept,
             @BodyParam("multipart/form-data") BinaryData audioTranslationOptions, RequestOptions requestOptions,
             Context context);
 
@@ -226,7 +224,7 @@ Mono> getAudioTranslationAsPlainText(@HostParam("endpoint")
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response getAudioTranslationAsPlainTextSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName,
-            @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept,
+            @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept,
             @BodyParam("multipart/form-data") BinaryData audioTranslationOptions, RequestOptions requestOptions,
             Context context);
 
@@ -239,7 +237,7 @@ Response getAudioTranslationAsPlainTextSync(@HostParam("endpoint") S
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getAudioTranslationAsResponseObject(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName,
-            @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept,
+            @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept,
             @BodyParam("multipart/form-data") BinaryData audioTranslationOptions, RequestOptions requestOptions,
             Context context);
 
@@ -252,7 +250,7 @@ Mono> getAudioTranslationAsResponseObject(@HostParam("endpo
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response getAudioTranslationAsResponseObjectSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName,
-            @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept,
+            @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept,
             @BodyParam("multipart/form-data") BinaryData audioTranslationOptions, RequestOptions requestOptions,
             Context context);
 
@@ -264,9 +262,8 @@ Response getAudioTranslationAsResponseObjectSync(@HostParam("endpoin
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getCompletions(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName,
-            @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
-            @BodyParam("application/json") BinaryData completionsOptions, RequestOptions requestOptions,
-            Context context);
+            @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData completionsOptions,
+            RequestOptions requestOptions, Context context);
 
         @Post("/deployments/{deploymentId}/completions")
         @ExpectedResponses({ 200 })
@@ -276,9 +273,8 @@ Mono> getCompletions(@HostParam("endpoint") String endpoint
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response getCompletionsSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName,
-            @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
-            @BodyParam("application/json") BinaryData completionsOptions, RequestOptions requestOptions,
-            Context context);
+            @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData completionsOptions,
+            RequestOptions requestOptions, Context context);
 
         @Post("/deployments/{deploymentId}/chat/completions")
         @ExpectedResponses({ 200 })
@@ -288,9 +284,8 @@ Response getCompletionsSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getChatCompletions(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName,
-            @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
-            @BodyParam("application/json") BinaryData chatCompletionsOptions, RequestOptions requestOptions,
-            Context context);
+            @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData chatCompletionsOptions,
+            RequestOptions requestOptions, Context context);
 
         @Post("/deployments/{deploymentId}/chat/completions")
         @ExpectedResponses({ 200 })
@@ -300,9 +295,8 @@ Mono> getChatCompletions(@HostParam("endpoint") String endp
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response getChatCompletionsSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName,
-            @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
-            @BodyParam("application/json") BinaryData chatCompletionsOptions, RequestOptions requestOptions,
-            Context context);
+            @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData chatCompletionsOptions,
+            RequestOptions requestOptions, Context context);
 
         @Post("/deployments/{deploymentId}/images/generations")
         @ExpectedResponses({ 200 })
@@ -312,9 +306,8 @@ Response getChatCompletionsSync(@HostParam("endpoint") String endpoi
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getImageGenerations(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName,
-            @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
-            @BodyParam("application/json") BinaryData imageGenerationOptions, RequestOptions requestOptions,
-            Context context);
+            @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData imageGenerationOptions,
+            RequestOptions requestOptions, Context context);
 
         @Post("/deployments/{deploymentId}/images/generations")
         @ExpectedResponses({ 200 })
@@ -324,9 +317,8 @@ Mono> getImageGenerations(@HostParam("endpoint") String end
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response getImageGenerationsSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName,
-            @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
-            @BodyParam("application/json") BinaryData imageGenerationOptions, RequestOptions requestOptions,
-            Context context);
+            @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData imageGenerationOptions,
+            RequestOptions requestOptions, Context context);
 
         @Post("/deployments/{deploymentId}/audio/speech")
         @ExpectedResponses({ 200 })
@@ -336,9 +328,8 @@ Response getImageGenerationsSync(@HostParam("endpoint") String endpo
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> generateSpeechFromText(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName,
-            @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
-            @BodyParam("application/json") BinaryData speechGenerationOptions, RequestOptions requestOptions,
-            Context context);
+            @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData speechGenerationOptions,
+            RequestOptions requestOptions, Context context);
 
         @Post("/deployments/{deploymentId}/audio/speech")
         @ExpectedResponses({ 200 })
@@ -348,9 +339,8 @@ Mono> generateSpeechFromText(@HostParam("endpoint") String
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response generateSpeechFromTextSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName,
-            @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
-            @BodyParam("application/json") BinaryData speechGenerationOptions, RequestOptions requestOptions,
-            Context context);
+            @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData speechGenerationOptions,
+            RequestOptions requestOptions, Context context);
 
         @Post("/deployments/{deploymentId}/embeddings")
         @ExpectedResponses({ 200 })
@@ -360,9 +350,8 @@ Response generateSpeechFromTextSync(@HostParam("endpoint") String en
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getEmbeddings(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName,
-            @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
-            @BodyParam("application/json") BinaryData embeddingsOptions, RequestOptions requestOptions,
-            Context context);
+            @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData embeddingsOptions,
+            RequestOptions requestOptions, Context context);
 
         @Post("/deployments/{deploymentId}/embeddings")
         @ExpectedResponses({ 200 })
@@ -372,187 +361,8 @@ Mono> getEmbeddings(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response getEmbeddingsSync(@HostParam("endpoint") String endpoint,
             @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName,
-            @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
-            @BodyParam("application/json") BinaryData embeddingsOptions, RequestOptions requestOptions,
-            Context context);
-
-        @Get("/files")
-        @ExpectedResponses({ 200 })
-        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
-        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
-        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
-        @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Mono> listFiles(@HostParam("endpoint") String endpoint,
-            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
-
-        @Get("/files")
-        @ExpectedResponses({ 200 })
-        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
-        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
-        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
-        @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response listFilesSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept,
+            @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData embeddingsOptions,
             RequestOptions requestOptions, Context context);
-
-        // @Multipart not supported by RestProxy
-        @Post("/files")
-        @ExpectedResponses({ 200 })
-        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
-        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
-        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
-        @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Mono> uploadFile(@HostParam("endpoint") String endpoint,
-            @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept,
-            @BodyParam("multipart/form-data") BinaryData uploadFileRequest, RequestOptions requestOptions,
-            Context context);
-
-        // @Multipart not supported by RestProxy
-        @Post("/files")
-        @ExpectedResponses({ 200 })
-        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
-        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
-        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
-        @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response uploadFileSync(@HostParam("endpoint") String endpoint,
-            @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept,
-            @BodyParam("multipart/form-data") BinaryData uploadFileRequest, RequestOptions requestOptions,
-            Context context);
-
-        @Delete("/files/{fileId}")
-        @ExpectedResponses({ 200 })
-        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
-        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
-        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
-        @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Mono> deleteFile(@HostParam("endpoint") String endpoint,
-            @PathParam("fileId") String fileId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
-            Context context);
-
-        @Delete("/files/{fileId}")
-        @ExpectedResponses({ 200 })
-        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
-        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
-        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
-        @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response deleteFileSync(@HostParam("endpoint") String endpoint, @PathParam("fileId") String fileId,
-            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
-
-        @Get("/files/{fileId}")
-        @ExpectedResponses({ 200 })
-        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
-        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
-        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
-        @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Mono> getFile(@HostParam("endpoint") String endpoint, @PathParam("fileId") String fileId,
-            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
-
-        @Get("/files/{fileId}")
-        @ExpectedResponses({ 200 })
-        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
-        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
-        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
-        @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response getFileSync(@HostParam("endpoint") String endpoint, @PathParam("fileId") String fileId,
-            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
-
-        @Get("/files/{fileId}/content")
-        @ExpectedResponses({ 200 })
-        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
-        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
-        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
-        @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Mono> getFileContent(@HostParam("endpoint") String endpoint,
-            @PathParam("fileId") String fileId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
-            Context context);
-
-        @Get("/files/{fileId}/content")
-        @ExpectedResponses({ 200 })
-        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
-        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
-        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
-        @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response getFileContentSync(@HostParam("endpoint") String endpoint,
-            @PathParam("fileId") String fileId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
-            Context context);
-
-        @Get("/batches")
-        @ExpectedResponses({ 200 })
-        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
-        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
-        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
-        @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Mono> listBatches(@HostParam("endpoint") String endpoint,
-            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
-
-        @Get("/batches")
-        @ExpectedResponses({ 200 })
-        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
-        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
-        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
-        @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response listBatchesSync(@HostParam("endpoint") String endpoint,
-            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
-
-        @Post("/batches")
-        @ExpectedResponses({ 201 })
-        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
-        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
-        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
-        @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Mono> createBatch(@HostParam("endpoint") String endpoint,
-            @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
-            @BodyParam("application/json") BinaryData createBatchRequest, RequestOptions requestOptions,
-            Context context);
-
-        @Post("/batches")
-        @ExpectedResponses({ 201 })
-        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
-        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
-        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
-        @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response createBatchSync(@HostParam("endpoint") String endpoint,
-            @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
-            @BodyParam("application/json") BinaryData createBatchRequest, RequestOptions requestOptions,
-            Context context);
-
-        @Get("/batches/{batchId}")
-        @ExpectedResponses({ 200 })
-        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
-        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
-        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
-        @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Mono> getBatch(@HostParam("endpoint") String endpoint,
-            @PathParam("batchId") String batchId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
-            Context context);
-
-        @Get("/batches/{batchId}")
-        @ExpectedResponses({ 200 })
-        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
-        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
-        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
-        @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response getBatchSync(@HostParam("endpoint") String endpoint, @PathParam("batchId") String batchId,
-            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
-
-        @Post("/batches/{batchId}/cancel")
-        @ExpectedResponses({ 200 })
-        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
-        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
-        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
-        @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Mono> cancelBatch(@HostParam("endpoint") String endpoint,
-            @PathParam("batchId") String batchId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
-            Context context);
-
-        @Post("/batches/{batchId}/cancel")
-        @ExpectedResponses({ 200 })
-        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
-        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
-        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
-        @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response cancelBatchSync(@HostParam("endpoint") String endpoint,
-            @PathParam("batchId") String batchId, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
-            Context context);
     }
 
     /**
@@ -579,7 +389,7 @@ Response cancelBatchSync(@HostParam("endpoint") String endpoint,
     public Mono> getAudioTranscriptionAsPlainTextWithResponseAsync(String deploymentOrModelName,
         BinaryData audioTranscriptionOptions, RequestOptions requestOptions) {
         final String contentType = "multipart/form-data";
-        final String accept = "text/plain";
+        final String accept = "text/plain, application/json";
         return FluxUtil.withContext(context -> service.getAudioTranscriptionAsPlainText(this.getEndpoint(),
             this.getServiceVersion().getVersion(), deploymentOrModelName, contentType, accept,
             audioTranscriptionOptions, requestOptions, context));
@@ -608,7 +418,7 @@ public Mono> getAudioTranscriptionAsPlainTextWithResponseAs
     public Response getAudioTranscriptionAsPlainTextWithResponse(String deploymentOrModelName,
         BinaryData audioTranscriptionOptions, RequestOptions requestOptions) {
         final String contentType = "multipart/form-data";
-        final String accept = "text/plain";
+        final String accept = "text/plain, application/json";
         return service.getAudioTranscriptionAsPlainTextSync(this.getEndpoint(), this.getServiceVersion().getVersion(),
             deploymentOrModelName, contentType, accept, audioTranscriptionOptions, requestOptions, Context.NONE);
     }
@@ -751,7 +561,7 @@ public Response getAudioTranscriptionAsResponseObjectWithResponse(St
     public Mono> getAudioTranslationAsPlainTextWithResponseAsync(String deploymentOrModelName,
         BinaryData audioTranslationOptions, RequestOptions requestOptions) {
         final String contentType = "multipart/form-data";
-        final String accept = "text/plain";
+        final String accept = "text/plain, application/json";
         return FluxUtil.withContext(
             context -> service.getAudioTranslationAsPlainText(this.getEndpoint(), this.getServiceVersion().getVersion(),
                 deploymentOrModelName, contentType, accept, audioTranslationOptions, requestOptions, context));
@@ -780,7 +590,7 @@ public Mono> getAudioTranslationAsPlainTextWithResponseAsyn
     public Response getAudioTranslationAsPlainTextWithResponse(String deploymentOrModelName,
         BinaryData audioTranslationOptions, RequestOptions requestOptions) {
         final String contentType = "multipart/form-data";
-        final String accept = "text/plain";
+        final String accept = "text/plain, application/json";
         return service.getAudioTranslationAsPlainTextSync(this.getEndpoint(), this.getServiceVersion().getVersion(),
             deploymentOrModelName, contentType, accept, audioTranslationOptions, requestOptions, Context.NONE);
     }
@@ -982,7 +792,7 @@ public Response getAudioTranslationAsResponseObjectWithResponse(Stri
      *                     filtered: boolean (Required)
      *                     detected: boolean (Required)
      *                     URL: String (Optional)
-     *                     license: String (Optional)
+     *                     license: String (Required)
      *                 }
      *             }
      *             logprobs (Required): {
@@ -1029,11 +839,10 @@ public Response getAudioTranslationAsResponseObjectWithResponse(Stri
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> getCompletionsWithResponseAsync(String deploymentOrModelName,
         BinaryData completionsOptions, RequestOptions requestOptions) {
-        final String contentType = "application/json";
         final String accept = "application/json";
         return FluxUtil
             .withContext(context -> service.getCompletions(this.getEndpoint(), this.getServiceVersion().getVersion(),
-                deploymentOrModelName, contentType, accept, completionsOptions, requestOptions, context));
+                deploymentOrModelName, accept, completionsOptions, requestOptions, context));
     }
 
     /**
@@ -1133,7 +942,7 @@ public Mono> getCompletionsWithResponseAsync(String deploym
      *                     filtered: boolean (Required)
      *                     detected: boolean (Required)
      *                     URL: String (Optional)
-     *                     license: String (Optional)
+     *                     license: String (Required)
      *                 }
      *             }
      *             logprobs (Required): {
@@ -1180,10 +989,9 @@ public Mono> getCompletionsWithResponseAsync(String deploym
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response getCompletionsWithResponse(String deploymentOrModelName, BinaryData completionsOptions,
         RequestOptions requestOptions) {
-        final String contentType = "application/json";
         final String accept = "application/json";
         return service.getCompletionsSync(this.getEndpoint(), this.getServiceVersion().getVersion(),
-            deploymentOrModelName, contentType, accept, completionsOptions, requestOptions, Context.NONE);
+            deploymentOrModelName, accept, completionsOptions, requestOptions, Context.NONE);
     }
 
     /**
@@ -1322,6 +1130,9 @@ public Response getCompletionsWithResponse(String deploymentOrModelN
      *             }
      *             index: int (Required)
      *             finish_reason: String(stop/length/content_filter/function_call/tool_calls) (Required)
+     *             finish_details (Optional): {
+     *                 type: String (Required)
+     *             }
      *             delta (Optional): (recursive schema, see delta above)
      *             content_filter_results (Optional): {
      *                 sexual (Optional): {
@@ -1361,7 +1172,7 @@ public Response getCompletionsWithResponse(String deploymentOrModelN
      *                     filtered: boolean (Required)
      *                     detected: boolean (Required)
      *                     URL: String (Optional)
-     *                     license: String (Optional)
+     *                     license: String (Required)
      *                 }
      *             }
      *             enhancements (Optional): {
@@ -1431,11 +1242,10 @@ public Response getCompletionsWithResponse(String deploymentOrModelN
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> getChatCompletionsWithResponseAsync(String deploymentOrModelName,
         BinaryData chatCompletionsOptions, RequestOptions requestOptions) {
-        final String contentType = "application/json";
         final String accept = "application/json";
         return FluxUtil.withContext(
             context -> service.getChatCompletions(this.getEndpoint(), this.getServiceVersion().getVersion(),
-                deploymentOrModelName, contentType, accept, chatCompletionsOptions, requestOptions, context));
+                deploymentOrModelName, accept, chatCompletionsOptions, requestOptions, context));
     }
 
     /**
@@ -1574,6 +1384,9 @@ public Mono> getChatCompletionsWithResponseAsync(String dep
      *             }
      *             index: int (Required)
      *             finish_reason: String(stop/length/content_filter/function_call/tool_calls) (Required)
+     *             finish_details (Optional): {
+     *                 type: String (Required)
+     *             }
      *             delta (Optional): (recursive schema, see delta above)
      *             content_filter_results (Optional): {
      *                 sexual (Optional): {
@@ -1613,7 +1426,7 @@ public Mono> getChatCompletionsWithResponseAsync(String dep
      *                     filtered: boolean (Required)
      *                     detected: boolean (Required)
      *                     URL: String (Optional)
-     *                     license: String (Optional)
+     *                     license: String (Required)
      *                 }
      *             }
      *             enhancements (Optional): {
@@ -1683,10 +1496,9 @@ public Mono> getChatCompletionsWithResponseAsync(String dep
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response getChatCompletionsWithResponse(String deploymentOrModelName,
         BinaryData chatCompletionsOptions, RequestOptions requestOptions) {
-        final String contentType = "application/json";
         final String accept = "application/json";
         return service.getChatCompletionsSync(this.getEndpoint(), this.getServiceVersion().getVersion(),
-            deploymentOrModelName, contentType, accept, chatCompletionsOptions, requestOptions, Context.NONE);
+            deploymentOrModelName, accept, chatCompletionsOptions, requestOptions, Context.NONE);
     }
 
     /**
@@ -1764,11 +1576,10 @@ public Response getChatCompletionsWithResponse(String deploymentOrMo
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> getImageGenerationsWithResponseAsync(String deploymentOrModelName,
         BinaryData imageGenerationOptions, RequestOptions requestOptions) {
-        final String contentType = "application/json";
         final String accept = "application/json";
         return FluxUtil.withContext(
             context -> service.getImageGenerations(this.getEndpoint(), this.getServiceVersion().getVersion(),
-                deploymentOrModelName, contentType, accept, imageGenerationOptions, requestOptions, context));
+                deploymentOrModelName, accept, imageGenerationOptions, requestOptions, context));
     }
 
     /**
@@ -1845,10 +1656,9 @@ public Mono> getImageGenerationsWithResponseAsync(String de
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response getImageGenerationsWithResponse(String deploymentOrModelName,
         BinaryData imageGenerationOptions, RequestOptions requestOptions) {
-        final String contentType = "application/json";
         final String accept = "application/json";
         return service.getImageGenerationsSync(this.getEndpoint(), this.getServiceVersion().getVersion(),
-            deploymentOrModelName, contentType, accept, imageGenerationOptions, requestOptions, Context.NONE);
+            deploymentOrModelName, accept, imageGenerationOptions, requestOptions, Context.NONE);
     }
 
     /**
@@ -1885,11 +1695,10 @@ public Response getImageGenerationsWithResponse(String deploymentOrM
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> generateSpeechFromTextWithResponseAsync(String deploymentOrModelName,
         BinaryData speechGenerationOptions, RequestOptions requestOptions) {
-        final String contentType = "application/json";
-        final String accept = "application/octet-stream";
+        final String accept = "application/octet-stream, application/json";
         return FluxUtil.withContext(
             context -> service.generateSpeechFromText(this.getEndpoint(), this.getServiceVersion().getVersion(),
-                deploymentOrModelName, contentType, accept, speechGenerationOptions, requestOptions, context));
+                deploymentOrModelName, accept, speechGenerationOptions, requestOptions, context));
     }
 
     /**
@@ -1926,10 +1735,9 @@ public Mono> generateSpeechFromTextWithResponseAsync(String
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response generateSpeechFromTextWithResponse(String deploymentOrModelName,
         BinaryData speechGenerationOptions, RequestOptions requestOptions) {
-        final String contentType = "application/json";
-        final String accept = "application/octet-stream";
+        final String accept = "application/octet-stream, application/json";
         return service.generateSpeechFromTextSync(this.getEndpoint(), this.getServiceVersion().getVersion(),
-            deploymentOrModelName, contentType, accept, speechGenerationOptions, requestOptions, Context.NONE);
+            deploymentOrModelName, accept, speechGenerationOptions, requestOptions, Context.NONE);
     }
 
     /**
@@ -1986,11 +1794,10 @@ public Response generateSpeechFromTextWithResponse(String deployment
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> getEmbeddingsWithResponseAsync(String deploymentOrModelName,
         BinaryData embeddingsOptions, RequestOptions requestOptions) {
-        final String contentType = "application/json";
         final String accept = "application/json";
         return FluxUtil
             .withContext(context -> service.getEmbeddings(this.getEndpoint(), this.getServiceVersion().getVersion(),
-                deploymentOrModelName, contentType, accept, embeddingsOptions, requestOptions, context));
+                deploymentOrModelName, accept, embeddingsOptions, requestOptions, context));
     }
 
     /**
@@ -2046,874 +1853,8 @@ public Mono> getEmbeddingsWithResponseAsync(String deployme
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response getEmbeddingsWithResponse(String deploymentOrModelName, BinaryData embeddingsOptions,
         RequestOptions requestOptions) {
-        final String contentType = "application/json";
         final String accept = "application/json";
         return service.getEmbeddingsSync(this.getEndpoint(), this.getServiceVersion().getVersion(),
-            deploymentOrModelName, contentType, accept, embeddingsOptions, requestOptions, Context.NONE);
-
-    }
-
-    /**
-     * Gets a list of previously uploaded files.
-     * 

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
purposeStringNoA value that, when provided, limits list results to files - * matching the corresponding purpose. Allowed values: "fine-tune", "fine-tune-results", "assistants", - * "assistants_output", "batch", "batch_output", "vision".
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
{@code
-     * {
-     *     object: String (Required)
-     *     data (Required): [
-     *          (Required){
-     *             object: String (Required)
-     *             id: String (Required)
-     *             bytes: int (Required)
-     *             filename: String (Required)
-     *             created_at: long (Required)
-     *             purpose: String(fine-tune/fine-tune-results/assistants/assistants_output/batch/batch_output/vision) (Required)
-     *             status: String(uploaded/pending/running/processed/error/deleting/deleted) (Optional)
-     *             status_details: String (Optional)
-     *         }
-     *     ]
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of previously uploaded files along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listFilesWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listFiles(this.getEndpoint(), accept, requestOptions, context)); - } - - /** - * Gets a list of previously uploaded files. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
purposeStringNoA value that, when provided, limits list results to files - * matching the corresponding purpose. Allowed values: "fine-tune", "fine-tune-results", "assistants", - * "assistants_output", "batch", "batch_output", "vision".
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
{@code
-     * {
-     *     object: String (Required)
-     *     data (Required): [
-     *          (Required){
-     *             object: String (Required)
-     *             id: String (Required)
-     *             bytes: int (Required)
-     *             filename: String (Required)
-     *             created_at: long (Required)
-     *             purpose: String(fine-tune/fine-tune-results/assistants/assistants_output/batch/batch_output/vision) (Required)
-     *             status: String(uploaded/pending/running/processed/error/deleting/deleted) (Optional)
-     *             status_details: String (Optional)
-     *         }
-     *     ]
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of previously uploaded files along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listFilesWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.listFilesSync(this.getEndpoint(), accept, requestOptions, Context.NONE); - } - - /** - * Uploads a file for use by other operations. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     object: String (Required)
-     *     id: String (Required)
-     *     bytes: int (Required)
-     *     filename: String (Required)
-     *     created_at: long (Required)
-     *     purpose: String(fine-tune/fine-tune-results/assistants/assistants_output/batch/batch_output/vision) (Required)
-     *     status: String(uploaded/pending/running/processed/error/deleting/deleted) (Optional)
-     *     status_details: String (Optional)
-     * }
-     * }
- * - * @param uploadFileRequest The uploadFileRequest parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents an assistant that can call the model and use tools along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uploadFileWithResponseAsync(BinaryData uploadFileRequest, - RequestOptions requestOptions) { - final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.uploadFile(this.getEndpoint(), contentType, accept, - uploadFileRequest, requestOptions, context)); - } - - /** - * Uploads a file for use by other operations. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     object: String (Required)
-     *     id: String (Required)
-     *     bytes: int (Required)
-     *     filename: String (Required)
-     *     created_at: long (Required)
-     *     purpose: String(fine-tune/fine-tune-results/assistants/assistants_output/batch/batch_output/vision) (Required)
-     *     status: String(uploaded/pending/running/processed/error/deleting/deleted) (Optional)
-     *     status_details: String (Optional)
-     * }
-     * }
- * - * @param uploadFileRequest The uploadFileRequest parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents an assistant that can call the model and use tools along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response uploadFileWithResponse(BinaryData uploadFileRequest, RequestOptions requestOptions) { - final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.uploadFileSync(this.getEndpoint(), contentType, accept, uploadFileRequest, requestOptions, - Context.NONE); - } - - /** - * Delete a previously uploaded file. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     deleted: boolean (Required)
-     *     object: String (Required)
-     * }
-     * }
- * - * @param fileId The ID of the file to delete. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a status response from a file deletion operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteFileWithResponseAsync(String fileId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.deleteFile(this.getEndpoint(), fileId, accept, requestOptions, context)); - } - - /** - * Delete a previously uploaded file. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     deleted: boolean (Required)
-     *     object: String (Required)
-     * }
-     * }
- * - * @param fileId The ID of the file to delete. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a status response from a file deletion operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteFileWithResponse(String fileId, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.deleteFileSync(this.getEndpoint(), fileId, accept, requestOptions, Context.NONE); - } - - /** - * Returns information about a specific file. Does not retrieve file content. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     object: String (Required)
-     *     id: String (Required)
-     *     bytes: int (Required)
-     *     filename: String (Required)
-     *     created_at: long (Required)
-     *     purpose: String(fine-tune/fine-tune-results/assistants/assistants_output/batch/batch_output/vision) (Required)
-     *     status: String(uploaded/pending/running/processed/error/deleting/deleted) (Optional)
-     *     status_details: String (Optional)
-     * }
-     * }
- * - * @param fileId The ID of the file to retrieve. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents an assistant that can call the model and use tools along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getFileWithResponseAsync(String fileId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getFile(this.getEndpoint(), fileId, accept, requestOptions, context)); - } - - /** - * Returns information about a specific file. Does not retrieve file content. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     object: String (Required)
-     *     id: String (Required)
-     *     bytes: int (Required)
-     *     filename: String (Required)
-     *     created_at: long (Required)
-     *     purpose: String(fine-tune/fine-tune-results/assistants/assistants_output/batch/batch_output/vision) (Required)
-     *     status: String(uploaded/pending/running/processed/error/deleting/deleted) (Optional)
-     *     status_details: String (Optional)
-     * }
-     * }
- * - * @param fileId The ID of the file to retrieve. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents an assistant that can call the model and use tools along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getFileWithResponse(String fileId, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getFileSync(this.getEndpoint(), fileId, accept, requestOptions, Context.NONE); - } - - /** - * Returns information about a specific file. Does not retrieve file content. - *

Response Body Schema

- * - *
{@code
-     * byte[]
-     * }
- * - * @param fileId The ID of the file to retrieve. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represent a byte array along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getFileContentWithResponseAsync(String fileId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getFileContent(this.getEndpoint(), fileId, accept, requestOptions, context)); - } - - /** - * Returns information about a specific file. Does not retrieve file content. - *

Response Body Schema

- * - *
{@code
-     * byte[]
-     * }
- * - * @param fileId The ID of the file to retrieve. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represent a byte array along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getFileContentWithResponse(String fileId, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getFileContentSync(this.getEndpoint(), fileId, accept, requestOptions, Context.NONE); - } - - /** - * Gets a list of all batches owned by the Azure OpenAI resource. - *

Query Parameters

- * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
afterStringNoIdentifier for the last event from the previous pagination - * request.
limitIntegerNoNumber of batches to retrieve. Defaults to 20.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
{@code
-     * {
-     *     object: String (Required)
-     *     data (Optional): [
-     *          (Optional){
-     *             id: String (Required)
-     *             object: String (Required)
-     *             endpoint: String (Optional)
-     *             errors (Optional): {
-     *                 object: String (Required)
-     *                 data (Optional): [
-     *                      (Optional){
-     *                         code: String (Optional)
-     *                         message: String (Optional)
-     *                         param: String (Optional)
-     *                         line: Integer (Optional)
-     *                     }
-     *                 ]
-     *             }
-     *             input_file_id: String (Required)
-     *             completion_window: String (Optional)
-     *             status: String(validating/failed/in_progress/finalizing/completed/expired/cancelling/cancelled) (Optional)
-     *             output_file_id: String (Optional)
-     *             error_file_id: String (Optional)
-     *             created_at: Long (Optional)
-     *             in_progress_at: Long (Optional)
-     *             expires_at: Long (Optional)
-     *             finalizing_at: Long (Optional)
-     *             completed_at: Long (Optional)
-     *             failed_at: Long (Optional)
-     *             expired_at: Long (Optional)
-     *             cancelling_at: Long (Optional)
-     *             cancelled_at: Long (Optional)
-     *             request_counts (Optional): {
-     *                 total: Integer (Optional)
-     *                 completed: Integer (Optional)
-     *                 failed: Integer (Optional)
-     *             }
-     *             metadata (Optional): {
-     *                 String: String (Required)
-     *             }
-     *         }
-     *     ]
-     *     first_id: String (Optional)
-     *     last_id: String (Optional)
-     *     has_more: Boolean (Optional)
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of all batches owned by the Azure OpenAI resource along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listBatchesWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listBatches(this.getEndpoint(), accept, requestOptions, context)); - } - - /** - * Gets a list of all batches owned by the Azure OpenAI resource. - *

Query Parameters

- * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
afterStringNoIdentifier for the last event from the previous pagination - * request.
limitIntegerNoNumber of batches to retrieve. Defaults to 20.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
{@code
-     * {
-     *     object: String (Required)
-     *     data (Optional): [
-     *          (Optional){
-     *             id: String (Required)
-     *             object: String (Required)
-     *             endpoint: String (Optional)
-     *             errors (Optional): {
-     *                 object: String (Required)
-     *                 data (Optional): [
-     *                      (Optional){
-     *                         code: String (Optional)
-     *                         message: String (Optional)
-     *                         param: String (Optional)
-     *                         line: Integer (Optional)
-     *                     }
-     *                 ]
-     *             }
-     *             input_file_id: String (Required)
-     *             completion_window: String (Optional)
-     *             status: String(validating/failed/in_progress/finalizing/completed/expired/cancelling/cancelled) (Optional)
-     *             output_file_id: String (Optional)
-     *             error_file_id: String (Optional)
-     *             created_at: Long (Optional)
-     *             in_progress_at: Long (Optional)
-     *             expires_at: Long (Optional)
-     *             finalizing_at: Long (Optional)
-     *             completed_at: Long (Optional)
-     *             failed_at: Long (Optional)
-     *             expired_at: Long (Optional)
-     *             cancelling_at: Long (Optional)
-     *             cancelled_at: Long (Optional)
-     *             request_counts (Optional): {
-     *                 total: Integer (Optional)
-     *                 completed: Integer (Optional)
-     *                 failed: Integer (Optional)
-     *             }
-     *             metadata (Optional): {
-     *                 String: String (Required)
-     *             }
-     *         }
-     *     ]
-     *     first_id: String (Optional)
-     *     last_id: String (Optional)
-     *     has_more: Boolean (Optional)
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of all batches owned by the Azure OpenAI resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listBatchesWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.listBatchesSync(this.getEndpoint(), accept, requestOptions, Context.NONE); - } - - /** - * Creates and executes a batch from an uploaded file of requests. - * Response includes details of the enqueued job including job status. - * The ID of the result file is added to the response once complete. - *

Request Body Schema

- * - *
{@code
-     * {
-     *     endpoint: String (Required)
-     *     input_file_id: String (Required)
-     *     completion_window: String (Required)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     object: String (Required)
-     *     endpoint: String (Optional)
-     *     errors (Optional): {
-     *         object: String (Required)
-     *         data (Optional): [
-     *              (Optional){
-     *                 code: String (Optional)
-     *                 message: String (Optional)
-     *                 param: String (Optional)
-     *                 line: Integer (Optional)
-     *             }
-     *         ]
-     *     }
-     *     input_file_id: String (Required)
-     *     completion_window: String (Optional)
-     *     status: String(validating/failed/in_progress/finalizing/completed/expired/cancelling/cancelled) (Optional)
-     *     output_file_id: String (Optional)
-     *     error_file_id: String (Optional)
-     *     created_at: Long (Optional)
-     *     in_progress_at: Long (Optional)
-     *     expires_at: Long (Optional)
-     *     finalizing_at: Long (Optional)
-     *     completed_at: Long (Optional)
-     *     failed_at: Long (Optional)
-     *     expired_at: Long (Optional)
-     *     cancelling_at: Long (Optional)
-     *     cancelled_at: Long (Optional)
-     *     request_counts (Optional): {
-     *         total: Integer (Optional)
-     *         completed: Integer (Optional)
-     *         failed: Integer (Optional)
-     *     }
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
-     * }
-     * }
- * - * @param createBatchRequest The specification of the batch to create and execute. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the Batch object along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createBatchWithResponseAsync(BinaryData createBatchRequest, - RequestOptions requestOptions) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createBatch(this.getEndpoint(), contentType, accept, - createBatchRequest, requestOptions, context)); - } - - /** - * Creates and executes a batch from an uploaded file of requests. - * Response includes details of the enqueued job including job status. - * The ID of the result file is added to the response once complete. - *

Request Body Schema

- * - *
{@code
-     * {
-     *     endpoint: String (Required)
-     *     input_file_id: String (Required)
-     *     completion_window: String (Required)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     object: String (Required)
-     *     endpoint: String (Optional)
-     *     errors (Optional): {
-     *         object: String (Required)
-     *         data (Optional): [
-     *              (Optional){
-     *                 code: String (Optional)
-     *                 message: String (Optional)
-     *                 param: String (Optional)
-     *                 line: Integer (Optional)
-     *             }
-     *         ]
-     *     }
-     *     input_file_id: String (Required)
-     *     completion_window: String (Optional)
-     *     status: String(validating/failed/in_progress/finalizing/completed/expired/cancelling/cancelled) (Optional)
-     *     output_file_id: String (Optional)
-     *     error_file_id: String (Optional)
-     *     created_at: Long (Optional)
-     *     in_progress_at: Long (Optional)
-     *     expires_at: Long (Optional)
-     *     finalizing_at: Long (Optional)
-     *     completed_at: Long (Optional)
-     *     failed_at: Long (Optional)
-     *     expired_at: Long (Optional)
-     *     cancelling_at: Long (Optional)
-     *     cancelled_at: Long (Optional)
-     *     request_counts (Optional): {
-     *         total: Integer (Optional)
-     *         completed: Integer (Optional)
-     *         failed: Integer (Optional)
-     *     }
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
-     * }
-     * }
- * - * @param createBatchRequest The specification of the batch to create and execute. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the Batch object along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createBatchWithResponse(BinaryData createBatchRequest, RequestOptions requestOptions) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createBatchSync(this.getEndpoint(), contentType, accept, createBatchRequest, requestOptions, - Context.NONE); - } - - /** - * Gets details for a single batch specified by the given batchID. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     object: String (Required)
-     *     endpoint: String (Optional)
-     *     errors (Optional): {
-     *         object: String (Required)
-     *         data (Optional): [
-     *              (Optional){
-     *                 code: String (Optional)
-     *                 message: String (Optional)
-     *                 param: String (Optional)
-     *                 line: Integer (Optional)
-     *             }
-     *         ]
-     *     }
-     *     input_file_id: String (Required)
-     *     completion_window: String (Optional)
-     *     status: String(validating/failed/in_progress/finalizing/completed/expired/cancelling/cancelled) (Optional)
-     *     output_file_id: String (Optional)
-     *     error_file_id: String (Optional)
-     *     created_at: Long (Optional)
-     *     in_progress_at: Long (Optional)
-     *     expires_at: Long (Optional)
-     *     finalizing_at: Long (Optional)
-     *     completed_at: Long (Optional)
-     *     failed_at: Long (Optional)
-     *     expired_at: Long (Optional)
-     *     cancelling_at: Long (Optional)
-     *     cancelled_at: Long (Optional)
-     *     request_counts (Optional): {
-     *         total: Integer (Optional)
-     *         completed: Integer (Optional)
-     *         failed: Integer (Optional)
-     *     }
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
-     * }
-     * }
- * - * @param batchId The identifier of the batch. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return details for a single batch specified by the given batchID along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getBatchWithResponseAsync(String batchId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getBatch(this.getEndpoint(), batchId, accept, requestOptions, context)); - } - - /** - * Gets details for a single batch specified by the given batchID. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     object: String (Required)
-     *     endpoint: String (Optional)
-     *     errors (Optional): {
-     *         object: String (Required)
-     *         data (Optional): [
-     *              (Optional){
-     *                 code: String (Optional)
-     *                 message: String (Optional)
-     *                 param: String (Optional)
-     *                 line: Integer (Optional)
-     *             }
-     *         ]
-     *     }
-     *     input_file_id: String (Required)
-     *     completion_window: String (Optional)
-     *     status: String(validating/failed/in_progress/finalizing/completed/expired/cancelling/cancelled) (Optional)
-     *     output_file_id: String (Optional)
-     *     error_file_id: String (Optional)
-     *     created_at: Long (Optional)
-     *     in_progress_at: Long (Optional)
-     *     expires_at: Long (Optional)
-     *     finalizing_at: Long (Optional)
-     *     completed_at: Long (Optional)
-     *     failed_at: Long (Optional)
-     *     expired_at: Long (Optional)
-     *     cancelling_at: Long (Optional)
-     *     cancelled_at: Long (Optional)
-     *     request_counts (Optional): {
-     *         total: Integer (Optional)
-     *         completed: Integer (Optional)
-     *         failed: Integer (Optional)
-     *     }
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
-     * }
-     * }
- * - * @param batchId The identifier of the batch. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return details for a single batch specified by the given batchID along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getBatchWithResponse(String batchId, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getBatchSync(this.getEndpoint(), batchId, accept, requestOptions, Context.NONE); - } - - /** - * Gets details for a single batch specified by the given batchID. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     object: String (Required)
-     *     endpoint: String (Optional)
-     *     errors (Optional): {
-     *         object: String (Required)
-     *         data (Optional): [
-     *              (Optional){
-     *                 code: String (Optional)
-     *                 message: String (Optional)
-     *                 param: String (Optional)
-     *                 line: Integer (Optional)
-     *             }
-     *         ]
-     *     }
-     *     input_file_id: String (Required)
-     *     completion_window: String (Optional)
-     *     status: String(validating/failed/in_progress/finalizing/completed/expired/cancelling/cancelled) (Optional)
-     *     output_file_id: String (Optional)
-     *     error_file_id: String (Optional)
-     *     created_at: Long (Optional)
-     *     in_progress_at: Long (Optional)
-     *     expires_at: Long (Optional)
-     *     finalizing_at: Long (Optional)
-     *     completed_at: Long (Optional)
-     *     failed_at: Long (Optional)
-     *     expired_at: Long (Optional)
-     *     cancelling_at: Long (Optional)
-     *     cancelled_at: Long (Optional)
-     *     request_counts (Optional): {
-     *         total: Integer (Optional)
-     *         completed: Integer (Optional)
-     *         failed: Integer (Optional)
-     *     }
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
-     * }
-     * }
- * - * @param batchId The identifier of the batch. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return details for a single batch specified by the given batchID along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> cancelBatchWithResponseAsync(String batchId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.cancelBatch(this.getEndpoint(), batchId, accept, requestOptions, context)); - } - - /** - * Gets details for a single batch specified by the given batchID. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     object: String (Required)
-     *     endpoint: String (Optional)
-     *     errors (Optional): {
-     *         object: String (Required)
-     *         data (Optional): [
-     *              (Optional){
-     *                 code: String (Optional)
-     *                 message: String (Optional)
-     *                 param: String (Optional)
-     *                 line: Integer (Optional)
-     *             }
-     *         ]
-     *     }
-     *     input_file_id: String (Required)
-     *     completion_window: String (Optional)
-     *     status: String(validating/failed/in_progress/finalizing/completed/expired/cancelling/cancelled) (Optional)
-     *     output_file_id: String (Optional)
-     *     error_file_id: String (Optional)
-     *     created_at: Long (Optional)
-     *     in_progress_at: Long (Optional)
-     *     expires_at: Long (Optional)
-     *     finalizing_at: Long (Optional)
-     *     completed_at: Long (Optional)
-     *     failed_at: Long (Optional)
-     *     expired_at: Long (Optional)
-     *     cancelling_at: Long (Optional)
-     *     cancelled_at: Long (Optional)
-     *     request_counts (Optional): {
-     *         total: Integer (Optional)
-     *         completed: Integer (Optional)
-     *         failed: Integer (Optional)
-     *     }
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
-     * }
-     * }
- * - * @param batchId The identifier of the batch. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return details for a single batch specified by the given batchID along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response cancelBatchWithResponse(String batchId, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.cancelBatchSync(this.getEndpoint(), batchId, accept, requestOptions, Context.NONE); + deploymentOrModelName, accept, embeddingsOptions, requestOptions, Context.NONE); } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityWithLocationsExecuteWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityWithLocationsExecuteWithResponseMockTests.java new file mode 100644 index 000000000000..1b8861e637ff --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityWithLocationsExecuteWithResponseMockTests.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.postgresqlflexibleserver.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; +import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityReason; +import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityRequest; +import com.azure.resourcemanager.postgresqlflexibleserver.models.NameAvailability; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class CheckNameAvailabilityWithLocationsExecuteWithResponseMockTests { + @Test + public void testExecuteWithResponse() throws Exception { + String responseStr + = "{\"name\":\"edxihchrphkmcrj\",\"type\":\"nsdfzpbgtgky\",\"nameAvailable\":false,\"reason\":\"AlreadyExists\",\"message\":\"jeuut\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + PostgreSqlManager manager = PostgreSqlManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + NameAvailability response = manager.checkNameAvailabilityWithLocations() + .executeWithResponse("t", + new CheckNameAvailabilityRequest().withName("lxgccknfnwmbtm").withType("dvjdhttza"), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(false, response.nameAvailable()); + Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, response.reason()); + Assertions.assertEquals("jeuut", response.message()); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/CheckNameAvailabilityResponseModelInner.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/CheckNameAvailabilityResponseModelInner.java new file mode 100644 index 000000000000..0b993bb11ea6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/CheckNameAvailabilityResponseModelInner.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Check name availability response model. */ +@Fluent +public final class CheckNameAvailabilityResponseModelInner { + /* + * Gets or sets a value indicating whether resource name is available or not. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /* + * Gets or sets the reason for resource name unavailability. + */ + @JsonProperty(value = "reason") + private String reason; + + /* + * Gets or sets the message for resource name unavailability. + */ + @JsonProperty(value = "message") + private String message; + + /** Creates an instance of CheckNameAvailabilityResponseModelInner class. */ + public CheckNameAvailabilityResponseModelInner() { + } + + /** + * Get the nameAvailable property: Gets or sets a value indicating whether resource name is available or not. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set the nameAvailable property: Gets or sets a value indicating whether resource name is available or not. + * + * @param nameAvailable the nameAvailable value to set. + * @return the CheckNameAvailabilityResponseModelInner object itself. + */ + public CheckNameAvailabilityResponseModelInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get the reason property: Gets or sets the reason for resource name unavailability. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason property: Gets or sets the reason for resource name unavailability. + * + * @param reason the reason value to set. + * @return the CheckNameAvailabilityResponseModelInner object itself. + */ + public CheckNameAvailabilityResponseModelInner withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get the message property: Gets or sets the message for resource name unavailability. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Gets or sets the message for resource name unavailability. + * + * @param message the message value to set. + * @return the CheckNameAvailabilityResponseModelInner object itself. + */ + public CheckNameAvailabilityResponseModelInner withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/CheckNameAvailabilityResponseModelImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/CheckNameAvailabilityResponseModelImpl.java new file mode 100644 index 000000000000..a2ba1d86b8ea --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/CheckNameAvailabilityResponseModelImpl.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.recoveryservicesdatareplication.implementation; + +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.CheckNameAvailabilityResponseModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.CheckNameAvailabilityResponseModel; + +public final class CheckNameAvailabilityResponseModelImpl implements CheckNameAvailabilityResponseModel { + private CheckNameAvailabilityResponseModelInner innerObject; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + CheckNameAvailabilityResponseModelImpl( + CheckNameAvailabilityResponseModelInner innerObject, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public String reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public CheckNameAvailabilityResponseModelInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ProtectedItemOperationStatusClientImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ProtectedItemOperationStatusClientImpl.java new file mode 100644 index 000000000000..a7f839198369 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ProtectedItemOperationStatusClientImpl.java @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.recoveryservicesdatareplication.fluent.ProtectedItemOperationStatusClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.OperationStatusInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ProtectedItemOperationStatusClient. */ +public final class ProtectedItemOperationStatusClientImpl implements ProtectedItemOperationStatusClient { + /** The proxy service used to perform REST calls. */ + private final ProtectedItemOperationStatusService service; + + /** The service client containing this operation class. */ + private final DataReplicationMgmtClientImpl client; + + /** + * Initializes an instance of ProtectedItemOperationStatusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProtectedItemOperationStatusClientImpl(DataReplicationMgmtClientImpl client) { + this.service = + RestProxy + .create( + ProtectedItemOperationStatusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataReplicationMgmtClientProtectedItemOperationStatus to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataReplicationMgmtC") + public interface ProtectedItemOperationStatusService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/operations/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("protectedItemName") String protectedItemName, + @PathParam("operationId") String operationId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the protected item operation status. + * + *

Tracks the results of an asynchronous operation on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param operationId The ID of an ongoing async operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the operation status along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String protectedItemName, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + protectedItemName, + operationId, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the protected item operation status. + * + *

Tracks the results of an asynchronous operation on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param operationId The ID of an ongoing async operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the operation status along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String protectedItemName, String operationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + protectedItemName, + operationId, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the protected item operation status. + * + *

Tracks the results of an asynchronous operation on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param operationId The ID of an ongoing async operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the operation status on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String vaultName, String protectedItemName, String operationId) { + return getWithResponseAsync(resourceGroupName, vaultName, protectedItemName, operationId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the protected item operation status. + * + *

Tracks the results of an asynchronous operation on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param operationId The ID of an ongoing async operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the operation status along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String vaultName, String protectedItemName, String operationId, Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, protectedItemName, operationId, context).block(); + } + + /** + * Gets the protected item operation status. + * + *

Tracks the results of an asynchronous operation on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param operationId The ID of an ongoing async operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner get( + String resourceGroupName, String vaultName, String protectedItemName, String operationId) { + return getWithResponse(resourceGroupName, vaultName, protectedItemName, operationId, Context.NONE).getValue(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciEventModelCustomProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciEventModelCustomProperties.java new file mode 100644 index 000000000000..9a56f27e75a8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciEventModelCustomProperties.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * HyperV to AzStackHCI event model custom properties. This class provides provider specific details for events of type + * DataContract.HealthEvents.HealthEventType.ProtectedItemHealth and + * DataContract.HealthEvents.HealthEventType.AgentHealth. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVToAzStackHCI") +@Immutable +public final class HyperVToAzStackHciEventModelCustomProperties extends EventModelCustomProperties { + /* + * Gets or sets the friendly name of the source which has raised this health event. + */ + @JsonProperty(value = "eventSourceFriendlyName", access = JsonProperty.Access.WRITE_ONLY) + private String eventSourceFriendlyName; + + /* + * Gets or sets the protected item friendly name. + */ + @JsonProperty(value = "protectedItemFriendlyName", access = JsonProperty.Access.WRITE_ONLY) + private String protectedItemFriendlyName; + + /* + * Gets or sets the source appliance name. + */ + @JsonProperty(value = "sourceApplianceName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceApplianceName; + + /* + * Gets or sets the source target name. + */ + @JsonProperty(value = "targetApplianceName", access = JsonProperty.Access.WRITE_ONLY) + private String targetApplianceName; + + /* + * Gets or sets the server type. + */ + @JsonProperty(value = "serverType", access = JsonProperty.Access.WRITE_ONLY) + private String serverType; + + /** Creates an instance of HyperVToAzStackHciEventModelCustomProperties class. */ + public HyperVToAzStackHciEventModelCustomProperties() { + } + + /** + * Get the eventSourceFriendlyName property: Gets or sets the friendly name of the source which has raised this + * health event. + * + * @return the eventSourceFriendlyName value. + */ + public String eventSourceFriendlyName() { + return this.eventSourceFriendlyName; + } + + /** + * Get the protectedItemFriendlyName property: Gets or sets the protected item friendly name. + * + * @return the protectedItemFriendlyName value. + */ + public String protectedItemFriendlyName() { + return this.protectedItemFriendlyName; + } + + /** + * Get the sourceApplianceName property: Gets or sets the source appliance name. + * + * @return the sourceApplianceName value. + */ + public String sourceApplianceName() { + return this.sourceApplianceName; + } + + /** + * Get the targetApplianceName property: Gets or sets the source target name. + * + * @return the targetApplianceName value. + */ + public String targetApplianceName() { + return this.targetApplianceName; + } + + /** + * Get the serverType property: Gets or sets the server type. + * + * @return the serverType value. + */ + public String serverType() { + return this.serverType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciPlannedFailoverCustomProps.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciPlannedFailoverCustomProps.java new file mode 100644 index 000000000000..3de28db94f3a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciPlannedFailoverCustomProps.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** HyperV to AzStackHCI planned failover model custom properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVToAzStackHCI") +@Fluent +public final class HyperVToAzStackHciPlannedFailoverCustomProps extends PlannedFailoverModelCustomProperties { + /* + * Gets or sets a value indicating whether VM needs to be shut down. + */ + @JsonProperty(value = "shutdownSourceVM", required = true) + private boolean shutdownSourceVM; + + /** Creates an instance of HyperVToAzStackHciPlannedFailoverCustomProps class. */ + public HyperVToAzStackHciPlannedFailoverCustomProps() { + } + + /** + * Get the shutdownSourceVM property: Gets or sets a value indicating whether VM needs to be shut down. + * + * @return the shutdownSourceVM value. + */ + public boolean shutdownSourceVM() { + return this.shutdownSourceVM; + } + + /** + * Set the shutdownSourceVM property: Gets or sets a value indicating whether VM needs to be shut down. + * + * @param shutdownSourceVM the shutdownSourceVM value to set. + * @return the HyperVToAzStackHciPlannedFailoverCustomProps object itself. + */ + public HyperVToAzStackHciPlannedFailoverCustomProps withShutdownSourceVM(boolean shutdownSourceVM) { + this.shutdownSourceVM = shutdownSourceVM; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciPolicyModelCustomProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciPolicyModelCustomProperties.java new file mode 100644 index 000000000000..e5bbcb9e3430 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciPolicyModelCustomProperties.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** HyperV To AzStackHCI Policy model custom properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVToAzStackHCI") +@Fluent +public final class HyperVToAzStackHciPolicyModelCustomProperties extends PolicyModelCustomProperties { + /* + * Gets or sets the duration in minutes until which the recovery points need to be + * stored. + */ + @JsonProperty(value = "recoveryPointHistoryInMinutes", required = true) + private int recoveryPointHistoryInMinutes; + + /* + * Gets or sets the crash consistent snapshot frequency (in minutes). + */ + @JsonProperty(value = "crashConsistentFrequencyInMinutes", required = true) + private int crashConsistentFrequencyInMinutes; + + /* + * Gets or sets the app consistent snapshot frequency (in minutes). + */ + @JsonProperty(value = "appConsistentFrequencyInMinutes", required = true) + private int appConsistentFrequencyInMinutes; + + /** Creates an instance of HyperVToAzStackHciPolicyModelCustomProperties class. */ + public HyperVToAzStackHciPolicyModelCustomProperties() { + } + + /** + * Get the recoveryPointHistoryInMinutes property: Gets or sets the duration in minutes until which the recovery + * points need to be stored. + * + * @return the recoveryPointHistoryInMinutes value. + */ + public int recoveryPointHistoryInMinutes() { + return this.recoveryPointHistoryInMinutes; + } + + /** + * Set the recoveryPointHistoryInMinutes property: Gets or sets the duration in minutes until which the recovery + * points need to be stored. + * + * @param recoveryPointHistoryInMinutes the recoveryPointHistoryInMinutes value to set. + * @return the HyperVToAzStackHciPolicyModelCustomProperties object itself. + */ + public HyperVToAzStackHciPolicyModelCustomProperties withRecoveryPointHistoryInMinutes( + int recoveryPointHistoryInMinutes) { + this.recoveryPointHistoryInMinutes = recoveryPointHistoryInMinutes; + return this; + } + + /** + * Get the crashConsistentFrequencyInMinutes property: Gets or sets the crash consistent snapshot frequency (in + * minutes). + * + * @return the crashConsistentFrequencyInMinutes value. + */ + public int crashConsistentFrequencyInMinutes() { + return this.crashConsistentFrequencyInMinutes; + } + + /** + * Set the crashConsistentFrequencyInMinutes property: Gets or sets the crash consistent snapshot frequency (in + * minutes). + * + * @param crashConsistentFrequencyInMinutes the crashConsistentFrequencyInMinutes value to set. + * @return the HyperVToAzStackHciPolicyModelCustomProperties object itself. + */ + public HyperVToAzStackHciPolicyModelCustomProperties withCrashConsistentFrequencyInMinutes( + int crashConsistentFrequencyInMinutes) { + this.crashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + return this; + } + + /** + * Get the appConsistentFrequencyInMinutes property: Gets or sets the app consistent snapshot frequency (in + * minutes). + * + * @return the appConsistentFrequencyInMinutes value. + */ + public int appConsistentFrequencyInMinutes() { + return this.appConsistentFrequencyInMinutes; + } + + /** + * Set the appConsistentFrequencyInMinutes property: Gets or sets the app consistent snapshot frequency (in + * minutes). + * + * @param appConsistentFrequencyInMinutes the appConsistentFrequencyInMinutes value to set. + * @return the HyperVToAzStackHciPolicyModelCustomProperties object itself. + */ + public HyperVToAzStackHciPolicyModelCustomProperties withAppConsistentFrequencyInMinutes( + int appConsistentFrequencyInMinutes) { + this.appConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelPropertiesLastTestFailoverJob.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelPropertiesLastTestFailoverJob.java new file mode 100644 index 000000000000..8d5fedc7179d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelPropertiesLastTestFailoverJob.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Immutable; + +/** The ProtectedItemModelPropertiesLastTestFailoverJob model. */ +@Immutable +public final class ProtectedItemModelPropertiesLastTestFailoverJob extends ProtectedItemJobProperties { + /** Creates an instance of ProtectedItemModelPropertiesLastTestFailoverJob class. */ + public ProtectedItemModelPropertiesLastTestFailoverJob() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TestFailoverCleanupWorkflowModelCustomProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TestFailoverCleanupWorkflowModelCustomProperties.java new file mode 100644 index 000000000000..48b859e77c80 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TestFailoverCleanupWorkflowModelCustomProperties.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Test failover cleanup workflow model custom properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("TestFailoverCleanupWorkflowDetails") +@Immutable +public final class TestFailoverCleanupWorkflowModelCustomProperties extends WorkflowModelCustomProperties { + /* + * Gets or sets the test failover cleanup comments. + */ + @JsonProperty(value = "comments", access = JsonProperty.Access.WRITE_ONLY) + private String comments; + + /** Creates an instance of TestFailoverCleanupWorkflowModelCustomProperties class. */ + public TestFailoverCleanupWorkflowModelCustomProperties() { + } + + /** + * Get the comments property: Gets or sets the test failover cleanup comments. + * + * @return the comments value. + */ + public String comments() { + return this.comments; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciPlannedFailoverCustomProps.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciPlannedFailoverCustomProps.java new file mode 100644 index 000000000000..81d3bc78ba68 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciPlannedFailoverCustomProps.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** VMware to AzStackHCI planned failover model custom properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VMwareToAzStackHCI") +@Fluent +public final class VMwareToAzStackHciPlannedFailoverCustomProps extends PlannedFailoverModelCustomProperties { + /* + * Gets or sets a value indicating whether VM needs to be shut down. + */ + @JsonProperty(value = "shutdownSourceVM", required = true) + private boolean shutdownSourceVM; + + /** Creates an instance of VMwareToAzStackHciPlannedFailoverCustomProps class. */ + public VMwareToAzStackHciPlannedFailoverCustomProps() { + } + + /** + * Get the shutdownSourceVM property: Gets or sets a value indicating whether VM needs to be shut down. + * + * @return the shutdownSourceVM value. + */ + public boolean shutdownSourceVM() { + return this.shutdownSourceVM; + } + + /** + * Set the shutdownSourceVM property: Gets or sets a value indicating whether VM needs to be shut down. + * + * @param shutdownSourceVM the shutdownSourceVM value to set. + * @return the VMwareToAzStackHciPlannedFailoverCustomProps object itself. + */ + public VMwareToAzStackHciPlannedFailoverCustomProps withShutdownSourceVM(boolean shutdownSourceVM) { + this.shutdownSourceVM = shutdownSourceVM; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciPolicyModelCustomProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciPolicyModelCustomProperties.java new file mode 100644 index 000000000000..3e43cfb5aa57 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciPolicyModelCustomProperties.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** VMware To AzStackHCI Policy model custom properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VMwareToAzStackHCI") +@Fluent +public final class VMwareToAzStackHciPolicyModelCustomProperties extends PolicyModelCustomProperties { + /* + * Gets or sets the duration in minutes until which the recovery points need to be + * stored. + */ + @JsonProperty(value = "recoveryPointHistoryInMinutes", required = true) + private int recoveryPointHistoryInMinutes; + + /* + * Gets or sets the crash consistent snapshot frequency (in minutes). + */ + @JsonProperty(value = "crashConsistentFrequencyInMinutes", required = true) + private int crashConsistentFrequencyInMinutes; + + /* + * Gets or sets the app consistent snapshot frequency (in minutes). + */ + @JsonProperty(value = "appConsistentFrequencyInMinutes", required = true) + private int appConsistentFrequencyInMinutes; + + /** Creates an instance of VMwareToAzStackHciPolicyModelCustomProperties class. */ + public VMwareToAzStackHciPolicyModelCustomProperties() { + } + + /** + * Get the recoveryPointHistoryInMinutes property: Gets or sets the duration in minutes until which the recovery + * points need to be stored. + * + * @return the recoveryPointHistoryInMinutes value. + */ + public int recoveryPointHistoryInMinutes() { + return this.recoveryPointHistoryInMinutes; + } + + /** + * Set the recoveryPointHistoryInMinutes property: Gets or sets the duration in minutes until which the recovery + * points need to be stored. + * + * @param recoveryPointHistoryInMinutes the recoveryPointHistoryInMinutes value to set. + * @return the VMwareToAzStackHciPolicyModelCustomProperties object itself. + */ + public VMwareToAzStackHciPolicyModelCustomProperties withRecoveryPointHistoryInMinutes( + int recoveryPointHistoryInMinutes) { + this.recoveryPointHistoryInMinutes = recoveryPointHistoryInMinutes; + return this; + } + + /** + * Get the crashConsistentFrequencyInMinutes property: Gets or sets the crash consistent snapshot frequency (in + * minutes). + * + * @return the crashConsistentFrequencyInMinutes value. + */ + public int crashConsistentFrequencyInMinutes() { + return this.crashConsistentFrequencyInMinutes; + } + + /** + * Set the crashConsistentFrequencyInMinutes property: Gets or sets the crash consistent snapshot frequency (in + * minutes). + * + * @param crashConsistentFrequencyInMinutes the crashConsistentFrequencyInMinutes value to set. + * @return the VMwareToAzStackHciPolicyModelCustomProperties object itself. + */ + public VMwareToAzStackHciPolicyModelCustomProperties withCrashConsistentFrequencyInMinutes( + int crashConsistentFrequencyInMinutes) { + this.crashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + return this; + } + + /** + * Get the appConsistentFrequencyInMinutes property: Gets or sets the app consistent snapshot frequency (in + * minutes). + * + * @return the appConsistentFrequencyInMinutes value. + */ + public int appConsistentFrequencyInMinutes() { + return this.appConsistentFrequencyInMinutes; + } + + /** + * Set the appConsistentFrequencyInMinutes property: Gets or sets the app consistent snapshot frequency (in + * minutes). + * + * @param appConsistentFrequencyInMinutes the appConsistentFrequencyInMinutes value to set. + * @return the VMwareToAzStackHciPolicyModelCustomProperties object itself. + */ + public VMwareToAzStackHciPolicyModelCustomProperties withAppConsistentFrequencyInMinutes( + int appConsistentFrequencyInMinutes) { + this.appConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemOperationStatusGetSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemOperationStatusGetSamples.java new file mode 100644 index 000000000000..89aa4411f5ca --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemOperationStatusGetSamples.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.recoveryservicesdatareplication.generated; + +/** Samples for ProtectedItemOperationStatus Get. */ +public final class ProtectedItemOperationStatusGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/ProtectedItemOperationStatus_Get.json + */ + /** + * Sample code: ProtectedItemOperationStatus_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void protectedItemOperationStatusGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .protectedItemOperationStatus() + .getWithResponse( + "rgrecoveryservicesdatareplication", "4", "d", "wdqacsc", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ResourceProviderCheckNameAvailabilityS.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ResourceProviderCheckNameAvailabilityS.java new file mode 100644 index 000000000000..9dcb06d01810 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ResourceProviderCheckNameAvailabilityS.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +import com.azure.resourcemanager.recoveryservicesdatareplication.models.CheckNameAvailabilityModel; + +/** Samples for ResourceProvider CheckNameAvailability. */ +public final class ResourceProviderCheckNameAvailabilityS { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/CheckNameAvailability.json + */ + /** + * Sample code: CheckNameAvailability. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void checkNameAvailability( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .resourceProviders() + .checkNameAvailabilityWithResponse( + "trfqtbtmusswpibw", + new CheckNameAvailabilityModel().withName("updkdcixs").withType("gngmcancdauwhdixjjvqnfkvqc"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ResourceProviderDeploymentPreflightSam.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ResourceProviderDeploymentPreflightSam.java new file mode 100644 index 000000000000..ef57b8b94b1d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ResourceProviderDeploymentPreflightSam.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.DeploymentPreflightModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.DeploymentPreflightResource; +import java.util.Arrays; + +/** Samples for ResourceProvider DeploymentPreflight. */ +public final class ResourceProviderDeploymentPreflightSam { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/DeploymentPreflight.json + */ + /** + * Sample code: DeploymentPreflight. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void deploymentPreflight( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .resourceProviders() + .deploymentPreflightWithResponse( + "rgrecoveryservicesdatareplication", + "kjoiahxljomjcmvabaobumg", + new DeploymentPreflightModelInner() + .withResources( + Arrays + .asList( + new DeploymentPreflightResource() + .withName("xtgugoflfc") + .withType("nsnaptduolqcxsikrewvgjbxqpt") + .withLocation("cbsgtxkjdzwbyp") + .withApiVersion("otihymhvzblycdoxo"))), + com.azure.core.util.Context.NONE); + } +} From ca4e8138a28ce7d174fb5c0bcf4c06f369f2aa32 Mon Sep 17 00:00:00 2001 From: glenn Date: Thu, 12 Sep 2024 16:34:17 -0400 Subject: [PATCH 100/128] restore more deleted files --- ...ligibilityResultsOperationsClientImpl.java | 348 ++ ...ProtectionContainerMappingsClientImpl.java | 2039 ++++++++++++ ...onRecoveryServicesProvidersClientImpl.java | 1859 +++++++++++ ...dOperatingSystemsOperationsClientImpl.java | 196 ++ ...reUpdateReplicationProtectedItemInput.java | 340 ++ ...ianceForReplicationProtectedItemInput.java | 61 + ...erSpecificUpdateContainerMappingInput.java | 39 + ...plicationProtectedItemInputProperties.java | 95 + .../proxy-config.json | 1 + .../reflect-config.json | 2816 +++++++++++++++++ ...ecoveryPointsListByReplicationMigrati.java | 26 + ...intsListByReplicationProtectedItemsSa.java | 27 + ...EligibilityResultsOperationGetSamples.java | 26 + ...nEligibilityResultsOperationListSampl.java | 26 + ...nLogicalNetworksListByReplicationFabr.java | 26 + ...nMigrationItemsListByReplicationProte.java | 26 + ...MigrationItemsPauseReplicationSamples.java | 33 + ...nMigrationItemsResumeReplicationSampl.java | 34 + ...nMigrationItemsTestMigrateCleanupSamp.java | 32 + ...nNetworkMappingsListByReplicationNetw.java | 27 + ...nNetworksListByReplicationFabricsSamp.java | 26 + ...nProtectableItemsListByReplicationPro.java | 26 + ...nProtectedItemsApplyRecoveryPointSamp.java | 34 + ...onProtectedItemsFailoverCancelSamples.java | 27 + ...onProtectedItemsFailoverCommitSamples.java | 27 + ...nProtectedItemsListByReplicationProte.java | 26 + ...nProtectedItemsPlannedFailoverSamples.java | 34 + ...nProtectedItemsRepairReplicationSampl.java | 27 + ...nProtectedItemsResolveHealthErrorsSam.java | 34 + ...onProtectedItemsSwitchProviderSamples.java | 38 + ...nProtectedItemsTestFailoverCleanupSam.java | 32 + ...nProtectedItemsUnplannedFailoverSampl.java | 34 + ...nProtectedItemsUpdateApplianceSamples.java | 36 + ...nProtectedItemsUpdateMobilityServiceS.java | 32 + ...nProtectionContainerMappingsCreateSam.java | 36 + ...nProtectionContainerMappingsDeleteSam.java | 34 + ...ProtectionContainerMappingsGetSamples.java | 26 + ...nProtectionContainerMappingsListByRep.java | 27 + ...nProtectionContainerMappingsListSampl.java | 26 + ...nProtectionContainerMappingsPurgeSamp.java | 26 + ...nProtectionContainerMappingsUpdateSam.java | 38 + ...nProtectionContainersDiscoverProtecta.java | 32 + ...nProtectionContainersListByReplicatio.java | 26 + ...nProtectionContainersSwitchProtection.java | 34 + ...onRecoveryPlansPlannedFailoverSamples.java | 35 + ...nRecoveryPlansTestFailoverCleanupSamp.java | 31 + ...RecoveryPlansUnplannedFailoverSamples.java | 37 + ...nRecoveryServicesProvidersCreateSampl.java | 43 + ...nRecoveryServicesProvidersDeleteSampl.java | 29 + ...onRecoveryServicesProvidersGetSamples.java | 26 + ...nRecoveryServicesProvidersListByRepli.java | 26 + ...nRecoveryServicesProvidersListSamples.java | 26 + ...RecoveryServicesProvidersPurgeSamples.java | 26 + ...nRecoveryServicesProvidersRefreshProv.java | 26 + ...nvCentersListByReplicationFabricsSamp.java | 26 + ...ssificationMappingsListByReplicationS.java | 27 + ...ssificationsListByReplicationFabricsS.java | 26 + ...uteSizesListByReplicationProtectedIte.java | 27 + ...MigrationApplyRecoveryPointInputTests.java | 23 + ...rMigrationContainerCreationInputTests.java | 23 + ...erMigrationEnableProtectionInputTests.java | 29 + ...onServerInstancesStartInstanceSamples.java | 44 + 62 files changed, 9345 insertions(+) create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEligibilityResultsOperationsClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionContainerMappingsClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationRecoveryServicesProvidersClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SupportedOperatingSystemsOperationsClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureUpdateReplicationProtectedItemInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmUpdateApplianceForReplicationProtectedItemInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderSpecificUpdateContainerMappingInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateApplianceForReplicationProtectedItemInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservicessiterecovery/proxy-config.json create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservicessiterecovery/reflect-config.json create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/MigrationRecoveryPointsListByReplicationMigrati.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPointsListByReplicationProtectedItemsSa.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEligibilityResultsOperationGetSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEligibilityResultsOperationListSampl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationLogicalNetworksListByReplicationFabr.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsListByReplicationProte.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsPauseReplicationSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsResumeReplicationSampl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsTestMigrateCleanupSamp.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsListByReplicationNetw.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworksListByReplicationFabricsSamp.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectableItemsListByReplicationPro.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsApplyRecoveryPointSamp.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsFailoverCancelSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsFailoverCommitSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsListByReplicationProte.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsPlannedFailoverSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsRepairReplicationSampl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsResolveHealthErrorsSam.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsSwitchProviderSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsTestFailoverCleanupSam.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUnplannedFailoverSampl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUpdateApplianceSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUpdateMobilityServiceS.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsCreateSam.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsDeleteSam.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsGetSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsListByRep.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsListSampl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsPurgeSamp.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsUpdateSam.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersDiscoverProtecta.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersListByReplicatio.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersSwitchProtection.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansPlannedFailoverSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansTestFailoverCleanupSamp.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansUnplannedFailoverSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersCreateSampl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersDeleteSampl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersGetSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersListByRepli.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersListSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersPurgeSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersRefreshProv.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersListByReplicationFabricsSamp.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/StorageClassificationMappingsListByReplicationS.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/StorageClassificationsListByReplicationFabricsS.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/TargetComputeSizesListByReplicationProtectedIte.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/A2ACrossClusterMigrationApplyRecoveryPointInputTests.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/A2ACrossClusterMigrationContainerCreationInputTests.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/A2ACrossClusterMigrationEnableProtectionInputTests.java create mode 100644 sdk/workloadssapvirtualinstance/azure-resourcemanager-workloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadssapvirtualinstance/generated/SapApplicationServerInstancesStartInstanceSamples.java diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEligibilityResultsOperationsClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEligibilityResultsOperationsClientImpl.java new file mode 100644 index 000000000000..77f23d6e09ad --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEligibilityResultsOperationsClientImpl.java @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationEligibilityResultsOperationsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationEligibilityResultsCollectionInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationEligibilityResultsInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ReplicationEligibilityResultsOperationsClient. + */ +public final class ReplicationEligibilityResultsOperationsClientImpl + implements ReplicationEligibilityResultsOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ReplicationEligibilityResultsOperationsService service; + + /** + * The service client containing this operation class. + */ + private final SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationEligibilityResultsOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReplicationEligibilityResultsOperationsClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = RestProxy.create(ReplicationEligibilityResultsOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientReplicationEligibilityResultsOperations + * to be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface ReplicationEligibilityResultsOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}/providers/Microsoft.RecoveryServices/replicationEligibilityResults") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("virtualMachineName") String virtualMachineName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}/providers/Microsoft.RecoveryServices/replicationEligibilityResults/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("virtualMachineName") String virtualMachineName, @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the validation errors in case the VM is unsuitable for protection. + * + * Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param virtualMachineName Virtual Machine 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 replication eligibility results collection response model along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, + String virtualMachineName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + resourceGroupName, this.client.getSubscriptionId(), virtualMachineName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the validation errors in case the VM is unsuitable for protection. + * + * Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param virtualMachineName Virtual Machine 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 replication eligibility results collection response model along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, + String virtualMachineName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName 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(), resourceGroupName, + this.client.getSubscriptionId(), virtualMachineName, accept, context); + } + + /** + * Gets the validation errors in case the VM is unsuitable for protection. + * + * Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param virtualMachineName Virtual Machine 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 replication eligibility results collection response model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, + String virtualMachineName) { + return listWithResponseAsync(resourceGroupName, virtualMachineName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the validation errors in case the VM is unsuitable for protection. + * + * Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param virtualMachineName Virtual Machine 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 replication eligibility results collection response model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String resourceGroupName, + String virtualMachineName, Context context) { + return listWithResponseAsync(resourceGroupName, virtualMachineName, context).block(); + } + + /** + * Gets the validation errors in case the VM is unsuitable for protection. + * + * Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param virtualMachineName Virtual Machine 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 replication eligibility results collection response model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationEligibilityResultsCollectionInner list(String resourceGroupName, String virtualMachineName) { + return listWithResponse(resourceGroupName, virtualMachineName, Context.NONE).getValue(); + } + + /** + * Gets the validation errors in case the VM is unsuitable for protection. + * + * Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param virtualMachineName Virtual Machine 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 replication eligibility results response model along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String virtualMachineName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + resourceGroupName, this.client.getSubscriptionId(), virtualMachineName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the validation errors in case the VM is unsuitable for protection. + * + * Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param virtualMachineName Virtual Machine 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 replication eligibility results response model along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String virtualMachineName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceGroupName, + this.client.getSubscriptionId(), virtualMachineName, accept, context); + } + + /** + * Gets the validation errors in case the VM is unsuitable for protection. + * + * Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param virtualMachineName Virtual Machine 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 replication eligibility results response model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String virtualMachineName) { + return getWithResponseAsync(resourceGroupName, virtualMachineName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the validation errors in case the VM is unsuitable for protection. + * + * Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param virtualMachineName Virtual Machine 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 replication eligibility results response model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String virtualMachineName, Context context) { + return getWithResponseAsync(resourceGroupName, virtualMachineName, context).block(); + } + + /** + * Gets the validation errors in case the VM is unsuitable for protection. + * + * Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param virtualMachineName Virtual Machine 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 replication eligibility results response model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationEligibilityResultsInner get(String resourceGroupName, String virtualMachineName) { + return getWithResponse(resourceGroupName, virtualMachineName, Context.NONE).getValue(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionContainerMappingsClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionContainerMappingsClientImpl.java new file mode 100644 index 000000000000..33944151acd5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionContainerMappingsClientImpl.java @@ -0,0 +1,2039 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationProtectionContainerMappingsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ProtectionContainerMappingInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionContainerMappingInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainerMappingCollection; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveProtectionContainerMappingInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateProtectionContainerMappingInput; +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 + * ReplicationProtectionContainerMappingsClient. + */ +public final class ReplicationProtectionContainerMappingsClientImpl + implements ReplicationProtectionContainerMappingsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ReplicationProtectionContainerMappingsService service; + + /** + * The service client containing this operation class. + */ + private final SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationProtectionContainerMappingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReplicationProtectionContainerMappingsClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = RestProxy.create(ReplicationProtectionContainerMappingsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientReplicationProtectionContainerMappings + * to be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface ReplicationProtectionContainerMappingsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationProtectionContainers( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("mappingName") String mappingName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("mappingName") String mappingName, + @BodyParam("application/json") CreateProtectionContainerMappingInput creationInput, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> purge(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("mappingName") String mappingName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("mappingName") String mappingName, + @BodyParam("application/json") UpdateProtectionContainerMappingInput updateInput, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}/remove") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("mappingName") String mappingName, + @BodyParam("application/json") RemoveProtectionContainerMappingInput removalInput, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionContainerMappings") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationProtectionContainersNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the list of protection container mappings for a protection container. + * + * Lists the protection container mappings for a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 protection container mapping collection class along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationProtectionContainersSinglePageAsync( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono.error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByReplicationProtectionContainers(this.client.getEndpoint(), + this.client.getApiVersion(), resourceName, resourceGroupName, this.client.getSubscriptionId(), + fabricName, protectionContainerName, accept, context)) + .>map(res -> new 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 protection container mappings for a protection container. + * + * Lists the protection container mappings for a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 protection container mapping collection class along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationProtectionContainersSinglePageAsync( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono.error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByReplicationProtectionContainers(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, + resourceGroupName, this.client.getSubscriptionId(), fabricName, protectionContainerName, accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Gets the list of protection container mappings for a protection container. + * + * Lists the protection container mappings for a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 protection container mapping collection class as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationProtectionContainersAsync(String resourceName, + String resourceGroupName, String fabricName, String protectionContainerName) { + return new PagedFlux<>( + () -> listByReplicationProtectionContainersSinglePageAsync(resourceName, resourceGroupName, fabricName, + protectionContainerName), + nextLink -> listByReplicationProtectionContainersNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of protection container mappings for a protection container. + * + * Lists the protection container mappings for a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 protection container mapping collection class as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationProtectionContainersAsync(String resourceName, + String resourceGroupName, String fabricName, String protectionContainerName, Context context) { + return new PagedFlux<>( + () -> listByReplicationProtectionContainersSinglePageAsync(resourceName, resourceGroupName, fabricName, + protectionContainerName, context), + nextLink -> listByReplicationProtectionContainersNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of protection container mappings for a protection container. + * + * Lists the protection container mappings for a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 protection container mapping collection class as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationProtectionContainers(String resourceName, + String resourceGroupName, String fabricName, String protectionContainerName) { + return new PagedIterable<>(listByReplicationProtectionContainersAsync(resourceName, resourceGroupName, + fabricName, protectionContainerName)); + } + + /** + * Gets the list of protection container mappings for a protection container. + * + * Lists the protection container mappings for a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 protection container mapping collection class as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationProtectionContainers(String resourceName, + String resourceGroupName, String fabricName, String protectionContainerName, Context context) { + return new PagedIterable<>(listByReplicationProtectionContainersAsync(resourceName, resourceGroupName, + fabricName, protectionContainerName, context)); + } + + /** + * Gets a protection container mapping. + * + * Gets the details of a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection Container mapping name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a protection container mapping along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceName, + String resourceGroupName, String fabricName, String protectionContainerName, String mappingName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono.error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (mappingName == null) { + return Mono.error(new IllegalArgumentException("Parameter mappingName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, + resourceGroupName, this.client.getSubscriptionId(), fabricName, protectionContainerName, mappingName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a protection container mapping. + * + * Gets the details of a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection Container mapping name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a protection container mapping along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceName, + String resourceGroupName, String fabricName, String protectionContainerName, String mappingName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono.error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (mappingName == null) { + return Mono.error(new IllegalArgumentException("Parameter mappingName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, resourceGroupName, + this.client.getSubscriptionId(), fabricName, protectionContainerName, mappingName, accept, context); + } + + /** + * Gets a protection container mapping. + * + * Gets the details of a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection Container mapping name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a protection container mapping on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceName, String resourceGroupName, + String fabricName, String protectionContainerName, String mappingName) { + return getWithResponseAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a protection container mapping. + * + * Gets the details of a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection Container mapping name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a protection container mapping along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceName, String resourceGroupName, + String fabricName, String protectionContainerName, String mappingName, Context context) { + return getWithResponseAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, + context).block(); + } + + /** + * Gets a protection container mapping. + * + * Gets the details of a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection Container mapping name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a protection container mapping. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectionContainerMappingInner get(String resourceName, String resourceGroupName, String fabricName, + String protectionContainerName, String mappingName) { + return getWithResponse(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, + Context.NONE).getValue(); + } + + /** + * Create protection container mapping. + * + * The operation to create a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param creationInput Mapping creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping object along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceName, String resourceGroupName, + String fabricName, String protectionContainerName, String mappingName, + CreateProtectionContainerMappingInput creationInput) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono.error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (mappingName == null) { + return Mono.error(new IllegalArgumentException("Parameter mappingName is required and cannot be null.")); + } + if (creationInput == null) { + return Mono.error(new IllegalArgumentException("Parameter creationInput is required and cannot be null.")); + } else { + creationInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, + resourceGroupName, this.client.getSubscriptionId(), fabricName, protectionContainerName, mappingName, + creationInput, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create protection container mapping. + * + * The operation to create a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param creationInput Mapping creation input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping object along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceName, String resourceGroupName, + String fabricName, String protectionContainerName, String mappingName, + CreateProtectionContainerMappingInput creationInput, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono.error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (mappingName == null) { + return Mono.error(new IllegalArgumentException("Parameter mappingName is required and cannot be null.")); + } + if (creationInput == null) { + return Mono.error(new IllegalArgumentException("Parameter creationInput is required and cannot be null.")); + } else { + creationInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, resourceGroupName, + this.client.getSubscriptionId(), fabricName, protectionContainerName, mappingName, creationInput, accept, + context); + } + + /** + * Create protection container mapping. + * + * The operation to create a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param creationInput Mapping creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProtectionContainerMappingInner> beginCreateAsync( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName, + String mappingName, CreateProtectionContainerMappingInput creationInput) { + Mono>> mono = createWithResponseAsync(resourceName, resourceGroupName, fabricName, + protectionContainerName, mappingName, creationInput); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ProtectionContainerMappingInner.class, ProtectionContainerMappingInner.class, + this.client.getContext()); + } + + /** + * Create protection container mapping. + * + * The operation to create a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param creationInput Mapping creation input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProtectionContainerMappingInner> beginCreateAsync( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName, + String mappingName, CreateProtectionContainerMappingInput creationInput, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createWithResponseAsync(resourceName, resourceGroupName, fabricName, + protectionContainerName, mappingName, creationInput, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ProtectionContainerMappingInner.class, ProtectionContainerMappingInner.class, + context); + } + + /** + * Create protection container mapping. + * + * The operation to create a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param creationInput Mapping creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProtectionContainerMappingInner> beginCreate( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName, + String mappingName, CreateProtectionContainerMappingInput creationInput) { + return this.beginCreateAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, + creationInput).getSyncPoller(); + } + + /** + * Create protection container mapping. + * + * The operation to create a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param creationInput Mapping creation input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProtectionContainerMappingInner> beginCreate( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName, + String mappingName, CreateProtectionContainerMappingInput creationInput, Context context) { + return this.beginCreateAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, + creationInput, context).getSyncPoller(); + } + + /** + * Create protection container mapping. + * + * The operation to create a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param creationInput Mapping creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceName, String resourceGroupName, + String fabricName, String protectionContainerName, String mappingName, + CreateProtectionContainerMappingInput creationInput) { + return beginCreateAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, + creationInput).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create protection container mapping. + * + * The operation to create a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param creationInput Mapping creation input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceName, String resourceGroupName, + String fabricName, String protectionContainerName, String mappingName, + CreateProtectionContainerMappingInput creationInput, Context context) { + return beginCreateAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, + creationInput, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create protection container mapping. + * + * The operation to create a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param creationInput Mapping creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectionContainerMappingInner create(String resourceName, String resourceGroupName, String fabricName, + String protectionContainerName, String mappingName, CreateProtectionContainerMappingInput creationInput) { + return createAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, + creationInput).block(); + } + + /** + * Create protection container mapping. + * + * The operation to create a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param creationInput Mapping creation input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectionContainerMappingInner create(String resourceName, String resourceGroupName, String fabricName, + String protectionContainerName, String mappingName, CreateProtectionContainerMappingInput creationInput, + Context context) { + return createAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, + creationInput, context).block(); + } + + /** + * Purge protection container mapping. + * + * The operation to purge(force delete) a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> purgeWithResponseAsync(String resourceName, String resourceGroupName, + String fabricName, String protectionContainerName, String mappingName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono.error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (mappingName == null) { + return Mono.error(new IllegalArgumentException("Parameter mappingName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.purge(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, + resourceGroupName, this.client.getSubscriptionId(), fabricName, protectionContainerName, mappingName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Purge protection container mapping. + * + * The operation to purge(force delete) a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> purgeWithResponseAsync(String resourceName, String resourceGroupName, + String fabricName, String protectionContainerName, String mappingName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono.error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (mappingName == null) { + return Mono.error(new IllegalArgumentException("Parameter mappingName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.purge(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, resourceGroupName, + this.client.getSubscriptionId(), fabricName, protectionContainerName, mappingName, context); + } + + /** + * Purge protection container mapping. + * + * The operation to purge(force delete) a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPurgeAsync(String resourceName, String resourceGroupName, + String fabricName, String protectionContainerName, String mappingName) { + Mono>> mono + = purgeWithResponseAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Purge protection container mapping. + * + * The operation to purge(force delete) a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPurgeAsync(String resourceName, String resourceGroupName, + String fabricName, String protectionContainerName, String mappingName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = purgeWithResponseAsync(resourceName, resourceGroupName, fabricName, + protectionContainerName, mappingName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Purge protection container mapping. + * + * The operation to purge(force delete) a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPurge(String resourceName, String resourceGroupName, + String fabricName, String protectionContainerName, String mappingName) { + return this.beginPurgeAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName) + .getSyncPoller(); + } + + /** + * Purge protection container mapping. + * + * The operation to purge(force delete) a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPurge(String resourceName, String resourceGroupName, + String fabricName, String protectionContainerName, String mappingName, Context context) { + return this + .beginPurgeAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, context) + .getSyncPoller(); + } + + /** + * Purge protection container mapping. + * + * The operation to purge(force delete) a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono purgeAsync(String resourceName, String resourceGroupName, String fabricName, + String protectionContainerName, String mappingName) { + return beginPurgeAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Purge protection container mapping. + * + * The operation to purge(force delete) a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono purgeAsync(String resourceName, String resourceGroupName, String fabricName, + String protectionContainerName, String mappingName, Context context) { + return beginPurgeAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, + context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Purge protection container mapping. + * + * The operation to purge(force delete) a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void purge(String resourceName, String resourceGroupName, String fabricName, String protectionContainerName, + String mappingName) { + purgeAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName).block(); + } + + /** + * Purge protection container mapping. + * + * The operation to purge(force delete) a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void purge(String resourceName, String resourceGroupName, String fabricName, String protectionContainerName, + String mappingName, Context context) { + purgeAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, context).block(); + } + + /** + * Update protection container mapping. + * + * The operation to update protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param updateInput Mapping update input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping object along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceName, String resourceGroupName, + String fabricName, String protectionContainerName, String mappingName, + UpdateProtectionContainerMappingInput updateInput) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono.error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (mappingName == null) { + return Mono.error(new IllegalArgumentException("Parameter mappingName is required and cannot be null.")); + } + if (updateInput == null) { + return Mono.error(new IllegalArgumentException("Parameter updateInput is required and cannot be null.")); + } else { + updateInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, + resourceGroupName, this.client.getSubscriptionId(), fabricName, protectionContainerName, mappingName, + updateInput, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update protection container mapping. + * + * The operation to update protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param updateInput Mapping update input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping object along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceName, String resourceGroupName, + String fabricName, String protectionContainerName, String mappingName, + UpdateProtectionContainerMappingInput updateInput, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono.error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (mappingName == null) { + return Mono.error(new IllegalArgumentException("Parameter mappingName is required and cannot be null.")); + } + if (updateInput == null) { + return Mono.error(new IllegalArgumentException("Parameter updateInput is required and cannot be null.")); + } else { + updateInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, resourceGroupName, + this.client.getSubscriptionId(), fabricName, protectionContainerName, mappingName, updateInput, accept, + context); + } + + /** + * Update protection container mapping. + * + * The operation to update protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param updateInput Mapping update input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProtectionContainerMappingInner> beginUpdateAsync( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName, + String mappingName, UpdateProtectionContainerMappingInput updateInput) { + Mono>> mono = updateWithResponseAsync(resourceName, resourceGroupName, fabricName, + protectionContainerName, mappingName, updateInput); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ProtectionContainerMappingInner.class, ProtectionContainerMappingInner.class, + this.client.getContext()); + } + + /** + * Update protection container mapping. + * + * The operation to update protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param updateInput Mapping update input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProtectionContainerMappingInner> beginUpdateAsync( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName, + String mappingName, UpdateProtectionContainerMappingInput updateInput, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceName, resourceGroupName, fabricName, + protectionContainerName, mappingName, updateInput, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ProtectionContainerMappingInner.class, ProtectionContainerMappingInner.class, + context); + } + + /** + * Update protection container mapping. + * + * The operation to update protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param updateInput Mapping update input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProtectionContainerMappingInner> beginUpdate( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName, + String mappingName, UpdateProtectionContainerMappingInput updateInput) { + return this.beginUpdateAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, + updateInput).getSyncPoller(); + } + + /** + * Update protection container mapping. + * + * The operation to update protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param updateInput Mapping update input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProtectionContainerMappingInner> beginUpdate( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName, + String mappingName, UpdateProtectionContainerMappingInput updateInput, Context context) { + return this.beginUpdateAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, + updateInput, context).getSyncPoller(); + } + + /** + * Update protection container mapping. + * + * The operation to update protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param updateInput Mapping update input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceName, String resourceGroupName, + String fabricName, String protectionContainerName, String mappingName, + UpdateProtectionContainerMappingInput updateInput) { + return beginUpdateAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, + updateInput).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update protection container mapping. + * + * The operation to update protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param updateInput Mapping update input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceName, String resourceGroupName, + String fabricName, String protectionContainerName, String mappingName, + UpdateProtectionContainerMappingInput updateInput, Context context) { + return beginUpdateAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, + updateInput, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update protection container mapping. + * + * The operation to update protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param updateInput Mapping update input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectionContainerMappingInner update(String resourceName, String resourceGroupName, String fabricName, + String protectionContainerName, String mappingName, UpdateProtectionContainerMappingInput updateInput) { + return updateAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, + updateInput).block(); + } + + /** + * Update protection container mapping. + * + * The operation to update protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param updateInput Mapping update input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectionContainerMappingInner update(String resourceName, String resourceGroupName, String fabricName, + String protectionContainerName, String mappingName, UpdateProtectionContainerMappingInput updateInput, + Context context) { + return updateAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, + updateInput, context).block(); + } + + /** + * Remove protection container mapping. + * + * The operation to delete or remove a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param removalInput Removal input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 resourceName, String resourceGroupName, + String fabricName, String protectionContainerName, String mappingName, + RemoveProtectionContainerMappingInput removalInput) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono.error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (mappingName == null) { + return Mono.error(new IllegalArgumentException("Parameter mappingName is required and cannot be null.")); + } + if (removalInput == null) { + return Mono.error(new IllegalArgumentException("Parameter removalInput is required and cannot be null.")); + } else { + removalInput.validate(); + } + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, + resourceGroupName, this.client.getSubscriptionId(), fabricName, protectionContainerName, mappingName, + removalInput, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Remove protection container mapping. + * + * The operation to delete or remove a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param removalInput Removal input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 resourceName, String resourceGroupName, + String fabricName, String protectionContainerName, String mappingName, + RemoveProtectionContainerMappingInput removalInput, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono.error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (mappingName == null) { + return Mono.error(new IllegalArgumentException("Parameter mappingName is required and cannot be null.")); + } + if (removalInput == null) { + return Mono.error(new IllegalArgumentException("Parameter removalInput is required and cannot be null.")); + } else { + removalInput.validate(); + } + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, resourceGroupName, + this.client.getSubscriptionId(), fabricName, protectionContainerName, mappingName, removalInput, context); + } + + /** + * Remove protection container mapping. + * + * The operation to delete or remove a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param removalInput Removal input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 resourceName, String resourceGroupName, + String fabricName, String protectionContainerName, String mappingName, + RemoveProtectionContainerMappingInput removalInput) { + Mono>> mono = deleteWithResponseAsync(resourceName, resourceGroupName, fabricName, + protectionContainerName, mappingName, removalInput); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Remove protection container mapping. + * + * The operation to delete or remove a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param removalInput Removal input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 resourceName, String resourceGroupName, + String fabricName, String protectionContainerName, String mappingName, + RemoveProtectionContainerMappingInput removalInput, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceName, resourceGroupName, fabricName, + protectionContainerName, mappingName, removalInput, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Remove protection container mapping. + * + * The operation to delete or remove a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param removalInput Removal input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 resourceName, String resourceGroupName, + String fabricName, String protectionContainerName, String mappingName, + RemoveProtectionContainerMappingInput removalInput) { + return this.beginDeleteAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, + removalInput).getSyncPoller(); + } + + /** + * Remove protection container mapping. + * + * The operation to delete or remove a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param removalInput Removal input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 resourceName, String resourceGroupName, + String fabricName, String protectionContainerName, String mappingName, + RemoveProtectionContainerMappingInput removalInput, Context context) { + return this.beginDeleteAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, + removalInput, context).getSyncPoller(); + } + + /** + * Remove protection container mapping. + * + * The operation to delete or remove a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param removalInput Removal input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, String resourceGroupName, String fabricName, + String protectionContainerName, String mappingName, RemoveProtectionContainerMappingInput removalInput) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, + removalInput).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Remove protection container mapping. + * + * The operation to delete or remove a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param removalInput Removal input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, String resourceGroupName, String fabricName, + String protectionContainerName, String mappingName, RemoveProtectionContainerMappingInput removalInput, + Context context) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, + removalInput, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Remove protection container mapping. + * + * The operation to delete or remove a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param removalInput Removal input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resourceName, String resourceGroupName, String fabricName, String protectionContainerName, + String mappingName, RemoveProtectionContainerMappingInput removalInput) { + deleteAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, removalInput) + .block(); + } + + /** + * Remove protection container mapping. + * + * The operation to delete or remove a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param removalInput Removal input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resourceName, String resourceGroupName, String fabricName, String protectionContainerName, + String mappingName, RemoveProtectionContainerMappingInput removalInput, Context context) { + deleteAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, removalInput, + context).block(); + } + + /** + * Gets the list of all protection container mappings in a vault. + * + * Lists the protection container mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping collection class along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceName, + String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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.list(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, + resourceGroupName, this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of all protection container mappings in a vault. + * + * Lists the protection container mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping collection class along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceName, + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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 + .list(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, resourceGroupName, + this.client.getSubscriptionId(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Gets the list of all protection container mappings in a vault. + * + * Lists the protection container mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping collection class as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceName, resourceGroupName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of all protection container mappings in a vault. + * + * Lists the protection container mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping collection class as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceName, resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of all protection container mappings in a vault. + * + * Lists the protection container mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping collection class as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); + } + + /** + * Gets the list of all protection container mappings in a vault. + * + * Lists the protection container mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping collection class as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName, + Context context) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, 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 protection container mapping collection class along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByReplicationProtectionContainersNextSinglePageAsync(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.listByReplicationProtectionContainersNext(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 protection container mapping collection class along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByReplicationProtectionContainersNextSinglePageAsync(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.listByReplicationProtectionContainersNext(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 protection container mapping collection class 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 protection container mapping collection class 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationRecoveryServicesProvidersClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationRecoveryServicesProvidersClientImpl.java new file mode 100644 index 000000000000..fb35a8fad6c2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationRecoveryServicesProvidersClientImpl.java @@ -0,0 +1,1859 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.ReplicationRecoveryServicesProvidersClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.RecoveryServicesProviderInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.AddRecoveryServicesProviderInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryServicesProviderCollection; +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 + * ReplicationRecoveryServicesProvidersClient. + */ +public final class ReplicationRecoveryServicesProvidersClientImpl + implements ReplicationRecoveryServicesProvidersClient { + /** + * The proxy service used to perform REST calls. + */ + private final ReplicationRecoveryServicesProvidersService service; + + /** + * The service client containing this operation class. + */ + private final SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationRecoveryServicesProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReplicationRecoveryServicesProvidersClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = RestProxy.create(ReplicationRecoveryServicesProvidersService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientReplicationRecoveryServicesProviders to + * be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface ReplicationRecoveryServicesProvidersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationFabrics(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, @PathParam("fabricName") String fabricName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, @PathParam("fabricName") String fabricName, + @PathParam("providerName") String providerName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, @PathParam("fabricName") String fabricName, + @PathParam("providerName") String providerName, + @BodyParam("application/json") AddRecoveryServicesProviderInput addProviderInput, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> purge(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, @PathParam("fabricName") String fabricName, + @PathParam("providerName") String providerName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/refreshProvider") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> refreshProvider(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, @PathParam("fabricName") String fabricName, + @PathParam("providerName") String providerName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/remove") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, @PathParam("fabricName") String fabricName, + @PathParam("providerName") String providerName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryServicesProviders") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationFabricsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the list of registered recovery services providers for the fabric. + * + * Lists the registered recovery services providers for the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric 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 collection of providers along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByReplicationFabricsSinglePageAsync(String resourceName, String resourceGroupName, String fabricName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByReplicationFabrics(this.client.getEndpoint(), this.client.getApiVersion(), + resourceName, resourceGroupName, this.client.getSubscriptionId(), fabricName, accept, context)) + .>map(res -> new 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 registered recovery services providers for the fabric. + * + * Lists the registered recovery services providers for the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric 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 collection of providers along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationFabricsSinglePageAsync( + String resourceName, String resourceGroupName, String fabricName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByReplicationFabrics(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, + resourceGroupName, this.client.getSubscriptionId(), fabricName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Gets the list of registered recovery services providers for the fabric. + * + * Lists the registered recovery services providers for the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric 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 collection of providers as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationFabricsAsync(String resourceName, + String resourceGroupName, String fabricName) { + return new PagedFlux<>( + () -> listByReplicationFabricsSinglePageAsync(resourceName, resourceGroupName, fabricName), + nextLink -> listByReplicationFabricsNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of registered recovery services providers for the fabric. + * + * Lists the registered recovery services providers for the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric 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 collection of providers as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationFabricsAsync(String resourceName, + String resourceGroupName, String fabricName, Context context) { + return new PagedFlux<>( + () -> listByReplicationFabricsSinglePageAsync(resourceName, resourceGroupName, fabricName, context), + nextLink -> listByReplicationFabricsNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of registered recovery services providers for the fabric. + * + * Lists the registered recovery services providers for the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric 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 collection of providers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationFabrics(String resourceName, + String resourceGroupName, String fabricName) { + return new PagedIterable<>(listByReplicationFabricsAsync(resourceName, resourceGroupName, fabricName)); + } + + /** + * Gets the list of registered recovery services providers for the fabric. + * + * Lists the registered recovery services providers for the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric 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 collection of providers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationFabrics(String resourceName, + String resourceGroupName, String fabricName, Context context) { + return new PagedIterable<>(listByReplicationFabricsAsync(resourceName, resourceGroupName, fabricName, context)); + } + + /** + * Gets the details of a recovery services provider. + * + * Gets the details of registered recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 details of registered recovery services provider along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceName, + String resourceGroupName, String fabricName, String providerName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (providerName == null) { + return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, + resourceGroupName, this.client.getSubscriptionId(), fabricName, providerName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the details of a recovery services provider. + * + * Gets the details of registered recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 details of registered recovery services provider along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceName, + String resourceGroupName, String fabricName, String providerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (providerName == null) { + return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, resourceGroupName, + this.client.getSubscriptionId(), fabricName, providerName, accept, context); + } + + /** + * Gets the details of a recovery services provider. + * + * Gets the details of registered recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 details of registered recovery services provider on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceName, String resourceGroupName, + String fabricName, String providerName) { + return getWithResponseAsync(resourceName, resourceGroupName, fabricName, providerName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the details of a recovery services provider. + * + * Gets the details of registered recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 details of registered recovery services provider along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceName, String resourceGroupName, + String fabricName, String providerName, Context context) { + return getWithResponseAsync(resourceName, resourceGroupName, fabricName, providerName, context).block(); + } + + /** + * Gets the details of a recovery services provider. + * + * Gets the details of registered recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 details of registered recovery services provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryServicesProviderInner get(String resourceName, String resourceGroupName, String fabricName, + String providerName) { + return getWithResponse(resourceName, resourceGroupName, fabricName, providerName, Context.NONE).getValue(); + } + + /** + * Adds a recovery services provider. + * + * The operation to add a recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider name. + * @param addProviderInput Add provider input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return provider details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceName, String resourceGroupName, + String fabricName, String providerName, AddRecoveryServicesProviderInput addProviderInput) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (providerName == null) { + return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + if (addProviderInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter addProviderInput is required and cannot be null.")); + } else { + addProviderInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, + resourceGroupName, this.client.getSubscriptionId(), fabricName, providerName, addProviderInput, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Adds a recovery services provider. + * + * The operation to add a recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider name. + * @param addProviderInput Add provider input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return provider details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceName, String resourceGroupName, + String fabricName, String providerName, AddRecoveryServicesProviderInput addProviderInput, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (providerName == null) { + return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + if (addProviderInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter addProviderInput is required and cannot be null.")); + } else { + addProviderInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, resourceGroupName, + this.client.getSubscriptionId(), fabricName, providerName, addProviderInput, accept, context); + } + + /** + * Adds a recovery services provider. + * + * The operation to add a recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider name. + * @param addProviderInput Add provider input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 provider details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryServicesProviderInner> beginCreateAsync( + String resourceName, String resourceGroupName, String fabricName, String providerName, + AddRecoveryServicesProviderInput addProviderInput) { + Mono>> mono + = createWithResponseAsync(resourceName, resourceGroupName, fabricName, providerName, addProviderInput); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), RecoveryServicesProviderInner.class, RecoveryServicesProviderInner.class, + this.client.getContext()); + } + + /** + * Adds a recovery services provider. + * + * The operation to add a recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider name. + * @param addProviderInput Add provider input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 provider details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryServicesProviderInner> beginCreateAsync( + String resourceName, String resourceGroupName, String fabricName, String providerName, + AddRecoveryServicesProviderInput addProviderInput, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createWithResponseAsync(resourceName, resourceGroupName, fabricName, + providerName, addProviderInput, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), RecoveryServicesProviderInner.class, RecoveryServicesProviderInner.class, + context); + } + + /** + * Adds a recovery services provider. + * + * The operation to add a recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider name. + * @param addProviderInput Add provider input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of provider details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryServicesProviderInner> beginCreate( + String resourceName, String resourceGroupName, String fabricName, String providerName, + AddRecoveryServicesProviderInput addProviderInput) { + return this.beginCreateAsync(resourceName, resourceGroupName, fabricName, providerName, addProviderInput) + .getSyncPoller(); + } + + /** + * Adds a recovery services provider. + * + * The operation to add a recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider name. + * @param addProviderInput Add provider input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of provider details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryServicesProviderInner> beginCreate( + String resourceName, String resourceGroupName, String fabricName, String providerName, + AddRecoveryServicesProviderInput addProviderInput, Context context) { + return this + .beginCreateAsync(resourceName, resourceGroupName, fabricName, providerName, addProviderInput, context) + .getSyncPoller(); + } + + /** + * Adds a recovery services provider. + * + * The operation to add a recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider name. + * @param addProviderInput Add provider input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return provider details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceName, String resourceGroupName, + String fabricName, String providerName, AddRecoveryServicesProviderInput addProviderInput) { + return beginCreateAsync(resourceName, resourceGroupName, fabricName, providerName, addProviderInput).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Adds a recovery services provider. + * + * The operation to add a recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider name. + * @param addProviderInput Add provider input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return provider details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceName, String resourceGroupName, + String fabricName, String providerName, AddRecoveryServicesProviderInput addProviderInput, Context context) { + return beginCreateAsync(resourceName, resourceGroupName, fabricName, providerName, addProviderInput, context) + .last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Adds a recovery services provider. + * + * The operation to add a recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider name. + * @param addProviderInput Add provider input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryServicesProviderInner create(String resourceName, String resourceGroupName, String fabricName, + String providerName, AddRecoveryServicesProviderInput addProviderInput) { + return createAsync(resourceName, resourceGroupName, fabricName, providerName, addProviderInput).block(); + } + + /** + * Adds a recovery services provider. + * + * The operation to add a recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider name. + * @param addProviderInput Add provider input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryServicesProviderInner create(String resourceName, String resourceGroupName, String fabricName, + String providerName, AddRecoveryServicesProviderInput addProviderInput, Context context) { + return createAsync(resourceName, resourceGroupName, fabricName, providerName, addProviderInput, context) + .block(); + } + + /** + * Purges recovery service provider from fabric. + * + * The operation to purge(force delete) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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>> purgeWithResponseAsync(String resourceName, String resourceGroupName, + String fabricName, String providerName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (providerName == null) { + return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.purge(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, + resourceGroupName, this.client.getSubscriptionId(), fabricName, providerName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Purges recovery service provider from fabric. + * + * The operation to purge(force delete) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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>> purgeWithResponseAsync(String resourceName, String resourceGroupName, + String fabricName, String providerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (providerName == null) { + return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.purge(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, resourceGroupName, + this.client.getSubscriptionId(), fabricName, providerName, context); + } + + /** + * Purges recovery service provider from fabric. + * + * The operation to purge(force delete) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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> beginPurgeAsync(String resourceName, String resourceGroupName, + String fabricName, String providerName) { + Mono>> mono + = purgeWithResponseAsync(resourceName, resourceGroupName, fabricName, providerName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Purges recovery service provider from fabric. + * + * The operation to purge(force delete) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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> beginPurgeAsync(String resourceName, String resourceGroupName, + String fabricName, String providerName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = purgeWithResponseAsync(resourceName, resourceGroupName, fabricName, providerName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Purges recovery service provider from fabric. + * + * The operation to purge(force delete) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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> beginPurge(String resourceName, String resourceGroupName, + String fabricName, String providerName) { + return this.beginPurgeAsync(resourceName, resourceGroupName, fabricName, providerName).getSyncPoller(); + } + + /** + * Purges recovery service provider from fabric. + * + * The operation to purge(force delete) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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> beginPurge(String resourceName, String resourceGroupName, + String fabricName, String providerName, Context context) { + return this.beginPurgeAsync(resourceName, resourceGroupName, fabricName, providerName, context).getSyncPoller(); + } + + /** + * Purges recovery service provider from fabric. + * + * The operation to purge(force delete) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 purgeAsync(String resourceName, String resourceGroupName, String fabricName, + String providerName) { + return beginPurgeAsync(resourceName, resourceGroupName, fabricName, providerName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Purges recovery service provider from fabric. + * + * The operation to purge(force delete) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 purgeAsync(String resourceName, String resourceGroupName, String fabricName, String providerName, + Context context) { + return beginPurgeAsync(resourceName, resourceGroupName, fabricName, providerName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Purges recovery service provider from fabric. + * + * The operation to purge(force delete) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 purge(String resourceName, String resourceGroupName, String fabricName, String providerName) { + purgeAsync(resourceName, resourceGroupName, fabricName, providerName).block(); + } + + /** + * Purges recovery service provider from fabric. + * + * The operation to purge(force delete) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 purge(String resourceName, String resourceGroupName, String fabricName, String providerName, + Context context) { + purgeAsync(resourceName, resourceGroupName, fabricName, providerName, context).block(); + } + + /** + * Refresh details from the recovery services provider. + * + * The operation to refresh the information from the recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 provider details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> refreshProviderWithResponseAsync(String resourceName, + String resourceGroupName, String fabricName, String providerName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (providerName == null) { + return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.refreshProvider(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, + resourceGroupName, this.client.getSubscriptionId(), fabricName, providerName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Refresh details from the recovery services provider. + * + * The operation to refresh the information from the recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 provider details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> refreshProviderWithResponseAsync(String resourceName, + String resourceGroupName, String fabricName, String providerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (providerName == null) { + return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.refreshProvider(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, + resourceGroupName, this.client.getSubscriptionId(), fabricName, providerName, accept, context); + } + + /** + * Refresh details from the recovery services provider. + * + * The operation to refresh the information from the recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 provider details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryServicesProviderInner> + beginRefreshProviderAsync(String resourceName, String resourceGroupName, String fabricName, + String providerName) { + Mono>> mono + = refreshProviderWithResponseAsync(resourceName, resourceGroupName, fabricName, providerName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), RecoveryServicesProviderInner.class, RecoveryServicesProviderInner.class, + this.client.getContext()); + } + + /** + * Refresh details from the recovery services provider. + * + * The operation to refresh the information from the recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 provider details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryServicesProviderInner> + beginRefreshProviderAsync(String resourceName, String resourceGroupName, String fabricName, String providerName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = refreshProviderWithResponseAsync(resourceName, resourceGroupName, fabricName, providerName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), RecoveryServicesProviderInner.class, RecoveryServicesProviderInner.class, + context); + } + + /** + * Refresh details from the recovery services provider. + * + * The operation to refresh the information from the recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 provider details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryServicesProviderInner> + beginRefreshProvider(String resourceName, String resourceGroupName, String fabricName, String providerName) { + return this.beginRefreshProviderAsync(resourceName, resourceGroupName, fabricName, providerName) + .getSyncPoller(); + } + + /** + * Refresh details from the recovery services provider. + * + * The operation to refresh the information from the recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 provider details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryServicesProviderInner> beginRefreshProvider( + String resourceName, String resourceGroupName, String fabricName, String providerName, Context context) { + return this.beginRefreshProviderAsync(resourceName, resourceGroupName, fabricName, providerName, context) + .getSyncPoller(); + } + + /** + * Refresh details from the recovery services provider. + * + * The operation to refresh the information from the recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 provider details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono refreshProviderAsync(String resourceName, String resourceGroupName, + String fabricName, String providerName) { + return beginRefreshProviderAsync(resourceName, resourceGroupName, fabricName, providerName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Refresh details from the recovery services provider. + * + * The operation to refresh the information from the recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 provider details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono refreshProviderAsync(String resourceName, String resourceGroupName, + String fabricName, String providerName, Context context) { + return beginRefreshProviderAsync(resourceName, resourceGroupName, fabricName, providerName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Refresh details from the recovery services provider. + * + * The operation to refresh the information from the recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryServicesProviderInner refreshProvider(String resourceName, String resourceGroupName, + String fabricName, String providerName) { + return refreshProviderAsync(resourceName, resourceGroupName, fabricName, providerName).block(); + } + + /** + * Refresh details from the recovery services provider. + * + * The operation to refresh the information from the recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryServicesProviderInner refreshProvider(String resourceName, String resourceGroupName, + String fabricName, String providerName, Context context) { + return refreshProviderAsync(resourceName, resourceGroupName, fabricName, providerName, context).block(); + } + + /** + * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To + * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty + * we assume that it is old client and continue the old behavior). + * + * The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, + String fabricName, String providerName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (providerName == null) { + return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, + resourceGroupName, this.client.getSubscriptionId(), fabricName, providerName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To + * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty + * we assume that it is old client and continue the old behavior). + * + * The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, + String fabricName, String providerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (providerName == null) { + return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, resourceGroupName, + this.client.getSubscriptionId(), fabricName, providerName, context); + } + + /** + * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To + * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty + * we assume that it is old client and continue the old behavior). + * + * The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, + String fabricName, String providerName) { + Mono>> mono + = deleteWithResponseAsync(resourceName, resourceGroupName, fabricName, providerName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To + * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty + * we assume that it is old client and continue the old behavior). + * + * The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, + String fabricName, String providerName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceName, resourceGroupName, fabricName, providerName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To + * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty + * we assume that it is old client and continue the old behavior). + * + * The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, + String fabricName, String providerName) { + return this.beginDeleteAsync(resourceName, resourceGroupName, fabricName, providerName).getSyncPoller(); + } + + /** + * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To + * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty + * we assume that it is old client and continue the old behavior). + * + * The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, + String fabricName, String providerName, Context context) { + return this.beginDeleteAsync(resourceName, resourceGroupName, fabricName, providerName, context) + .getSyncPoller(); + } + + /** + * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To + * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty + * we assume that it is old client and continue the old behavior). + * + * The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, String fabricName, + String providerName) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName, providerName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To + * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty + * we assume that it is old client and continue the old behavior). + * + * The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, String fabricName, + String providerName, Context context) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName, providerName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To + * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty + * we assume that it is old client and continue the old behavior). + * + * The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, String fabricName, String providerName) { + deleteAsync(resourceName, resourceGroupName, fabricName, providerName).block(); + } + + /** + * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To + * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty + * we assume that it is old client and continue the old behavior). + * + * The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, String fabricName, String providerName, + Context context) { + deleteAsync(resourceName, resourceGroupName, fabricName, providerName, context).block(); + } + + /** + * Gets the list of registered recovery services providers in the vault. This is a view only api. + * + * Lists the registered recovery services providers in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of providers along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceName, + String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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.list(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, + resourceGroupName, this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of registered recovery services providers in the vault. This is a view only api. + * + * Lists the registered recovery services providers in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of providers along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceName, + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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 + .list(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, resourceGroupName, + this.client.getSubscriptionId(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Gets the list of registered recovery services providers in the vault. This is a view only api. + * + * Lists the registered recovery services providers in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of providers as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceName, resourceGroupName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of registered recovery services providers in the vault. This is a view only api. + * + * Lists the registered recovery services providers in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of providers as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceName, resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of registered recovery services providers in the vault. This is a view only api. + * + * Lists the registered recovery services providers in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of providers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); + } + + /** + * Gets the list of registered recovery services providers in the vault. This is a view only api. + * + * Lists the registered recovery services providers in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of providers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName, + Context context) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, 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 collection of providers along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByReplicationFabricsNextSinglePageAsync(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.listByReplicationFabricsNext(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 collection of providers along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByReplicationFabricsNextSinglePageAsync(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.listByReplicationFabricsNext(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 collection of providers 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 collection of providers 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SupportedOperatingSystemsOperationsClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SupportedOperatingSystemsOperationsClientImpl.java new file mode 100644 index 000000000000..d8547f504c35 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SupportedOperatingSystemsOperationsClientImpl.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.SupportedOperatingSystemsOperationsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.SupportedOperatingSystemsInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * SupportedOperatingSystemsOperationsClient. + */ +public final class SupportedOperatingSystemsOperationsClientImpl implements SupportedOperatingSystemsOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SupportedOperatingSystemsOperationsService service; + + /** + * The service client containing this operation class. + */ + private final SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of SupportedOperatingSystemsOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SupportedOperatingSystemsOperationsClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = RestProxy.create(SupportedOperatingSystemsOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientSupportedOperatingSystemsOperations to + * be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface SupportedOperatingSystemsOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationSupportedOperatingSystems") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("instanceType") String instanceType, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the data of supported operating systems by SRS. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param instanceType The instance type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data of supported operating systems by SRS along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceName, + String resourceGroupName, String instanceType) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, + resourceGroupName, this.client.getSubscriptionId(), instanceType, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the data of supported operating systems by SRS. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param instanceType The instance type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data of supported operating systems by SRS along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceName, + String resourceGroupName, String instanceType, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceName, resourceGroupName, + this.client.getSubscriptionId(), instanceType, accept, context); + } + + /** + * Gets the data of supported operating systems by SRS. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data of supported operating systems by SRS on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceName, String resourceGroupName) { + final String instanceType = null; + return getWithResponseAsync(resourceName, resourceGroupName, instanceType) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the data of supported operating systems by SRS. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param instanceType The instance type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data of supported operating systems by SRS along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceName, String resourceGroupName, + String instanceType, Context context) { + return getWithResponseAsync(resourceName, resourceGroupName, instanceType, context).block(); + } + + /** + * Gets the data of supported operating systems by SRS. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data of supported operating systems by SRS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SupportedOperatingSystemsInner get(String resourceName, String resourceGroupName) { + final String instanceType = null; + return getWithResponse(resourceName, resourceGroupName, instanceType, Context.NONE).getValue(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureUpdateReplicationProtectedItemInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureUpdateReplicationProtectedItemInput.java new file mode 100644 index 000000000000..ddfaa2ec3d9b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureUpdateReplicationProtectedItemInput.java @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** + * HyperV replica Azure input to update replication protected item. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVReplicaAzure") +@Fluent +public final class HyperVReplicaAzureUpdateReplicationProtectedItemInput + extends UpdateReplicationProtectedItemProviderInput { + /* + * The recovery Azure resource group Id for classic deployment. + */ + @JsonProperty(value = "recoveryAzureV1ResourceGroupId") + private String recoveryAzureV1ResourceGroupId; + + /* + * The recovery Azure resource group Id for resource manager deployment. + */ + @JsonProperty(value = "recoveryAzureV2ResourceGroupId") + private String recoveryAzureV2ResourceGroupId; + + /* + * A value indicating whether managed disks should be used during failover. + */ + @JsonProperty(value = "useManagedDisks") + private String useManagedDisks; + + /* + * The dictionary of disk resource Id to disk encryption set ARM Id. + */ + @JsonProperty(value = "diskIdToDiskEncryptionMap") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map diskIdToDiskEncryptionMap; + + /* + * The target proximity placement group Id. + */ + @JsonProperty(value = "targetProximityPlacementGroupId") + private String targetProximityPlacementGroupId; + + /* + * The target availability zone. + */ + @JsonProperty(value = "targetAvailabilityZone") + private String targetAvailabilityZone; + + /* + * The target VM tags. + */ + @JsonProperty(value = "targetVmTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetVmTags; + + /* + * The tags for the target managed disks. + */ + @JsonProperty(value = "targetManagedDiskTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetManagedDiskTags; + + /* + * The tags for the target NICs. + */ + @JsonProperty(value = "targetNicTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetNicTags; + + /* + * The SQL Server license type. + */ + @JsonProperty(value = "sqlServerLicenseType") + private SqlServerLicenseType sqlServerLicenseType; + + /* + * The list of disk update properties. + */ + @JsonProperty(value = "vmDisks") + private List vmDisks; + + /** + * Creates an instance of HyperVReplicaAzureUpdateReplicationProtectedItemInput class. + */ + public HyperVReplicaAzureUpdateReplicationProtectedItemInput() { + } + + /** + * Get the recoveryAzureV1ResourceGroupId property: The recovery Azure resource group Id for classic deployment. + * + * @return the recoveryAzureV1ResourceGroupId value. + */ + public String recoveryAzureV1ResourceGroupId() { + return this.recoveryAzureV1ResourceGroupId; + } + + /** + * Set the recoveryAzureV1ResourceGroupId property: The recovery Azure resource group Id for classic deployment. + * + * @param recoveryAzureV1ResourceGroupId the recoveryAzureV1ResourceGroupId value to set. + * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. + */ + public HyperVReplicaAzureUpdateReplicationProtectedItemInput + withRecoveryAzureV1ResourceGroupId(String recoveryAzureV1ResourceGroupId) { + this.recoveryAzureV1ResourceGroupId = recoveryAzureV1ResourceGroupId; + return this; + } + + /** + * Get the recoveryAzureV2ResourceGroupId property: The recovery Azure resource group Id for resource manager + * deployment. + * + * @return the recoveryAzureV2ResourceGroupId value. + */ + public String recoveryAzureV2ResourceGroupId() { + return this.recoveryAzureV2ResourceGroupId; + } + + /** + * Set the recoveryAzureV2ResourceGroupId property: The recovery Azure resource group Id for resource manager + * deployment. + * + * @param recoveryAzureV2ResourceGroupId the recoveryAzureV2ResourceGroupId value to set. + * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. + */ + public HyperVReplicaAzureUpdateReplicationProtectedItemInput + withRecoveryAzureV2ResourceGroupId(String recoveryAzureV2ResourceGroupId) { + this.recoveryAzureV2ResourceGroupId = recoveryAzureV2ResourceGroupId; + return this; + } + + /** + * Get the useManagedDisks property: A value indicating whether managed disks should be used during failover. + * + * @return the useManagedDisks value. + */ + public String useManagedDisks() { + return this.useManagedDisks; + } + + /** + * Set the useManagedDisks property: A value indicating whether managed disks should be used during failover. + * + * @param useManagedDisks the useManagedDisks value to set. + * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. + */ + public HyperVReplicaAzureUpdateReplicationProtectedItemInput withUseManagedDisks(String useManagedDisks) { + this.useManagedDisks = useManagedDisks; + return this; + } + + /** + * Get the diskIdToDiskEncryptionMap property: The dictionary of disk resource Id to disk encryption set ARM Id. + * + * @return the diskIdToDiskEncryptionMap value. + */ + public Map diskIdToDiskEncryptionMap() { + return this.diskIdToDiskEncryptionMap; + } + + /** + * Set the diskIdToDiskEncryptionMap property: The dictionary of disk resource Id to disk encryption set ARM Id. + * + * @param diskIdToDiskEncryptionMap the diskIdToDiskEncryptionMap value to set. + * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. + */ + public HyperVReplicaAzureUpdateReplicationProtectedItemInput + withDiskIdToDiskEncryptionMap(Map diskIdToDiskEncryptionMap) { + this.diskIdToDiskEncryptionMap = diskIdToDiskEncryptionMap; + return this; + } + + /** + * Get the targetProximityPlacementGroupId property: The target proximity placement group Id. + * + * @return the targetProximityPlacementGroupId value. + */ + public String targetProximityPlacementGroupId() { + return this.targetProximityPlacementGroupId; + } + + /** + * Set the targetProximityPlacementGroupId property: The target proximity placement group Id. + * + * @param targetProximityPlacementGroupId the targetProximityPlacementGroupId value to set. + * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. + */ + public HyperVReplicaAzureUpdateReplicationProtectedItemInput + withTargetProximityPlacementGroupId(String targetProximityPlacementGroupId) { + this.targetProximityPlacementGroupId = targetProximityPlacementGroupId; + return this; + } + + /** + * Get the targetAvailabilityZone property: The target availability zone. + * + * @return the targetAvailabilityZone value. + */ + public String targetAvailabilityZone() { + return this.targetAvailabilityZone; + } + + /** + * Set the targetAvailabilityZone property: The target availability zone. + * + * @param targetAvailabilityZone the targetAvailabilityZone value to set. + * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. + */ + public HyperVReplicaAzureUpdateReplicationProtectedItemInput + withTargetAvailabilityZone(String targetAvailabilityZone) { + this.targetAvailabilityZone = targetAvailabilityZone; + return this; + } + + /** + * Get the targetVmTags property: The target VM tags. + * + * @return the targetVmTags value. + */ + public Map targetVmTags() { + return this.targetVmTags; + } + + /** + * Set the targetVmTags property: The target VM tags. + * + * @param targetVmTags the targetVmTags value to set. + * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. + */ + public HyperVReplicaAzureUpdateReplicationProtectedItemInput withTargetVmTags(Map targetVmTags) { + this.targetVmTags = targetVmTags; + return this; + } + + /** + * Get the targetManagedDiskTags property: The tags for the target managed disks. + * + * @return the targetManagedDiskTags value. + */ + public Map targetManagedDiskTags() { + return this.targetManagedDiskTags; + } + + /** + * Set the targetManagedDiskTags property: The tags for the target managed disks. + * + * @param targetManagedDiskTags the targetManagedDiskTags value to set. + * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. + */ + public HyperVReplicaAzureUpdateReplicationProtectedItemInput + withTargetManagedDiskTags(Map targetManagedDiskTags) { + this.targetManagedDiskTags = targetManagedDiskTags; + return this; + } + + /** + * Get the targetNicTags property: The tags for the target NICs. + * + * @return the targetNicTags value. + */ + public Map targetNicTags() { + return this.targetNicTags; + } + + /** + * Set the targetNicTags property: The tags for the target NICs. + * + * @param targetNicTags the targetNicTags value to set. + * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. + */ + public HyperVReplicaAzureUpdateReplicationProtectedItemInput withTargetNicTags(Map targetNicTags) { + this.targetNicTags = targetNicTags; + return this; + } + + /** + * Get the sqlServerLicenseType property: The SQL Server license type. + * + * @return the sqlServerLicenseType value. + */ + public SqlServerLicenseType sqlServerLicenseType() { + return this.sqlServerLicenseType; + } + + /** + * Set the sqlServerLicenseType property: The SQL Server license type. + * + * @param sqlServerLicenseType the sqlServerLicenseType value to set. + * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. + */ + public HyperVReplicaAzureUpdateReplicationProtectedItemInput + withSqlServerLicenseType(SqlServerLicenseType sqlServerLicenseType) { + this.sqlServerLicenseType = sqlServerLicenseType; + return this; + } + + /** + * Get the vmDisks property: The list of disk update properties. + * + * @return the vmDisks value. + */ + public List vmDisks() { + return this.vmDisks; + } + + /** + * Set the vmDisks property: The list of disk update properties. + * + * @param vmDisks the vmDisks value to set. + * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. + */ + public HyperVReplicaAzureUpdateReplicationProtectedItemInput withVmDisks(List vmDisks) { + this.vmDisks = vmDisks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (vmDisks() != null) { + vmDisks().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmUpdateApplianceForReplicationProtectedItemInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmUpdateApplianceForReplicationProtectedItemInput.java new file mode 100644 index 000000000000..c041e01a7024 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmUpdateApplianceForReplicationProtectedItemInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * InMageRcm provider specific input to update appliance for replication protected item. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageRcm") +@Fluent +public final class InMageRcmUpdateApplianceForReplicationProtectedItemInput + extends UpdateReplicationProtectedItemProviderSpecificInput { + /* + * The run as account Id. + */ + @JsonProperty(value = "runAsAccountId") + private String runAsAccountId; + + /** + * Creates an instance of InMageRcmUpdateApplianceForReplicationProtectedItemInput class. + */ + public InMageRcmUpdateApplianceForReplicationProtectedItemInput() { + } + + /** + * Get the runAsAccountId property: The run as account Id. + * + * @return the runAsAccountId value. + */ + public String runAsAccountId() { + return this.runAsAccountId; + } + + /** + * Set the runAsAccountId property: The run as account Id. + * + * @param runAsAccountId the runAsAccountId value to set. + * @return the InMageRcmUpdateApplianceForReplicationProtectedItemInput object itself. + */ + public InMageRcmUpdateApplianceForReplicationProtectedItemInput withRunAsAccountId(String runAsAccountId) { + this.runAsAccountId = runAsAccountId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderSpecificUpdateContainerMappingInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderSpecificUpdateContainerMappingInput.java new file mode 100644 index 000000000000..7fb68982f635 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderSpecificUpdateContainerMappingInput.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Provider specific input for update pairing operations. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = ReplicationProviderSpecificUpdateContainerMappingInput.class) +@JsonTypeName("ReplicationProviderSpecificUpdateContainerMappingInput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "A2A", value = A2AUpdateContainerMappingInput.class), + @JsonSubTypes.Type(name = "InMageRcm", value = InMageRcmUpdateContainerMappingInput.class) }) +@Immutable +public class ReplicationProviderSpecificUpdateContainerMappingInput { + /** + * Creates an instance of ReplicationProviderSpecificUpdateContainerMappingInput class. + */ + public ReplicationProviderSpecificUpdateContainerMappingInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateApplianceForReplicationProtectedItemInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateApplianceForReplicationProtectedItemInputProperties.java new file mode 100644 index 000000000000..9efc8e1f2b10 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateApplianceForReplicationProtectedItemInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Update appliance for protected item input properties. + */ +@Fluent +public final class UpdateApplianceForReplicationProtectedItemInputProperties { + /* + * The target appliance Id. + */ + @JsonProperty(value = "targetApplianceId", required = true) + private String targetApplianceId; + + /* + * The provider specific input to update replication protected item. + */ + @JsonProperty(value = "providerSpecificDetails", required = true) + private UpdateReplicationProtectedItemProviderSpecificInput providerSpecificDetails; + + /** + * Creates an instance of UpdateApplianceForReplicationProtectedItemInputProperties class. + */ + public UpdateApplianceForReplicationProtectedItemInputProperties() { + } + + /** + * Get the targetApplianceId property: The target appliance Id. + * + * @return the targetApplianceId value. + */ + public String targetApplianceId() { + return this.targetApplianceId; + } + + /** + * Set the targetApplianceId property: The target appliance Id. + * + * @param targetApplianceId the targetApplianceId value to set. + * @return the UpdateApplianceForReplicationProtectedItemInputProperties object itself. + */ + public UpdateApplianceForReplicationProtectedItemInputProperties withTargetApplianceId(String targetApplianceId) { + this.targetApplianceId = targetApplianceId; + return this; + } + + /** + * Get the providerSpecificDetails property: The provider specific input to update replication protected item. + * + * @return the providerSpecificDetails value. + */ + public UpdateReplicationProtectedItemProviderSpecificInput providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: The provider specific input to update replication protected item. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the UpdateApplianceForReplicationProtectedItemInputProperties object itself. + */ + public UpdateApplianceForReplicationProtectedItemInputProperties + withProviderSpecificDetails(UpdateReplicationProtectedItemProviderSpecificInput providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetApplianceId() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property targetApplianceId in model UpdateApplianceForReplicationProtectedItemInputProperties")); + } + if (providerSpecificDetails() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property providerSpecificDetails in model UpdateApplianceForReplicationProtectedItemInputProperties")); + } else { + providerSpecificDetails().validate(); + } + } + + private static final ClientLogger LOGGER + = new ClientLogger(UpdateApplianceForReplicationProtectedItemInputProperties.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservicessiterecovery/proxy-config.json b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservicessiterecovery/proxy-config.json new file mode 100644 index 000000000000..ee6b890b3a43 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservicessiterecovery/proxy-config.json @@ -0,0 +1 @@ +[ [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.OperationsClientImpl$OperationsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationAlertSettingsClientImpl$ReplicationAlertSettingsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationAppliancesClientImpl$ReplicationAppliancesService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationEligibilityResultsOperationsClientImpl$ReplicationEligibilityResultsOperationsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationEventsClientImpl$ReplicationEventsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationFabricsClientImpl$ReplicationFabricsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationLogicalNetworksClientImpl$ReplicationLogicalNetworksService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationNetworksClientImpl$ReplicationNetworksService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationNetworkMappingsClientImpl$ReplicationNetworkMappingsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationProtectionContainersClientImpl$ReplicationProtectionContainersService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationMigrationItemsClientImpl$ReplicationMigrationItemsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.MigrationRecoveryPointsClientImpl$MigrationRecoveryPointsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationProtectableItemsClientImpl$ReplicationProtectableItemsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationProtectedItemsClientImpl$ReplicationProtectedItemsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.RecoveryPointsClientImpl$RecoveryPointsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.TargetComputeSizesClientImpl$TargetComputeSizesService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationProtectionContainerMappingsClientImpl$ReplicationProtectionContainerMappingsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationRecoveryServicesProvidersClientImpl$ReplicationRecoveryServicesProvidersService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.StorageClassificationsClientImpl$StorageClassificationsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.StorageClassificationMappingsClientImpl$StorageClassificationMappingsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationvCentersClientImpl$ReplicationvCentersService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationJobsClientImpl$ReplicationJobsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationPoliciesClientImpl$ReplicationPoliciesService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationProtectionIntentsClientImpl$ReplicationProtectionIntentsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationRecoveryPlansClientImpl$ReplicationRecoveryPlansService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.SupportedOperatingSystemsOperationsClientImpl$SupportedOperatingSystemsOperationsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationVaultHealthsClientImpl$ReplicationVaultHealthsService" ], [ "com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationVaultSettingsClientImpl$ReplicationVaultSettingsService" ] ] \ No newline at end of file diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservicessiterecovery/reflect-config.json b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservicessiterecovery/reflect-config.json new file mode 100644 index 000000000000..1f20b21f6b48 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservicessiterecovery/reflect-config.json @@ -0,0 +1,2816 @@ +[ { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.OperationsDiscoveryCollection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.OperationsDiscoveryInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.Display", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AlertCollection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.AlertInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AlertProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ConfigureAlertRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ConfigureAlertRequestProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ApplianceCollection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationApplianceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationApplianceProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ApplianceSpecificDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationEligibilityResultsCollectionInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationEligibilityResultsInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationEligibilityResultsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationEligibilityResultsErrorInfo", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.EventCollection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.EventInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.EventProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.EventProviderSpecificDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.EventSpecificDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HealthError", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InnerHealthError", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.FabricCollection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.FabricInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.FabricProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.EncryptionDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.FabricSpecificDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.FabricCreationInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.FabricCreationInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.FabricSpecificCreationInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.FailoverProcessServerRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.FailoverProcessServerRequestProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RenewCertificateInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RenewCertificateInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.LogicalNetworkCollection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.LogicalNetworkInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.LogicalNetworkProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.NetworkCollection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.NetworkInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.NetworkProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.Subnet", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.NetworkMappingCollection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.NetworkMappingInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.NetworkMappingProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.NetworkMappingFabricSpecificSettings", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateNetworkMappingInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateNetworkMappingInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.FabricSpecificCreateNetworkMappingInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateNetworkMappingInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateNetworkMappingInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.FabricSpecificUpdateNetworkMappingInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainerCollection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ProtectionContainerInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainerProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainerFabricSpecificDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionContainerInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionContainerInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProviderSpecificContainerCreationInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DiscoverProtectableItemRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DiscoverProtectableItemRequestProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationItemCollection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.MigrationItemInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationItemProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CurrentJobDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CriticalJobHistoryDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationProviderSpecificSettings", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.EnableMigrationInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.EnableMigrationInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.EnableMigrationProviderSpecificInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateMigrationItemInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateMigrationItemInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateMigrationItemProviderSpecificInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrateInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrateInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrateProviderSpecificInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationRecoveryPointCollection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.MigrationRecoveryPointInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationRecoveryPointProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.PauseReplicationInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.PauseReplicationInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ResumeReplicationInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ResumeReplicationInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ResumeReplicationProviderSpecificInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ResyncInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ResyncInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ResyncProviderSpecificInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateProviderSpecificInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateCleanupInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateCleanupInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectableItemCollection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ProtectableItemInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectableItemProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ConfigurationSettings", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectedItemCollection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationProtectedItemInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectedItemProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CurrentScenarioDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProviderSpecificSettings", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.EnableProtectionInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.EnableProtectionInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.EnableProtectionProviderSpecificInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateReplicationProtectedItemInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateReplicationProtectedItemInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMNicInputDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.IpConfigInputDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateReplicationProtectedItemProviderInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AddDisksInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AddDisksInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AddDisksProviderSpecificInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ApplyRecoveryPointInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ApplyRecoveryPointInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ApplyRecoveryPointProviderSpecificInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.PlannedFailoverInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.PlannedFailoverInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.PlannedFailoverProviderSpecificFailoverInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPointCollection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.RecoveryPointInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPointProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ProviderSpecificRecoveryPointDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DisableProtectionInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DisableProtectionInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DisableProtectionProviderSpecificInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveDisksInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveDisksInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveDisksProviderSpecificInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReverseReplicationInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReverseReplicationInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReverseReplicationProviderSpecificInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ResolveHealthInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ResolveHealthInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ResolveHealthError", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProviderInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProviderInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProviderSpecificInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.TargetComputeSizeCollection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.TargetComputeSizeInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.TargetComputeSizeProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ComputeSizeErrorDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverProviderSpecificInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverCleanupInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverCleanupInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UnplannedFailoverInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UnplannedFailoverInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UnplannedFailoverProviderSpecificInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateApplianceForReplicationProtectedItemInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateApplianceForReplicationProtectedItemInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateReplicationProtectedItemProviderSpecificInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateMobilityServiceRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateMobilityServiceRequestProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainerMappingCollection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ProtectionContainerMappingInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainerMappingProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainerMappingProviderSpecificDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionContainerMappingInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionContainerMappingInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProviderSpecificContainerMappingInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateProtectionContainerMappingInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateProtectionContainerMappingInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProviderSpecificUpdateContainerMappingInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveProtectionContainerMappingInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveProtectionContainerMappingInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProviderContainerUnmappingInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProtectionInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProtectionInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProtectionProviderSpecificInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryServicesProviderCollection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.RecoveryServicesProviderInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryServicesProviderProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.IdentityProviderDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VersionDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AddRecoveryServicesProviderInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AddRecoveryServicesProviderInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.IdentityProviderInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageClassificationCollection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.StorageClassificationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageClassificationProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageClassificationMappingCollection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.StorageClassificationMappingInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageClassificationMappingProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageClassificationMappingInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageMappingInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VCenterCollection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.VCenterInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VCenterProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AddVCenterRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AddVCenterRequestProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateVCenterRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateVCenterRequestProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.JobCollection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.JobInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.JobProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AsrTask", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.TaskTypeDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.GroupTaskDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.JobErrorDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ServiceError", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ProviderError", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.JobDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ResumeJobParams", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ResumeJobParamsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.JobQueryParameter", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.PolicyCollection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.PolicyInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.PolicyProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.PolicyProviderSpecificDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CreatePolicyInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CreatePolicyInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.PolicyProviderSpecificInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdatePolicyInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdatePolicyInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectionIntentCollection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationProtectionIntentInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectionIntentProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectionIntentProviderSpecificSettings", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionIntentInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionIntentProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionIntentProviderSpecificDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanCollection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.RecoveryPlanInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanGroup", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanProtectedItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanAction", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanActionDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanProviderSpecificDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateRecoveryPlanInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateRecoveryPlanInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanProviderSpecificInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateRecoveryPlanInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateRecoveryPlanInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanPlannedFailoverInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanPlannedFailoverInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanProviderSpecificFailoverInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverCleanupInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverCleanupInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanUnplannedFailoverInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanUnplannedFailoverInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.SupportedOperatingSystemsInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.SupportedOSProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.SupportedOSProperty", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.SupportedOSDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.OSVersionWrapper", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.VaultHealthDetailsInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VaultHealthProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ResourceHealthSummary", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HealthErrorSummary", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VaultSettingCollection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.VaultSettingInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VaultSettingProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VaultSettingCreationInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VaultSettingCreationInputProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AAddDisksInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AVmDiskInputDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AVmManagedDiskInputDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DiskEncryptionInfo", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DiskEncryptionKeyInfo", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.KeyEncryptionKeyInfo", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AApplyRecoveryPointInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AContainerCreationInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AContainerMappingInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ACreateProtectionIntentInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionProfileCustomDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageAccountCustomDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryAvailabilitySetCustomDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryVirtualNetworkCustomDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryProximityPlacementGroupCustomDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AProtectionIntentDiskInputDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AProtectionIntentManagedDiskInputDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryResourceGroupCustomDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ACrossClusterMigrationApplyRecoveryPointInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ACrossClusterMigrationContainerCreationInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ACrossClusterMigrationEnableProtectionInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ACrossClusterMigrationPolicyCreationInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ACrossClusterMigrationReplicationDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AEnableProtectionInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ExtendedLocation", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AEventDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AExtendedLocationDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AFabricSpecificLocationDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2APolicyCreationInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2APolicyDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AProtectedDiskDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AProtectedManagedDiskDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AProtectionContainerMappingDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ARecoveryPointDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ARemoveDisksInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AReplicationDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AUnprotectedDiskDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMNicDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.IpConfigDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AzureToAzureVmSyncedConfigDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InputEndpoint", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AReplicationIntentDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AReprotectInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ASwitchProtectionInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ATestFailoverInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AUnplannedFailoverInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AUpdateContainerMappingInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AUpdateReplicationProtectedItemInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AVmManagedDiskUpdateDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AZoneDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AgentDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AgentDiskDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ApplianceMonitoringDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ApplianceResourceDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DataStoreUtilizationDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AsrJobDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AutomationRunbookTaskDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AzureFabricCreationInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AzureFabricSpecificDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AzureToAzureCreateNetworkMappingInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AzureToAzureNetworkMappingSettings", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AzureToAzureUpdateNetworkMappingInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AzureVmDiskDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ConsistencyCheckTaskDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InconsistentVmDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DataStore", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DiskDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DiskVolumeDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DraDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ExistingProtectionProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ExistingRecoveryAvailabilitySet", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ExistingRecoveryProximityPlacementGroup", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ExistingRecoveryResourceGroup", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ExistingRecoveryVirtualNetwork", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ExistingStorageAccount", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ExportJobDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.FabricReplicationGroupTaskDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.JobTaskDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.JobEntity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.FailoverJobDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.FailoverReplicationProtectedItemDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.GatewayOperationDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVHostDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplica2012EventDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplica2012R2EventDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureApplyRecoveryPointInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureDiskInputDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureEnableProtectionInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureEventDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureFailbackProviderInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureManagedDiskDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzurePlannedFailoverProviderInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzurePolicyDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzurePolicyInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureReplicationDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InitialReplicationDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.OSDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.OSUpgradeSupportedVersions", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureReprotectInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureTestFailoverInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureUnplannedFailoverInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureUpdateReplicationProtectedItemInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateDiskInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaBaseEventDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaBasePolicyDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaBaseReplicationDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaBluePolicyDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaBluePolicyInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaPolicyInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaBlueReplicationDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaPolicyDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaReplicationDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVSiteDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVVirtualMachineDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InlineWorkflowTaskDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAgentDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2ApplyRecoveryPointInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2DiskInputDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2EnableProtectionInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2EventDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2ManagedDiskDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2PolicyDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2PolicyInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2ProtectedDiskDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2RecoveryPointDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2ReplicationDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2SwitchProviderBlockingErrorDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2SwitchProviderDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2ReprotectInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2SwitchProviderInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2TestFailoverInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2UnplannedFailoverInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2UpdateReplicationProtectedItemInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageBasePolicyDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageDisableProtectionProviderSpecificInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageDiskDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageDiskExclusionInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageVolumeExclusionOptions", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageDiskSignatureExclusionOptions", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageEnableProtectionInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageFabricSwitchProviderBlockingErrorDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMagePolicyDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMagePolicyInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageProtectedDiskDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmAgentUpgradeBlockingErrorDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmApplianceDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ProcessServerDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RcmProxyDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.PushInstallerDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationAgentDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReprotectAgentDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MarsAgentDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFabricSwitchProviderBlockingErrorDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmApplianceSpecificDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmApplyRecoveryPointInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmDiscoveredProtectedVmDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmDiskInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmDisksDefaultInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmEnableProtectionInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmEventDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFabricCreationInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFabricSpecificDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFailbackDiscoveredProtectedVmDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFailbackEventDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFailbackMobilityAgentDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFailbackNicDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFailbackPlannedFailoverProviderInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFailbackPolicyCreationInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFailbackPolicyDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFailbackProtectedDiskDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFailbackSyncDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFailbackReplicationDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFailbackReprotectInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmLastAgentUpgradeErrorDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmMobilityAgentDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmNicDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmNicInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmPolicyCreationInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmPolicyDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmProtectedDiskDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmSyncDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmProtectionContainerMappingDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmRecoveryPointDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmReplicationDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmReprotectInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmTestFailoverInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmUnplannedFailoverInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmUpdateApplianceForReplicationProtectedItemInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmUpdateContainerMappingInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmUpdateReplicationProtectedItemInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageReplicationDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.OSDiskDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageReprotectInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageTestFailoverInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageUnplannedFailoverInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.JobStatusEventDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ManualActionTaskDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MasterTargetServer", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RetentionVolume", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MobilityServiceUpdate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.NewProtectionProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.NewRecoveryVirtualNetwork", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ProcessServer", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanA2ADetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanA2AFailoverInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanA2AInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanAutomationRunbookActionDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanGroupTaskDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanHyperVReplicaAzureFailbackInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanHyperVReplicaAzureFailoverInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanInMageAzureV2FailoverInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanInMageFailoverInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanInMageRcmFailbackFailoverInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanInMageRcmFailoverInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanManualActionDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanScriptActionDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanShutdownGroupTaskDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationGroupDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RunAsAccount", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ScriptActionTaskDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProtectionJobDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverJobDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VirtualMachineTaskDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VmmDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VmmToAzureCreateNetworkMappingInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VmmToAzureNetworkMappingSettings", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VmmToAzureUpdateNetworkMappingInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VmmToVmmCreateNetworkMappingInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VmmToVmmNetworkMappingSettings", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VmmToVmmUpdateNetworkMappingInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VmmVirtualMachineDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VmNicUpdatesTaskDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtContainerCreationInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtContainerMappingInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtDiskInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtEnableMigrationInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtSecurityProfileProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtEventDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtMigrateInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtMigrationDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtProtectedDiskDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtNicDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtNicInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtPolicyCreationInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VmwareCbtPolicyDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtProtectionContainerMappingDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtResumeReplicationInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtResyncInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtTestMigrateInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtUpdateDiskInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtUpdateMigrationItemInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareV2FabricCreationInput", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareV2FabricSpecificDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareVirtualMachineDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HealthErrorCustomerResolvability", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrationState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionHealth", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationItemOperation", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationRecoveryPointType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.LicenseType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DisableProtectionReason", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AgentVersionStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ExportJobOutputSerializationType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanGroupType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectedItemOperation", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.PossibleOperationsDirections", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.FailoverDeploymentModel", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.SourceSiteOperations", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HealthErrorCategory", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.Severity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AgentAutoUpdateStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AutomationAccountAuthenticationType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ARecoveryAvailabilityType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AutoProtectionOfDataDisk", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ExtendedLocationType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.SetMultiVmSyncStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPointSyncType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MultiVmGroupCreateOption", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VmEncryptionType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ChurnOptionSelected", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DiskAccountType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.SqlServerLicenseType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.PresenceStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RcmComponentStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AgentUpgradeBlockedReason", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFailbackRecoveryPointType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DiskReplicationProgressHealth", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.VmReplicationProgressHealth", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.ResyncState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.PlannedFailoverStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.EthernetAddressType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MobilityAgentUpgradeState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPointType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ARpRecoveryPointType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.MultiVmSyncPointOption", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanActionLocation", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.DataSyncStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.AlternateLocationRecoveryOption", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureRpRecoveryPointType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageV2RpRecoveryPointType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RpInMageRecoveryPointType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanPointType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.recoveryservicessiterecovery.models.SecurityType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +} ] \ No newline at end of file diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/MigrationRecoveryPointsListByReplicationMigrati.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/MigrationRecoveryPointsListByReplicationMigrati.java new file mode 100644 index 000000000000..b2ac18a15f29 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/MigrationRecoveryPointsListByReplicationMigrati.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.recoveryservicessiterecovery.generated; + +/** + * Samples for MigrationRecoveryPoints ListByReplicationMigrationItems. + */ +public final class MigrationRecoveryPointsListByReplicationMigrati { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /MigrationRecoveryPoints_ListByReplicationMigrationItems.json + */ + /** + * Sample code: Gets the recovery points for a migration item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheRecoveryPointsForAMigrationItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.migrationRecoveryPoints().listByReplicationMigrationItems("migrationvault", "resourcegroup1", + "vmwarefabric1", "vmwareContainer1", "virtualmachine1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPointsListByReplicationProtectedItemsSa.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPointsListByReplicationProtectedItemsSa.java new file mode 100644 index 000000000000..0e2e49f3a295 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPointsListByReplicationProtectedItemsSa.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.recoveryservicessiterecovery.generated; + +/** + * Samples for RecoveryPoints ListByReplicationProtectedItems. + */ +public final class RecoveryPointsListByReplicationProtectedItemsSa { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /RecoveryPoints_ListByReplicationProtectedItems.json + */ + /** + * Sample code: Gets the list of recovery points for a replication protected item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfRecoveryPointsForAReplicationProtectedItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.recoveryPoints().listByReplicationProtectedItems("vault1", "resourceGroupPS1", "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEligibilityResultsOperationGetSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEligibilityResultsOperationGetSamples.java new file mode 100644 index 000000000000..c6905f4d26a1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEligibilityResultsOperationGetSamples.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.recoveryservicessiterecovery.generated; + +/** + * Samples for ReplicationEligibilityResultsOperation Get. + */ +public final class ReplicationEligibilityResultsOperationGetSamples { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationEligibilityResults_Get.json + */ + /** + * Sample code: Gets the validation errors in case the VM is unsuitable for protection. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheValidationErrorsInCaseTheVMIsUnsuitableForProtection( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationEligibilityResultsOperations().getWithResponse("testRg1", "testVm1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEligibilityResultsOperationListSampl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEligibilityResultsOperationListSampl.java new file mode 100644 index 000000000000..80373c255233 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEligibilityResultsOperationListSampl.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.recoveryservicessiterecovery.generated; + +/** + * Samples for ReplicationEligibilityResultsOperation List. + */ +public final class ReplicationEligibilityResultsOperationListSampl { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationEligibilityResults_List.json + */ + /** + * Sample code: Gets the validation errors in case the VM is unsuitable for protection. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheValidationErrorsInCaseTheVMIsUnsuitableForProtection( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationEligibilityResultsOperations().listWithResponse("testRg1", "testVm2", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationLogicalNetworksListByReplicationFabr.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationLogicalNetworksListByReplicationFabr.java new file mode 100644 index 000000000000..7bca9e48acb8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationLogicalNetworksListByReplicationFabr.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.recoveryservicessiterecovery.generated; + +/** + * Samples for ReplicationLogicalNetworks ListByReplicationFabrics. + */ +public final class ReplicationLogicalNetworksListByReplicationFabr { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationLogicalNetworks_ListByReplicationFabrics.json + */ + /** + * Sample code: Gets the list of logical networks under a fabric. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfLogicalNetworksUnderAFabric( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationLogicalNetworks().listByReplicationFabrics("vault1", "resourceGroupPS1", "cloud1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsListByReplicationProte.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsListByReplicationProte.java new file mode 100644 index 000000000000..eeb34dbe9b27 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsListByReplicationProte.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.recoveryservicessiterecovery.generated; + +/** + * Samples for ReplicationMigrationItems ListByReplicationProtectionContainers. + */ +public final class ReplicationMigrationItemsListByReplicationProte { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationMigrationItems_ListByReplicationProtectionContainers.json + */ + /** + * Sample code: Gets the list of migration items in the protection container. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfMigrationItemsInTheProtectionContainer( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationMigrationItems().listByReplicationProtectionContainers("migrationvault", "resourcegroup1", + "vmwarefabric1", "vmwareContainer1", null, null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsPauseReplicationSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsPauseReplicationSamples.java new file mode 100644 index 000000000000..c8ac7e863011 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsPauseReplicationSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PauseReplicationInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PauseReplicationInputProperties; + +/** + * Samples for ReplicationMigrationItems PauseReplication. + */ +public final class ReplicationMigrationItemsPauseReplicationSamples { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationMigrationItems_PauseReplication.json + */ + /** + * Sample code: Pause replication. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void + pauseReplication(com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationMigrationItems() + .pauseReplication("migrationvault", "resourcegroup1", "vmwarefabric1", "vmwareContainer1", + "virtualmachine1", + new PauseReplicationInput() + .withProperties(new PauseReplicationInputProperties().withInstanceType("VMwareCbt")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsResumeReplicationSampl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsResumeReplicationSampl.java new file mode 100644 index 000000000000..27cf3507fa4c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsResumeReplicationSampl.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.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResumeReplicationInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResumeReplicationInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtResumeReplicationInput; + +/** + * Samples for ReplicationMigrationItems ResumeReplication. + */ +public final class ReplicationMigrationItemsResumeReplicationSampl { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationMigrationItems_ResumeReplication.json + */ + /** + * Sample code: Resume replication. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void + resumeReplication(com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationMigrationItems().resumeReplication("migrationvault", "resourcegroup1", "vmwarefabric1", + "vmwareContainer1", "virtualmachine1", + new ResumeReplicationInput() + .withProperties(new ResumeReplicationInputProperties().withProviderSpecificDetails( + new VMwareCbtResumeReplicationInput().withDeleteMigrationResources("false"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsTestMigrateCleanupSamp.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsTestMigrateCleanupSamp.java new file mode 100644 index 000000000000..7ef9ee6cd1ab --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsTestMigrateCleanupSamp.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.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateCleanupInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateCleanupInputProperties; + +/** + * Samples for ReplicationMigrationItems TestMigrateCleanup. + */ +public final class ReplicationMigrationItemsTestMigrateCleanupSamp { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationMigrationItems_TestMigrateCleanup.json + */ + /** + * Sample code: Test migrate cleanup. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void + testMigrateCleanup(com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationMigrationItems().testMigrateCleanup("migrationvault", "resourcegroup1", "vmwarefabric1", + "vmwareContainer1", "virtualmachine1", + new TestMigrateCleanupInput() + .withProperties(new TestMigrateCleanupInputProperties().withComments("Test Failover Cleanup")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsListByReplicationNetw.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsListByReplicationNetw.java new file mode 100644 index 000000000000..9366b61075e4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsListByReplicationNetw.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.recoveryservicessiterecovery.generated; + +/** + * Samples for ReplicationNetworkMappings ListByReplicationNetworks. + */ +public final class ReplicationNetworkMappingsListByReplicationNetw { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationNetworkMappings_ListByReplicationNetworks.json + */ + /** + * Sample code: Gets all the network mappings under a network. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsAllTheNetworkMappingsUnderANetwork( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationNetworkMappings().listByReplicationNetworks("srce2avaultbvtaC27", "srcBvte2a14C27", + "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac", "e2267b5c-2650-49bd-ab3f-d66aae694c06", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworksListByReplicationFabricsSamp.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworksListByReplicationFabricsSamp.java new file mode 100644 index 000000000000..ce76768b4222 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworksListByReplicationFabricsSamp.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.recoveryservicessiterecovery.generated; + +/** + * Samples for ReplicationNetworks ListByReplicationFabrics. + */ +public final class ReplicationNetworksListByReplicationFabricsSamp { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationNetworks_ListByReplicationFabrics.json + */ + /** + * Sample code: Gets the list of networks under a fabric. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfNetworksUnderAFabric( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationNetworks().listByReplicationFabrics("srce2avaultbvtaC27", "srcBvte2a14C27", + "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectableItemsListByReplicationPro.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectableItemsListByReplicationPro.java new file mode 100644 index 000000000000..94a420670541 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectableItemsListByReplicationPro.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.recoveryservicessiterecovery.generated; + +/** + * Samples for ReplicationProtectableItems ListByReplicationProtectionContainers. + */ +public final class ReplicationProtectableItemsListByReplicationPro { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationProtectableItems_ListByReplicationProtectionContainers.json + */ + /** + * Sample code: Gets the list of protectable items. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfProtectableItems( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectableItems().listByReplicationProtectionContainers("vault1", "resourceGroupPS1", + "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", null, null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsApplyRecoveryPointSamp.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsApplyRecoveryPointSamp.java new file mode 100644 index 000000000000..ec3508276026 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsApplyRecoveryPointSamp.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.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ApplyRecoveryPointInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ApplyRecoveryPointInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureApplyRecoveryPointInput; + +/** + * Samples for ReplicationProtectedItems ApplyRecoveryPoint. + */ +public final class ReplicationProtectedItemsApplyRecoveryPointSamp { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationProtectedItems_ApplyRecoveryPoint.json + */ + /** + * Sample code: Change or apply recovery point. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void + changeOrApplyRecoveryPoint(com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectedItems().applyRecoveryPoint("vault1", "resourceGroupPS1", "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", + new ApplyRecoveryPointInput().withProperties(new ApplyRecoveryPointInputProperties().withRecoveryPointId( + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b/recoveryPoints/e4d05fe9-5dfd-47be-b50b-aad306b2802d") + .withProviderSpecificDetails(new HyperVReplicaAzureApplyRecoveryPointInput())), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsFailoverCancelSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsFailoverCancelSamples.java new file mode 100644 index 000000000000..0bcd8a5ce48d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsFailoverCancelSamples.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.recoveryservicessiterecovery.generated; + +/** + * Samples for ReplicationProtectedItems FailoverCancel. + */ +public final class ReplicationProtectedItemsFailoverCancelSamples { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationProtectedItems_FailoverCancel.json + */ + /** + * Sample code: Execute cancel failover. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void + executeCancelFailover(com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectedItems().failoverCancel("vault1", "resourceGroupPS1", "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsFailoverCommitSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsFailoverCommitSamples.java new file mode 100644 index 000000000000..1b24329884fc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsFailoverCommitSamples.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.recoveryservicessiterecovery.generated; + +/** + * Samples for ReplicationProtectedItems FailoverCommit. + */ +public final class ReplicationProtectedItemsFailoverCommitSamples { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationProtectedItems_FailoverCommit.json + */ + /** + * Sample code: Execute commit failover. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void + executeCommitFailover(com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectedItems().failoverCommit("vault1", "resourceGroupPS1", "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsListByReplicationProte.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsListByReplicationProte.java new file mode 100644 index 000000000000..d3d821778e3f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsListByReplicationProte.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.recoveryservicessiterecovery.generated; + +/** + * Samples for ReplicationProtectedItems ListByReplicationProtectionContainers. + */ +public final class ReplicationProtectedItemsListByReplicationProte { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationProtectedItems_ListByReplicationProtectionContainers.json + */ + /** + * Sample code: Gets the list of Replication protected items. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfReplicationProtectedItems( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectedItems().listByReplicationProtectionContainers("vault1", "resourceGroupPS1", + "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsPlannedFailoverSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsPlannedFailoverSamples.java new file mode 100644 index 000000000000..3352864e3eaa --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsPlannedFailoverSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzurePlannedFailoverProviderInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PlannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PlannedFailoverInputProperties; + +/** + * Samples for ReplicationProtectedItems PlannedFailover. + */ +public final class ReplicationProtectedItemsPlannedFailoverSamples { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationProtectedItems_PlannedFailover.json + */ + /** + * Sample code: Execute planned failover. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void + executePlannedFailover(com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectedItems().plannedFailover("vault1", "resourceGroupPS1", "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", + new PlannedFailoverInput() + .withProperties(new PlannedFailoverInputProperties().withFailoverDirection("PrimaryToRecovery") + .withProviderSpecificDetails(new HyperVReplicaAzurePlannedFailoverProviderInput())), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsRepairReplicationSampl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsRepairReplicationSampl.java new file mode 100644 index 000000000000..e0b038b958c3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsRepairReplicationSampl.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.recoveryservicessiterecovery.generated; + +/** + * Samples for ReplicationProtectedItems RepairReplication. + */ +public final class ReplicationProtectedItemsRepairReplicationSampl { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationProtectedItems_RepairReplication.json + */ + /** + * Sample code: Resynchronize or repair replication. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void resynchronizeOrRepairReplication( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectedItems().repairReplication("vault1", "resourceGroupPS1", "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsResolveHealthErrorsSam.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsResolveHealthErrorsSam.java new file mode 100644 index 000000000000..763a0b082d39 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsResolveHealthErrorsSam.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.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResolveHealthError; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResolveHealthInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResolveHealthInputProperties; +import java.util.Arrays; + +/** + * Samples for ReplicationProtectedItems ResolveHealthErrors. + */ +public final class ReplicationProtectedItemsResolveHealthErrorsSam { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationProtectedItems_ResolveHealthErrors.json + */ + /** + * Sample code: Resolve health errors. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void + resolveHealthErrors(com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectedItems().resolveHealthErrors("vault1", "resourceGroupPS1", "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", + new ResolveHealthInput().withProperties(new ResolveHealthInputProperties() + .withHealthErrors(Arrays.asList(new ResolveHealthError().withHealthErrorId("3:8020")))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsSwitchProviderSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsSwitchProviderSamples.java new file mode 100644 index 000000000000..e5f31bac9164 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsSwitchProviderSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2SwitchProviderInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProviderInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProviderInputProperties; + +/** + * Samples for ReplicationProtectedItems SwitchProvider. + */ +public final class ReplicationProtectedItemsSwitchProviderSamples { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationProtectedItems_SwitchProvider.json + */ + /** + * Sample code: Execute switch provider. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void + executeSwitchProvider(com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectedItems().switchProvider("vault1", "resourceGroupPS1", "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", + new SwitchProviderInput().withProperties(new SwitchProviderInputProperties() + .withTargetInstanceType("InMageRcm") + .withProviderSpecificDetails(new InMageAzureV2SwitchProviderInput().withTargetVaultId( + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault2") + .withTargetFabricId( + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud2") + .withTargetApplianceId("5efaa202-e958-435e-8171-706bf735fcc4"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsTestFailoverCleanupSam.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsTestFailoverCleanupSam.java new file mode 100644 index 000000000000..38d7d1c25465 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsTestFailoverCleanupSam.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.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverCleanupInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverCleanupInputProperties; + +/** + * Samples for ReplicationProtectedItems TestFailoverCleanup. + */ +public final class ReplicationProtectedItemsTestFailoverCleanupSam { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationProtectedItems_TestFailoverCleanup.json + */ + /** + * Sample code: Execute test failover cleanup. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void + executeTestFailoverCleanup(com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectedItems().testFailoverCleanup("vault1", "resourceGroupPS1", "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", + new TestFailoverCleanupInput() + .withProperties(new TestFailoverCleanupInputProperties().withComments("Test Failover Cleanup")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUnplannedFailoverSampl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUnplannedFailoverSampl.java new file mode 100644 index 000000000000..26bb538e0472 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUnplannedFailoverSampl.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.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureUnplannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UnplannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UnplannedFailoverInputProperties; + +/** + * Samples for ReplicationProtectedItems UnplannedFailover. + */ +public final class ReplicationProtectedItemsUnplannedFailoverSampl { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationProtectedItems_UnplannedFailover.json + */ + /** + * Sample code: Execute unplanned failover. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void + executeUnplannedFailover(com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectedItems().unplannedFailover("vault1", "resourceGroupPS1", "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", + new UnplannedFailoverInput().withProperties(new UnplannedFailoverInputProperties() + .withFailoverDirection("PrimaryToRecovery").withSourceSiteOperations("NotRequired") + .withProviderSpecificDetails(new HyperVReplicaAzureUnplannedFailoverInput())), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUpdateApplianceSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUpdateApplianceSamples.java new file mode 100644 index 000000000000..29774ec78e10 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUpdateApplianceSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmUpdateApplianceForReplicationProtectedItemInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateApplianceForReplicationProtectedItemInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateApplianceForReplicationProtectedItemInputProperties; + +/** + * Samples for ReplicationProtectedItems UpdateAppliance. + */ +public final class ReplicationProtectedItemsUpdateApplianceSamples { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationProtectedItems_UpdateAppliance.json + */ + /** + * Sample code: Updates appliance for replication protected Item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void updatesApplianceForReplicationProtectedItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectedItems().updateAppliance("Ayan-0106-SA-Vault", "Ayan-0106-SA-RG", + "Ayan-0106-SA-Vaultreplicationfabric", "Ayan-0106-SA-Vaultreplicationcontainer", + "idclab-vcen67_50158124-8857-3e08-0893-2ddf8ebb8c1f", + new UpdateApplianceForReplicationProtectedItemInput() + .withProperties(new UpdateApplianceForReplicationProtectedItemInputProperties() + .withTargetApplianceId("").withProviderSpecificDetails( + new InMageRcmUpdateApplianceForReplicationProtectedItemInput().withRunAsAccountId(""))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUpdateMobilityServiceS.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUpdateMobilityServiceS.java new file mode 100644 index 000000000000..0327ef7dfce6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUpdateMobilityServiceS.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.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateMobilityServiceRequest; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateMobilityServiceRequestProperties; + +/** + * Samples for ReplicationProtectedItems UpdateMobilityService. + */ +public final class ReplicationProtectedItemsUpdateMobilityServiceS { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationProtectedItems_UpdateMobilityService.json + */ + /** + * Sample code: Update the mobility service on a protected item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void updateTheMobilityServiceOnAProtectedItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectedItems().updateMobilityService("WCUSVault", "wcusValidations", "WIN-JKKJ31QI8U2", + "cloud_c6780228-83bd-4f3e-a70e-cb46b7da33a0", "79dd20ab-2b40-11e7-9791-0050568f387e", + new UpdateMobilityServiceRequest() + .withProperties(new UpdateMobilityServiceRequestProperties().withRunAsAccountId("2")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsCreateSam.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsCreateSam.java new file mode 100644 index 000000000000..86f26bdf905b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsCreateSam.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionContainerMappingInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProviderSpecificContainerMappingInput; + +/** + * Samples for ReplicationProtectionContainerMappings Create. + */ +public final class ReplicationProtectionContainerMappingsCreateSam { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationProtectionContainerMappings_Create.json + */ + /** + * Sample code: Create protection container mapping. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void createProtectionContainerMapping( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectionContainerMappings().define("cloud1protectionprofile1") + .withExistingReplicationProtectionContainer("vault1", "resourceGroupPS1", "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179") + .withProperties(new CreateProtectionContainerMappingInputProperties() + .withTargetProtectionContainerId("Microsoft Azure") + .withPolicyId( + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1") + .withProviderSpecificInput(new ReplicationProviderSpecificContainerMappingInput())) + .create(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsDeleteSam.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsDeleteSam.java new file mode 100644 index 000000000000..c4af1d145053 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsDeleteSam.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.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveProtectionContainerMappingInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveProtectionContainerMappingInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProviderContainerUnmappingInput; + +/** + * Samples for ReplicationProtectionContainerMappings Delete. + */ +public final class ReplicationProtectionContainerMappingsDeleteSam { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationProtectionContainerMappings_Delete.json + */ + /** + * Sample code: Remove protection container mapping. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void removeProtectionContainerMapping( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectionContainerMappings().delete("vault1", "resourceGroupPS1", "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "cloud1protectionprofile1", + new RemoveProtectionContainerMappingInput() + .withProperties(new RemoveProtectionContainerMappingInputProperties() + .withProviderSpecificInput(new ReplicationProviderContainerUnmappingInput())), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsGetSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsGetSamples.java new file mode 100644 index 000000000000..58facbe36663 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsGetSamples.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.recoveryservicessiterecovery.generated; + +/** + * Samples for ReplicationProtectionContainerMappings Get. + */ +public final class ReplicationProtectionContainerMappingsGetSamples { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationProtectionContainerMappings_Get.json + */ + /** + * Sample code: Gets a protection container mapping. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsAProtectionContainerMapping( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectionContainerMappings().getWithResponse("vault1", "resourceGroupPS1", "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "cloud1protectionprofile1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsListByRep.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsListByRep.java new file mode 100644 index 000000000000..18d0ba76bb81 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsListByRep.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.recoveryservicessiterecovery.generated; + +/** + * Samples for ReplicationProtectionContainerMappings ListByReplicationProtectionContainers. + */ +public final class ReplicationProtectionContainerMappingsListByRep { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationProtectionContainerMappings_ListByReplicationProtectionContainers.json + */ + /** + * Sample code: Gets the list of protection container mappings for a protection container. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfProtectionContainerMappingsForAProtectionContainer( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectionContainerMappings().listByReplicationProtectionContainers("vault1", + "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsListSampl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsListSampl.java new file mode 100644 index 000000000000..909ffae683ea --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsListSampl.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.recoveryservicessiterecovery.generated; + +/** + * Samples for ReplicationProtectionContainerMappings List. + */ +public final class ReplicationProtectionContainerMappingsListSampl { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationProtectionContainerMappings_List.json + */ + /** + * Sample code: Gets the list of all protection container mappings in a vault. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfAllProtectionContainerMappingsInAVault( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectionContainerMappings().list("vault1", "resourceGroupPS1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsPurgeSamp.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsPurgeSamp.java new file mode 100644 index 000000000000..cc4ec37b70ee --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsPurgeSamp.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.recoveryservicessiterecovery.generated; + +/** + * Samples for ReplicationProtectionContainerMappings Purge. + */ +public final class ReplicationProtectionContainerMappingsPurgeSamp { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationProtectionContainerMappings_Purge.json + */ + /** + * Sample code: Purge protection container mapping. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void purgeProtectionContainerMapping( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectionContainerMappings().purge("vault1", "resourceGroupPS1", "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "cloud1protectionprofile1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsUpdateSam.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsUpdateSam.java new file mode 100644 index 000000000000..00fa3ad52ae2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsUpdateSam.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AUpdateContainerMappingInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.AgentAutoUpdateStatus; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainerMapping; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateProtectionContainerMappingInputProperties; + +/** + * Samples for ReplicationProtectionContainerMappings Update. + */ +public final class ReplicationProtectionContainerMappingsUpdateSam { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationProtectionContainerMappings_Update.json + */ + /** + * Sample code: Update protection container mapping. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void updateProtectionContainerMapping( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + ProtectionContainerMapping resource = manager.replicationProtectionContainerMappings() + .getWithResponse("vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "cloud1protectionprofile1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withProperties(new UpdateProtectionContainerMappingInputProperties() + .withProviderSpecificInput(new A2AUpdateContainerMappingInput() + .withAgentAutoUpdateStatus(AgentAutoUpdateStatus.ENABLED).withAutomationAccountArmId( + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/automationrg1/providers/Microsoft.Automation/automationAccounts/automationaccount1"))) + .apply(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersDiscoverProtecta.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersDiscoverProtecta.java new file mode 100644 index 000000000000..ed71103f1ac0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersDiscoverProtecta.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.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.DiscoverProtectableItemRequest; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.DiscoverProtectableItemRequestProperties; + +/** + * Samples for ReplicationProtectionContainers DiscoverProtectableItem. + */ +public final class ReplicationProtectionContainersDiscoverProtecta { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationProtectionContainers_DiscoverProtectableItem.json + */ + /** + * Sample code: Adds a protectable item to the replication protection container. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void addsAProtectableItemToTheReplicationProtectionContainer( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectionContainers().discoverProtectableItem("MadhaviVault", "MadhaviVRG", "V2A-W2K12-660", + "cloud_7328549c-5c37-4459-a3c2-e35f9ef6893c", + new DiscoverProtectableItemRequest().withProperties(new DiscoverProtectableItemRequestProperties() + .withFriendlyName("Test").withIpAddress("10.150.2.3").withOsType("Windows")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersListByReplicatio.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersListByReplicatio.java new file mode 100644 index 000000000000..508f8c0d70b1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersListByReplicatio.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.recoveryservicessiterecovery.generated; + +/** + * Samples for ReplicationProtectionContainers ListByReplicationFabrics. + */ +public final class ReplicationProtectionContainersListByReplicatio { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationProtectionContainers_ListByReplicationFabrics.json + */ + /** + * Sample code: Gets the list of protection container for a fabric. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfProtectionContainerForAFabric( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectionContainers().listByReplicationFabrics("vault1", "resourceGroupPS1", "cloud1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersSwitchProtection.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersSwitchProtection.java new file mode 100644 index 000000000000..4eb8b13a428f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersSwitchProtection.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.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ASwitchProtectionInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProtectionInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProtectionInputProperties; + +/** + * Samples for ReplicationProtectionContainers SwitchProtection. + */ +public final class ReplicationProtectionContainersSwitchProtection { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationProtectionContainers_SwitchProtection.json + */ + /** + * Sample code: Switches protection from one container to another or one replication provider to another. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void switchesProtectionFromOneContainerToAnotherOrOneReplicationProviderToAnother( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectionContainers().switchProtection("priyanponeboxvault", "priyanprg", + "CentralUSCanSite", "CentralUSCancloud", + new SwitchProtectionInput() + .withProperties(new SwitchProtectionInputProperties().withReplicationProtectedItemName("a2aSwapOsVm") + .withProviderSpecificDetails(new A2ASwitchProtectionInput())), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansPlannedFailoverSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansPlannedFailoverSamples.java new file mode 100644 index 000000000000..2c00c8930351 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansPlannedFailoverSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PossibleOperationsDirections; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanHyperVReplicaAzureFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanPlannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanPlannedFailoverInputProperties; +import java.util.Arrays; + +/** + * Samples for ReplicationRecoveryPlans PlannedFailover. + */ +public final class ReplicationRecoveryPlansPlannedFailoverSamples { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationRecoveryPlans_PlannedFailover.json + */ + /** + * Sample code: Execute planned failover of the recovery plan. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executePlannedFailoverOfTheRecoveryPlan( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationRecoveryPlans().plannedFailover("vault1", "resourceGroupPS1", "RPtest1", + new RecoveryPlanPlannedFailoverInput().withProperties(new RecoveryPlanPlannedFailoverInputProperties() + .withFailoverDirection(PossibleOperationsDirections.PRIMARY_TO_RECOVERY) + .withProviderSpecificDetails(Arrays.asList(new RecoveryPlanHyperVReplicaAzureFailoverInput()))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansTestFailoverCleanupSamp.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansTestFailoverCleanupSamp.java new file mode 100644 index 000000000000..92dcc0ecf6e0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansTestFailoverCleanupSamp.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverCleanupInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverCleanupInputProperties; + +/** + * Samples for ReplicationRecoveryPlans TestFailoverCleanup. + */ +public final class ReplicationRecoveryPlansTestFailoverCleanupSamp { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationRecoveryPlans_TestFailoverCleanup.json + */ + /** + * Sample code: Execute test failover cleanup of the recovery plan. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executeTestFailoverCleanupOfTheRecoveryPlan( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationRecoveryPlans().testFailoverCleanup("vault1", "resourceGroupPS1", "RPtest1", + new RecoveryPlanTestFailoverCleanupInput().withProperties( + new RecoveryPlanTestFailoverCleanupInputProperties().withComments("Test Failover Cleanup")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansUnplannedFailoverSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansUnplannedFailoverSamples.java new file mode 100644 index 000000000000..6b633653a291 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansUnplannedFailoverSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PossibleOperationsDirections; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanHyperVReplicaAzureFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanUnplannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanUnplannedFailoverInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SourceSiteOperations; +import java.util.Arrays; + +/** + * Samples for ReplicationRecoveryPlans UnplannedFailover. + */ +public final class ReplicationRecoveryPlansUnplannedFailoverSamples { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationRecoveryPlans_UnplannedFailover.json + */ + /** + * Sample code: Execute unplanned failover of the recovery plan. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executeUnplannedFailoverOfTheRecoveryPlan( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationRecoveryPlans().unplannedFailover("vault1", "resourceGroupPS1", "RPtest1", + new RecoveryPlanUnplannedFailoverInput().withProperties(new RecoveryPlanUnplannedFailoverInputProperties() + .withFailoverDirection(PossibleOperationsDirections.PRIMARY_TO_RECOVERY) + .withSourceSiteOperations(SourceSiteOperations.REQUIRED) + .withProviderSpecificDetails(Arrays.asList(new RecoveryPlanHyperVReplicaAzureFailoverInput()))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersCreateSampl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersCreateSampl.java new file mode 100644 index 000000000000..441f132e50e3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersCreateSampl.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.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.AddRecoveryServicesProviderInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.IdentityProviderInput; + +/** + * Samples for ReplicationRecoveryServicesProviders Create. + */ +public final class ReplicationRecoveryServicesProvidersCreateSampl { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationRecoveryServicesProviders_Create.json + */ + /** + * Sample code: Adds a recovery services provider. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void addsARecoveryServicesProvider( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationRecoveryServicesProviders().define("vmwareprovider1") + .withExistingReplicationFabric("migrationvault", "resourcegroup1", "vmwarefabric1") + .withProperties(new AddRecoveryServicesProviderInputProperties().withMachineName("vmwareprovider1") + .withAuthenticationIdentityInput( + new IdentityProviderInput().withTenantId("72f988bf-86f1-41af-91ab-2d7cd011db47") + .withApplicationId("f66fce08-c0c6-47a1-beeb-0ede5ea94f90") + .withObjectId("141360b8-5686-4240-a027-5e24e6affeba") + .withAudience("https://microsoft.onmicrosoft.com/cf19e349-644c-4c6a-bcae-9c8f35357874") + .withAadAuthority("https://login.microsoftonline.com")) + .withResourceAccessIdentityInput( + new IdentityProviderInput().withTenantId("72f988bf-86f1-41af-91ab-2d7cd011db47") + .withApplicationId("f66fce08-c0c6-47a1-beeb-0ede5ea94f90") + .withObjectId("141360b8-5686-4240-a027-5e24e6affeba") + .withAudience("https://microsoft.onmicrosoft.com/cf19e349-644c-4c6a-bcae-9c8f35357874") + .withAadAuthority("https://login.microsoftonline.com"))) + .create(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersDeleteSampl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersDeleteSampl.java new file mode 100644 index 000000000000..33f3a703b620 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersDeleteSampl.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +/** + * Samples for ReplicationRecoveryServicesProviders Delete. + */ +public final class ReplicationRecoveryServicesProvidersDeleteSampl { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationRecoveryServicesProviders_Delete.json + */ + /** + * Sample code: Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is + * unsupported. To maintain backward compatibility for released clients the object "deleteRspInput" is used (if the + * object is empty we assume that it is old client and continue the old behavior). + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void + deletesProviderFromFabricNoteDeletingProviderForAnyFabricOtherThanSingleHostIsUnsupportedToMaintainBackwardCompatibilityForReleasedClientsTheObjectDeleteRspInputIsUsedIfTheObjectIsEmptyWeAssumeThatItIsOldClientAndContinueTheOldBehavior( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationRecoveryServicesProviders().delete("vault1", "resourceGroupPS1", "cloud1", + "241641e6-ee7b-4ee4-8141-821fadda43fa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersGetSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersGetSamples.java new file mode 100644 index 000000000000..cc1aada06d5e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersGetSamples.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.recoveryservicessiterecovery.generated; + +/** + * Samples for ReplicationRecoveryServicesProviders Get. + */ +public final class ReplicationRecoveryServicesProvidersGetSamples { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationRecoveryServicesProviders_Get.json + */ + /** + * Sample code: Gets the details of a recovery services provider. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheDetailsOfARecoveryServicesProvider( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationRecoveryServicesProviders().getWithResponse("vault1", "resourceGroupPS1", "cloud1", + "241641e6-ee7b-4ee4-8141-821fadda43fa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersListByRepli.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersListByRepli.java new file mode 100644 index 000000000000..b075a140af16 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersListByRepli.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.recoveryservicessiterecovery.generated; + +/** + * Samples for ReplicationRecoveryServicesProviders ListByReplicationFabrics. + */ +public final class ReplicationRecoveryServicesProvidersListByRepli { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationRecoveryServicesProviders_ListByReplicationFabrics.json + */ + /** + * Sample code: Gets the list of registered recovery services providers for the fabric. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfRegisteredRecoveryServicesProvidersForTheFabric( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationRecoveryServicesProviders().listByReplicationFabrics("vault1", "resourceGroupPS1", "cloud1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersListSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersListSamples.java new file mode 100644 index 000000000000..1f8d2a0c21d9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersListSamples.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.recoveryservicessiterecovery.generated; + +/** + * Samples for ReplicationRecoveryServicesProviders List. + */ +public final class ReplicationRecoveryServicesProvidersListSamples { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationRecoveryServicesProviders_List.json + */ + /** + * Sample code: Gets the list of registered recovery services providers in the vault. This is a view only api. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfRegisteredRecoveryServicesProvidersInTheVaultThisIsAViewOnlyApi( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationRecoveryServicesProviders().list("vault1", "resourceGroupPS1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersPurgeSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersPurgeSamples.java new file mode 100644 index 000000000000..8661210581b0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersPurgeSamples.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.recoveryservicessiterecovery.generated; + +/** + * Samples for ReplicationRecoveryServicesProviders Purge. + */ +public final class ReplicationRecoveryServicesProvidersPurgeSamples { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationRecoveryServicesProviders_Purge.json + */ + /** + * Sample code: Purges recovery service provider from fabric. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void purgesRecoveryServiceProviderFromFabric( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationRecoveryServicesProviders().purge("vault1", "resourceGroupPS1", "cloud1", + "241641e6-ee7b-4ee4-8141-821fadda43fa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersRefreshProv.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersRefreshProv.java new file mode 100644 index 000000000000..b4e81583005c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersRefreshProv.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.recoveryservicessiterecovery.generated; + +/** + * Samples for ReplicationRecoveryServicesProviders RefreshProvider. + */ +public final class ReplicationRecoveryServicesProvidersRefreshProv { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationRecoveryServicesProviders_RefreshProvider.json + */ + /** + * Sample code: Refresh details from the recovery services provider. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void refreshDetailsFromTheRecoveryServicesProvider( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationRecoveryServicesProviders().refreshProvider("vault1", "resourceGroupPS1", "cloud1", + "241641e6-ee7b-4ee4-8141-821fadda43fa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersListByReplicationFabricsSamp.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersListByReplicationFabricsSamp.java new file mode 100644 index 000000000000..0da26d648fa9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersListByReplicationFabricsSamp.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.recoveryservicessiterecovery.generated; + +/** + * Samples for ReplicationvCenters ListByReplicationFabrics. + */ +public final class ReplicationvCentersListByReplicationFabricsSamp { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationvCenters_ListByReplicationFabrics.json + */ + /** + * Sample code: Gets the list of vCenter registered under a fabric. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfVCenterRegisteredUnderAFabric( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationvCenters().listByReplicationFabrics("MadhaviVault", "MadhaviVRG", "MadhaviFabric", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/StorageClassificationMappingsListByReplicationS.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/StorageClassificationMappingsListByReplicationS.java new file mode 100644 index 000000000000..985242c2818f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/StorageClassificationMappingsListByReplicationS.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.recoveryservicessiterecovery.generated; + +/** + * Samples for StorageClassificationMappings ListByReplicationStorageClassifications. + */ +public final class StorageClassificationMappingsListByReplicationS { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationStorageClassificationMappings_ListByReplicationStorageClassifications.json + */ + /** + * Sample code: Gets the list of storage classification mappings objects under a storage. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfStorageClassificationMappingsObjectsUnderAStorage( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.storageClassificationMappings().listByReplicationStorageClassifications("vault1", "resourceGroupPS1", + "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0", "8891569e-aaef-4a46-a4a0-78c14f2d7b09", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/StorageClassificationsListByReplicationFabricsS.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/StorageClassificationsListByReplicationFabricsS.java new file mode 100644 index 000000000000..1196306a3371 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/StorageClassificationsListByReplicationFabricsS.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.recoveryservicessiterecovery.generated; + +/** + * Samples for StorageClassifications ListByReplicationFabrics. + */ +public final class StorageClassificationsListByReplicationFabricsS { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /ReplicationStorageClassifications_ListByReplicationFabrics.json + */ + /** + * Sample code: Gets the list of storage classification objects under a fabric. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfStorageClassificationObjectsUnderAFabric( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.storageClassifications().listByReplicationFabrics("vault1", "resourceGroupPS1", + "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/TargetComputeSizesListByReplicationProtectedIte.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/TargetComputeSizesListByReplicationProtectedIte.java new file mode 100644 index 000000000000..a651d56cee6c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/TargetComputeSizesListByReplicationProtectedIte.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.recoveryservicessiterecovery.generated; + +/** + * Samples for TargetComputeSizes ListByReplicationProtectedItems. + */ +public final class TargetComputeSizesListByReplicationProtectedIte { + /* + * x-ms-original-file: + * specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples + * /TargetComputeSizes_ListByReplicationProtectedItems.json + */ + /** + * Sample code: Gets the list of target compute sizes for the replication protected item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfTargetComputeSizesForTheReplicationProtectedItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.targetComputeSizes().listByReplicationProtectedItems("avraiMgDiskVault", "avraiMgDiskVaultRG", + "asr-a2a-default-centraluseuap", "asr-a2a-default-centraluseuap-container", + "468c912d-b1ab-4ea2-97eb-4b5095155db2", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/A2ACrossClusterMigrationApplyRecoveryPointInputTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/A2ACrossClusterMigrationApplyRecoveryPointInputTests.java new file mode 100644 index 000000000000..85b7b8eaf0d8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/A2ACrossClusterMigrationApplyRecoveryPointInputTests.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ACrossClusterMigrationApplyRecoveryPointInput; + +public final class A2ACrossClusterMigrationApplyRecoveryPointInputTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + A2ACrossClusterMigrationApplyRecoveryPointInput model + = BinaryData.fromString("{\"instanceType\":\"A2ACrossClusterMigration\"}") + .toObject(A2ACrossClusterMigrationApplyRecoveryPointInput.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + A2ACrossClusterMigrationApplyRecoveryPointInput model = new A2ACrossClusterMigrationApplyRecoveryPointInput(); + model = BinaryData.fromObject(model).toObject(A2ACrossClusterMigrationApplyRecoveryPointInput.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/A2ACrossClusterMigrationContainerCreationInputTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/A2ACrossClusterMigrationContainerCreationInputTests.java new file mode 100644 index 000000000000..61eda4fc31b8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/A2ACrossClusterMigrationContainerCreationInputTests.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ACrossClusterMigrationContainerCreationInput; + +public final class A2ACrossClusterMigrationContainerCreationInputTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + A2ACrossClusterMigrationContainerCreationInput model + = BinaryData.fromString("{\"instanceType\":\"A2ACrossClusterMigration\"}") + .toObject(A2ACrossClusterMigrationContainerCreationInput.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + A2ACrossClusterMigrationContainerCreationInput model = new A2ACrossClusterMigrationContainerCreationInput(); + model = BinaryData.fromObject(model).toObject(A2ACrossClusterMigrationContainerCreationInput.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/A2ACrossClusterMigrationEnableProtectionInputTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/A2ACrossClusterMigrationEnableProtectionInputTests.java new file mode 100644 index 000000000000..96b7033609cb --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/A2ACrossClusterMigrationEnableProtectionInputTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ACrossClusterMigrationEnableProtectionInput; +import org.junit.jupiter.api.Assertions; + +public final class A2ACrossClusterMigrationEnableProtectionInputTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + A2ACrossClusterMigrationEnableProtectionInput model = BinaryData.fromString( + "{\"instanceType\":\"A2ACrossClusterMigration\",\"fabricObjectId\":\"lickduoi\",\"recoveryContainerId\":\"amt\"}") + .toObject(A2ACrossClusterMigrationEnableProtectionInput.class); + Assertions.assertEquals("lickduoi", model.fabricObjectId()); + Assertions.assertEquals("amt", model.recoveryContainerId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + A2ACrossClusterMigrationEnableProtectionInput model = new A2ACrossClusterMigrationEnableProtectionInput() + .withFabricObjectId("lickduoi").withRecoveryContainerId("amt"); + model = BinaryData.fromObject(model).toObject(A2ACrossClusterMigrationEnableProtectionInput.class); + Assertions.assertEquals("lickduoi", model.fabricObjectId()); + Assertions.assertEquals("amt", model.recoveryContainerId()); + } +} diff --git a/sdk/workloadssapvirtualinstance/azure-resourcemanager-workloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadssapvirtualinstance/generated/SapApplicationServerInstancesStartInstanceSamples.java b/sdk/workloadssapvirtualinstance/azure-resourcemanager-workloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadssapvirtualinstance/generated/SapApplicationServerInstancesStartInstanceSamples.java new file mode 100644 index 000000000000..097140891ab0 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/azure-resourcemanager-workloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadssapvirtualinstance/generated/SapApplicationServerInstancesStartInstanceSamples.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.workloadssapvirtualinstance.generated; + +import com.azure.resourcemanager.workloadssapvirtualinstance.models.StartRequest; + +/** + * Samples for SapApplicationServerInstances StartInstance. + */ +public final class SapApplicationServerInstancesStartInstanceSamples { + /* + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/ + * examples/sapapplicationinstances/SAPApplicationServerInstances_StartInstance_WithInfraOperations.json + */ + /** + * Sample code: Start Virtual Machine and the SAP Application Server Instance on it. + * + * @param manager Entry point to WorkloadsSapVirtualInstanceManager. + */ + public static void startVirtualMachineAndTheSAPApplicationServerInstanceOnIt( + com.azure.resourcemanager.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceManager manager) { + manager.sapApplicationServerInstances().startInstance("test-rg", "X00", "app01", + new StartRequest().withStartVm(true), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/ + * examples/sapapplicationinstances/SAPApplicationServerInstances_StartInstance.json + */ + /** + * Sample code: Start the SAP Application Server Instance. + * + * @param manager Entry point to WorkloadsSapVirtualInstanceManager. + */ + public static void startTheSAPApplicationServerInstance( + com.azure.resourcemanager.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceManager manager) { + manager.sapApplicationServerInstances().startInstance("test-rg", "X00", "app01", null, + com.azure.core.util.Context.NONE); + } +} From 5333b4f0178a5271ed8603967302bd2976b29d16 Mon Sep 17 00:00:00 2001 From: glenn Date: Thu, 12 Sep 2024 16:38:37 -0400 Subject: [PATCH 101/128] even more deleted files --- ...nContainerMappingInputPropertiesTests.java | 31 ++++++++ ...ionIntentProviderSpecificDetailsTests.java | 23 ++++++ ...zurePlannedFailoverProviderInputTests.java | 34 +++++++++ ...ateReplicationProtectedItemInputTests.java | 73 ++++++++++++++++++ ...eProtectionProviderSpecificInputTests.java | 27 +++++++ ...backDiscoveredProtectedVmDetailsTests.java | 23 ++++++ ...backPlannedFailoverProviderInputTests.java | 28 +++++++ ...ateReplicationProtectedItemInputTests.java | 75 +++++++++++++++++++ ...verProviderSpecificFailoverInputTests.java | 23 ++++++ ...erMappingProviderSpecificDetailsTests.java | 24 ++++++ ...stFailoverCleanupInputPropertiesTests.java | 26 +++++++ ...UnplannedFailoverInputPropertiesTests.java | 36 +++++++++ ...tByReplicationProtectedItemsMockTests.java | 60 +++++++++++++++ ...imityPlacementGroupCustomDetailsTests.java | 23 ++++++ ...nContainerMappingInputPropertiesTests.java | 28 +++++++ ...rtSettingsCreateWithResponseMockTests.java | 64 ++++++++++++++++ ...gicalNetworksGetWithResponseMockTests.java | 60 +++++++++++++++ ...tworkMappingsGetWithResponseMockTests.java | 64 ++++++++++++++++ ...orksListByReplicationFabricsMockTests.java | 63 ++++++++++++++++ 19 files changed, 785 insertions(+) create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/CreateProtectionContainerMappingInputPropertiesTests.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/CreateProtectionIntentProviderSpecificDetailsTests.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/HyperVReplicaAzurePlannedFailoverProviderInputTests.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageAzureV2UpdateReplicationProtectedItemInputTests.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageDisableProtectionProviderSpecificInputTests.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageRcmFailbackDiscoveredProtectedVmDetailsTests.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageRcmFailbackPlannedFailoverProviderInputTests.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageRcmUpdateReplicationProtectedItemInputTests.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/PlannedFailoverProviderSpecificFailoverInputTests.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ProtectionContainerMappingProviderSpecificDetailsTests.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPlanTestFailoverCleanupInputPropertiesTests.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPlanUnplannedFailoverInputPropertiesTests.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPointsListByReplicationProtectedItemsMockTests.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryProximityPlacementGroupCustomDetailsTests.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RemoveProtectionContainerMappingInputPropertiesTests.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationAlertSettingsCreateWithResponseMockTests.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationLogicalNetworksGetWithResponseMockTests.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsGetWithResponseMockTests.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworksListByReplicationFabricsMockTests.java diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/CreateProtectionContainerMappingInputPropertiesTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/CreateProtectionContainerMappingInputPropertiesTests.java new file mode 100644 index 000000000000..fc6302e55e41 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/CreateProtectionContainerMappingInputPropertiesTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionContainerMappingInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProviderSpecificContainerMappingInput; +import org.junit.jupiter.api.Assertions; + +public final class CreateProtectionContainerMappingInputPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CreateProtectionContainerMappingInputProperties model = BinaryData.fromString( + "{\"targetProtectionContainerId\":\"qbmfpjbabwidf\",\"policyId\":\"sspuunnoxyhkx\",\"providerSpecificInput\":{\"instanceType\":\"ReplicationProviderSpecificContainerMappingInput\"}}") + .toObject(CreateProtectionContainerMappingInputProperties.class); + Assertions.assertEquals("qbmfpjbabwidf", model.targetProtectionContainerId()); + Assertions.assertEquals("sspuunnoxyhkx", model.policyId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CreateProtectionContainerMappingInputProperties model = new CreateProtectionContainerMappingInputProperties() + .withTargetProtectionContainerId("qbmfpjbabwidf").withPolicyId("sspuunnoxyhkx") + .withProviderSpecificInput(new ReplicationProviderSpecificContainerMappingInput()); + model = BinaryData.fromObject(model).toObject(CreateProtectionContainerMappingInputProperties.class); + Assertions.assertEquals("qbmfpjbabwidf", model.targetProtectionContainerId()); + Assertions.assertEquals("sspuunnoxyhkx", model.policyId()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/CreateProtectionIntentProviderSpecificDetailsTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/CreateProtectionIntentProviderSpecificDetailsTests.java new file mode 100644 index 000000000000..8f3bbf17f1d9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/CreateProtectionIntentProviderSpecificDetailsTests.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionIntentProviderSpecificDetails; + +public final class CreateProtectionIntentProviderSpecificDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CreateProtectionIntentProviderSpecificDetails model + = BinaryData.fromString("{\"instanceType\":\"CreateProtectionIntentProviderSpecificDetails\"}") + .toObject(CreateProtectionIntentProviderSpecificDetails.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CreateProtectionIntentProviderSpecificDetails model = new CreateProtectionIntentProviderSpecificDetails(); + model = BinaryData.fromObject(model).toObject(CreateProtectionIntentProviderSpecificDetails.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/HyperVReplicaAzurePlannedFailoverProviderInputTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/HyperVReplicaAzurePlannedFailoverProviderInputTests.java new file mode 100644 index 000000000000..a7e1de51cd31 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/HyperVReplicaAzurePlannedFailoverProviderInputTests.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzurePlannedFailoverProviderInput; +import org.junit.jupiter.api.Assertions; + +public final class HyperVReplicaAzurePlannedFailoverProviderInputTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HyperVReplicaAzurePlannedFailoverProviderInput model = BinaryData.fromString( + "{\"instanceType\":\"HyperVReplicaAzure\",\"primaryKekCertificatePfx\":\"fsbw\",\"secondaryKekCertificatePfx\":\"ivbvzi\",\"recoveryPointId\":\"wxgoooxzpra\",\"osUpgradeVersion\":\"s\"}") + .toObject(HyperVReplicaAzurePlannedFailoverProviderInput.class); + Assertions.assertEquals("fsbw", model.primaryKekCertificatePfx()); + Assertions.assertEquals("ivbvzi", model.secondaryKekCertificatePfx()); + Assertions.assertEquals("wxgoooxzpra", model.recoveryPointId()); + Assertions.assertEquals("s", model.osUpgradeVersion()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + HyperVReplicaAzurePlannedFailoverProviderInput model + = new HyperVReplicaAzurePlannedFailoverProviderInput().withPrimaryKekCertificatePfx("fsbw") + .withSecondaryKekCertificatePfx("ivbvzi").withRecoveryPointId("wxgoooxzpra").withOsUpgradeVersion("s"); + model = BinaryData.fromObject(model).toObject(HyperVReplicaAzurePlannedFailoverProviderInput.class); + Assertions.assertEquals("fsbw", model.primaryKekCertificatePfx()); + Assertions.assertEquals("ivbvzi", model.secondaryKekCertificatePfx()); + Assertions.assertEquals("wxgoooxzpra", model.recoveryPointId()); + Assertions.assertEquals("s", model.osUpgradeVersion()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageAzureV2UpdateReplicationProtectedItemInputTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageAzureV2UpdateReplicationProtectedItemInputTests.java new file mode 100644 index 000000000000..4170b0db073c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageAzureV2UpdateReplicationProtectedItemInputTests.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.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2UpdateReplicationProtectedItemInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SqlServerLicenseType; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateDiskInput; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class InMageAzureV2UpdateReplicationProtectedItemInputTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + InMageAzureV2UpdateReplicationProtectedItemInput model = BinaryData.fromString( + "{\"instanceType\":\"InMageAzureV2\",\"recoveryAzureV1ResourceGroupId\":\"llrqmtlpbyxro\",\"recoveryAzureV2ResourceGroupId\":\"uyqyp\",\"useManagedDisks\":\"mnoiicsudy\",\"targetProximityPlacementGroupId\":\"rjjtalxrdsjrho\",\"targetAvailabilityZone\":\"qwgusxxhdo\",\"targetVmTags\":{\"bdmvsby\":\"wyblv\",\"kmkwjfbo\":\"daelqpv\",\"v\":\"loggdusxursu\",\"qrizfwihvaan\":\"xcjkcoqwczsy\"},\"targetManagedDiskTags\":{\"bbaex\":\"nhjrfdmfd\",\"vmuafmc\":\"jfwtgdfkkaui\",\"vpltidajjvy\":\"fedyuep\"},\"targetNicTags\":{\"yelsyasvfnk\":\"cfkumcfjxo\",\"jekrknfd\":\"myg\",\"lcr\":\"ugjqyckgtxkrdt\",\"tcsubmzoo\":\"jdkl\"},\"sqlServerLicenseType\":\"NotSpecified\",\"vmDisks\":[{\"diskId\":\"chkxfpwhdysl\",\"targetDiskName\":\"lglmnnkkwayqsh\"}]}") + .toObject(InMageAzureV2UpdateReplicationProtectedItemInput.class); + Assertions.assertEquals("llrqmtlpbyxro", model.recoveryAzureV1ResourceGroupId()); + Assertions.assertEquals("uyqyp", model.recoveryAzureV2ResourceGroupId()); + Assertions.assertEquals("mnoiicsudy", model.useManagedDisks()); + Assertions.assertEquals("rjjtalxrdsjrho", model.targetProximityPlacementGroupId()); + Assertions.assertEquals("qwgusxxhdo", model.targetAvailabilityZone()); + Assertions.assertEquals("wyblv", model.targetVmTags().get("bdmvsby")); + Assertions.assertEquals("nhjrfdmfd", model.targetManagedDiskTags().get("bbaex")); + Assertions.assertEquals("cfkumcfjxo", model.targetNicTags().get("yelsyasvfnk")); + Assertions.assertEquals(SqlServerLicenseType.NOT_SPECIFIED, model.sqlServerLicenseType()); + Assertions.assertEquals("chkxfpwhdysl", model.vmDisks().get(0).diskId()); + Assertions.assertEquals("lglmnnkkwayqsh", model.vmDisks().get(0).targetDiskName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + InMageAzureV2UpdateReplicationProtectedItemInput model = new InMageAzureV2UpdateReplicationProtectedItemInput() + .withRecoveryAzureV1ResourceGroupId("llrqmtlpbyxro").withRecoveryAzureV2ResourceGroupId("uyqyp") + .withUseManagedDisks("mnoiicsudy").withTargetProximityPlacementGroupId("rjjtalxrdsjrho") + .withTargetAvailabilityZone("qwgusxxhdo") + .withTargetVmTags( + mapOf("bdmvsby", "wyblv", "kmkwjfbo", "daelqpv", "v", "loggdusxursu", "qrizfwihvaan", "xcjkcoqwczsy")) + .withTargetManagedDiskTags(mapOf("bbaex", "nhjrfdmfd", "vmuafmc", "jfwtgdfkkaui", "vpltidajjvy", "fedyuep")) + .withTargetNicTags( + mapOf("yelsyasvfnk", "cfkumcfjxo", "jekrknfd", "myg", "lcr", "ugjqyckgtxkrdt", "tcsubmzoo", "jdkl")) + .withSqlServerLicenseType(SqlServerLicenseType.NOT_SPECIFIED).withVmDisks( + Arrays.asList(new UpdateDiskInput().withDiskId("chkxfpwhdysl").withTargetDiskName("lglmnnkkwayqsh"))); + model = BinaryData.fromObject(model).toObject(InMageAzureV2UpdateReplicationProtectedItemInput.class); + Assertions.assertEquals("llrqmtlpbyxro", model.recoveryAzureV1ResourceGroupId()); + Assertions.assertEquals("uyqyp", model.recoveryAzureV2ResourceGroupId()); + Assertions.assertEquals("mnoiicsudy", model.useManagedDisks()); + Assertions.assertEquals("rjjtalxrdsjrho", model.targetProximityPlacementGroupId()); + Assertions.assertEquals("qwgusxxhdo", model.targetAvailabilityZone()); + Assertions.assertEquals("wyblv", model.targetVmTags().get("bdmvsby")); + Assertions.assertEquals("nhjrfdmfd", model.targetManagedDiskTags().get("bbaex")); + Assertions.assertEquals("cfkumcfjxo", model.targetNicTags().get("yelsyasvfnk")); + Assertions.assertEquals(SqlServerLicenseType.NOT_SPECIFIED, model.sqlServerLicenseType()); + Assertions.assertEquals("chkxfpwhdysl", model.vmDisks().get(0).diskId()); + Assertions.assertEquals("lglmnnkkwayqsh", model.vmDisks().get(0).targetDiskName()); + } + + // 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageDisableProtectionProviderSpecificInputTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageDisableProtectionProviderSpecificInputTests.java new file mode 100644 index 000000000000..1463a5e79fb1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageDisableProtectionProviderSpecificInputTests.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageDisableProtectionProviderSpecificInput; +import org.junit.jupiter.api.Assertions; + +public final class InMageDisableProtectionProviderSpecificInputTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + InMageDisableProtectionProviderSpecificInput model + = BinaryData.fromString("{\"instanceType\":\"InMage\",\"replicaVmDeletionStatus\":\"q\"}") + .toObject(InMageDisableProtectionProviderSpecificInput.class); + Assertions.assertEquals("q", model.replicaVmDeletionStatus()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + InMageDisableProtectionProviderSpecificInput model + = new InMageDisableProtectionProviderSpecificInput().withReplicaVmDeletionStatus("q"); + model = BinaryData.fromObject(model).toObject(InMageDisableProtectionProviderSpecificInput.class); + Assertions.assertEquals("q", model.replicaVmDeletionStatus()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageRcmFailbackDiscoveredProtectedVmDetailsTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageRcmFailbackDiscoveredProtectedVmDetailsTests.java new file mode 100644 index 000000000000..2a2fff902f03 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageRcmFailbackDiscoveredProtectedVmDetailsTests.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFailbackDiscoveredProtectedVmDetails; + +public final class InMageRcmFailbackDiscoveredProtectedVmDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + InMageRcmFailbackDiscoveredProtectedVmDetails model = BinaryData.fromString( + "{\"vCenterId\":\"zkdolrndwdbvxvza\",\"vCenterFqdn\":\"doyqx\",\"datastores\":[\"kft\",\"mcxqqxmyzklao\",\"n\",\"ohrvmz\"],\"ipAddresses\":[\"azad\",\"vznllaslkskhjqj\",\"vbaihxjt\",\"zgtai\"],\"vmwareToolsStatus\":\"b\",\"powerStatus\":\"roigbsfsgsaenwld\",\"vmFqdn\":\"hljqlxsp\",\"osName\":\"jc\",\"createdTimestamp\":\"2021-06-14T00:46:05Z\",\"updatedTimestamp\":\"2021-03-22T03:50:23Z\",\"isDeleted\":true,\"lastDiscoveryTimeInUtc\":\"2021-08-20T07:36Z\"}") + .toObject(InMageRcmFailbackDiscoveredProtectedVmDetails.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + InMageRcmFailbackDiscoveredProtectedVmDetails model = new InMageRcmFailbackDiscoveredProtectedVmDetails(); + model = BinaryData.fromObject(model).toObject(InMageRcmFailbackDiscoveredProtectedVmDetails.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageRcmFailbackPlannedFailoverProviderInputTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageRcmFailbackPlannedFailoverProviderInputTests.java new file mode 100644 index 000000000000..1114198d4bbc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageRcmFailbackPlannedFailoverProviderInputTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFailbackPlannedFailoverProviderInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmFailbackRecoveryPointType; +import org.junit.jupiter.api.Assertions; + +public final class InMageRcmFailbackPlannedFailoverProviderInputTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + InMageRcmFailbackPlannedFailoverProviderInput model = BinaryData + .fromString("{\"instanceType\":\"InMageRcmFailback\",\"recoveryPointType\":\"CrashConsistent\"}") + .toObject(InMageRcmFailbackPlannedFailoverProviderInput.class); + Assertions.assertEquals(InMageRcmFailbackRecoveryPointType.CRASH_CONSISTENT, model.recoveryPointType()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + InMageRcmFailbackPlannedFailoverProviderInput model = new InMageRcmFailbackPlannedFailoverProviderInput() + .withRecoveryPointType(InMageRcmFailbackRecoveryPointType.CRASH_CONSISTENT); + model = BinaryData.fromObject(model).toObject(InMageRcmFailbackPlannedFailoverProviderInput.class); + Assertions.assertEquals(InMageRcmFailbackRecoveryPointType.CRASH_CONSISTENT, model.recoveryPointType()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageRcmUpdateReplicationProtectedItemInputTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageRcmUpdateReplicationProtectedItemInputTests.java new file mode 100644 index 000000000000..eb87c97e577a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/InMageRcmUpdateReplicationProtectedItemInputTests.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmNicInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmUpdateReplicationProtectedItemInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.LicenseType; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class InMageRcmUpdateReplicationProtectedItemInputTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + InMageRcmUpdateReplicationProtectedItemInput model = BinaryData.fromString( + "{\"instanceType\":\"InMageRcm\",\"targetVmName\":\"tuxy\",\"targetVmSize\":\"hfcaeo\",\"targetResourceGroupId\":\"fqd\",\"targetAvailabilitySetId\":\"jflobhahqmomf\",\"targetAvailabilityZone\":\"o\",\"targetProximityPlacementGroupId\":\"fr\",\"targetBootDiagnosticsStorageAccountId\":\"gbmxldjmz\",\"targetNetworkId\":\"bjesylslur\",\"testNetworkId\":\"fygpnyhgd\",\"vmNics\":[{\"nicId\":\"sc\",\"isPrimaryNic\":\"gqyvouprsytqzss\",\"isSelectedForFailover\":\"mgw\",\"targetSubnetName\":\"ivrxpfduiol\",\"targetStaticIPAddress\":\"yqvpbfjpo\",\"testSubnetName\":\"ucfzluczdquu\",\"testStaticIPAddress\":\"ormvh\"},{\"nicId\":\"zielbprnq\",\"isPrimaryNic\":\"jywzcqyg\",\"isSelectedForFailover\":\"nwsvhbngqiwye\",\"targetSubnetName\":\"ob\",\"targetStaticIPAddress\":\"rpnrehkunsbfjh\",\"testSubnetName\":\"w\",\"testStaticIPAddress\":\"kvegeattbzkgtzq\"}],\"licenseType\":\"NoLicenseType\"}") + .toObject(InMageRcmUpdateReplicationProtectedItemInput.class); + Assertions.assertEquals("tuxy", model.targetVmName()); + Assertions.assertEquals("hfcaeo", model.targetVmSize()); + Assertions.assertEquals("fqd", model.targetResourceGroupId()); + Assertions.assertEquals("jflobhahqmomf", model.targetAvailabilitySetId()); + Assertions.assertEquals("o", model.targetAvailabilityZone()); + Assertions.assertEquals("fr", model.targetProximityPlacementGroupId()); + Assertions.assertEquals("gbmxldjmz", model.targetBootDiagnosticsStorageAccountId()); + Assertions.assertEquals("bjesylslur", model.targetNetworkId()); + Assertions.assertEquals("fygpnyhgd", model.testNetworkId()); + Assertions.assertEquals("sc", model.vmNics().get(0).nicId()); + Assertions.assertEquals("gqyvouprsytqzss", model.vmNics().get(0).isPrimaryNic()); + Assertions.assertEquals("mgw", model.vmNics().get(0).isSelectedForFailover()); + Assertions.assertEquals("ivrxpfduiol", model.vmNics().get(0).targetSubnetName()); + Assertions.assertEquals("yqvpbfjpo", model.vmNics().get(0).targetStaticIpAddress()); + Assertions.assertEquals("ucfzluczdquu", model.vmNics().get(0).testSubnetName()); + Assertions.assertEquals("ormvh", model.vmNics().get(0).testStaticIpAddress()); + Assertions.assertEquals(LicenseType.NO_LICENSE_TYPE, model.licenseType()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + InMageRcmUpdateReplicationProtectedItemInput model = new InMageRcmUpdateReplicationProtectedItemInput() + .withTargetVmName("tuxy").withTargetVmSize("hfcaeo").withTargetResourceGroupId("fqd") + .withTargetAvailabilitySetId("jflobhahqmomf").withTargetAvailabilityZone("o") + .withTargetProximityPlacementGroupId("fr").withTargetBootDiagnosticsStorageAccountId("gbmxldjmz") + .withTargetNetworkId("bjesylslur").withTestNetworkId("fygpnyhgd") + .withVmNics(Arrays.asList( + new InMageRcmNicInput().withNicId("sc").withIsPrimaryNic("gqyvouprsytqzss") + .withIsSelectedForFailover("mgw").withTargetSubnetName("ivrxpfduiol") + .withTargetStaticIpAddress("yqvpbfjpo").withTestSubnetName("ucfzluczdquu") + .withTestStaticIpAddress("ormvh"), + new InMageRcmNicInput().withNicId("zielbprnq").withIsPrimaryNic("jywzcqyg") + .withIsSelectedForFailover("nwsvhbngqiwye").withTargetSubnetName("ob") + .withTargetStaticIpAddress("rpnrehkunsbfjh").withTestSubnetName("w") + .withTestStaticIpAddress("kvegeattbzkgtzq"))) + .withLicenseType(LicenseType.NO_LICENSE_TYPE); + model = BinaryData.fromObject(model).toObject(InMageRcmUpdateReplicationProtectedItemInput.class); + Assertions.assertEquals("tuxy", model.targetVmName()); + Assertions.assertEquals("hfcaeo", model.targetVmSize()); + Assertions.assertEquals("fqd", model.targetResourceGroupId()); + Assertions.assertEquals("jflobhahqmomf", model.targetAvailabilitySetId()); + Assertions.assertEquals("o", model.targetAvailabilityZone()); + Assertions.assertEquals("fr", model.targetProximityPlacementGroupId()); + Assertions.assertEquals("gbmxldjmz", model.targetBootDiagnosticsStorageAccountId()); + Assertions.assertEquals("bjesylslur", model.targetNetworkId()); + Assertions.assertEquals("fygpnyhgd", model.testNetworkId()); + Assertions.assertEquals("sc", model.vmNics().get(0).nicId()); + Assertions.assertEquals("gqyvouprsytqzss", model.vmNics().get(0).isPrimaryNic()); + Assertions.assertEquals("mgw", model.vmNics().get(0).isSelectedForFailover()); + Assertions.assertEquals("ivrxpfduiol", model.vmNics().get(0).targetSubnetName()); + Assertions.assertEquals("yqvpbfjpo", model.vmNics().get(0).targetStaticIpAddress()); + Assertions.assertEquals("ucfzluczdquu", model.vmNics().get(0).testSubnetName()); + Assertions.assertEquals("ormvh", model.vmNics().get(0).testStaticIpAddress()); + Assertions.assertEquals(LicenseType.NO_LICENSE_TYPE, model.licenseType()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/PlannedFailoverProviderSpecificFailoverInputTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/PlannedFailoverProviderSpecificFailoverInputTests.java new file mode 100644 index 000000000000..ce88dc844299 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/PlannedFailoverProviderSpecificFailoverInputTests.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PlannedFailoverProviderSpecificFailoverInput; + +public final class PlannedFailoverProviderSpecificFailoverInputTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PlannedFailoverProviderSpecificFailoverInput model + = BinaryData.fromString("{\"instanceType\":\"PlannedFailoverProviderSpecificFailoverInput\"}") + .toObject(PlannedFailoverProviderSpecificFailoverInput.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PlannedFailoverProviderSpecificFailoverInput model = new PlannedFailoverProviderSpecificFailoverInput(); + model = BinaryData.fromObject(model).toObject(PlannedFailoverProviderSpecificFailoverInput.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ProtectionContainerMappingProviderSpecificDetailsTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ProtectionContainerMappingProviderSpecificDetailsTests.java new file mode 100644 index 000000000000..182e475e00df --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ProtectionContainerMappingProviderSpecificDetailsTests.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainerMappingProviderSpecificDetails; + +public final class ProtectionContainerMappingProviderSpecificDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ProtectionContainerMappingProviderSpecificDetails model + = BinaryData.fromString("{\"instanceType\":\"ProtectionContainerMappingProviderSpecificDetails\"}") + .toObject(ProtectionContainerMappingProviderSpecificDetails.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ProtectionContainerMappingProviderSpecificDetails model + = new ProtectionContainerMappingProviderSpecificDetails(); + model = BinaryData.fromObject(model).toObject(ProtectionContainerMappingProviderSpecificDetails.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPlanTestFailoverCleanupInputPropertiesTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPlanTestFailoverCleanupInputPropertiesTests.java new file mode 100644 index 000000000000..3efd91189356 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPlanTestFailoverCleanupInputPropertiesTests.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverCleanupInputProperties; +import org.junit.jupiter.api.Assertions; + +public final class RecoveryPlanTestFailoverCleanupInputPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RecoveryPlanTestFailoverCleanupInputProperties model = BinaryData.fromString("{\"comments\":\"d\"}") + .toObject(RecoveryPlanTestFailoverCleanupInputProperties.class); + Assertions.assertEquals("d", model.comments()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RecoveryPlanTestFailoverCleanupInputProperties model + = new RecoveryPlanTestFailoverCleanupInputProperties().withComments("d"); + model = BinaryData.fromObject(model).toObject(RecoveryPlanTestFailoverCleanupInputProperties.class); + Assertions.assertEquals("d", model.comments()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPlanUnplannedFailoverInputPropertiesTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPlanUnplannedFailoverInputPropertiesTests.java new file mode 100644 index 000000000000..33cd2774a55c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPlanUnplannedFailoverInputPropertiesTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PossibleOperationsDirections; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanProviderSpecificFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanUnplannedFailoverInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SourceSiteOperations; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class RecoveryPlanUnplannedFailoverInputPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RecoveryPlanUnplannedFailoverInputProperties model = BinaryData.fromString( + "{\"failoverDirection\":\"RecoveryToPrimary\",\"sourceSiteOperations\":\"NotRequired\",\"providerSpecificDetails\":[{\"instanceType\":\"RecoveryPlanProviderSpecificFailoverInput\"},{\"instanceType\":\"RecoveryPlanProviderSpecificFailoverInput\"},{\"instanceType\":\"RecoveryPlanProviderSpecificFailoverInput\"}]}") + .toObject(RecoveryPlanUnplannedFailoverInputProperties.class); + Assertions.assertEquals(PossibleOperationsDirections.RECOVERY_TO_PRIMARY, model.failoverDirection()); + Assertions.assertEquals(SourceSiteOperations.NOT_REQUIRED, model.sourceSiteOperations()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RecoveryPlanUnplannedFailoverInputProperties model = new RecoveryPlanUnplannedFailoverInputProperties() + .withFailoverDirection(PossibleOperationsDirections.RECOVERY_TO_PRIMARY) + .withSourceSiteOperations(SourceSiteOperations.NOT_REQUIRED) + .withProviderSpecificDetails(Arrays.asList(new RecoveryPlanProviderSpecificFailoverInput(), + new RecoveryPlanProviderSpecificFailoverInput(), new RecoveryPlanProviderSpecificFailoverInput())); + model = BinaryData.fromObject(model).toObject(RecoveryPlanUnplannedFailoverInputProperties.class); + Assertions.assertEquals(PossibleOperationsDirections.RECOVERY_TO_PRIMARY, model.failoverDirection()); + Assertions.assertEquals(SourceSiteOperations.NOT_REQUIRED, model.sourceSiteOperations()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPointsListByReplicationProtectedItemsMockTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPointsListByReplicationProtectedItemsMockTests.java new file mode 100644 index 000000000000..67bffbfbff86 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPointsListByReplicationProtectedItemsMockTests.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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.SiteRecoveryManager; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPoint; +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 RecoveryPointsListByReplicationProtectedItemsMockTests { + @Test + public void testListByReplicationProtectedItems() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr + = "{\"value\":[{\"properties\":{\"recoveryPointTime\":\"2021-08-10T18:08:27Z\",\"recoveryPointType\":\"utyjukkedputocr\",\"providerSpecificDetails\":{\"instanceType\":\"ProviderSpecificRecoveryPointDetails\"}},\"location\":\"qicmdrgcuzjmvk\",\"id\":\"wrjcqhgcmljzk\",\"name\":\"qimybqjvfio\",\"type\":\"hcaqpv\"}]}"; + + 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); + })); + + SiteRecoveryManager manager = SiteRecoveryManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = manager.recoveryPoints().listByReplicationProtectedItems("ehdhjofywwna", + "oxlorxgsl", "c", "u", "hvpaglyyhrgma", com.azure.core.util.Context.NONE); + + Assertions.assertEquals(OffsetDateTime.parse("2021-08-10T18:08:27Z"), + response.iterator().next().properties().recoveryPointTime()); + Assertions.assertEquals("utyjukkedputocr", response.iterator().next().properties().recoveryPointType()); + Assertions.assertEquals("qicmdrgcuzjmvk", response.iterator().next().location()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryProximityPlacementGroupCustomDetailsTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryProximityPlacementGroupCustomDetailsTests.java new file mode 100644 index 000000000000..4dcc3d7ca9be --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryProximityPlacementGroupCustomDetailsTests.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryProximityPlacementGroupCustomDetails; + +public final class RecoveryProximityPlacementGroupCustomDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RecoveryProximityPlacementGroupCustomDetails model + = BinaryData.fromString("{\"resourceType\":\"RecoveryProximityPlacementGroupCustomDetails\"}") + .toObject(RecoveryProximityPlacementGroupCustomDetails.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RecoveryProximityPlacementGroupCustomDetails model = new RecoveryProximityPlacementGroupCustomDetails(); + model = BinaryData.fromObject(model).toObject(RecoveryProximityPlacementGroupCustomDetails.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RemoveProtectionContainerMappingInputPropertiesTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RemoveProtectionContainerMappingInputPropertiesTests.java new file mode 100644 index 000000000000..fd032ad6019e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RemoveProtectionContainerMappingInputPropertiesTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveProtectionContainerMappingInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProviderContainerUnmappingInput; +import org.junit.jupiter.api.Assertions; + +public final class RemoveProtectionContainerMappingInputPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RemoveProtectionContainerMappingInputProperties model + = BinaryData.fromString("{\"providerSpecificInput\":{\"instanceType\":\"dao\"}}") + .toObject(RemoveProtectionContainerMappingInputProperties.class); + Assertions.assertEquals("dao", model.providerSpecificInput().instanceType()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RemoveProtectionContainerMappingInputProperties model = new RemoveProtectionContainerMappingInputProperties() + .withProviderSpecificInput(new ReplicationProviderContainerUnmappingInput().withInstanceType("dao")); + model = BinaryData.fromObject(model).toObject(RemoveProtectionContainerMappingInputProperties.class); + Assertions.assertEquals("dao", model.providerSpecificInput().instanceType()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationAlertSettingsCreateWithResponseMockTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationAlertSettingsCreateWithResponseMockTests.java new file mode 100644 index 000000000000..594712c0301a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationAlertSettingsCreateWithResponseMockTests.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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.SiteRecoveryManager; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.Alert; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ConfigureAlertRequestProperties; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class ReplicationAlertSettingsCreateWithResponseMockTests { + @Test + public void testCreateWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr + = "{\"properties\":{\"sendToOwners\":\"xbvkvwzdmvdd\",\"customEmailAddresses\":[\"rugyozzzawnjdv\"],\"locale\":\"rho\"},\"location\":\"kkvxu\",\"id\":\"dqzbvbpsuvqhx\",\"name\":\"ozf\",\"type\":\"dkwbkurklpiig\"}"; + + 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); + })); + + SiteRecoveryManager manager = SiteRecoveryManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + Alert response + = manager.replicationAlertSettings().define("derjennmk").withExistingVault("ustihtgrafjajvky", "mmjczvog") + .withProperties(new ConfigureAlertRequestProperties().withSendToOwners("uwqdwxhhlbmyphf") + .withCustomEmailAddresses(Arrays.asList("pdhewokyqs", "kx", "sy")).withLocale("ihqbtod")) + .create(); + + Assertions.assertEquals("xbvkvwzdmvdd", response.properties().sendToOwners()); + Assertions.assertEquals("rugyozzzawnjdv", response.properties().customEmailAddresses().get(0)); + Assertions.assertEquals("rho", response.properties().locale()); + Assertions.assertEquals("kkvxu", response.location()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationLogicalNetworksGetWithResponseMockTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationLogicalNetworksGetWithResponseMockTests.java new file mode 100644 index 000000000000..5ec2e7da5312 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationLogicalNetworksGetWithResponseMockTests.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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.SiteRecoveryManager; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.LogicalNetwork; +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 ReplicationLogicalNetworksGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr + = "{\"properties\":{\"friendlyName\":\"xwvegenlrj\",\"networkVirtualizationStatus\":\"mwevguyflnxel\",\"logicalNetworkUsage\":\"kfzcdetowwezhy\",\"logicalNetworkDefinitionsStatus\":\"di\"},\"location\":\"wqlqacs\",\"id\":\"qb\",\"name\":\"rtybcel\",\"type\":\"jnxodnjyhzfax\"}"; + + 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); + })); + + SiteRecoveryManager manager = SiteRecoveryManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + LogicalNetwork response = manager.replicationLogicalNetworks() + .getWithResponse("kwwnq", "qlq", "pwxtvc", "bav", com.azure.core.util.Context.NONE).getValue(); + + Assertions.assertEquals("xwvegenlrj", response.properties().friendlyName()); + Assertions.assertEquals("mwevguyflnxel", response.properties().networkVirtualizationStatus()); + Assertions.assertEquals("kfzcdetowwezhy", response.properties().logicalNetworkUsage()); + Assertions.assertEquals("di", response.properties().logicalNetworkDefinitionsStatus()); + Assertions.assertEquals("wqlqacs", response.location()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsGetWithResponseMockTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsGetWithResponseMockTests.java new file mode 100644 index 000000000000..16d287c86cf0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsGetWithResponseMockTests.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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.SiteRecoveryManager; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.NetworkMapping; +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 ReplicationNetworkMappingsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr + = "{\"properties\":{\"state\":\"ciagvkdlhu\",\"primaryNetworkFriendlyName\":\"klbjoafmjfe\",\"primaryNetworkId\":\"lvoepknarse\",\"primaryFabricFriendlyName\":\"ncsqoacbuqd\",\"recoveryNetworkFriendlyName\":\"apleq\",\"recoveryNetworkId\":\"kxen\",\"recoveryFabricArmId\":\"z\",\"recoveryFabricFriendlyName\":\"vya\",\"fabricSpecificSettings\":{\"instanceType\":\"NetworkMappingFabricSpecificSettings\"}},\"location\":\"z\",\"id\":\"uuvu\",\"name\":\"aqcwggchxvlqgf\",\"type\":\"rvecica\"}"; + + 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); + })); + + SiteRecoveryManager manager = SiteRecoveryManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + NetworkMapping response = manager.replicationNetworkMappings().getWithResponse("jbvyezjwjkqo", "bwh", + "ieyozvrcwfpucwnb", "gqefgzjvbxqcb", "oarx", com.azure.core.util.Context.NONE).getValue(); + + Assertions.assertEquals("ciagvkdlhu", response.properties().state()); + Assertions.assertEquals("klbjoafmjfe", response.properties().primaryNetworkFriendlyName()); + Assertions.assertEquals("lvoepknarse", response.properties().primaryNetworkId()); + Assertions.assertEquals("ncsqoacbuqd", response.properties().primaryFabricFriendlyName()); + Assertions.assertEquals("apleq", response.properties().recoveryNetworkFriendlyName()); + Assertions.assertEquals("kxen", response.properties().recoveryNetworkId()); + Assertions.assertEquals("z", response.properties().recoveryFabricArmId()); + Assertions.assertEquals("vya", response.properties().recoveryFabricFriendlyName()); + Assertions.assertEquals("z", response.location()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworksListByReplicationFabricsMockTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworksListByReplicationFabricsMockTests.java new file mode 100644 index 000000000000..b42d062978f5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworksListByReplicationFabricsMockTests.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.SiteRecoveryManager; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.Network; +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 ReplicationNetworksListByReplicationFabricsMockTests { + @Test + public void testListByReplicationFabrics() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr + = "{\"value\":[{\"properties\":{\"fabricType\":\"sorch\",\"subnets\":[{\"name\":\"o\",\"friendlyName\":\"yhl\",\"addressList\":[\"vhs\",\"b\",\"pwxslaj\"]},{\"name\":\"fzga\",\"friendlyName\":\"hawkmibuydwi\",\"addressList\":[\"icupdyt\",\"qmiuvjpl\"]},{\"name\":\"ebmhhtuq\",\"friendlyName\":\"xynof\",\"addressList\":[\"bfix\",\"gxebihexhnk\",\"ng\"]},{\"name\":\"cdolrpgupsjlbsmn\",\"friendlyName\":\"fbncuyje\",\"addressList\":[\"nhpplzhcfzxjzi\",\"ucrln\",\"wnuwkkfzzetl\",\"hdyxz\"]}],\"friendlyName\":\"wywjvrlgqpwwlzp\",\"networkType\":\"arcbcdwhslxebaja\"},\"location\":\"n\",\"id\":\"stbdoprwkampyh\",\"name\":\"pbldz\",\"type\":\"iudrcycmwhuzym\"}]}"; + + 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); + })); + + SiteRecoveryManager manager = SiteRecoveryManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = manager.replicationNetworks().listByReplicationFabrics("kdv", "el", "modpe", + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("sorch", response.iterator().next().properties().fabricType()); + Assertions.assertEquals("o", response.iterator().next().properties().subnets().get(0).name()); + Assertions.assertEquals("yhl", response.iterator().next().properties().subnets().get(0).friendlyName()); + Assertions.assertEquals("vhs", response.iterator().next().properties().subnets().get(0).addressList().get(0)); + Assertions.assertEquals("wywjvrlgqpwwlzp", response.iterator().next().properties().friendlyName()); + Assertions.assertEquals("arcbcdwhslxebaja", response.iterator().next().properties().networkType()); + Assertions.assertEquals("n", response.iterator().next().location()); + } +} From 300047d5223f2db7a8647f06e81c356fb8592152 Mon Sep 17 00:00:00 2001 From: glenn Date: Thu, 12 Sep 2024 16:42:25 -0400 Subject: [PATCH 102/128] pull in openai changes from main --- .../implementation/OpenAIClientImpl.java | 108 +++++++++++------- 1 file changed, 64 insertions(+), 44 deletions(-) diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/OpenAIClientImpl.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/OpenAIClientImpl.java index 48b58a1ad600..869340dba788 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/OpenAIClientImpl.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/OpenAIClientImpl.java @@ -159,7 +159,7 @@ public interface OpenAIClientService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getAudioTranscriptionAsPlainText(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData audioTranscriptionOptions, RequestOptions requestOptions, Context context); @@ -172,7 +172,7 @@ Mono> getAudioTranscriptionAsPlainText(@HostParam("endpoint @UnexpectedResponseExceptionType(HttpResponseException.class) Response getAudioTranscriptionAsPlainTextSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData audioTranscriptionOptions, RequestOptions requestOptions, Context context); @@ -185,7 +185,7 @@ Response getAudioTranscriptionAsPlainTextSync(@HostParam("endpoint") @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getAudioTranscriptionAsResponseObject(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData audioTranscriptionOptions, RequestOptions requestOptions, Context context); @@ -198,7 +198,7 @@ Mono> getAudioTranscriptionAsResponseObject(@HostParam("end @UnexpectedResponseExceptionType(HttpResponseException.class) Response getAudioTranscriptionAsResponseObjectSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData audioTranscriptionOptions, RequestOptions requestOptions, Context context); @@ -211,7 +211,7 @@ Response getAudioTranscriptionAsResponseObjectSync(@HostParam("endpo @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getAudioTranslationAsPlainText(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData audioTranslationOptions, RequestOptions requestOptions, Context context); @@ -224,7 +224,7 @@ Mono> getAudioTranslationAsPlainText(@HostParam("endpoint") @UnexpectedResponseExceptionType(HttpResponseException.class) Response getAudioTranslationAsPlainTextSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData audioTranslationOptions, RequestOptions requestOptions, Context context); @@ -237,7 +237,7 @@ Response getAudioTranslationAsPlainTextSync(@HostParam("endpoint") S @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getAudioTranslationAsResponseObject(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData audioTranslationOptions, RequestOptions requestOptions, Context context); @@ -250,7 +250,7 @@ Mono> getAudioTranslationAsResponseObject(@HostParam("endpo @UnexpectedResponseExceptionType(HttpResponseException.class) Response getAudioTranslationAsResponseObjectSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData audioTranslationOptions, RequestOptions requestOptions, Context context); @@ -262,8 +262,9 @@ Response getAudioTranslationAsResponseObjectSync(@HostParam("endpoin @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getCompletions(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData completionsOptions, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData completionsOptions, RequestOptions requestOptions, + Context context); @Post("/deployments/{deploymentId}/completions") @ExpectedResponses({ 200 }) @@ -273,8 +274,9 @@ Mono> getCompletions(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(HttpResponseException.class) Response getCompletionsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData completionsOptions, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData completionsOptions, RequestOptions requestOptions, + Context context); @Post("/deployments/{deploymentId}/chat/completions") @ExpectedResponses({ 200 }) @@ -284,8 +286,9 @@ Response getCompletionsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getChatCompletions(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData chatCompletionsOptions, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData chatCompletionsOptions, RequestOptions requestOptions, + Context context); @Post("/deployments/{deploymentId}/chat/completions") @ExpectedResponses({ 200 }) @@ -295,8 +298,9 @@ Mono> getChatCompletions(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(HttpResponseException.class) Response getChatCompletionsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData chatCompletionsOptions, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData chatCompletionsOptions, RequestOptions requestOptions, + Context context); @Post("/deployments/{deploymentId}/images/generations") @ExpectedResponses({ 200 }) @@ -306,8 +310,9 @@ Response getChatCompletionsSync(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getImageGenerations(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData imageGenerationOptions, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData imageGenerationOptions, RequestOptions requestOptions, + Context context); @Post("/deployments/{deploymentId}/images/generations") @ExpectedResponses({ 200 }) @@ -317,8 +322,9 @@ Mono> getImageGenerations(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(HttpResponseException.class) Response getImageGenerationsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData imageGenerationOptions, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData imageGenerationOptions, RequestOptions requestOptions, + Context context); @Post("/deployments/{deploymentId}/audio/speech") @ExpectedResponses({ 200 }) @@ -328,8 +334,9 @@ Response getImageGenerationsSync(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> generateSpeechFromText(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData speechGenerationOptions, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData speechGenerationOptions, RequestOptions requestOptions, + Context context); @Post("/deployments/{deploymentId}/audio/speech") @ExpectedResponses({ 200 }) @@ -339,8 +346,9 @@ Mono> generateSpeechFromText(@HostParam("endpoint") String @UnexpectedResponseExceptionType(HttpResponseException.class) Response generateSpeechFromTextSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData speechGenerationOptions, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData speechGenerationOptions, RequestOptions requestOptions, + Context context); @Post("/deployments/{deploymentId}/embeddings") @ExpectedResponses({ 200 }) @@ -350,8 +358,9 @@ Response generateSpeechFromTextSync(@HostParam("endpoint") String en @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getEmbeddings(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData embeddingsOptions, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData embeddingsOptions, RequestOptions requestOptions, + Context context); @Post("/deployments/{deploymentId}/embeddings") @ExpectedResponses({ 200 }) @@ -361,8 +370,9 @@ Mono> getEmbeddings(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response getEmbeddingsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData embeddingsOptions, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData embeddingsOptions, RequestOptions requestOptions, + Context context); } /** @@ -389,7 +399,7 @@ Response getEmbeddingsSync(@HostParam("endpoint") String endpoint, public Mono> getAudioTranscriptionAsPlainTextWithResponseAsync(String deploymentOrModelName, BinaryData audioTranscriptionOptions, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "text/plain, application/json"; + final String accept = "text/plain"; return FluxUtil.withContext(context -> service.getAudioTranscriptionAsPlainText(this.getEndpoint(), this.getServiceVersion().getVersion(), deploymentOrModelName, contentType, accept, audioTranscriptionOptions, requestOptions, context)); @@ -418,7 +428,7 @@ public Mono> getAudioTranscriptionAsPlainTextWithResponseAs public Response getAudioTranscriptionAsPlainTextWithResponse(String deploymentOrModelName, BinaryData audioTranscriptionOptions, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "text/plain, application/json"; + final String accept = "text/plain"; return service.getAudioTranscriptionAsPlainTextSync(this.getEndpoint(), this.getServiceVersion().getVersion(), deploymentOrModelName, contentType, accept, audioTranscriptionOptions, requestOptions, Context.NONE); } @@ -561,7 +571,7 @@ public Response getAudioTranscriptionAsResponseObjectWithResponse(St public Mono> getAudioTranslationAsPlainTextWithResponseAsync(String deploymentOrModelName, BinaryData audioTranslationOptions, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "text/plain, application/json"; + final String accept = "text/plain"; return FluxUtil.withContext( context -> service.getAudioTranslationAsPlainText(this.getEndpoint(), this.getServiceVersion().getVersion(), deploymentOrModelName, contentType, accept, audioTranslationOptions, requestOptions, context)); @@ -590,7 +600,7 @@ public Mono> getAudioTranslationAsPlainTextWithResponseAsyn public Response getAudioTranslationAsPlainTextWithResponse(String deploymentOrModelName, BinaryData audioTranslationOptions, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "text/plain, application/json"; + final String accept = "text/plain"; return service.getAudioTranslationAsPlainTextSync(this.getEndpoint(), this.getServiceVersion().getVersion(), deploymentOrModelName, contentType, accept, audioTranslationOptions, requestOptions, Context.NONE); } @@ -839,10 +849,11 @@ public Response getAudioTranslationAsResponseObjectWithResponse(Stri @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getCompletionsWithResponseAsync(String deploymentOrModelName, BinaryData completionsOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.getCompletions(this.getEndpoint(), this.getServiceVersion().getVersion(), - deploymentOrModelName, accept, completionsOptions, requestOptions, context)); + deploymentOrModelName, contentType, accept, completionsOptions, requestOptions, context)); } /** @@ -989,9 +1000,10 @@ public Mono> getCompletionsWithResponseAsync(String deploym @ServiceMethod(returns = ReturnType.SINGLE) public Response getCompletionsWithResponse(String deploymentOrModelName, BinaryData completionsOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.getCompletionsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), - deploymentOrModelName, accept, completionsOptions, requestOptions, Context.NONE); + deploymentOrModelName, contentType, accept, completionsOptions, requestOptions, Context.NONE); } /** @@ -1242,10 +1254,11 @@ public Response getCompletionsWithResponse(String deploymentOrModelN @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getChatCompletionsWithResponseAsync(String deploymentOrModelName, BinaryData chatCompletionsOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext( context -> service.getChatCompletions(this.getEndpoint(), this.getServiceVersion().getVersion(), - deploymentOrModelName, accept, chatCompletionsOptions, requestOptions, context)); + deploymentOrModelName, contentType, accept, chatCompletionsOptions, requestOptions, context)); } /** @@ -1496,9 +1509,10 @@ public Mono> getChatCompletionsWithResponseAsync(String dep @ServiceMethod(returns = ReturnType.SINGLE) public Response getChatCompletionsWithResponse(String deploymentOrModelName, BinaryData chatCompletionsOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.getChatCompletionsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), - deploymentOrModelName, accept, chatCompletionsOptions, requestOptions, Context.NONE); + deploymentOrModelName, contentType, accept, chatCompletionsOptions, requestOptions, Context.NONE); } /** @@ -1576,10 +1590,11 @@ public Response getChatCompletionsWithResponse(String deploymentOrMo @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getImageGenerationsWithResponseAsync(String deploymentOrModelName, BinaryData imageGenerationOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext( context -> service.getImageGenerations(this.getEndpoint(), this.getServiceVersion().getVersion(), - deploymentOrModelName, accept, imageGenerationOptions, requestOptions, context)); + deploymentOrModelName, contentType, accept, imageGenerationOptions, requestOptions, context)); } /** @@ -1656,9 +1671,10 @@ public Mono> getImageGenerationsWithResponseAsync(String de @ServiceMethod(returns = ReturnType.SINGLE) public Response getImageGenerationsWithResponse(String deploymentOrModelName, BinaryData imageGenerationOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.getImageGenerationsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), - deploymentOrModelName, accept, imageGenerationOptions, requestOptions, Context.NONE); + deploymentOrModelName, contentType, accept, imageGenerationOptions, requestOptions, Context.NONE); } /** @@ -1695,10 +1711,11 @@ public Response getImageGenerationsWithResponse(String deploymentOrM @ServiceMethod(returns = ReturnType.SINGLE) public Mono> generateSpeechFromTextWithResponseAsync(String deploymentOrModelName, BinaryData speechGenerationOptions, RequestOptions requestOptions) { - final String accept = "application/octet-stream, application/json"; + final String contentType = "application/json"; + final String accept = "application/octet-stream"; return FluxUtil.withContext( context -> service.generateSpeechFromText(this.getEndpoint(), this.getServiceVersion().getVersion(), - deploymentOrModelName, accept, speechGenerationOptions, requestOptions, context)); + deploymentOrModelName, contentType, accept, speechGenerationOptions, requestOptions, context)); } /** @@ -1735,9 +1752,10 @@ public Mono> generateSpeechFromTextWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) public Response generateSpeechFromTextWithResponse(String deploymentOrModelName, BinaryData speechGenerationOptions, RequestOptions requestOptions) { - final String accept = "application/octet-stream, application/json"; + final String contentType = "application/json"; + final String accept = "application/octet-stream"; return service.generateSpeechFromTextSync(this.getEndpoint(), this.getServiceVersion().getVersion(), - deploymentOrModelName, accept, speechGenerationOptions, requestOptions, Context.NONE); + deploymentOrModelName, contentType, accept, speechGenerationOptions, requestOptions, Context.NONE); } /** @@ -1794,10 +1812,11 @@ public Response generateSpeechFromTextWithResponse(String deployment @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmbeddingsWithResponseAsync(String deploymentOrModelName, BinaryData embeddingsOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.getEmbeddings(this.getEndpoint(), this.getServiceVersion().getVersion(), - deploymentOrModelName, accept, embeddingsOptions, requestOptions, context)); + deploymentOrModelName, contentType, accept, embeddingsOptions, requestOptions, context)); } /** @@ -1853,8 +1872,9 @@ public Mono> getEmbeddingsWithResponseAsync(String deployme @ServiceMethod(returns = ReturnType.SINGLE) public Response getEmbeddingsWithResponse(String deploymentOrModelName, BinaryData embeddingsOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.getEmbeddingsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), - deploymentOrModelName, accept, embeddingsOptions, requestOptions, Context.NONE); + deploymentOrModelName, contentType, accept, embeddingsOptions, requestOptions, Context.NONE); } } From dd39426a0dc71a37cf5406ad6ce2a670cca0fae8 Mon Sep 17 00:00:00 2001 From: glenn Date: Thu, 12 Sep 2024 16:46:13 -0400 Subject: [PATCH 103/128] more deleted files --- ...tectableItemsGetWithResponseMockTests.java | 62 ++ ...ectionIntentsGetWithResponseMockTests.java | 57 ++ ...erSpecificContainerCreationInputTests.java | 24 + ...derSpecificContainerMappingInputTests.java | 23 + ...veryPlansTestFailoverCleanupMockTests.java | 84 +++ ...coveryPlansUnplannedFailoverMockTests.java | 92 +++ ...ationMappingsGetWithResponseMockTests.java | 58 ++ ...ForReplicationProtectedItemInputTests.java | 31 + ...nContainerMappingInputPropertiesTests.java | 25 + ...tionProtectedItemInputPropertiesTests.java | 188 ++++++ .../reflect-config.json | 606 ++++++++++++++++++ ...iderSapAvailabilityZoneDetailsSamples.java | 50 ++ 12 files changed, 1300 insertions(+) create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectableItemsGetWithResponseMockTests.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionIntentsGetWithResponseMockTests.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProviderSpecificContainerCreationInputTests.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProviderSpecificContainerMappingInputTests.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansTestFailoverCleanupMockTests.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansUnplannedFailoverMockTests.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/StorageClassificationMappingsGetWithResponseMockTests.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/UpdateApplianceForReplicationProtectedItemInputTests.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/UpdateProtectionContainerMappingInputPropertiesTests.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/UpdateReplicationProtectedItemInputPropertiesTests.java create mode 100644 sdk/workloadssapvirtualinstance/azure-resourcemanager-workloadssapvirtualinstance/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-workloadssapvirtualinstance/reflect-config.json create mode 100644 sdk/workloadssapvirtualinstance/azure-resourcemanager-workloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadssapvirtualinstance/generated/ResourceProviderSapAvailabilityZoneDetailsSamples.java diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectableItemsGetWithResponseMockTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectableItemsGetWithResponseMockTests.java new file mode 100644 index 000000000000..ccfe23d31667 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectableItemsGetWithResponseMockTests.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.SiteRecoveryManager; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectableItem; +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 ReplicationProtectableItemsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr + = "{\"properties\":{\"friendlyName\":\"dahyclxrsidoeb\",\"protectionStatus\":\"poiaffjkrtn\",\"replicationProtectedItemId\":\"evimxmaxcj\",\"recoveryServicesProviderId\":\"itygvdwds\",\"protectionReadinessErrors\":[\"bf\"],\"supportedReplicationProviders\":[\"ozbzchnqekwan\"],\"customDetails\":{\"instanceType\":\"ConfigurationSettings\"}},\"location\":\"urlcydjhtkjs\",\"id\":\"rwiyndurdonkgobx\",\"name\":\"lr\",\"type\":\"olenrswknpdr\"}"; + + 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); + })); + + SiteRecoveryManager manager = SiteRecoveryManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + ProtectableItem response = manager.replicationProtectableItems() + .getWithResponse("wdalisd", "qngca", "dz", "nloou", "p", com.azure.core.util.Context.NONE).getValue(); + + Assertions.assertEquals("dahyclxrsidoeb", response.properties().friendlyName()); + Assertions.assertEquals("poiaffjkrtn", response.properties().protectionStatus()); + Assertions.assertEquals("evimxmaxcj", response.properties().replicationProtectedItemId()); + Assertions.assertEquals("itygvdwds", response.properties().recoveryServicesProviderId()); + Assertions.assertEquals("bf", response.properties().protectionReadinessErrors().get(0)); + Assertions.assertEquals("ozbzchnqekwan", response.properties().supportedReplicationProviders().get(0)); + Assertions.assertEquals("urlcydjhtkjs", response.location()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionIntentsGetWithResponseMockTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionIntentsGetWithResponseMockTests.java new file mode 100644 index 000000000000..6b5e089ea68c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionIntentsGetWithResponseMockTests.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.SiteRecoveryManager; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectionIntent; +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 ReplicationProtectionIntentsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr + = "{\"properties\":{\"friendlyName\":\"cacwaaqakv\",\"jobId\":\"y\",\"jobState\":\"xra\",\"isActive\":false,\"creationTimeUTC\":\"eqbrcmmdtsh\",\"providerSpecificDetails\":{\"instanceType\":\"ReplicationProtectionIntentProviderSpecificSettings\"}},\"location\":\"xucznb\",\"id\":\"bowr\",\"name\":\"yrnmjw\",\"type\":\"owxqzkk\"}"; + + 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); + })); + + SiteRecoveryManager manager = SiteRecoveryManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + ReplicationProtectionIntent response = manager.replicationProtectionIntents() + .getWithResponse("ilzvxotno", "lqcdvhye", "qhxytsq", com.azure.core.util.Context.NONE).getValue(); + + Assertions.assertEquals("cacwaaqakv", response.properties().friendlyName()); + Assertions.assertEquals("xucznb", response.location()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProviderSpecificContainerCreationInputTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProviderSpecificContainerCreationInputTests.java new file mode 100644 index 000000000000..0818dcc1aa4a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProviderSpecificContainerCreationInputTests.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProviderSpecificContainerCreationInput; + +public final class ReplicationProviderSpecificContainerCreationInputTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ReplicationProviderSpecificContainerCreationInput model + = BinaryData.fromString("{\"instanceType\":\"ReplicationProviderSpecificContainerCreationInput\"}") + .toObject(ReplicationProviderSpecificContainerCreationInput.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ReplicationProviderSpecificContainerCreationInput model + = new ReplicationProviderSpecificContainerCreationInput(); + model = BinaryData.fromObject(model).toObject(ReplicationProviderSpecificContainerCreationInput.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProviderSpecificContainerMappingInputTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProviderSpecificContainerMappingInputTests.java new file mode 100644 index 000000000000..5b5f27aae03f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProviderSpecificContainerMappingInputTests.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProviderSpecificContainerMappingInput; + +public final class ReplicationProviderSpecificContainerMappingInputTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ReplicationProviderSpecificContainerMappingInput model + = BinaryData.fromString("{\"instanceType\":\"ReplicationProviderSpecificContainerMappingInput\"}") + .toObject(ReplicationProviderSpecificContainerMappingInput.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ReplicationProviderSpecificContainerMappingInput model = new ReplicationProviderSpecificContainerMappingInput(); + model = BinaryData.fromObject(model).toObject(ReplicationProviderSpecificContainerMappingInput.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansTestFailoverCleanupMockTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansTestFailoverCleanupMockTests.java new file mode 100644 index 000000000000..b2ff6927a4d7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansTestFailoverCleanupMockTests.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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.SiteRecoveryManager; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlan; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanGroupType; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverCleanupInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverCleanupInputProperties; +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 ReplicationRecoveryPlansTestFailoverCleanupMockTests { + @Test + public void testTestFailoverCleanup() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr + = "{\"properties\":{\"friendlyName\":\"lbiqq\",\"primaryFabricId\":\"arxknfvbsym\",\"primaryFabricFriendlyName\":\"bahdbtjm\",\"recoveryFabricId\":\"zonrklbizrxh\",\"recoveryFabricFriendlyName\":\"fvpanloqovvcxgq\",\"failoverDeploymentModel\":\"uirgopgzatucu\",\"replicationProviders\":[\"uzvyjxuxchquoqhq\",\"csksxqf\",\"lrvuvdagv\"],\"allowedOperations\":[\"d\"],\"lastPlannedFailoverTime\":\"2021-04-28T08:18:31Z\",\"lastUnplannedFailoverTime\":\"2021-02-19T21:32:29Z\",\"lastTestFailoverTime\":\"2020-12-25T04:39:30Z\",\"currentScenario\":{\"scenarioName\":\"odiijcsapqhip\",\"jobId\":\"snivnmevljbcu\",\"startTime\":\"2021-08-10T00:42:25Z\"},\"currentScenarioStatus\":\"pjf\",\"currentScenarioStatusDescription\":\"wkseodvlmd\",\"groups\":[{\"groupType\":\"Failover\",\"replicationProtectedItems\":[{},{},{}],\"startGroupActions\":[{\"actionName\":\"u\",\"failoverTypes\":[],\"failoverDirections\":[],\"customDetails\":{\"instanceType\":\"RecoveryPlanActionDetails\"}}],\"endGroupActions\":[{\"actionName\":\"yg\",\"failoverTypes\":[],\"failoverDirections\":[],\"customDetails\":{\"instanceType\":\"RecoveryPlanActionDetails\"}},{\"actionName\":\"bmum\",\"failoverTypes\":[],\"failoverDirections\":[],\"customDetails\":{\"instanceType\":\"RecoveryPlanActionDetails\"}},{\"actionName\":\"jvvcrsmwojm\",\"failoverTypes\":[],\"failoverDirections\":[],\"customDetails\":{\"instanceType\":\"RecoveryPlanActionDetails\"}},{\"actionName\":\"wcvumnrut\",\"failoverTypes\":[],\"failoverDirections\":[],\"customDetails\":{\"instanceType\":\"RecoveryPlanActionDetails\"}}]},{\"groupType\":\"Boot\",\"replicationProtectedItems\":[{}],\"startGroupActions\":[{\"actionName\":\"f\",\"failoverTypes\":[],\"failoverDirections\":[],\"customDetails\":{\"instanceType\":\"RecoveryPlanActionDetails\"}},{\"actionName\":\"vltjo\",\"failoverTypes\":[],\"failoverDirections\":[],\"customDetails\":{\"instanceType\":\"RecoveryPlanActionDetails\"}}],\"endGroupActions\":[{\"actionName\":\"vpkbz\",\"failoverTypes\":[],\"failoverDirections\":[],\"customDetails\":{\"instanceType\":\"RecoveryPlanActionDetails\"}},{\"actionName\":\"tnowpajfhxsmu\",\"failoverTypes\":[],\"failoverDirections\":[],\"customDetails\":{\"instanceType\":\"RecoveryPlanActionDetails\"}}]}],\"providerSpecificDetails\":[{\"instanceType\":\"RecoveryPlanProviderSpecificDetails\"},{\"instanceType\":\"RecoveryPlanProviderSpecificDetails\"},{\"instanceType\":\"RecoveryPlanProviderSpecificDetails\"}]},\"location\":\"dzglmuuzpsuhsyp\",\"id\":\"muldhfr\",\"name\":\"rkqpyfjxkby\",\"type\":\"sbuqfm\"}"; + + 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); + })); + + SiteRecoveryManager manager = SiteRecoveryManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + RecoveryPlan response = manager.replicationRecoveryPlans().testFailoverCleanup("p", "addpxqrxipe", "rplf", + new RecoveryPlanTestFailoverCleanupInput() + .withProperties(new RecoveryPlanTestFailoverCleanupInputProperties().withComments("vmjjfz")), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("lbiqq", response.properties().friendlyName()); + Assertions.assertEquals("arxknfvbsym", response.properties().primaryFabricId()); + Assertions.assertEquals("bahdbtjm", response.properties().primaryFabricFriendlyName()); + Assertions.assertEquals("zonrklbizrxh", response.properties().recoveryFabricId()); + Assertions.assertEquals("fvpanloqovvcxgq", response.properties().recoveryFabricFriendlyName()); + Assertions.assertEquals("uirgopgzatucu", response.properties().failoverDeploymentModel()); + Assertions.assertEquals("uzvyjxuxchquoqhq", response.properties().replicationProviders().get(0)); + Assertions.assertEquals("d", response.properties().allowedOperations().get(0)); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-28T08:18:31Z"), + response.properties().lastPlannedFailoverTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-19T21:32:29Z"), + response.properties().lastUnplannedFailoverTime()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-25T04:39:30Z"), + response.properties().lastTestFailoverTime()); + Assertions.assertEquals("odiijcsapqhip", response.properties().currentScenario().scenarioName()); + Assertions.assertEquals("snivnmevljbcu", response.properties().currentScenario().jobId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-10T00:42:25Z"), + response.properties().currentScenario().startTime()); + Assertions.assertEquals("pjf", response.properties().currentScenarioStatus()); + Assertions.assertEquals("wkseodvlmd", response.properties().currentScenarioStatusDescription()); + Assertions.assertEquals(RecoveryPlanGroupType.FAILOVER, response.properties().groups().get(0).groupType()); + Assertions.assertEquals("u", response.properties().groups().get(0).startGroupActions().get(0).actionName()); + Assertions.assertEquals("yg", response.properties().groups().get(0).endGroupActions().get(0).actionName()); + Assertions.assertEquals("dzglmuuzpsuhsyp", response.location()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansUnplannedFailoverMockTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansUnplannedFailoverMockTests.java new file mode 100644 index 000000000000..e1378dbe3cb3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansUnplannedFailoverMockTests.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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.SiteRecoveryManager; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PossibleOperationsDirections; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlan; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanGroupType; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanProviderSpecificFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanUnplannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanUnplannedFailoverInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SourceSiteOperations; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class ReplicationRecoveryPlansUnplannedFailoverMockTests { + @Test + public void testUnplannedFailover() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr + = "{\"properties\":{\"friendlyName\":\"ikh\",\"primaryFabricId\":\"thypepxshmrd\",\"primaryFabricFriendlyName\":\"csdvkymktc\",\"recoveryFabricId\":\"ivoxgzegnglafnf\",\"recoveryFabricFriendlyName\":\"zaghddc\",\"failoverDeploymentModel\":\"wxuxor\",\"replicationProviders\":[\"uhvemgxlss\",\"lqypvwxl\"],\"allowedOperations\":[\"vrkqv\",\"vgdojcvzfcmxmjp\"],\"lastPlannedFailoverTime\":\"2021-11-18T03:57:06Z\",\"lastUnplannedFailoverTime\":\"2021-01-12T06:14:49Z\",\"lastTestFailoverTime\":\"2021-06-13T19:20:39Z\",\"currentScenario\":{\"scenarioName\":\"ocgquqx\",\"jobId\":\"xp\",\"startTime\":\"2021-08-14T00:33Z\"},\"currentScenarioStatus\":\"qniiontqikdipk\",\"currentScenarioStatusDescription\":\"qkuzabrsoihataj\",\"groups\":[{\"groupType\":\"Shutdown\",\"replicationProtectedItems\":[{},{}],\"startGroupActions\":[{\"actionName\":\"ssxylsu\",\"failoverTypes\":[],\"failoverDirections\":[],\"customDetails\":{\"instanceType\":\"RecoveryPlanActionDetails\"}},{\"actionName\":\"oadoh\",\"failoverTypes\":[],\"failoverDirections\":[],\"customDetails\":{\"instanceType\":\"RecoveryPlanActionDetails\"}},{\"actionName\":\"jyiehkxgfuzqqnz\",\"failoverTypes\":[],\"failoverDirections\":[],\"customDetails\":{\"instanceType\":\"RecoveryPlanActionDetails\"}}],\"endGroupActions\":[{\"actionName\":\"xqds\",\"failoverTypes\":[],\"failoverDirections\":[],\"customDetails\":{\"instanceType\":\"RecoveryPlanActionDetails\"}},{\"actionName\":\"ipdnl\",\"failoverTypes\":[],\"failoverDirections\":[],\"customDetails\":{\"instanceType\":\"RecoveryPlanActionDetails\"}}]}],\"providerSpecificDetails\":[{\"instanceType\":\"RecoveryPlanProviderSpecificDetails\"},{\"instanceType\":\"RecoveryPlanProviderSpecificDetails\"},{\"instanceType\":\"RecoveryPlanProviderSpecificDetails\"},{\"instanceType\":\"RecoveryPlanProviderSpecificDetails\"}]},\"location\":\"f\",\"id\":\"pwwgzeylzp\",\"name\":\"imxacrkt\",\"type\":\"o\"}"; + + 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); + })); + + SiteRecoveryManager manager = SiteRecoveryManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + RecoveryPlan response = manager.replicationRecoveryPlans().unplannedFailover("bdjkmnxsggnow", "hyvdbrdvsv", + "hbtyc", + new RecoveryPlanUnplannedFailoverInput().withProperties(new RecoveryPlanUnplannedFailoverInputProperties() + .withFailoverDirection(PossibleOperationsDirections.PRIMARY_TO_RECOVERY) + .withSourceSiteOperations(SourceSiteOperations.REQUIRED).withProviderSpecificDetails(Arrays.asList( + new RecoveryPlanProviderSpecificFailoverInput(), new RecoveryPlanProviderSpecificFailoverInput()))), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("ikh", response.properties().friendlyName()); + Assertions.assertEquals("thypepxshmrd", response.properties().primaryFabricId()); + Assertions.assertEquals("csdvkymktc", response.properties().primaryFabricFriendlyName()); + Assertions.assertEquals("ivoxgzegnglafnf", response.properties().recoveryFabricId()); + Assertions.assertEquals("zaghddc", response.properties().recoveryFabricFriendlyName()); + Assertions.assertEquals("wxuxor", response.properties().failoverDeploymentModel()); + Assertions.assertEquals("uhvemgxlss", response.properties().replicationProviders().get(0)); + Assertions.assertEquals("vrkqv", response.properties().allowedOperations().get(0)); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-18T03:57:06Z"), + response.properties().lastPlannedFailoverTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-12T06:14:49Z"), + response.properties().lastUnplannedFailoverTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-13T19:20:39Z"), + response.properties().lastTestFailoverTime()); + Assertions.assertEquals("ocgquqx", response.properties().currentScenario().scenarioName()); + Assertions.assertEquals("xp", response.properties().currentScenario().jobId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-14T00:33Z"), + response.properties().currentScenario().startTime()); + Assertions.assertEquals("qniiontqikdipk", response.properties().currentScenarioStatus()); + Assertions.assertEquals("qkuzabrsoihataj", response.properties().currentScenarioStatusDescription()); + Assertions.assertEquals(RecoveryPlanGroupType.SHUTDOWN, response.properties().groups().get(0).groupType()); + Assertions.assertEquals("ssxylsu", + response.properties().groups().get(0).startGroupActions().get(0).actionName()); + Assertions.assertEquals("xqds", response.properties().groups().get(0).endGroupActions().get(0).actionName()); + Assertions.assertEquals("f", response.location()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/StorageClassificationMappingsGetWithResponseMockTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/StorageClassificationMappingsGetWithResponseMockTests.java new file mode 100644 index 000000000000..6fcec1124431 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/StorageClassificationMappingsGetWithResponseMockTests.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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.SiteRecoveryManager; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageClassificationMapping; +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 StorageClassificationMappingsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr + = "{\"properties\":{\"targetStorageClassificationId\":\"sxaqqjhdfhfa\"},\"location\":\"qnjcsbozvcdqwssy\",\"id\":\"vwr\",\"name\":\"bivyw\",\"type\":\"tjnjuvtz\"}"; + + 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); + })); + + SiteRecoveryManager manager = SiteRecoveryManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + StorageClassificationMapping response = manager.storageClassificationMappings() + .getWithResponse("sobggva", "crqaxlmbrtvtgolm", "p", "gtla", "yxhxj", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("sxaqqjhdfhfa", response.properties().targetStorageClassificationId()); + Assertions.assertEquals("qnjcsbozvcdqwssy", response.location()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/UpdateApplianceForReplicationProtectedItemInputTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/UpdateApplianceForReplicationProtectedItemInputTests.java new file mode 100644 index 000000000000..0c7c21b9d53e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/UpdateApplianceForReplicationProtectedItemInputTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateApplianceForReplicationProtectedItemInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateApplianceForReplicationProtectedItemInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateReplicationProtectedItemProviderSpecificInput; +import org.junit.jupiter.api.Assertions; + +public final class UpdateApplianceForReplicationProtectedItemInputTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UpdateApplianceForReplicationProtectedItemInput model = BinaryData.fromString( + "{\"properties\":{\"targetApplianceId\":\"xsffgcviz\",\"providerSpecificDetails\":{\"instanceType\":\"UpdateApplianceForReplicationProtectedItemProviderSpecificInput\"}}}") + .toObject(UpdateApplianceForReplicationProtectedItemInput.class); + Assertions.assertEquals("xsffgcviz", model.properties().targetApplianceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UpdateApplianceForReplicationProtectedItemInput model + = new UpdateApplianceForReplicationProtectedItemInput().withProperties( + new UpdateApplianceForReplicationProtectedItemInputProperties().withTargetApplianceId("xsffgcviz") + .withProviderSpecificDetails(new UpdateReplicationProtectedItemProviderSpecificInput())); + model = BinaryData.fromObject(model).toObject(UpdateApplianceForReplicationProtectedItemInput.class); + Assertions.assertEquals("xsffgcviz", model.properties().targetApplianceId()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/UpdateProtectionContainerMappingInputPropertiesTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/UpdateProtectionContainerMappingInputPropertiesTests.java new file mode 100644 index 000000000000..b9dd6eefcbcb --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/UpdateProtectionContainerMappingInputPropertiesTests.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProviderSpecificUpdateContainerMappingInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateProtectionContainerMappingInputProperties; + +public final class UpdateProtectionContainerMappingInputPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UpdateProtectionContainerMappingInputProperties model = BinaryData.fromString( + "{\"providerSpecificInput\":{\"instanceType\":\"ReplicationProviderSpecificUpdateContainerMappingInput\"}}") + .toObject(UpdateProtectionContainerMappingInputProperties.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UpdateProtectionContainerMappingInputProperties model = new UpdateProtectionContainerMappingInputProperties() + .withProviderSpecificInput(new ReplicationProviderSpecificUpdateContainerMappingInput()); + model = BinaryData.fromObject(model).toObject(UpdateProtectionContainerMappingInputProperties.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/UpdateReplicationProtectedItemInputPropertiesTests.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/UpdateReplicationProtectedItemInputPropertiesTests.java new file mode 100644 index 000000000000..d7c07f96c0ef --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/test/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/UpdateReplicationProtectedItemInputPropertiesTests.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. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.IpConfigInputDetails; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.LicenseType; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateReplicationProtectedItemInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateReplicationProtectedItemProviderInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VMNicInputDetails; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class UpdateReplicationProtectedItemInputPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UpdateReplicationProtectedItemInputProperties model = BinaryData.fromString( + "{\"recoveryAzureVMName\":\"lpqblylsyxk\",\"recoveryAzureVMSize\":\"nsj\",\"selectedRecoveryAzureNetworkId\":\"vti\",\"selectedTfoAzureNetworkId\":\"xsdszuempsb\",\"selectedSourceNicId\":\"f\",\"enableRdpOnTargetOption\":\"eyvpnqicvinvkj\",\"vmNics\":[{\"nicId\":\"rbuukzclewyhmlwp\",\"ipConfigs\":[{\"ipConfigName\":\"pofncck\",\"isPrimary\":false,\"isSeletedForFailover\":true,\"recoverySubnetName\":\"hxx\",\"recoveryStaticIPAddress\":\"yq\",\"recoveryPublicIPAddressId\":\"zfeqztppri\",\"recoveryLBBackendAddressPoolIds\":[\"or\",\"altol\",\"ncwsob\",\"wcsdbnwdcfhucq\"],\"tfoSubnetName\":\"fuvglsbjjca\",\"tfoStaticIPAddress\":\"xbvtvudu\",\"tfoPublicIPAddressId\":\"cormr\",\"tfoLBBackendAddressPoolIds\":[\"tvcof\",\"dflvkg\",\"u\",\"gdknnqv\"]},{\"ipConfigName\":\"znqntoru\",\"isPrimary\":true,\"isSeletedForFailover\":false,\"recoverySubnetName\":\"mkycgra\",\"recoveryStaticIPAddress\":\"juetaebur\",\"recoveryPublicIPAddressId\":\"dmovsm\",\"recoveryLBBackendAddressPoolIds\":[\"wabm\",\"oefki\"],\"tfoSubnetName\":\"vtpuqujmqlgk\",\"tfoStaticIPAddress\":\"tndoaongbjc\",\"tfoPublicIPAddressId\":\"ujitcjedftww\",\"tfoLBBackendAddressPoolIds\":[\"kojvd\"]},{\"ipConfigName\":\"zfoqouicybxar\",\"isPrimary\":true,\"isSeletedForFailover\":false,\"recoverySubnetName\":\"oxciqopidoamcio\",\"recoveryStaticIPAddress\":\"khazxkhnzbonlwn\",\"recoveryPublicIPAddressId\":\"egokdwbwhkszzcmr\",\"recoveryLBBackendAddressPoolIds\":[\"ztvbtqgsfr\",\"oyzko\",\"wtl\",\"nguxawqaldsy\"],\"tfoSubnetName\":\"ximerqfobwyznk\",\"tfoStaticIPAddress\":\"kutwpf\",\"tfoPublicIPAddressId\":\"a\",\"tfoLBBackendAddressPoolIds\":[\"r\",\"kdsnfdsdoakgtdl\",\"kkze\"]},{\"ipConfigName\":\"l\",\"isPrimary\":true,\"isSeletedForFailover\":false,\"recoverySubnetName\":\"dsttwvo\",\"recoveryStaticIPAddress\":\"bbejdcngqqm\",\"recoveryPublicIPAddressId\":\"kufgmj\",\"recoveryLBBackendAddressPoolIds\":[\"rdgrtw\"],\"tfoSubnetName\":\"nuuzkopbm\",\"tfoStaticIPAddress\":\"rfdwoyu\",\"tfoPublicIPAddressId\":\"ziuiefozbhdm\",\"tfoLBBackendAddressPoolIds\":[\"mzqhoftrmaequi\"]}],\"selectionType\":\"xicslfao\",\"recoveryNetworkSecurityGroupId\":\"piyylhalnswhccsp\",\"enableAcceleratedNetworkingOnRecovery\":true,\"tfoNetworkSecurityGroupId\":\"vwitqscyw\",\"enableAcceleratedNetworkingOnTfo\":false,\"recoveryNicName\":\"oluhczbwemh\",\"recoveryNicResourceGroupName\":\"rsbrgzdwm\",\"reuseExistingNic\":true,\"tfoNicName\":\"pqwd\",\"tfoNicResourceGroupName\":\"gicccnxqhuex\",\"tfoReuseExistingNic\":true,\"targetNicName\":\"lstvlzywe\"},{\"nicId\":\"zrncsdt\",\"ipConfigs\":[{\"ipConfigName\":\"iypbsfgytgusl\",\"isPrimary\":false,\"isSeletedForFailover\":false,\"recoverySubnetName\":\"gq\",\"recoveryStaticIPAddress\":\"yhejhzisxgfp\",\"recoveryPublicIPAddressId\":\"olppvksrpqvujz\",\"recoveryLBBackendAddressPoolIds\":[\"htwdwrftswibyrcd\",\"bhshfwpracstwity\",\"hevxcced\"],\"tfoSubnetName\":\"nmdyodnwzxl\",\"tfoStaticIPAddress\":\"cvnhltiugc\",\"tfoPublicIPAddressId\":\"avvwxqi\",\"tfoLBBackendAddressPoolIds\":[\"unyowxwl\",\"djrkvfgbvfvpd\",\"odacizs\",\"q\"]}],\"selectionType\":\"krribdeibqi\",\"recoveryNetworkSecurityGroupId\":\"kghv\",\"enableAcceleratedNetworkingOnRecovery\":true,\"tfoNetworkSecurityGroupId\":\"wm\",\"enableAcceleratedNetworkingOnTfo\":false,\"recoveryNicName\":\"ajpjo\",\"recoveryNicResourceGroupName\":\"kqnyh\",\"reuseExistingNic\":false,\"tfoNicName\":\"tjivfxzsjabib\",\"tfoNicResourceGroupName\":\"stawfsdjpvkv\",\"tfoReuseExistingNic\":true,\"targetNicName\":\"bkzbzkd\"},{\"nicId\":\"cjabudurgkakmo\",\"ipConfigs\":[{\"ipConfigName\":\"jk\",\"isPrimary\":false,\"isSeletedForFailover\":true,\"recoverySubnetName\":\"uwqlgzrfzeey\",\"recoveryStaticIPAddress\":\"izikayuhq\",\"recoveryPublicIPAddressId\":\"jbsybbqw\",\"recoveryLBBackendAddressPoolIds\":[\"ldgmfpgvmpip\"],\"tfoSubnetName\":\"ltha\",\"tfoStaticIPAddress\":\"x\",\"tfoPublicIPAddressId\":\"mwutwbdsre\",\"tfoLBBackendAddressPoolIds\":[\"rhneuyowq\",\"d\",\"ytisibir\"]},{\"ipConfigName\":\"pikpz\",\"isPrimary\":false,\"isSeletedForFailover\":false,\"recoverySubnetName\":\"nlfzxiavrmbz\",\"recoveryStaticIPAddress\":\"okixrjqcir\",\"recoveryPublicIPAddressId\":\"pfrlazsz\",\"recoveryLBBackendAddressPoolIds\":[\"oiindfpwpjy\",\"wbtlhflsjcdh\"],\"tfoSubnetName\":\"fjvfbgofeljagr\",\"tfoStaticIPAddress\":\"qhl\",\"tfoPublicIPAddressId\":\"riiiojnalghfkv\",\"tfoLBBackendAddressPoolIds\":[\"ex\",\"owueluqh\"]}],\"selectionType\":\"hhxvrhmzkwpj\",\"recoveryNetworkSecurityGroupId\":\"wspughftqsxhqx\",\"enableAcceleratedNetworkingOnRecovery\":true,\"tfoNetworkSecurityGroupId\":\"kndxdigrjgu\",\"enableAcceleratedNetworkingOnTfo\":true,\"recoveryNicName\":\"msyqtfi\",\"recoveryNicResourceGroupName\":\"hbotzingamvppho\",\"reuseExistingNic\":false,\"tfoNicName\":\"udphqamvdkfwyn\",\"tfoNicResourceGroupName\":\"vtbvkayh\",\"tfoReuseExistingNic\":false,\"targetNicName\":\"yqiatkzwp\"}],\"licenseType\":\"WindowsServer\",\"recoveryAvailabilitySetId\":\"zcjaesgvvsccy\",\"providerSpecificDetails\":{\"instanceType\":\"UpdateReplicationProtectedItemProviderInput\"}}") + .toObject(UpdateReplicationProtectedItemInputProperties.class); + Assertions.assertEquals("lpqblylsyxk", model.recoveryAzureVMName()); + Assertions.assertEquals("nsj", model.recoveryAzureVMSize()); + Assertions.assertEquals("vti", model.selectedRecoveryAzureNetworkId()); + Assertions.assertEquals("xsdszuempsb", model.selectedTfoAzureNetworkId()); + Assertions.assertEquals("f", model.selectedSourceNicId()); + Assertions.assertEquals("eyvpnqicvinvkj", model.enableRdpOnTargetOption()); + Assertions.assertEquals("rbuukzclewyhmlwp", model.vmNics().get(0).nicId()); + Assertions.assertEquals("pofncck", model.vmNics().get(0).ipConfigs().get(0).ipConfigName()); + Assertions.assertEquals(false, model.vmNics().get(0).ipConfigs().get(0).isPrimary()); + Assertions.assertEquals(true, model.vmNics().get(0).ipConfigs().get(0).isSeletedForFailover()); + Assertions.assertEquals("hxx", model.vmNics().get(0).ipConfigs().get(0).recoverySubnetName()); + Assertions.assertEquals("yq", model.vmNics().get(0).ipConfigs().get(0).recoveryStaticIpAddress()); + Assertions.assertEquals("zfeqztppri", model.vmNics().get(0).ipConfigs().get(0).recoveryPublicIpAddressId()); + Assertions.assertEquals("or", + model.vmNics().get(0).ipConfigs().get(0).recoveryLBBackendAddressPoolIds().get(0)); + Assertions.assertEquals("fuvglsbjjca", model.vmNics().get(0).ipConfigs().get(0).tfoSubnetName()); + Assertions.assertEquals("xbvtvudu", model.vmNics().get(0).ipConfigs().get(0).tfoStaticIpAddress()); + Assertions.assertEquals("cormr", model.vmNics().get(0).ipConfigs().get(0).tfoPublicIpAddressId()); + Assertions.assertEquals("tvcof", model.vmNics().get(0).ipConfigs().get(0).tfoLBBackendAddressPoolIds().get(0)); + Assertions.assertEquals("xicslfao", model.vmNics().get(0).selectionType()); + Assertions.assertEquals("piyylhalnswhccsp", model.vmNics().get(0).recoveryNetworkSecurityGroupId()); + Assertions.assertEquals(true, model.vmNics().get(0).enableAcceleratedNetworkingOnRecovery()); + Assertions.assertEquals("vwitqscyw", model.vmNics().get(0).tfoNetworkSecurityGroupId()); + Assertions.assertEquals(false, model.vmNics().get(0).enableAcceleratedNetworkingOnTfo()); + Assertions.assertEquals("oluhczbwemh", model.vmNics().get(0).recoveryNicName()); + Assertions.assertEquals("rsbrgzdwm", model.vmNics().get(0).recoveryNicResourceGroupName()); + Assertions.assertEquals(true, model.vmNics().get(0).reuseExistingNic()); + Assertions.assertEquals("pqwd", model.vmNics().get(0).tfoNicName()); + Assertions.assertEquals("gicccnxqhuex", model.vmNics().get(0).tfoNicResourceGroupName()); + Assertions.assertEquals(true, model.vmNics().get(0).tfoReuseExistingNic()); + Assertions.assertEquals("lstvlzywe", model.vmNics().get(0).targetNicName()); + Assertions.assertEquals(LicenseType.WINDOWS_SERVER, model.licenseType()); + Assertions.assertEquals("zcjaesgvvsccy", model.recoveryAvailabilitySetId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UpdateReplicationProtectedItemInputProperties model + = new UpdateReplicationProtectedItemInputProperties() + .withRecoveryAzureVMName( + "lpqblylsyxk") + .withRecoveryAzureVMSize("nsj").withSelectedRecoveryAzureNetworkId("vti") + .withSelectedTfoAzureNetworkId("xsdszuempsb").withSelectedSourceNicId( + "f") + .withEnableRdpOnTargetOption( + "eyvpnqicvinvkj") + .withVmNics(Arrays.asList( + new VMNicInputDetails().withNicId("rbuukzclewyhmlwp") + .withIpConfigs(Arrays.asList( + new IpConfigInputDetails().withIpConfigName("pofncck").withIsPrimary(false) + .withIsSeletedForFailover(true).withRecoverySubnetName("hxx") + .withRecoveryStaticIpAddress("yq").withRecoveryPublicIpAddressId("zfeqztppri") + .withRecoveryLBBackendAddressPoolIds( + Arrays.asList("or", "altol", "ncwsob", "wcsdbnwdcfhucq")) + .withTfoSubnetName("fuvglsbjjca").withTfoStaticIpAddress("xbvtvudu") + .withTfoPublicIpAddressId("cormr") + .withTfoLBBackendAddressPoolIds(Arrays.asList("tvcof", "dflvkg", "u", "gdknnqv")), + new IpConfigInputDetails().withIpConfigName("znqntoru").withIsPrimary(true) + .withIsSeletedForFailover(false).withRecoverySubnetName("mkycgra") + .withRecoveryStaticIpAddress("juetaebur").withRecoveryPublicIpAddressId("dmovsm") + .withRecoveryLBBackendAddressPoolIds(Arrays.asList("wabm", "oefki")) + .withTfoSubnetName("vtpuqujmqlgk").withTfoStaticIpAddress("tndoaongbjc") + .withTfoPublicIpAddressId("ujitcjedftww") + .withTfoLBBackendAddressPoolIds(Arrays.asList("kojvd")), + new IpConfigInputDetails().withIpConfigName("zfoqouicybxar").withIsPrimary(true) + .withIsSeletedForFailover(false).withRecoverySubnetName("oxciqopidoamcio") + .withRecoveryStaticIpAddress("khazxkhnzbonlwn") + .withRecoveryPublicIpAddressId("egokdwbwhkszzcmr") + .withRecoveryLBBackendAddressPoolIds( + Arrays.asList("ztvbtqgsfr", "oyzko", "wtl", "nguxawqaldsy")) + .withTfoSubnetName("ximerqfobwyznk").withTfoStaticIpAddress("kutwpf") + .withTfoPublicIpAddressId("a") + .withTfoLBBackendAddressPoolIds(Arrays.asList("r", "kdsnfdsdoakgtdl", "kkze")), + new IpConfigInputDetails().withIpConfigName("l").withIsPrimary(true) + .withIsSeletedForFailover(false).withRecoverySubnetName("dsttwvo") + .withRecoveryStaticIpAddress("bbejdcngqqm").withRecoveryPublicIpAddressId("kufgmj") + .withRecoveryLBBackendAddressPoolIds(Arrays.asList("rdgrtw")) + .withTfoSubnetName("nuuzkopbm").withTfoStaticIpAddress("rfdwoyu") + .withTfoPublicIpAddressId("ziuiefozbhdm") + .withTfoLBBackendAddressPoolIds(Arrays.asList("mzqhoftrmaequi")))) + .withSelectionType("xicslfao").withRecoveryNetworkSecurityGroupId("piyylhalnswhccsp") + .withEnableAcceleratedNetworkingOnRecovery(true).withTfoNetworkSecurityGroupId("vwitqscyw") + .withEnableAcceleratedNetworkingOnTfo(false).withRecoveryNicName("oluhczbwemh") + .withRecoveryNicResourceGroupName("rsbrgzdwm").withReuseExistingNic(true).withTfoNicName("pqwd") + .withTfoNicResourceGroupName("gicccnxqhuex").withTfoReuseExistingNic(true) + .withTargetNicName("lstvlzywe"), + new VMNicInputDetails().withNicId("zrncsdt") + .withIpConfigs(Arrays.asList(new IpConfigInputDetails().withIpConfigName("iypbsfgytgusl") + .withIsPrimary(false).withIsSeletedForFailover(false).withRecoverySubnetName("gq") + .withRecoveryStaticIpAddress("yhejhzisxgfp").withRecoveryPublicIpAddressId("olppvksrpqvujz") + .withRecoveryLBBackendAddressPoolIds( + Arrays.asList("htwdwrftswibyrcd", "bhshfwpracstwity", "hevxcced")) + .withTfoSubnetName("nmdyodnwzxl").withTfoStaticIpAddress("cvnhltiugc") + .withTfoPublicIpAddressId("avvwxqi").withTfoLBBackendAddressPoolIds( + Arrays.asList("unyowxwl", "djrkvfgbvfvpd", "odacizs", "q")))) + .withSelectionType("krribdeibqi").withRecoveryNetworkSecurityGroupId("kghv") + .withEnableAcceleratedNetworkingOnRecovery(true).withTfoNetworkSecurityGroupId("wm") + .withEnableAcceleratedNetworkingOnTfo(false).withRecoveryNicName("ajpjo") + .withRecoveryNicResourceGroupName( + "kqnyh") + .withReuseExistingNic( + false) + .withTfoNicName( + "tjivfxzsjabib") + .withTfoNicResourceGroupName( + "stawfsdjpvkv") + .withTfoReuseExistingNic(true).withTargetNicName("bkzbzkd"), + new VMNicInputDetails().withNicId("cjabudurgkakmo") + .withIpConfigs(Arrays.asList( + new IpConfigInputDetails().withIpConfigName("jk").withIsPrimary(false) + .withIsSeletedForFailover(true).withRecoverySubnetName("uwqlgzrfzeey") + .withRecoveryStaticIpAddress("izikayuhq").withRecoveryPublicIpAddressId("jbsybbqw") + .withRecoveryLBBackendAddressPoolIds(Arrays.asList("ldgmfpgvmpip")) + .withTfoSubnetName("ltha").withTfoStaticIpAddress("x") + .withTfoPublicIpAddressId("mwutwbdsre") + .withTfoLBBackendAddressPoolIds(Arrays.asList("rhneuyowq", "d", "ytisibir")), + new IpConfigInputDetails().withIpConfigName("pikpz").withIsPrimary(false) + .withIsSeletedForFailover(false).withRecoverySubnetName("nlfzxiavrmbz") + .withRecoveryStaticIpAddress("okixrjqcir").withRecoveryPublicIpAddressId("pfrlazsz") + .withRecoveryLBBackendAddressPoolIds(Arrays.asList("oiindfpwpjy", "wbtlhflsjcdh")) + .withTfoSubnetName("fjvfbgofeljagr").withTfoStaticIpAddress("qhl") + .withTfoPublicIpAddressId("riiiojnalghfkv") + .withTfoLBBackendAddressPoolIds(Arrays.asList("ex", "owueluqh")))) + .withSelectionType("hhxvrhmzkwpj").withRecoveryNetworkSecurityGroupId("wspughftqsxhqx") + .withEnableAcceleratedNetworkingOnRecovery(true).withTfoNetworkSecurityGroupId("kndxdigrjgu") + .withEnableAcceleratedNetworkingOnTfo(true).withRecoveryNicName("msyqtfi") + .withRecoveryNicResourceGroupName("hbotzingamvppho").withReuseExistingNic(false) + .withTfoNicName("udphqamvdkfwyn").withTfoNicResourceGroupName("vtbvkayh") + .withTfoReuseExistingNic(false).withTargetNicName("yqiatkzwp"))) + .withLicenseType(LicenseType.WINDOWS_SERVER).withRecoveryAvailabilitySetId("zcjaesgvvsccy") + .withProviderSpecificDetails(new UpdateReplicationProtectedItemProviderInput()); + model = BinaryData.fromObject(model).toObject(UpdateReplicationProtectedItemInputProperties.class); + Assertions.assertEquals("lpqblylsyxk", model.recoveryAzureVMName()); + Assertions.assertEquals("nsj", model.recoveryAzureVMSize()); + Assertions.assertEquals("vti", model.selectedRecoveryAzureNetworkId()); + Assertions.assertEquals("xsdszuempsb", model.selectedTfoAzureNetworkId()); + Assertions.assertEquals("f", model.selectedSourceNicId()); + Assertions.assertEquals("eyvpnqicvinvkj", model.enableRdpOnTargetOption()); + Assertions.assertEquals("rbuukzclewyhmlwp", model.vmNics().get(0).nicId()); + Assertions.assertEquals("pofncck", model.vmNics().get(0).ipConfigs().get(0).ipConfigName()); + Assertions.assertEquals(false, model.vmNics().get(0).ipConfigs().get(0).isPrimary()); + Assertions.assertEquals(true, model.vmNics().get(0).ipConfigs().get(0).isSeletedForFailover()); + Assertions.assertEquals("hxx", model.vmNics().get(0).ipConfigs().get(0).recoverySubnetName()); + Assertions.assertEquals("yq", model.vmNics().get(0).ipConfigs().get(0).recoveryStaticIpAddress()); + Assertions.assertEquals("zfeqztppri", model.vmNics().get(0).ipConfigs().get(0).recoveryPublicIpAddressId()); + Assertions.assertEquals("or", + model.vmNics().get(0).ipConfigs().get(0).recoveryLBBackendAddressPoolIds().get(0)); + Assertions.assertEquals("fuvglsbjjca", model.vmNics().get(0).ipConfigs().get(0).tfoSubnetName()); + Assertions.assertEquals("xbvtvudu", model.vmNics().get(0).ipConfigs().get(0).tfoStaticIpAddress()); + Assertions.assertEquals("cormr", model.vmNics().get(0).ipConfigs().get(0).tfoPublicIpAddressId()); + Assertions.assertEquals("tvcof", model.vmNics().get(0).ipConfigs().get(0).tfoLBBackendAddressPoolIds().get(0)); + Assertions.assertEquals("xicslfao", model.vmNics().get(0).selectionType()); + Assertions.assertEquals("piyylhalnswhccsp", model.vmNics().get(0).recoveryNetworkSecurityGroupId()); + Assertions.assertEquals(true, model.vmNics().get(0).enableAcceleratedNetworkingOnRecovery()); + Assertions.assertEquals("vwitqscyw", model.vmNics().get(0).tfoNetworkSecurityGroupId()); + Assertions.assertEquals(false, model.vmNics().get(0).enableAcceleratedNetworkingOnTfo()); + Assertions.assertEquals("oluhczbwemh", model.vmNics().get(0).recoveryNicName()); + Assertions.assertEquals("rsbrgzdwm", model.vmNics().get(0).recoveryNicResourceGroupName()); + Assertions.assertEquals(true, model.vmNics().get(0).reuseExistingNic()); + Assertions.assertEquals("pqwd", model.vmNics().get(0).tfoNicName()); + Assertions.assertEquals("gicccnxqhuex", model.vmNics().get(0).tfoNicResourceGroupName()); + Assertions.assertEquals(true, model.vmNics().get(0).tfoReuseExistingNic()); + Assertions.assertEquals("lstvlzywe", model.vmNics().get(0).targetNicName()); + Assertions.assertEquals(LicenseType.WINDOWS_SERVER, model.licenseType()); + Assertions.assertEquals("zcjaesgvvsccy", model.recoveryAvailabilitySetId()); + } +} diff --git a/sdk/workloadssapvirtualinstance/azure-resourcemanager-workloadssapvirtualinstance/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-workloadssapvirtualinstance/reflect-config.json b/sdk/workloadssapvirtualinstance/azure-resourcemanager-workloadssapvirtualinstance/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-workloadssapvirtualinstance/reflect-config.json new file mode 100644 index 000000000000..ab96128bed0d --- /dev/null +++ b/sdk/workloadssapvirtualinstance/azure-resourcemanager-workloadssapvirtualinstance/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-workloadssapvirtualinstance/reflect-config.json @@ -0,0 +1,606 @@ +[ { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapSizingRecommendationRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.fluent.models.SapSizingRecommendationResultInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapSupportedSkusRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.fluent.models.SapSupportedResourceSkusResultInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapSupportedSku", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapDiskConfigurationsRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.fluent.models.SapDiskConfigurationsResultInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapDiskConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.DiskVolumeConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.DiskSku", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.DiskDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapAvailabilityZoneDetailsRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.fluent.models.SapAvailabilityZoneDetailsResultInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapAvailabilityZonePair", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.fluent.models.SapVirtualInstanceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.UserAssignedServiceIdentity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.UserAssignedIdentity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapVirtualInstanceProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ManagedRGConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapVirtualInstanceError", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ErrorDefinition", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.UpdateSapVirtualInstanceRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.UpdateSapVirtualInstanceProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapVirtualInstanceList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.fluent.models.SapCentralServerInstanceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapCentralServerProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.MessageServerProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.EnqueueServerProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.GatewayServerProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.EnqueueReplicationServerProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.LoadBalancerDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.CentralServerVmDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.StorageInformation", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.UpdateSapCentralInstanceRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapCentralInstanceList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.fluent.models.SapDatabaseInstanceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapDatabaseProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.DatabaseVmDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.UpdateSapDatabaseInstanceRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapDatabaseInstanceList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.fluent.models.SapApplicationServerInstanceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapApplicationServerProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ApplicationServerVmDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.UpdateSapApplicationInstanceRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapApplicationServerInstanceList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.StartRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.fluent.models.OperationStatusResultInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.StopRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.OperationListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.fluent.models.OperationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.OperationDisplay", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ImageReference", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.WindowsConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.OSConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SshPublicKey", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SshConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.LinuxConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SshKeyPair", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.OSProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SingleServerRecommendationResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ThreeTierRecommendationResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.DiskConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.VirtualMachineConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SingleServerConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.NetworkConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SingleServerCustomResourceNames", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.InfrastructureConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.CentralServerConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.DatabaseConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ApplicationServerConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.HighAvailabilityConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SkipFileShareConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.FileShareConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.CreateAndMountFileShareConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.MountFileShareConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.StorageConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ThreeTierConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ThreeTierCustomResourceNames", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SingleServerFullResourceNames", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.VirtualMachineResourceNames", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.NetworkInterfaceResourceNames", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ThreeTierFullResourceNames", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.CentralServerFullResourceNames", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.LoadBalancerResourceNames", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ApplicationServerFullResourceNames", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.DatabaseServerFullResourceNames", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SharedStorageResourceNames", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SoftwareConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ServiceInitiatedSoftwareConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.HighAvailabilitySoftwareConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapInstallWithoutOSConfigSoftwareConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ExternalInstallationSoftwareConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.DiscoveryConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.DeploymentConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.DeploymentWithOSConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.OsSapConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.DeployerVmPackages", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapEnvironmentType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapProductType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapDeploymentType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapDatabaseType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapDatabaseScaleMethod", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapHighAvailabilityType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.DiskSkuName", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ManagedServiceIdentityType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ManagedResourcesNetworkAccessType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapConfigurationType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapVirtualInstanceStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapHealthState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapVirtualInstanceState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapVirtualInstanceProvisioningState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.EnqueueReplicationServerType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.CentralServerVirtualMachineType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ApplicationServerVirtualMachineType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.Origin", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ActionType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.OSType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.NamingPatternType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.ConfigurationType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadssapvirtualinstance.models.SapSoftwareInstallationType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +} ] \ No newline at end of file diff --git a/sdk/workloadssapvirtualinstance/azure-resourcemanager-workloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadssapvirtualinstance/generated/ResourceProviderSapAvailabilityZoneDetailsSamples.java b/sdk/workloadssapvirtualinstance/azure-resourcemanager-workloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadssapvirtualinstance/generated/ResourceProviderSapAvailabilityZoneDetailsSamples.java new file mode 100644 index 000000000000..af174c9edc1f --- /dev/null +++ b/sdk/workloadssapvirtualinstance/azure-resourcemanager-workloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadssapvirtualinstance/generated/ResourceProviderSapAvailabilityZoneDetailsSamples.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.workloadssapvirtualinstance.generated; + +import com.azure.resourcemanager.workloadssapvirtualinstance.models.SapAvailabilityZoneDetailsRequest; +import com.azure.resourcemanager.workloadssapvirtualinstance.models.SapDatabaseType; +import com.azure.resourcemanager.workloadssapvirtualinstance.models.SapProductType; + +/** + * Samples for ResourceProvider SapAvailabilityZoneDetails. + */ +public final class ResourceProviderSapAvailabilityZoneDetailsSamples { + /* + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/ + * examples/sapvirtualinstances/SAPAvailabilityZoneDetails_northeurope.json + */ + /** + * Sample code: SAPAvailabilityZoneDetails_northeurope. + * + * @param manager Entry point to WorkloadsSapVirtualInstanceManager. + */ + public static void sAPAvailabilityZoneDetailsNortheurope( + com.azure.resourcemanager.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceManager manager) { + manager.resourceProviders().sapAvailabilityZoneDetailsWithResponse( + "centralus", new SapAvailabilityZoneDetailsRequest().withAppLocation("northeurope") + .withSapProduct(SapProductType.S4HANA).withDatabaseType(SapDatabaseType.HANA), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/ + * examples/sapvirtualinstances/SAPAvailabilityZoneDetails_eastus.json + */ + /** + * Sample code: SAPAvailabilityZoneDetails_eastus. + * + * @param manager Entry point to WorkloadsSapVirtualInstanceManager. + */ + public static void sAPAvailabilityZoneDetailsEastus( + com.azure.resourcemanager.workloadssapvirtualinstance.WorkloadsSapVirtualInstanceManager manager) { + manager.resourceProviders().sapAvailabilityZoneDetailsWithResponse( + "centralus", new SapAvailabilityZoneDetailsRequest().withAppLocation("eastus") + .withSapProduct(SapProductType.S4HANA).withDatabaseType(SapDatabaseType.HANA), + com.azure.core.util.Context.NONE); + } +} From 37bd87149e95dbb897fe0abcb764978c3daa847f Mon Sep 17 00:00:00 2001 From: glenn Date: Thu, 12 Sep 2024 18:05:23 -0400 Subject: [PATCH 104/128] unmod openai file --- .../implementation/OpenAIClientImpl.java | 1058 ++++++++++++++++- 1 file changed, 1048 insertions(+), 10 deletions(-) diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/OpenAIClientImpl.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/OpenAIClientImpl.java index 869340dba788..dda56048d1f1 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/OpenAIClientImpl.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/OpenAIClientImpl.java @@ -6,7 +6,9 @@ import com.azure.ai.openai.OpenAIServiceVersion; 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.Host; import com.azure.core.annotation.HostParam; @@ -373,6 +375,184 @@ Response getEmbeddingsSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData embeddingsOptions, RequestOptions requestOptions, Context context); + + @Get("/files") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listFiles(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/files") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listFilesSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + // @Multipart not supported by RestProxy + @Post("/files") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> uploadFile(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("multipart/form-data") BinaryData uploadFileRequest, RequestOptions requestOptions, + Context context); + + // @Multipart not supported by RestProxy + @Post("/files") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response uploadFileSync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("multipart/form-data") BinaryData uploadFileRequest, RequestOptions requestOptions, + Context context); + + @Delete("/files/{fileId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteFile(@HostParam("endpoint") String endpoint, + @PathParam("fileId") String fileId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Delete("/files/{fileId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteFileSync(@HostParam("endpoint") String endpoint, @PathParam("fileId") String fileId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/files/{fileId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getFile(@HostParam("endpoint") String endpoint, @PathParam("fileId") String fileId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/files/{fileId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getFileSync(@HostParam("endpoint") String endpoint, @PathParam("fileId") String fileId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/files/{fileId}/content") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getFileContent(@HostParam("endpoint") String endpoint, + @PathParam("fileId") String fileId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("/files/{fileId}/content") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getFileContentSync(@HostParam("endpoint") String endpoint, + @PathParam("fileId") String fileId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("/batches") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listBatches(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/batches") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listBatchesSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/batches") + @ExpectedResponses({ 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createBatch(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData createBatchRequest, RequestOptions requestOptions, + Context context); + + @Post("/batches") + @ExpectedResponses({ 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createBatchSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData createBatchRequest, RequestOptions requestOptions, + Context context); + + @Get("/batches/{batchId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getBatch(@HostParam("endpoint") String endpoint, + @PathParam("batchId") String batchId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("/batches/{batchId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getBatchSync(@HostParam("endpoint") String endpoint, @PathParam("batchId") String batchId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/batches/{batchId}/cancel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> cancelBatch(@HostParam("endpoint") String endpoint, + @PathParam("batchId") String batchId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Post("/batches/{batchId}/cancel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response cancelBatchSync(@HostParam("endpoint") String endpoint, + @PathParam("batchId") String batchId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); } /** @@ -802,7 +982,7 @@ public Response getAudioTranslationAsResponseObjectWithResponse(Stri * filtered: boolean (Required) * detected: boolean (Required) * URL: String (Optional) - * license: String (Required) + * license: String (Optional) * } * } * logprobs (Required): { @@ -953,7 +1133,7 @@ public Mono> getCompletionsWithResponseAsync(String deploym * filtered: boolean (Required) * detected: boolean (Required) * URL: String (Optional) - * license: String (Required) + * license: String (Optional) * } * } * logprobs (Required): { @@ -1142,9 +1322,6 @@ public Response getCompletionsWithResponse(String deploymentOrModelN * } * index: int (Required) * finish_reason: String(stop/length/content_filter/function_call/tool_calls) (Required) - * finish_details (Optional): { - * type: String (Required) - * } * delta (Optional): (recursive schema, see delta above) * content_filter_results (Optional): { * sexual (Optional): { @@ -1184,7 +1361,7 @@ public Response getCompletionsWithResponse(String deploymentOrModelN * filtered: boolean (Required) * detected: boolean (Required) * URL: String (Optional) - * license: String (Required) + * license: String (Optional) * } * } * enhancements (Optional): { @@ -1397,9 +1574,6 @@ public Mono> getChatCompletionsWithResponseAsync(String dep * } * index: int (Required) * finish_reason: String(stop/length/content_filter/function_call/tool_calls) (Required) - * finish_details (Optional): { - * type: String (Required) - * } * delta (Optional): (recursive schema, see delta above) * content_filter_results (Optional): { * sexual (Optional): { @@ -1439,7 +1613,7 @@ public Mono> getChatCompletionsWithResponseAsync(String dep * filtered: boolean (Required) * detected: boolean (Required) * URL: String (Optional) - * license: String (Required) + * license: String (Optional) * } * } * enhancements (Optional): { @@ -1877,4 +2051,868 @@ public Response getEmbeddingsWithResponse(String deploymentOrModelNa return service.getEmbeddingsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), deploymentOrModelName, contentType, accept, embeddingsOptions, requestOptions, Context.NONE); } + + /** + * Gets a list of previously uploaded files. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
purposeStringNoA value that, when provided, limits list results to files + * matching the corresponding purpose. Allowed values: "fine-tune", "fine-tune-results", "assistants", + * "assistants_output", "batch", "batch_output", "vision".
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     object: String (Required)
+     *     data (Required): [
+     *          (Required){
+     *             object: String (Required)
+     *             id: String (Required)
+     *             bytes: int (Required)
+     *             filename: String (Required)
+     *             created_at: long (Required)
+     *             purpose: String(fine-tune/fine-tune-results/assistants/assistants_output/batch/batch_output/vision) (Required)
+     *             status: String(uploaded/pending/running/processed/error/deleting/deleted) (Optional)
+     *             status_details: String (Optional)
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of previously uploaded files along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listFilesWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listFiles(this.getEndpoint(), accept, requestOptions, context)); + } + + /** + * Gets a list of previously uploaded files. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
purposeStringNoA value that, when provided, limits list results to files + * matching the corresponding purpose. Allowed values: "fine-tune", "fine-tune-results", "assistants", + * "assistants_output", "batch", "batch_output", "vision".
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     object: String (Required)
+     *     data (Required): [
+     *          (Required){
+     *             object: String (Required)
+     *             id: String (Required)
+     *             bytes: int (Required)
+     *             filename: String (Required)
+     *             created_at: long (Required)
+     *             purpose: String(fine-tune/fine-tune-results/assistants/assistants_output/batch/batch_output/vision) (Required)
+     *             status: String(uploaded/pending/running/processed/error/deleting/deleted) (Optional)
+     *             status_details: String (Optional)
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of previously uploaded files along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listFilesWithResponse(RequestOptions requestOptions) { + final String accept = "application/json"; + return service.listFilesSync(this.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * Uploads a file for use by other operations. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     object: String (Required)
+     *     id: String (Required)
+     *     bytes: int (Required)
+     *     filename: String (Required)
+     *     created_at: long (Required)
+     *     purpose: String(fine-tune/fine-tune-results/assistants/assistants_output/batch/batch_output/vision) (Required)
+     *     status: String(uploaded/pending/running/processed/error/deleting/deleted) (Optional)
+     *     status_details: String (Optional)
+     * }
+     * }
+ * + * @param uploadFileRequest The uploadFileRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents an assistant that can call the model and use tools along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> uploadFileWithResponseAsync(BinaryData uploadFileRequest, + RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.uploadFile(this.getEndpoint(), contentType, accept, + uploadFileRequest, requestOptions, context)); + } + + /** + * Uploads a file for use by other operations. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     object: String (Required)
+     *     id: String (Required)
+     *     bytes: int (Required)
+     *     filename: String (Required)
+     *     created_at: long (Required)
+     *     purpose: String(fine-tune/fine-tune-results/assistants/assistants_output/batch/batch_output/vision) (Required)
+     *     status: String(uploaded/pending/running/processed/error/deleting/deleted) (Optional)
+     *     status_details: String (Optional)
+     * }
+     * }
+ * + * @param uploadFileRequest The uploadFileRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents an assistant that can call the model and use tools along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response uploadFileWithResponse(BinaryData uploadFileRequest, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; + final String accept = "application/json"; + return service.uploadFileSync(this.getEndpoint(), contentType, accept, uploadFileRequest, requestOptions, + Context.NONE); + } + + /** + * Delete a previously uploaded file. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     deleted: boolean (Required)
+     *     object: String (Required)
+     * }
+     * }
+ * + * @param fileId The ID of the file to delete. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a status response from a file deletion operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteFileWithResponseAsync(String fileId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.deleteFile(this.getEndpoint(), fileId, accept, requestOptions, context)); + } + + /** + * Delete a previously uploaded file. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     deleted: boolean (Required)
+     *     object: String (Required)
+     * }
+     * }
+ * + * @param fileId The ID of the file to delete. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a status response from a file deletion operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteFileWithResponse(String fileId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deleteFileSync(this.getEndpoint(), fileId, accept, requestOptions, Context.NONE); + } + + /** + * Returns information about a specific file. Does not retrieve file content. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     object: String (Required)
+     *     id: String (Required)
+     *     bytes: int (Required)
+     *     filename: String (Required)
+     *     created_at: long (Required)
+     *     purpose: String(fine-tune/fine-tune-results/assistants/assistants_output/batch/batch_output/vision) (Required)
+     *     status: String(uploaded/pending/running/processed/error/deleting/deleted) (Optional)
+     *     status_details: String (Optional)
+     * }
+     * }
+ * + * @param fileId The ID of the file to retrieve. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents an assistant that can call the model and use tools along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getFileWithResponseAsync(String fileId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getFile(this.getEndpoint(), fileId, accept, requestOptions, context)); + } + + /** + * Returns information about a specific file. Does not retrieve file content. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     object: String (Required)
+     *     id: String (Required)
+     *     bytes: int (Required)
+     *     filename: String (Required)
+     *     created_at: long (Required)
+     *     purpose: String(fine-tune/fine-tune-results/assistants/assistants_output/batch/batch_output/vision) (Required)
+     *     status: String(uploaded/pending/running/processed/error/deleting/deleted) (Optional)
+     *     status_details: String (Optional)
+     * }
+     * }
+ * + * @param fileId The ID of the file to retrieve. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents an assistant that can call the model and use tools along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getFileWithResponse(String fileId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getFileSync(this.getEndpoint(), fileId, accept, requestOptions, Context.NONE); + } + + /** + * Returns information about a specific file. Does not retrieve file content. + *

Response Body Schema

+ * + *
{@code
+     * byte[]
+     * }
+ * + * @param fileId The ID of the file to retrieve. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represent a byte array along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getFileContentWithResponseAsync(String fileId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.getFileContent(this.getEndpoint(), fileId, accept, requestOptions, context)); + } + + /** + * Returns information about a specific file. Does not retrieve file content. + *

Response Body Schema

+ * + *
{@code
+     * byte[]
+     * }
+ * + * @param fileId The ID of the file to retrieve. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represent a byte array along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getFileContentWithResponse(String fileId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getFileContentSync(this.getEndpoint(), fileId, accept, requestOptions, Context.NONE); + } + + /** + * Gets a list of all batches owned by the Azure OpenAI resource. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
afterStringNoIdentifier for the last event from the previous pagination + * request.
limitIntegerNoNumber of batches to retrieve. Defaults to 20.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     object: String (Required)
+     *     data (Optional): [
+     *          (Optional){
+     *             id: String (Required)
+     *             object: String (Required)
+     *             endpoint: String (Optional)
+     *             errors (Optional): {
+     *                 object: String (Required)
+     *                 data (Optional): [
+     *                      (Optional){
+     *                         code: String (Optional)
+     *                         message: String (Optional)
+     *                         param: String (Optional)
+     *                         line: Integer (Optional)
+     *                     }
+     *                 ]
+     *             }
+     *             input_file_id: String (Required)
+     *             completion_window: String (Optional)
+     *             status: String(validating/failed/in_progress/finalizing/completed/expired/cancelling/cancelled) (Optional)
+     *             output_file_id: String (Optional)
+     *             error_file_id: String (Optional)
+     *             created_at: Long (Optional)
+     *             in_progress_at: Long (Optional)
+     *             expires_at: Long (Optional)
+     *             finalizing_at: Long (Optional)
+     *             completed_at: Long (Optional)
+     *             failed_at: Long (Optional)
+     *             expired_at: Long (Optional)
+     *             cancelling_at: Long (Optional)
+     *             cancelled_at: Long (Optional)
+     *             request_counts (Optional): {
+     *                 total: Integer (Optional)
+     *                 completed: Integer (Optional)
+     *                 failed: Integer (Optional)
+     *             }
+     *             metadata (Optional): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     ]
+     *     first_id: String (Optional)
+     *     last_id: String (Optional)
+     *     has_more: Boolean (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of all batches owned by the Azure OpenAI resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listBatchesWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listBatches(this.getEndpoint(), accept, requestOptions, context)); + } + + /** + * Gets a list of all batches owned by the Azure OpenAI resource. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
afterStringNoIdentifier for the last event from the previous pagination + * request.
limitIntegerNoNumber of batches to retrieve. Defaults to 20.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     object: String (Required)
+     *     data (Optional): [
+     *          (Optional){
+     *             id: String (Required)
+     *             object: String (Required)
+     *             endpoint: String (Optional)
+     *             errors (Optional): {
+     *                 object: String (Required)
+     *                 data (Optional): [
+     *                      (Optional){
+     *                         code: String (Optional)
+     *                         message: String (Optional)
+     *                         param: String (Optional)
+     *                         line: Integer (Optional)
+     *                     }
+     *                 ]
+     *             }
+     *             input_file_id: String (Required)
+     *             completion_window: String (Optional)
+     *             status: String(validating/failed/in_progress/finalizing/completed/expired/cancelling/cancelled) (Optional)
+     *             output_file_id: String (Optional)
+     *             error_file_id: String (Optional)
+     *             created_at: Long (Optional)
+     *             in_progress_at: Long (Optional)
+     *             expires_at: Long (Optional)
+     *             finalizing_at: Long (Optional)
+     *             completed_at: Long (Optional)
+     *             failed_at: Long (Optional)
+     *             expired_at: Long (Optional)
+     *             cancelling_at: Long (Optional)
+     *             cancelled_at: Long (Optional)
+     *             request_counts (Optional): {
+     *                 total: Integer (Optional)
+     *                 completed: Integer (Optional)
+     *                 failed: Integer (Optional)
+     *             }
+     *             metadata (Optional): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     ]
+     *     first_id: String (Optional)
+     *     last_id: String (Optional)
+     *     has_more: Boolean (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of all batches owned by the Azure OpenAI resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listBatchesWithResponse(RequestOptions requestOptions) { + final String accept = "application/json"; + return service.listBatchesSync(this.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * Creates and executes a batch from an uploaded file of requests. + * Response includes details of the enqueued job including job status. + * The ID of the result file is added to the response once complete. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     endpoint: String (Required)
+     *     input_file_id: String (Required)
+     *     completion_window: String (Required)
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     endpoint: String (Optional)
+     *     errors (Optional): {
+     *         object: String (Required)
+     *         data (Optional): [
+     *              (Optional){
+     *                 code: String (Optional)
+     *                 message: String (Optional)
+     *                 param: String (Optional)
+     *                 line: Integer (Optional)
+     *             }
+     *         ]
+     *     }
+     *     input_file_id: String (Required)
+     *     completion_window: String (Optional)
+     *     status: String(validating/failed/in_progress/finalizing/completed/expired/cancelling/cancelled) (Optional)
+     *     output_file_id: String (Optional)
+     *     error_file_id: String (Optional)
+     *     created_at: Long (Optional)
+     *     in_progress_at: Long (Optional)
+     *     expires_at: Long (Optional)
+     *     finalizing_at: Long (Optional)
+     *     completed_at: Long (Optional)
+     *     failed_at: Long (Optional)
+     *     expired_at: Long (Optional)
+     *     cancelling_at: Long (Optional)
+     *     cancelled_at: Long (Optional)
+     *     request_counts (Optional): {
+     *         total: Integer (Optional)
+     *         completed: Integer (Optional)
+     *         failed: Integer (Optional)
+     *     }
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param createBatchRequest The specification of the batch to create and execute. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the Batch object along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createBatchWithResponseAsync(BinaryData createBatchRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createBatch(this.getEndpoint(), contentType, accept, + createBatchRequest, requestOptions, context)); + } + + /** + * Creates and executes a batch from an uploaded file of requests. + * Response includes details of the enqueued job including job status. + * The ID of the result file is added to the response once complete. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     endpoint: String (Required)
+     *     input_file_id: String (Required)
+     *     completion_window: String (Required)
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     endpoint: String (Optional)
+     *     errors (Optional): {
+     *         object: String (Required)
+     *         data (Optional): [
+     *              (Optional){
+     *                 code: String (Optional)
+     *                 message: String (Optional)
+     *                 param: String (Optional)
+     *                 line: Integer (Optional)
+     *             }
+     *         ]
+     *     }
+     *     input_file_id: String (Required)
+     *     completion_window: String (Optional)
+     *     status: String(validating/failed/in_progress/finalizing/completed/expired/cancelling/cancelled) (Optional)
+     *     output_file_id: String (Optional)
+     *     error_file_id: String (Optional)
+     *     created_at: Long (Optional)
+     *     in_progress_at: Long (Optional)
+     *     expires_at: Long (Optional)
+     *     finalizing_at: Long (Optional)
+     *     completed_at: Long (Optional)
+     *     failed_at: Long (Optional)
+     *     expired_at: Long (Optional)
+     *     cancelling_at: Long (Optional)
+     *     cancelled_at: Long (Optional)
+     *     request_counts (Optional): {
+     *         total: Integer (Optional)
+     *         completed: Integer (Optional)
+     *         failed: Integer (Optional)
+     *     }
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param createBatchRequest The specification of the batch to create and execute. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the Batch object along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createBatchWithResponse(BinaryData createBatchRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createBatchSync(this.getEndpoint(), contentType, accept, createBatchRequest, requestOptions, + Context.NONE); + } + + /** + * Gets details for a single batch specified by the given batchID. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     endpoint: String (Optional)
+     *     errors (Optional): {
+     *         object: String (Required)
+     *         data (Optional): [
+     *              (Optional){
+     *                 code: String (Optional)
+     *                 message: String (Optional)
+     *                 param: String (Optional)
+     *                 line: Integer (Optional)
+     *             }
+     *         ]
+     *     }
+     *     input_file_id: String (Required)
+     *     completion_window: String (Optional)
+     *     status: String(validating/failed/in_progress/finalizing/completed/expired/cancelling/cancelled) (Optional)
+     *     output_file_id: String (Optional)
+     *     error_file_id: String (Optional)
+     *     created_at: Long (Optional)
+     *     in_progress_at: Long (Optional)
+     *     expires_at: Long (Optional)
+     *     finalizing_at: Long (Optional)
+     *     completed_at: Long (Optional)
+     *     failed_at: Long (Optional)
+     *     expired_at: Long (Optional)
+     *     cancelling_at: Long (Optional)
+     *     cancelled_at: Long (Optional)
+     *     request_counts (Optional): {
+     *         total: Integer (Optional)
+     *         completed: Integer (Optional)
+     *         failed: Integer (Optional)
+     *     }
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param batchId The identifier of the batch. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return details for a single batch specified by the given batchID along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getBatchWithResponseAsync(String batchId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getBatch(this.getEndpoint(), batchId, accept, requestOptions, context)); + } + + /** + * Gets details for a single batch specified by the given batchID. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     endpoint: String (Optional)
+     *     errors (Optional): {
+     *         object: String (Required)
+     *         data (Optional): [
+     *              (Optional){
+     *                 code: String (Optional)
+     *                 message: String (Optional)
+     *                 param: String (Optional)
+     *                 line: Integer (Optional)
+     *             }
+     *         ]
+     *     }
+     *     input_file_id: String (Required)
+     *     completion_window: String (Optional)
+     *     status: String(validating/failed/in_progress/finalizing/completed/expired/cancelling/cancelled) (Optional)
+     *     output_file_id: String (Optional)
+     *     error_file_id: String (Optional)
+     *     created_at: Long (Optional)
+     *     in_progress_at: Long (Optional)
+     *     expires_at: Long (Optional)
+     *     finalizing_at: Long (Optional)
+     *     completed_at: Long (Optional)
+     *     failed_at: Long (Optional)
+     *     expired_at: Long (Optional)
+     *     cancelling_at: Long (Optional)
+     *     cancelled_at: Long (Optional)
+     *     request_counts (Optional): {
+     *         total: Integer (Optional)
+     *         completed: Integer (Optional)
+     *         failed: Integer (Optional)
+     *     }
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param batchId The identifier of the batch. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return details for a single batch specified by the given batchID along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getBatchWithResponse(String batchId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getBatchSync(this.getEndpoint(), batchId, accept, requestOptions, Context.NONE); + } + + /** + * Gets details for a single batch specified by the given batchID. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     endpoint: String (Optional)
+     *     errors (Optional): {
+     *         object: String (Required)
+     *         data (Optional): [
+     *              (Optional){
+     *                 code: String (Optional)
+     *                 message: String (Optional)
+     *                 param: String (Optional)
+     *                 line: Integer (Optional)
+     *             }
+     *         ]
+     *     }
+     *     input_file_id: String (Required)
+     *     completion_window: String (Optional)
+     *     status: String(validating/failed/in_progress/finalizing/completed/expired/cancelling/cancelled) (Optional)
+     *     output_file_id: String (Optional)
+     *     error_file_id: String (Optional)
+     *     created_at: Long (Optional)
+     *     in_progress_at: Long (Optional)
+     *     expires_at: Long (Optional)
+     *     finalizing_at: Long (Optional)
+     *     completed_at: Long (Optional)
+     *     failed_at: Long (Optional)
+     *     expired_at: Long (Optional)
+     *     cancelling_at: Long (Optional)
+     *     cancelled_at: Long (Optional)
+     *     request_counts (Optional): {
+     *         total: Integer (Optional)
+     *         completed: Integer (Optional)
+     *         failed: Integer (Optional)
+     *     }
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param batchId The identifier of the batch. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return details for a single batch specified by the given batchID along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> cancelBatchWithResponseAsync(String batchId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.cancelBatch(this.getEndpoint(), batchId, accept, requestOptions, context)); + } + + /** + * Gets details for a single batch specified by the given batchID. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     endpoint: String (Optional)
+     *     errors (Optional): {
+     *         object: String (Required)
+     *         data (Optional): [
+     *              (Optional){
+     *                 code: String (Optional)
+     *                 message: String (Optional)
+     *                 param: String (Optional)
+     *                 line: Integer (Optional)
+     *             }
+     *         ]
+     *     }
+     *     input_file_id: String (Required)
+     *     completion_window: String (Optional)
+     *     status: String(validating/failed/in_progress/finalizing/completed/expired/cancelling/cancelled) (Optional)
+     *     output_file_id: String (Optional)
+     *     error_file_id: String (Optional)
+     *     created_at: Long (Optional)
+     *     in_progress_at: Long (Optional)
+     *     expires_at: Long (Optional)
+     *     finalizing_at: Long (Optional)
+     *     completed_at: Long (Optional)
+     *     failed_at: Long (Optional)
+     *     expired_at: Long (Optional)
+     *     cancelling_at: Long (Optional)
+     *     cancelled_at: Long (Optional)
+     *     request_counts (Optional): {
+     *         total: Integer (Optional)
+     *         completed: Integer (Optional)
+     *         failed: Integer (Optional)
+     *     }
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param batchId The identifier of the batch. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return details for a single batch specified by the given batchID along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response cancelBatchWithResponse(String batchId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.cancelBatchSync(this.getEndpoint(), batchId, accept, requestOptions, Context.NONE); + } } From 015dba29d0fb46dfc3a47afb31169297378baa28 Mon Sep 17 00:00:00 2001 From: glenn Date: Thu, 12 Sep 2024 18:09:40 -0400 Subject: [PATCH 105/128] update HTTP client link --- sdk/ai/azure-ai-inference/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/ai/azure-ai-inference/README.md b/sdk/ai/azure-ai-inference/README.md index a2e434839455..ae318abd9625 100644 --- a/sdk/ai/azure-ai-inference/README.md +++ b/sdk/ai/azure-ai-inference/README.md @@ -186,7 +186,7 @@ be found here: [log levels][logLevels]. ### Default HTTP Client All client libraries by default use the Netty HTTP client. Adding the above dependency will automatically configure the client library to use the Netty HTTP client. Configuring or changing the HTTP client is detailed in the -[HTTP clients wiki](https://github.com/Azure/azure-sdk-for-java/wiki/HTTP-clients). +[HTTP clients wiki](https://github.com/Azure/azure-sdk-for-java/wiki/Configure-HTTP-Clients). ### Default SSL library All client libraries, by default, use the Tomcat-native Boring SSL library to enable native-level performance for SSL From d16a4d6c73ef4ee19f97cee8da5bd25bbedd778a Mon Sep 17 00:00:00 2001 From: glenn Date: Fri, 13 Sep 2024 12:37:48 -0400 Subject: [PATCH 106/128] spacing for typespec gen --- .../inference/ChatCompletionsAsyncClient.java | 33 ++++++++++--------- .../ai/inference/ChatCompletionsClient.java | 5 ++- .../ai/inference/EmbeddingsAsyncClient.java | 12 ++++--- .../azure/ai/inference/EmbeddingsClient.java | 5 +-- .../ai/inference/EmbeddingsClientBuilder.java | 1 - 5 files changed, 30 insertions(+), 26 deletions(-) diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java index a4703f2594ba..2b4352175d95 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java @@ -150,8 +150,9 @@ public final class ChatCompletionsAsyncClient { * provided prompt data along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> completeWithBinaryResponse(BinaryData completeRequest, RequestOptions requestOptions) { - return this.serviceClient.completeWithResponseAsync(completeRequest, requestOptions); + private Mono> completeWithBinaryResponse(BinaryData completeRequest, + RequestOptions requestOptions) { + return this.serviceClient.completeWithResponseAsync(completeRequest, requestOptions); } /** @@ -159,6 +160,7 @@ private Mono> completeWithBinaryResponse(BinaryData complet * Completions support a wide variety of tasks and generate text that continues from or "completes" * provided prompt data. The method makes a REST API call to the `/chat/completions` route * on the given endpoint. + * * @param options The configuration information for a chat completions request. Completions support a * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -175,25 +177,26 @@ public Mono> completeWithResponse(ChatCompletionsOptio RequestOptions requestOptions = new RequestOptions(); CompleteRequest completeRequestObj = new CompleteRequest(options.getMessages()).setFrequencyPenalty(options.getFrequencyPenalty()) - .setStream(options.isStream()) - .setPresencePenalty(options.getPresencePenalty()) - .setTemperature(options.getTemperature()) - .setTopP(options.getTopP()) - .setMaxTokens(options.getMaxTokens()) - .setResponseFormat(options.getResponseFormat()) - .setStop(options.getStop()) - .setTools(options.getTools()) - .setToolChoice(options.getToolChoice()) - .setSeed(options.getSeed()) - .setModel(options.getModel()); + .setStream(options.isStream()) + .setPresencePenalty(options.getPresencePenalty()) + .setTemperature(options.getTemperature()) + .setTopP(options.getTopP()) + .setMaxTokens(options.getMaxTokens()) + .setResponseFormat(options.getResponseFormat()) + .setStop(options.getStop()) + .setTools(options.getTools()) + .setToolChoice(options.getToolChoice()) + .setSeed(options.getSeed()) + .setModel(options.getModel()); BinaryData completeRequest = BinaryData.fromObject(completeRequestObj); ExtraParameters extraParams = options.getExtraParams(); if (extraParams != null) { requestOptions.setHeader(HttpHeaderName.fromString("extra-parameters"), extraParams.toString()); } - return completeWithBinaryResponse(completeRequest, requestOptions).map( - methodDataResponse -> new SimpleResponse<>(methodDataResponse, methodDataResponse.getValue().toObject(ChatCompletions.class))); + return completeWithBinaryResponse(completeRequest, requestOptions) + .map(methodDataResponse -> new SimpleResponse<>(methodDataResponse, + methodDataResponse.getValue().toObject(ChatCompletions.class))); } /** diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java index f2b06cf31a62..bc52b778616c 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java @@ -21,15 +21,14 @@ import com.azure.core.http.rest.Response; import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.BinaryData; +import java.util.Objects; import com.azure.ai.inference.implementation.InferenceServerSentEvents; import com.azure.ai.inference.models.ChatCompletionsOptions; import com.azure.ai.inference.implementation.ChatCompletionsUtils; import com.azure.ai.inference.models.StreamingChatCompletionsUpdate; import com.azure.core.util.IterableStream; import reactor.core.publisher.Flux; - import java.nio.ByteBuffer; -import java.util.Objects; /** * Initializes a new instance of the synchronous ChatCompletionsClient type. @@ -364,7 +363,7 @@ public IterableStream completeStream(ChatComplet */ @ServiceMethod(returns = ReturnType.SINGLE) public Response completeStreamWithResponse(BinaryData chatCompletionsOptions, - RequestOptions requestOptions) { + RequestOptions requestOptions) { return serviceClient.completeWithResponse(chatCompletionsOptions, requestOptions); } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java index da030b631e27..8b739b4d6e64 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java @@ -166,9 +166,10 @@ Mono> getModelInfoWithResponse(RequestOptions requestOption * recommendations, and other similar scenarios on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> embedWithResponse(List input, Integer dimensions, EmbeddingEncodingFormat encodingFormat, - EmbeddingInputType inputType, String model, ExtraParameters extraParams) { - RequestOptions requestOptions = new RequestOptions(); + public Mono> embedWithResponse(List input, Integer dimensions, + EmbeddingEncodingFormat encodingFormat, EmbeddingInputType inputType, String model, + ExtraParameters extraParams) { + RequestOptions requestOptions = new RequestOptions(); EmbedRequest embedRequestObj = new EmbedRequest(input).setDimensions(dimensions) .setEncodingFormat(encodingFormat) .setInputType(inputType) @@ -177,8 +178,9 @@ public Mono> embedWithResponse(List input, In if (extraParams != null) { requestOptions.setHeader(HttpHeaderName.fromString("extra-parameters"), extraParams.toString()); } - return embedWithResponse(embedRequest, requestOptions).map( - protocolMethodData -> new SimpleResponse<>(protocolMethodData, protocolMethodData.getValue().toObject(EmbeddingsResult.class))); + return embedWithResponse(embedRequest, requestOptions) + .map(protocolMethodData -> new SimpleResponse<>(protocolMethodData, + protocolMethodData.getValue().toObject(EmbeddingsResult.class))); } /** diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java index 817deef58bed..8df62d3fba95 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java @@ -161,8 +161,9 @@ Response getModelInfoWithResponse(RequestOptions requestOptions) { * Embeddings measure the relatedness of text strings and are commonly used for search, clustering, * recommendations, and other similar scenarios. */ - public Response embedWithResponse(List input, Integer dimensions, EmbeddingEncodingFormat encodingFormat, - EmbeddingInputType inputType, String model, ExtraParameters extraParams) { + public Response embedWithResponse(List input, Integer dimensions, + EmbeddingEncodingFormat encodingFormat, EmbeddingInputType inputType, String model, + ExtraParameters extraParams) { // Generated convenience method for embedWithResponse RequestOptions requestOptions = new RequestOptions(); EmbedRequest embedRequestObj = new EmbedRequest(input).setDimensions(dimensions) diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClientBuilder.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClientBuilder.java index f5b62ad9cf7b..2d923a62a37b 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClientBuilder.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClientBuilder.java @@ -212,7 +212,6 @@ public EmbeddingsClientBuilder scopes(String[] scopes) { return this; } - /* * The KeyCredential used for authentication. */ From 6b6300a4aacd897456150f0d1e0e9e461c0237c2 Mon Sep 17 00:00:00 2001 From: glenn Date: Fri, 13 Sep 2024 12:45:53 -0400 Subject: [PATCH 107/128] update dependencies --- sdk/ai/azure-ai-inference/pom.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk/ai/azure-ai-inference/pom.xml b/sdk/ai/azure-ai-inference/pom.xml index fb4c69b384bc..a67e7745cc72 100644 --- a/sdk/ai/azure-ai-inference/pom.xml +++ b/sdk/ai/azure-ai-inference/pom.xml @@ -53,12 +53,12 @@ com.azure azure-core - 1.51.0 + 1.52.0 com.azure azure-core-http-netty - 1.15.3 + 1.15.4 @@ -82,13 +82,13 @@ com.azure azure-core-http-okhttp - 1.12.2 + 1.12.3 test com.azure azure-core-http-vertx - 1.0.0-beta.20 + 1.0.0-beta.21 test @@ -128,7 +128,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.15 + 1.0.0-beta.16 test From cd42ab10ab71832b7e68ed77329f5f172954b3df Mon Sep 17 00:00:00 2001 From: glenn Date: Fri, 13 Sep 2024 12:59:17 -0400 Subject: [PATCH 108/128] spacing --- .../azure/ai/inference/ChatCompletionsAsyncClient.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java index 2b4352175d95..ec64ca2bf59f 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java @@ -151,8 +151,8 @@ public final class ChatCompletionsAsyncClient { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> completeWithBinaryResponse(BinaryData completeRequest, - RequestOptions requestOptions) { - return this.serviceClient.completeWithResponseAsync(completeRequest, requestOptions); + RequestOptions requestOptions) { + return this.serviceClient.completeWithResponseAsync(completeRequest, requestOptions); } /** @@ -193,10 +193,9 @@ public Mono> completeWithResponse(ChatCompletionsOptio if (extraParams != null) { requestOptions.setHeader(HttpHeaderName.fromString("extra-parameters"), extraParams.toString()); } - return completeWithBinaryResponse(completeRequest, requestOptions) - .map(methodDataResponse -> new SimpleResponse<>(methodDataResponse, - methodDataResponse.getValue().toObject(ChatCompletions.class))); + .map(methodDataResponse -> new SimpleResponse<>(methodDataResponse, + methodDataResponse.getValue().toObject(ChatCompletions.class))); } /** From 784b34879eaddf9900f2ecd3ef1a2f7175ff883c Mon Sep 17 00:00:00 2001 From: Glenn Harper Date: Fri, 13 Sep 2024 10:11:57 -0700 Subject: [PATCH 109/128] spacing --- .../azure/ai/inference/ChatCompletionsClient.java | 2 +- .../azure/ai/inference/EmbeddingsAsyncClient.java | 13 +++++++------ .../com/azure/ai/inference/EmbeddingsClient.java | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java index bc52b778616c..189be4bf9248 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java @@ -363,7 +363,7 @@ public IterableStream completeStream(ChatComplet */ @ServiceMethod(returns = ReturnType.SINGLE) public Response completeStreamWithResponse(BinaryData chatCompletionsOptions, - RequestOptions requestOptions) { + RequestOptions requestOptions) { return serviceClient.completeWithResponse(chatCompletionsOptions, requestOptions); } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java index 8b739b4d6e64..72dd939c550e 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java @@ -167,9 +167,9 @@ Mono> getModelInfoWithResponse(RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> embedWithResponse(List input, Integer dimensions, - EmbeddingEncodingFormat encodingFormat, EmbeddingInputType inputType, String model, - ExtraParameters extraParams) { - RequestOptions requestOptions = new RequestOptions(); + EmbeddingEncodingFormat encodingFormat, EmbeddingInputType inputType, String model, + ExtraParameters extraParams) { + RequestOptions requestOptions = new RequestOptions(); EmbedRequest embedRequestObj = new EmbedRequest(input).setDimensions(dimensions) .setEncodingFormat(encodingFormat) .setInputType(inputType) @@ -179,8 +179,8 @@ public Mono> embedWithResponse(List input, In requestOptions.setHeader(HttpHeaderName.fromString("extra-parameters"), extraParams.toString()); } return embedWithResponse(embedRequest, requestOptions) - .map(protocolMethodData -> new SimpleResponse<>(protocolMethodData, - protocolMethodData.getValue().toObject(EmbeddingsResult.class))); + .map(protocolMethodData -> new SimpleResponse<>(protocolMethodData, + protocolMethodData.getValue().toObject(EmbeddingsResult.class))); } /** @@ -250,7 +250,8 @@ public Mono> embedWithResponse(List input) { EmbedRequest embedRequestObj = new EmbedRequest(input); BinaryData embedRequest = BinaryData.fromObject(embedRequestObj); return embedWithResponse(embedRequest, requestOptions).map( - protocolMethodData -> new SimpleResponse<>(protocolMethodData, protocolMethodData.getValue().toObject(EmbeddingsResult.class))); + protocolMethodData -> new SimpleResponse<>(protocolMethodData, + protocolMethodData.getValue().toObject(EmbeddingsResult.class))); } /** diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java index 8df62d3fba95..584dd7ba94fd 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsClient.java @@ -162,8 +162,8 @@ Response getModelInfoWithResponse(RequestOptions requestOptions) { * recommendations, and other similar scenarios. */ public Response embedWithResponse(List input, Integer dimensions, - EmbeddingEncodingFormat encodingFormat, EmbeddingInputType inputType, String model, - ExtraParameters extraParams) { + EmbeddingEncodingFormat encodingFormat, EmbeddingInputType inputType, String model, + ExtraParameters extraParams) { // Generated convenience method for embedWithResponse RequestOptions requestOptions = new RequestOptions(); EmbedRequest embedRequestObj = new EmbedRequest(input).setDimensions(dimensions) From a2cb50e2793cdfd46ff302fe47d6a2bacde7b148 Mon Sep 17 00:00:00 2001 From: Glenn Harper Date: Fri, 13 Sep 2024 10:21:25 -0700 Subject: [PATCH 110/128] spacing --- .../java/com/azure/ai/inference/EmbeddingsAsyncClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java index 72dd939c550e..fb089027a9f4 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/EmbeddingsAsyncClient.java @@ -249,8 +249,8 @@ public Mono> embedWithResponse(List input) { RequestOptions requestOptions = new RequestOptions(); EmbedRequest embedRequestObj = new EmbedRequest(input); BinaryData embedRequest = BinaryData.fromObject(embedRequestObj); - return embedWithResponse(embedRequest, requestOptions).map( - protocolMethodData -> new SimpleResponse<>(protocolMethodData, + return embedWithResponse(embedRequest, requestOptions) + .map(protocolMethodData -> new SimpleResponse<>(protocolMethodData, protocolMethodData.getValue().toObject(EmbeddingsResult.class))); } From 33e804517fbc3754a297d7d56ce707825993e5d5 Mon Sep 17 00:00:00 2001 From: Glenn Harper Date: Fri, 13 Sep 2024 10:41:01 -0700 Subject: [PATCH 111/128] update min jacoco settings --- sdk/ai/azure-ai-inference/pom.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/ai/azure-ai-inference/pom.xml b/sdk/ai/azure-ai-inference/pom.xml index a67e7745cc72..641c84e897d1 100644 --- a/sdk/ai/azure-ai-inference/pom.xml +++ b/sdk/ai/azure-ai-inference/pom.xml @@ -43,6 +43,8 @@ UTF-8 + 0.30 + 0.20 From 71ae8dce7181db7900934248c8d5085fbdb57cd0 Mon Sep 17 00:00:00 2001 From: Glenn Harper Date: Fri, 13 Sep 2024 11:11:47 -0700 Subject: [PATCH 112/128] trigger CI build --- sdk/ai/azure-ai-inference/TROUBLESHOOTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/ai/azure-ai-inference/TROUBLESHOOTING.md b/sdk/ai/azure-ai-inference/TROUBLESHOOTING.md index 7eba94893407..a77130be13d9 100644 --- a/sdk/ai/azure-ai-inference/TROUBLESHOOTING.md +++ b/sdk/ai/azure-ai-inference/TROUBLESHOOTING.md @@ -32,7 +32,7 @@ Refer to the instructions in this reference document on how to [configure loggin Reviewing the HTTP request sent or response received over the wire to/from the Azure Model service can be useful in troubleshooting issues. To enable logging the HTTP request and response payload, the [ChatCompletionsClient][chat_completions_client] can be configured as shown below. If there is no SLF4J's `Logger` on the class path, set an environment variable -[AZURE_LOG_LEVEL][azure_log_level] in your machine to enable logging. +[AZURE_LOG_LEVEL][azure_log_level] in your machine to enable logging. ```java readme-sample-enablehttplogging ChatCompletionsClient chatCompletionsClient = new ChatCompletionsClientBuilder() From 1c3a19f29555a81bff0e7ae01b21a4808db4a47c Mon Sep 17 00:00:00 2001 From: Glenn Harper Date: Mon, 16 Sep 2024 11:04:53 -0700 Subject: [PATCH 113/128] Naive implementations of new APIs fromContentItems and file constructor for ChatMessageImageContentItem --- .../models/ChatMessageImageContentItem.java | 26 ++++++++++++++ .../models/ChatRequestUserMessage.java | 34 +++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageContentItem.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageContentItem.java index 526bba57bba3..92a0289bf8b1 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageContentItem.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageContentItem.java @@ -8,7 +8,12 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; import java.io.IOException; +import java.util.Base64; /** * A structured chat content item containing an image reference. @@ -38,6 +43,27 @@ public ChatMessageImageContentItem(ChatMessageImageUrl imageUrl) { this.imageUrl = imageUrl; } + /** + * Creates an instance of ChatMessageImageContentItem class. + * + * @param imageFile the imageFile to read. + * @param imageFormat format of the image + */ + public ChatMessageImageContentItem(File imageFile, String imageFormat) { + try { + FileInputStream fileInputStreamReader = new FileInputStream(imageFile); + byte[] bytes = new byte[(int)imageFile.length()]; + fileInputStreamReader.read(bytes); + String encodedFile = new String(Base64.getEncoder().encode(bytes), "UTF-8"); + String urlTemplate = "data:image/%s;base64,%s"; + this.imageUrl = new ChatMessageImageUrl(String.format(urlTemplate, imageFormat, encodedFile)); + } catch (FileNotFoundException e) { + throw new RuntimeException("Local file not found.", e); + } catch (IOException e) { + throw new RuntimeException("IO Error.", e); + } + } + /** * Get the type property: The discriminated object type. * diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java index 285ec3eb0931..1ecdfac0a50e 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java @@ -132,4 +132,38 @@ public static ChatRequestUserMessage fromString(String content) { throw new RuntimeException(e); } } + + /** + * Creates an instance of ChatRequestUserMessage class. + * + * @param contentItems An array of content items to include in the message. + * @return An instance of ChatRequestUserMessage if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws RuntimeException If the deserialized JSON object was missing any required properties. + */ + public static ChatRequestUserMessage fromContentItems(ChatMessageContentItem[] contentItems) { + String jsonPrompt = "{\"content\":["; + for (ChatMessageContentItem item : contentItems) { + if (item instanceof ChatMessageTextContentItem) + { + ChatMessageTextContentItem textItem = (ChatMessageTextContentItem) item; + String textPrompt = "{" + "\"text\":\"%s\"" + "}"; + jsonPrompt += String.format(textPrompt, textItem.getText()); + } + else if (item instanceof ChatMessageImageContentItem) + { + ChatMessageImageContentItem imageItem = (ChatMessageImageContentItem) item; + String imageUrlPrompt = "{" + "\"image_url\":%s" + "}"; + jsonPrompt += String.format(imageUrlPrompt, imageItem.getImageUrl().getUrl()); + } + jsonPrompt += ","; + } + jsonPrompt += "]}"; + try { + return ChatRequestUserMessage.fromJson(JsonProviders.createReader(new StringReader(jsonPrompt))); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + } From c58eeaea2b8ba67e5de4f73294c81ed9c2bbccf2 Mon Sep 17 00:00:00 2001 From: glenn Date: Mon, 16 Sep 2024 16:01:33 -0400 Subject: [PATCH 114/128] spacing --- .../ai/inference/models/ChatMessageImageContentItem.java | 7 +++---- .../azure/ai/inference/models/ChatRequestUserMessage.java | 8 ++------ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageContentItem.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageContentItem.java index 92a0289bf8b1..09fade589677 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageContentItem.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageContentItem.java @@ -8,12 +8,11 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; - +import java.io.IOException; +import java.util.Base64; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.Base64; /** * A structured chat content item containing an image reference. @@ -52,7 +51,7 @@ public ChatMessageImageContentItem(ChatMessageImageUrl imageUrl) { public ChatMessageImageContentItem(File imageFile, String imageFormat) { try { FileInputStream fileInputStreamReader = new FileInputStream(imageFile); - byte[] bytes = new byte[(int)imageFile.length()]; + byte[] bytes = new byte[(int) imageFile.length()]; fileInputStreamReader.read(bytes); String encodedFile = new String(Base64.getEncoder().encode(bytes), "UTF-8"); String urlTemplate = "data:image/%s;base64,%s"; diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java index 1ecdfac0a50e..eaa43c583196 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java @@ -144,14 +144,11 @@ public static ChatRequestUserMessage fromString(String content) { public static ChatRequestUserMessage fromContentItems(ChatMessageContentItem[] contentItems) { String jsonPrompt = "{\"content\":["; for (ChatMessageContentItem item : contentItems) { - if (item instanceof ChatMessageTextContentItem) - { + if (item instanceof ChatMessageTextContentItem) { ChatMessageTextContentItem textItem = (ChatMessageTextContentItem) item; String textPrompt = "{" + "\"text\":\"%s\"" + "}"; jsonPrompt += String.format(textPrompt, textItem.getText()); - } - else if (item instanceof ChatMessageImageContentItem) - { + } else if (item instanceof ChatMessageImageContentItem) { ChatMessageImageContentItem imageItem = (ChatMessageImageContentItem) item; String imageUrlPrompt = "{" + "\"image_url\":%s" + "}"; jsonPrompt += String.format(imageUrlPrompt, imageItem.getImageUrl().getUrl()); @@ -165,5 +162,4 @@ else if (item instanceof ChatMessageImageContentItem) throw new RuntimeException(e); } } - } From 589af5dbcca8950f7f34f7532f8d2a9e49214294 Mon Sep 17 00:00:00 2001 From: glenn Date: Mon, 16 Sep 2024 16:44:49 -0400 Subject: [PATCH 115/128] add image read sample and correct API implementations --- .../models/ChatMessageImageContentItem.java | 6 ++- .../models/ChatRequestUserMessage.java | 8 +-- .../inference/usage/ImageFileChatSample.java | 48 ++++++++++++++++++ .../resources/sample-images/sample.png | Bin 0 -> 7533 bytes 4 files changed, 57 insertions(+), 5 deletions(-) create mode 100644 sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ImageFileChatSample.java create mode 100644 sdk/ai/azure-ai-inference/src/samples/resources/sample-images/sample.png diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageContentItem.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageContentItem.java index 09fade589677..5f3166887aa2 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageContentItem.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageContentItem.java @@ -13,6 +13,7 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; +import java.nio.file.Path; /** * A structured chat content item containing an image reference. @@ -45,11 +46,12 @@ public ChatMessageImageContentItem(ChatMessageImageUrl imageUrl) { /** * Creates an instance of ChatMessageImageContentItem class. * - * @param imageFile the imageFile to read. + * @param filePath path to the imageFile. * @param imageFormat format of the image */ - public ChatMessageImageContentItem(File imageFile, String imageFormat) { + public ChatMessageImageContentItem(Path filePath, String imageFormat) { try { + File imageFile = filePath.toFile(); FileInputStream fileInputStreamReader = new FileInputStream(imageFile); byte[] bytes = new byte[(int) imageFile.length()]; fileInputStreamReader.read(bytes); diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java index eaa43c583196..c19da9a25938 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java @@ -12,6 +12,7 @@ import java.io.IOException; import com.azure.json.JsonProviders; import java.io.StringReader; +import java.util.List; /** * A request chat message representing user input to the assistant. @@ -141,20 +142,21 @@ public static ChatRequestUserMessage fromString(String content) { * was pointing to JSON null. * @throws RuntimeException If the deserialized JSON object was missing any required properties. */ - public static ChatRequestUserMessage fromContentItems(ChatMessageContentItem[] contentItems) { + public static ChatRequestUserMessage fromContentItems(List contentItems) { String jsonPrompt = "{\"content\":["; for (ChatMessageContentItem item : contentItems) { if (item instanceof ChatMessageTextContentItem) { ChatMessageTextContentItem textItem = (ChatMessageTextContentItem) item; - String textPrompt = "{" + "\"text\":\"%s\"" + "}"; + String textPrompt = "{\"type\": \"text\", \"text\":\"%s\"" + "}"; jsonPrompt += String.format(textPrompt, textItem.getText()); } else if (item instanceof ChatMessageImageContentItem) { ChatMessageImageContentItem imageItem = (ChatMessageImageContentItem) item; - String imageUrlPrompt = "{" + "\"image_url\":%s" + "}"; + String imageUrlPrompt = "{\"type\": \"image_url\", \"image_url\":{ \"url\": \"%s\"}" + "}"; jsonPrompt += String.format(imageUrlPrompt, imageItem.getImageUrl().getUrl()); } jsonPrompt += ","; } + jsonPrompt = jsonPrompt.substring(0, jsonPrompt.length() - 1); jsonPrompt += "]}"; try { return ChatRequestUserMessage.fromJson(JsonProviders.createReader(new StringReader(jsonPrompt))); diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ImageFileChatSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ImageFileChatSample.java new file mode 100644 index 000000000000..d6e161451a7e --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ImageFileChatSample.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.usage; + +import com.azure.ai.inference.ChatCompletionsClient; +import com.azure.ai.inference.ChatCompletionsClientBuilder; +import com.azure.ai.inference.models.*; +import com.azure.core.credential.AzureKeyCredential; +import com.azure.core.util.Configuration; + +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.List; + +public final class ImageFileChatSample { + + private static final String TEST_IMAGE_PATH = "./src/samples/resources/sample-images/sample.png"; + private static final String TEST_IMAGE_FORMAT = "png"; + /** + * @param args Unused. Arguments to the program. + */ + public static void main(String[] args) { + String key = Configuration.getGlobalConfiguration().get("AZURE_API_KEY"); + String endpoint = Configuration.getGlobalConfiguration().get("MODEL_ENDPOINT"); + ChatCompletionsClient client = new ChatCompletionsClientBuilder() + .credential(new AzureKeyCredential(key)) + .endpoint(endpoint) + .buildClient(); + + Path testFilePath = Paths.get(TEST_IMAGE_PATH); + List contentItems = new ArrayList<>(); + contentItems.add(new ChatMessageTextContentItem("Describe the image.")); + contentItems.add(new ChatMessageImageContentItem(testFilePath, TEST_IMAGE_FORMAT)); + + List chatMessages = new ArrayList<>(); + chatMessages.add(new ChatRequestSystemMessage("You are a helpful assistant.")); + chatMessages.add(ChatRequestUserMessage.fromContentItems(contentItems)); + + ChatCompletions completions = client.complete(new ChatCompletionsOptions(chatMessages)); + + for (ChatChoice choice : completions.getChoices()) { + System.out.printf("%s.%n", choice.getMessage().getContent()); + } + } +} diff --git a/sdk/ai/azure-ai-inference/src/samples/resources/sample-images/sample.png b/sdk/ai/azure-ai-inference/src/samples/resources/sample-images/sample.png new file mode 100644 index 0000000000000000000000000000000000000000..55dafd287ef7c00aee4e9a62ded72622cc615d77 GIT binary patch literal 7533 zcmV-z9g^aSP)001cn1^@s6eR9;h00001b5ch_0Itp) z=>Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!2kdb!2!6DYwZ949Rf*2K~!i%MVeX6 zt@m}-*PiF$+xwf&Y#%$0ouO`%wsA{HTSY1j^rCc9fflY%gv6w{H%O=o5?laR6a*3= zgn%njl_b!#7a%B2A~hb;9y_sJkLNh&eDk#DdGq`Iw=KS-efIFa?|)e9Sehhn~ zC=^PuSS(^VnMSQritIX~Sk6bIS&8@FJ&oRE9(QhSMKPC&La7+bbtXoGY0PGe7*Dxw zIE@0wI-Fl9P$B5Ph!gA@})B8En|jpGua#)%0!M0wL6XIT@K@FJdLeZB}&D7u=glo%o&@U&Sq>q zV$K3`xolK8USb2Y`7%})?C2l;?XfU7N$HdXwa| zJo}jAgaw0S7PX#K9hLPS=)Y-wQswo(b#rcYj+gxtJ4*0-=P3 z$5R%+cEg!;Qg1Yk1{Usg>d_xgk^$;95Z0*0a=uD~>8;reLoHlTM4j`sb(3pmvw1u` z>Zb+nbZfD~IJH(aE-wb08Ifnf)9L(!1w~XVg@llEkXkC{(k7~o$6_;}ZaSVM#1F5= zvEsd4V8d)GpJy|RWh~a<52sZz+!!R4t7VLyi7fML9Ou$uwR+W^r*jL1LaZ?61a$Ku zjV~DT{JvbQqR9R@lg}6sCvZ5jdfAKI@DxP#2NS}skPI~jx+|>Ote2vQ=k-kgYQTUD zl*z@MfijtFlsV=Am0Bsm`1t6O@SDZ;-DYw?wN+2vTj2E>iyPsLIY#%#cDV9v0Q{2ma!x{bTq&x z)WJPF&Jn^{ysE+6pHXCZ`(m+J0jp%ZE|=^gI#;a4-?Jhr%Z7wypNmVyY;-Y{la29c zhcGfsEAYnEc`tb?Uo1txKTe)2Vc0bTmf2vH&^Ral56(t$>)KWd9Yce|aeg|$Pt3!- z`FtV97^i~w46zB}*k`l1pWKPtAKi|<$2*{R5j7~Fh@r}5LJn?=6k4k^P6;C#VuoUg zIqHpia<+RZlrbLTv$f=qgbLQWz(9W22!`B@IsMaFI#mNLIcJKKYVHT>SrdmFqcMhv zSP+Ii5GBdC*zj@*@nX0JUN7OLTDut|JUe3pdPd^UaIR>}F-aLu*Eo00a1W1r$@3aq z@5v7{h}ZWuo}O^+@B{9-ey0;pfA)6#{NMUaJpZr$a{TIVejzS@?3d%;Wqu{T(fCVo zu-?NQ8!nmha{LP1F$GM`(q@Eh9g?l%-I?KeHDnQ7 z%-B=BmV?ksc-;(EB72Fv!$;?F3a>nVr;A}0jODRPg8PI;>Os~JoyVK;7k}f~`0Ot{ z6L&vxEw0_#iU0meCw~1uwBzfqa{js=!^&Q~Ft`!j^)Q-~BQ~8)Xy@|8TO#`We8?Ag z(l7^c7tGym*KuS%hJ$fT;ZuoJN45A}8j*usv)OG1H}%QBFkftMH`B3%SfPkT^IVq< z&M;C!cIriVtphn`$@?P==RmC{*$)FO!QaS`gJ|{I1g@A%fO-&v79eCZ#nsg)9ujKT z;Hd(Om0N19W-^p%Tf=SNX~i%8{paGZf9a><>1S_6y^eDVjd=cdcH{Z4@5Ct6h;F+Q z%}OqI8>P5*XFtA?`SbDe>?y$js){jZS`;vB*bx)Bo3)Uz%N$!$% zl0;mh9sDjA%X?It0|F5_9aj$9b|=Ww^fE0@+pf=IN1;?!X>3L z1d0*NdbN5zU8r{}gk}!ImLb?2XvyUv^|K+wT#3$BBav-uyR{)^VU71c@iR}x&wueJ z6>#xZ0_3?rIM zE@i@KMuHLrhPTFOceheToQo=P$eVPcmE`4I4jJQ-Ea-D>d@)4jEQx&KIqXNeF+r?Y zyysx|$hIJ|8mV?X9`nL*?HVDNOS)=6<{JTL1*VIdq|AX4H6#<5+H*kr;(P$&BChRs zSq9mW6fG(*&bS^u*1vlzzWa%1<4>neh!*4(YG|u&{Ifr3#UI^oVWcu-kLTE%1U+TZ z4P-&J09k|Je61G8#V62vBp@8P0__8YVvej;!C~@=*|osB`h!tInZVOnzRl5VMbIOM zx@&pMh?zhqQ+|_ov+6`%8aV|aYuJ#!#zh!=yoq)awnNgn3Y=&ovp|-;KH)b?;%^Gt z9N5%tD7dMjUL}0>!o#Dh*zUp!c@h?AYIIu3fPi4drAoz+4EG_Basn|(D{79K_TLUeDgo`~y*i}=xlY5eHXB0e?F zM_F|aF%L;jZfvXDiYqFO8K{$kC2YK?EG_AoX&S8tMwlms?r&Z+CH%aggn{&Yy$PXW?MAy14<4M5{fcNY zGfp8&Rk9TGjxdyhZ^XR)?QX~fdi!Kuj<258V)v_W#+Sx#L}LLTGL{Obz$QxQog%Lu zd@{lNTZHFim5Ga0HSR37{7*d0wGh%)X zBKkzA2-8raiY2BbRZ-hvB+;7o3UEG@Ql96Zq3GVSa?}bfVcl0HBn@(FKE0781y4Ya zv8y~VYiLkMSD2ntr!6>k9Zi+=6xT?k7w7$SjSwzTqfM;Cm}3F76?}i^-u-xDo{hg+ zx{UuadLe%D>Osn$DFcaG7Hhre>0O9k5@ri=zq}u7#>^U;@K?Fkh#w)Ge|BDvHsucN zl29h9T!*rt2$^T$sYxPz>PJu~iT4Kc#9t+j8>&*!#$bj%dtto>q&y}Xl@QrE7j{Ui zN`0-Tp^_TrBGtWwt~Zi`=b{Sywt;XYQm?ATBuIW!CYS{m#Jw5Egi(g*XX+Iubu-VB z-hbhpbD~o&$i!|b8~?oggZQoU??!#lLlr>-NEG=><6n^4MT!OZVX+e{tA`vLWQP{p z#YQ7;HFo1KtUIwjA0_cvG!d{?L(p|wx0XpN<;n+HH0_NVGRYg&I}xNFWB-O^sxMIl zqTTb26l5s`-*B_keUS2$(!mW%N^V4=bfJdd3RrsH2FkfOIK0HWx#*Iu_#qLj8tM`~ zX6fRZI#lhC&_W*;tuFG5FTTTPj0bW&ABUwf=<~U&_>a>+i61$6H>^$pq3~^qsI(0M!$sx4o?BzC;$xS?_=)>hAOlX}xX@lssS_`I zF*-ht((zIJ*4cOBH{SVHoZUa9a2`;&&r_kT5S?b&7>ESUk!etOLfByrA#CzH-PpPF zblln5PmZ!{qK7J6EBRYDibfO8Ol^sS%y_Ot!+5Sb&6nrQ0nH{EKsmgt2C_9WpM&=a zKf}&0#GK8ksf_&!sFFVnQH$pDi*cM@j#Abrkx3lHT2bSCC@u6zoka2Aupd=popWsC z{L*Vjc-HtQRM8sgMXFy6$FTz0t8O#q{PuH~@5Vnq{AMg(c|B$vD-xE<0=og`vmArR;3DE$xsb96n>^-R)95bcf#FzY!9rPB8;Yqd zA_p*z=q$+#pr^zHpL_3^2n2P)o_cOR-WY1#X~vql=lx+USlGCC8MoegDSoH={kZ+` z-54@whE3#f;`AJ2F<0UejFYKB1E7078pU_#=kdRGnsGw;BS#uBqAHKP5lJQ^Yd_a% z&6&pFUGc2_2iC{%-5djX{gid5B*AY5xH3Ctu^#knk>sXLnPn}@Z?;_IGk-fi=_RA? zLfU%5f?Ek;m(o^;A!`=2&Uyr=xu7l!-W?3$?(tb{q1zS<(8MBq%}0}1ve4ndQS@Ga zJ%$e+@cCg3&yGREEQ;^H75{Sh?fC4wFU0upB#Ow4Y5zQy7}~Ys^2nHQ5WxNOllZ5f zek{%>V`K_{I6DjX7)}y)%4RrMKGUI^X;ThOl2aW^6xB!=c`~c|(Y?5D{4Omc9k6st zvu+eCx)}|nsNZYJCtP8VLborUc5M;1YBVI6ExXsmV+f{z=!lPv)i3WyVusNSEJcR zPiw*u1yHse|VY3P@QKn`0X={!6qjs$1y%W6oQTvIHA{UzWo#Rn06TkLj zH{$D@DQD#gsoHQDc}g{F&4#5MhPL&RVLhpQ!7x&Wf6|ClA<8BoO2DZKY$X}GqtQ6+ zH;09l864(xzUW=Op@=gh2;&@|&yWeD$wp%}o02)!mvhK2W2C~2vP6;`b55gPi?gdy z8ly`|Bx1d}U?O_|o$dI~x1XW}p$yU}%s2L(1xfU?$tZ?H=9-RTfN^@uX`C-6F<8&Y zgpH_m_M>|3x?MWtNk9I5XBB_#b03M9(PQ&V_z_g)8E5;whfx*@(1?9{H!lzrrkjEr zM|@B_YN#nj(q3j^0g|JHucLYZ_CZ;p53tadlPTKrV}n`@tm!&N={ zQHX*kdr48kW)+%A0Rsw&UL+Y&-iWa6Qzc5UT{4dJ zF@x)pw198z#MH7*?rLJb}D*gG|?%lBuAm`otEJ&8*k6|V@kNCsVIO8 zltrCe`_XygV^O>L$*A6ZHX3(68QV`i9i6+kqO{$O<5@FixxIMiho6j(o*YH-k6(=y z+$L1A@JF8aoS}r{8V?@DQ-AQycIb+KL6aaUsfX(*!cEdC!KhNvHGKFY7w_uwGA(Ej(Y0! z^lCE*vuGG^1U!6np6)H$Q%e2!R4PUM*+nJZS>24`DxX3yaRg;c5ieH=l>)V08RxXG zccZo2WK)IIU690|*`LJz)-3+d_mLNW_*!%?K%0zEYZbS=7sV3qgraFVJC*Q9|o&M7j;3WY7D8!{U$<(-_3qOaOeAWY5l{w6Zr z3?Dalq>a}aI>S2~Cr9UGzfBRjL+P+-3R2}`+e^w0Gm6K&wJukkk_0rgMQI6-ZtAId zLK{+$luT8ySW|eTmlmkxHRxl`9CKwbSca^*uo}oAVOBY$3WApKzjro^fAm_!yMrQC zKq>BEtdG3vU6G_XH!2;^yn--H!$MB-fk<2KeMF$ z`2nShcal>b$fOpxe!k>)Ef1&?;>?PmfWCdcq;aW@b!!X;SD8GJtH!jGw zhLP*=?vAKAI6RMsBn%1LR`#w>)QBcgn1uQo-Xj4$JR@^*9mr25AmH%EO?K1o$;RpN zMO?5+$*!|i!{K-X5)`I`-XJ|7qA`>fb{&Q+UPz0mI^WGG>KGTe$t)2gRP+zFIQRTG z%IELLGpBFFXAbVgkH7Ps_@Vb-iD$--qH=ja8AN?J?lT_7!eA>FH)HO-2k%FLjM{2% z3U?n9s@6dx;~Q>1*We8orHs5}R#&o=2+4Fm5uq0 zhz3i~Kp+KF_vvmA5I2je>Ajt%XWo2#FW#r1R&@_9Ph)UKeaLHYbjSuMoSDN`%aV|= zm`}wy(%^nI7dPH`J8tZ4^Bto!8_7^bYQrV)^JS=e_gVQO|0F$y)9fDjZgK2qLrYz? zgwy;pifZt%e{!;t=)+Ra`3*<;A@#H{T&e)@epbEYLmoa9;zMNZRwc!$!pw_(7^F{a zR~0?*l!ocqYQYPJs2OKu=9{{muZxYyaP&ap{?Kb#XVVWHbMxbGoAbb1zRuYmbb+e-> z^z784lnK`iMi@%UC-6ZLg7$u21q1uYj|pIaVT5p_R!n!NohYSV63GAEZ^q%BF8YbG z0!XJCO^(7KE68?DJg*4(5!vTIb+fVc>g&-&T9{!QB8t$e*dPQ24N&I2LGMWC)lY21 z(6U7=nze)kZw=an-_(z0Hy>5dV4_92pghoE7TBrO<3c&t<5G=AS7AA)#?3xNsSin= zw-BF~S7V?pNH!0wi8xbc4sRQBJ}Kkll0H!34GixW;?@}1KxA?LRg?vy3lDCd75G5F z658)QwiEXr@5E7-@kQBe%qAziW-*>k;tHgFZLb*b-g`B!ZEr#7&D6Q@>ApIK6BQ!M zkZ|L66;$SCJU1({?C3hL!Q^+l4Oh^}hX|BQeYRm!NV|Ni5)3U$*=y?W0UV>m&|H8} zqsHs9Lv&DjR+LG6fJ4qo0u%$Bp{v}y?G}v9Ir;d(qcc)6pIumrXH-3tr5hV~t61b9 z1AAwB!DK#PYAg8`B~unO-e?iQEh(I$V=TSt|#48BVraywklQarR6! zc*CWNs2-30|2;<|$uSMn^uQm#XC>3UE~1W&-n!Yv8$Po+PLDJi|Edo&N(WDy1mp&h zW*0OSogl{@*xzQj4e67qCa8Uh(dQ_Hd1@r$5YH_WR{d5z{-lzPZxt8ur_F4;YV zM`$Rxi>xRa$^nK!x+ll^LOgi{k4pYt=UpJ-t`}|dWErnXnbSp7UfbV`?#@m;`S_i< zdFuv7$i)_gd#IHU31TJ@o>HN}D4q^e%gGKvAj=Njio1EyUX) zWsrR>A95>L0Rt9B;97c$&kffJH+9j9 z&s(il>P$3n+!jjR`m#W%`7};muQUFVL{LDxZ4@|_1tI5HW@8Sgme4Wll(W3yq4cc4 zc^cH3*A_SyWBs}0WFx~cmY3vdLp7lgG^PDtp z+t@UrXjmVO)M%SKS^@wEr6^*Z8d$kO#&hmMAs7D-6wQ$2S1&I~00000NkvXXu0mjf D@d%u9 literal 0 HcmV?d00001 From cc4bd444953bb2fb56ca48feddcbdcb397dbf112 Mon Sep 17 00:00:00 2001 From: glenn Date: Mon, 16 Sep 2024 21:58:18 -0400 Subject: [PATCH 116/128] sanity check, cleaner syntax, and samples style fixes --- sdk/ai/azure-ai-inference/TROUBLESHOOTING.md | 16 ++++++------ .../models/ChatMessageImageContentItem.java | 11 ++++---- .../models/ChatRequestUserMessage.java | 3 +++ .../com/azure/ai/inference/ReadmeSamples.java | 25 ++++++++++++------- .../inference/usage/BasicChatAADSample.java | 5 +--- .../ai/inference/usage/BasicChatSample.java | 2 +- .../inference/usage/BasicChatSampleAsync.java | 10 +++----- .../inference/usage/ImageFileChatSample.java | 12 +++++++-- .../inference/usage/StreamingChatSample.java | 9 +++++-- .../usage/StreamingChatSampleAsync.java | 9 +++++-- .../usage/TextEmbeddingsAsyncSample.java | 15 +++++------ .../inference/usage/TextEmbeddingsSample.java | 2 +- .../ai/inference/usage/ToolCallSample.java | 17 +++++++++++-- 13 files changed, 87 insertions(+), 49 deletions(-) diff --git a/sdk/ai/azure-ai-inference/TROUBLESHOOTING.md b/sdk/ai/azure-ai-inference/TROUBLESHOOTING.md index a77130be13d9..78534e80e459 100644 --- a/sdk/ai/azure-ai-inference/TROUBLESHOOTING.md +++ b/sdk/ai/azure-ai-inference/TROUBLESHOOTING.md @@ -87,21 +87,21 @@ chatMessages.add(new ChatRequestAssistantMessage("Of course, me hearty! What can chatMessages.add(new ChatRequestUserMessage("What's the best way to train a parrot?")); try { - ChatCompletions chatCompletions = client.complete(new ChatCompletionsOptions(chatMessages)); - } catch (HttpResponseException e) { - System.out.println(e.getMessage()); - // Do something with the exception - } + ChatCompletions chatCompletions = client.complete(new ChatCompletionsOptions(chatMessages)); +} catch (HttpResponseException e) { + System.out.println(e.getMessage()); + // Do something with the exception +} ``` With async clients, you can catch and handle exceptions in the error callbacks: ```java readme-sample-troubleshootingExceptions-async asyncClient.complete(new ChatCompletionsOptions(chatMessages)) - .doOnSuccess(ignored -> System.out.println("Success!")) - .doOnError( + .doOnSuccess(ignored -> System.out.println("Success!")) + .doOnError( error -> error instanceof ResourceNotFoundException, - error -> System.out.println("Exception: 'getChatCompletions' could not be performed.")); + error -> System.out.println("Exception: 'getChatCompletions' could not be performed.")); ``` ### Authentication errors diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageContentItem.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageContentItem.java index 5f3166887aa2..aac9367cae0e 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageContentItem.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageContentItem.java @@ -9,6 +9,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.util.Base64; import java.io.File; import java.io.FileInputStream; @@ -48,20 +49,20 @@ public ChatMessageImageContentItem(ChatMessageImageUrl imageUrl) { * * @param filePath path to the imageFile. * @param imageFormat format of the image + * @throws RuntimeException If an error occurs while reading the file or file not found. */ public ChatMessageImageContentItem(Path filePath, String imageFormat) { - try { - File imageFile = filePath.toFile(); - FileInputStream fileInputStreamReader = new FileInputStream(imageFile); + File imageFile = filePath.toFile(); + try (FileInputStream fileInputStreamReader = new FileInputStream(imageFile)) { byte[] bytes = new byte[(int) imageFile.length()]; fileInputStreamReader.read(bytes); - String encodedFile = new String(Base64.getEncoder().encode(bytes), "UTF-8"); + String encodedFile = new String(Base64.getEncoder().encode(bytes), StandardCharsets.UTF_8); String urlTemplate = "data:image/%s;base64,%s"; this.imageUrl = new ChatMessageImageUrl(String.format(urlTemplate, imageFormat, encodedFile)); } catch (FileNotFoundException e) { throw new RuntimeException("Local file not found.", e); } catch (IOException e) { - throw new RuntimeException("IO Error.", e); + throw new RuntimeException(e); } } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java index c19da9a25938..f20f6d02b6d8 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java @@ -143,6 +143,9 @@ public static ChatRequestUserMessage fromString(String content) { * @throws RuntimeException If the deserialized JSON object was missing any required properties. */ public static ChatRequestUserMessage fromContentItems(List contentItems) { + if (contentItems == null || contentItems.isEmpty()) { + throw new RuntimeException("Content items cannot be null or empty."); + } String jsonPrompt = "{\"content\":["; for (ChatMessageContentItem item : contentItems) { if (item instanceof ChatMessageTextContentItem) { diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/ReadmeSamples.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/ReadmeSamples.java index 5c5a58cb3e84..8d7c2d808fff 100644 --- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/ReadmeSamples.java +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/ReadmeSamples.java @@ -4,8 +4,15 @@ package com.azure.ai.inference; +import com.azure.ai.inference.models.ChatChoice; +import com.azure.ai.inference.models.ChatCompletions; import com.azure.ai.inference.models.ChatCompletionsOptions; -import com.azure.ai.inference.models.*; +import com.azure.ai.inference.models.ChatRequestMessage; +import com.azure.ai.inference.models.ChatRequestAssistantMessage; +import com.azure.ai.inference.models.ChatRequestSystemMessage; +import com.azure.ai.inference.models.ChatRequestUserMessage; +import com.azure.ai.inference.models.ChatResponseMessage; +import com.azure.ai.inference.models.StreamingChatResponseMessageUpdate; import com.azure.core.credential.AzureKeyCredential; import com.azure.core.credential.TokenCredential; import com.azure.core.exception.HttpResponseException; @@ -126,11 +133,11 @@ public void troubleshootingExceptions() { chatMessages.add(new ChatRequestUserMessage("What's the best way to train a parrot?")); try { - ChatCompletions chatCompletions = client.complete(new ChatCompletionsOptions(chatMessages)); - } catch (HttpResponseException e) { - System.out.println(e.getMessage()); - // Do something with the exception - } + ChatCompletions chatCompletions = client.complete(new ChatCompletionsOptions(chatMessages)); + } catch (HttpResponseException e) { + System.out.println(e.getMessage()); + // Do something with the exception + } // END: readme-sample-troubleshootingExceptions } @@ -148,10 +155,10 @@ public void troubleshootingExceptionsAsync() { // BEGIN: readme-sample-troubleshootingExceptions-async asyncClient.complete(new ChatCompletionsOptions(chatMessages)) - .doOnSuccess(ignored -> System.out.println("Success!")) - .doOnError( + .doOnSuccess(ignored -> System.out.println("Success!")) + .doOnError( error -> error instanceof ResourceNotFoundException, - error -> System.out.println("Exception: 'getChatCompletions' could not be performed.")); + error -> System.out.println("Exception: 'getChatCompletions' could not be performed.")); // END: readme-sample-troubleshootingExceptions-async } diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatAADSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatAADSample.java index 93db0d1decb8..5c66a37cb196 100644 --- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatAADSample.java +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatAADSample.java @@ -8,10 +8,7 @@ import com.azure.ai.inference.ChatCompletionsClientBuilder; import com.azure.ai.inference.models.ChatChoice; import com.azure.ai.inference.models.ChatCompletions; -import com.azure.core.credential.AccessToken; -import com.azure.core.credential.AzureKeyCredential; import com.azure.core.credential.TokenCredential; -import com.azure.core.credential.TokenRequestContext; import com.azure.core.util.Configuration; import com.azure.identity.DefaultAzureCredentialBuilder; @@ -27,7 +24,7 @@ public static void main(String[] args) { String endpoint = Configuration.getGlobalConfiguration().get("MODEL_ENDPOINT"); ChatCompletionsClient client = new ChatCompletionsClientBuilder() .scopes(scopes) // remove for non-Azure OpenAI models - .credential(defaultCredential) + .credential(defaultCredential) .endpoint(endpoint) .buildClient(); diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatSample.java index 897bc699d70d..744e75a24888 100644 --- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatSample.java +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatSample.java @@ -19,7 +19,7 @@ public static void main(String[] args) { String key = Configuration.getGlobalConfiguration().get("AZURE_API_KEY"); String endpoint = Configuration.getGlobalConfiguration().get("MODEL_ENDPOINT"); ChatCompletionsClient client = new ChatCompletionsClientBuilder() - .credential(new AzureKeyCredential(key)) + .credential(new AzureKeyCredential(key)) .endpoint(endpoint) .buildClient(); diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatSampleAsync.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatSampleAsync.java index 1f6792992982..5bc7112e8cba 100644 --- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatSampleAsync.java +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/BasicChatSampleAsync.java @@ -6,13 +6,11 @@ import com.azure.ai.inference.ChatCompletionsAsyncClient; import com.azure.ai.inference.ChatCompletionsClientBuilder; -import com.azure.ai.inference.models.*; +import com.azure.ai.inference.models.ChatChoice; +import com.azure.ai.inference.models.ChatResponseMessage; +import com.azure.ai.inference.models.CompletionsUsage; import com.azure.core.credential.AzureKeyCredential; import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; - -import java.util.ArrayList; -import java.util.List; import java.util.concurrent.TimeUnit; public final class BasicChatSampleAsync { @@ -23,7 +21,7 @@ public static void main(String[] args) throws InterruptedException { String key = Configuration.getGlobalConfiguration().get("AZURE_API_KEY"); String endpoint = Configuration.getGlobalConfiguration().get("MODEL_ENDPOINT"); ChatCompletionsAsyncClient client = new ChatCompletionsClientBuilder() - .credential(new AzureKeyCredential(key)) + .credential(new AzureKeyCredential(key)) .endpoint(endpoint) .buildAsyncClient(); diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ImageFileChatSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ImageFileChatSample.java index d6e161451a7e..d97c65e1b8c4 100644 --- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ImageFileChatSample.java +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ImageFileChatSample.java @@ -6,7 +6,15 @@ import com.azure.ai.inference.ChatCompletionsClient; import com.azure.ai.inference.ChatCompletionsClientBuilder; -import com.azure.ai.inference.models.*; +import com.azure.ai.inference.models.ChatChoice; +import com.azure.ai.inference.models.ChatCompletions; +import com.azure.ai.inference.models.ChatCompletionsOptions; +import com.azure.ai.inference.models.ChatMessageContentItem; +import com.azure.ai.inference.models.ChatMessageImageContentItem; +import com.azure.ai.inference.models.ChatMessageTextContentItem; +import com.azure.ai.inference.models.ChatRequestMessage; +import com.azure.ai.inference.models.ChatRequestUserMessage; +import com.azure.ai.inference.models.ChatRequestSystemMessage; import com.azure.core.credential.AzureKeyCredential; import com.azure.core.util.Configuration; @@ -26,7 +34,7 @@ public static void main(String[] args) { String key = Configuration.getGlobalConfiguration().get("AZURE_API_KEY"); String endpoint = Configuration.getGlobalConfiguration().get("MODEL_ENDPOINT"); ChatCompletionsClient client = new ChatCompletionsClientBuilder() - .credential(new AzureKeyCredential(key)) + .credential(new AzureKeyCredential(key)) .endpoint(endpoint) .buildClient(); diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java index 1ce322bc800b..aeaec4414866 100644 --- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSample.java @@ -7,7 +7,12 @@ import com.azure.ai.inference.ChatCompletionsClient; import com.azure.ai.inference.ChatCompletionsClientBuilder; import com.azure.ai.inference.models.ChatCompletionsOptions; -import com.azure.ai.inference.models.*; +import com.azure.ai.inference.models.ChatRequestMessage; +import com.azure.ai.inference.models.ChatRequestAssistantMessage; +import com.azure.ai.inference.models.ChatRequestSystemMessage; +import com.azure.ai.inference.models.ChatRequestUserMessage; +import com.azure.ai.inference.models.StreamingChatCompletionsUpdate; +import com.azure.ai.inference.models.StreamingChatResponseMessageUpdate; import com.azure.core.credential.AzureKeyCredential; import com.azure.core.util.Configuration; import com.azure.core.util.CoreUtils; @@ -24,7 +29,7 @@ public static void main(String[] args) { String key = Configuration.getGlobalConfiguration().get("AZURE_API_KEY"); String endpoint = Configuration.getGlobalConfiguration().get("MODEL_ENDPOINT"); ChatCompletionsClient client = new ChatCompletionsClientBuilder() - .credential(new AzureKeyCredential(key)) + .credential(new AzureKeyCredential(key)) .endpoint(endpoint) .buildClient(); diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSampleAsync.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSampleAsync.java index e6a28ffc9846..9b92ef03621d 100644 --- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSampleAsync.java +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingChatSampleAsync.java @@ -6,7 +6,12 @@ import com.azure.ai.inference.ChatCompletionsAsyncClient; import com.azure.ai.inference.ChatCompletionsClientBuilder; -import com.azure.ai.inference.models.*; +import com.azure.ai.inference.models.ChatRequestMessage; +import com.azure.ai.inference.models.ChatRequestUserMessage; +import com.azure.ai.inference.models.ChatRequestSystemMessage; +import com.azure.ai.inference.models.ChatRequestAssistantMessage; +import com.azure.ai.inference.models.ChatCompletionsOptions; +import com.azure.ai.inference.models.StreamingChatResponseMessageUpdate; import com.azure.core.credential.AzureKeyCredential; import com.azure.core.util.Configuration; import com.azure.core.util.CoreUtils; @@ -23,7 +28,7 @@ public static void main(String[] args) throws InterruptedException { String key = Configuration.getGlobalConfiguration().get("AZURE_API_KEY"); String endpoint = Configuration.getGlobalConfiguration().get("MODEL_ENDPOINT"); ChatCompletionsAsyncClient client = new ChatCompletionsClientBuilder() - .credential(new AzureKeyCredential(key)) + .credential(new AzureKeyCredential(key)) .endpoint(endpoint) .buildAsyncClient(); diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TextEmbeddingsAsyncSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TextEmbeddingsAsyncSample.java index 7864dc6db701..5b27daab137d 100644 --- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TextEmbeddingsAsyncSample.java +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TextEmbeddingsAsyncSample.java @@ -6,7 +6,8 @@ import com.azure.ai.inference.EmbeddingsAsyncClient; import com.azure.ai.inference.EmbeddingsClientBuilder; -import com.azure.ai.inference.models.*; +import com.azure.ai.inference.models.EmbeddingItem; +import com.azure.ai.inference.models.EmbeddingsUsage; import com.azure.core.credential.AzureKeyCredential; import com.azure.core.util.Configuration; @@ -22,7 +23,7 @@ public static void main(String[] args) throws InterruptedException { String key = Configuration.getGlobalConfiguration().get("AZURE_EMBEDDINGS_KEY"); String endpoint = Configuration.getGlobalConfiguration().get("EMBEDDINGS_MODEL_ENDPOINT"); EmbeddingsAsyncClient client = new EmbeddingsClientBuilder() - .credential(new AzureKeyCredential(key)) + .credential(new AzureKeyCredential(key)) .endpoint(endpoint) .buildAsyncClient(); @@ -48,10 +49,10 @@ public static void main(String[] args) throws InterruptedException { error -> System.err.println("There was an error getting embeddings." + error), () -> System.out.println("Completed called getEmbeddings.")); - // The .subscribe() creation and assignment is not a blocking call. For the purpose of this example, we sleep - // the thread so the program does not end before the send operation is complete. Using .block() instead of - // .subscribe() will turn this into a synchronous call. - TimeUnit.SECONDS.sleep(10); + // The .subscribe() creation and assignment is not a blocking call. For the purpose of this example, we sleep + // the thread so the program does not end before the send operation is complete. Using .block() instead of + // .subscribe() will turn this into a synchronous call. + TimeUnit.SECONDS.sleep(10); - } + } } diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TextEmbeddingsSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TextEmbeddingsSample.java index 62a9341bf542..1e9282117755 100644 --- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TextEmbeddingsSample.java +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TextEmbeddingsSample.java @@ -22,7 +22,7 @@ public static void main(String[] args) { String key = Configuration.getGlobalConfiguration().get("AZURE_EMBEDDINGS_KEY"); String endpoint = Configuration.getGlobalConfiguration().get("EMBEDDINGS_MODEL_ENDPOINT"); EmbeddingsClient client = new EmbeddingsClientBuilder() - .credential(new AzureKeyCredential(key)) + .credential(new AzureKeyCredential(key)) .endpoint(endpoint) .buildClient(); diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ToolCallSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ToolCallSample.java index c53e4b819601..e59a2e9ee3eb 100644 --- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ToolCallSample.java +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ToolCallSample.java @@ -6,7 +6,20 @@ import com.azure.ai.inference.ChatCompletionsClient; import com.azure.ai.inference.ChatCompletionsClientBuilder; -import com.azure.ai.inference.models.*; +import com.azure.ai.inference.models.ChatCompletionsFunctionToolCall; +import com.azure.ai.inference.models.ChatCompletionsFunctionToolDefinition; +import com.azure.ai.inference.models.ChatCompletionsOptions; +import com.azure.ai.inference.models.ChatRequestMessage; +import com.azure.ai.inference.models.ChatRequestAssistantMessage; +import com.azure.ai.inference.models.ChatRequestSystemMessage; +import com.azure.ai.inference.models.ChatRequestToolMessage; +import com.azure.ai.inference.models.ChatRequestUserMessage; +import com.azure.ai.inference.models.CompletionsFinishReason; +import com.azure.ai.inference.models.FunctionCall; +import com.azure.ai.inference.models.FunctionDefinition; +import com.azure.ai.inference.models.StreamingChatChoiceUpdate; +import com.azure.ai.inference.models.StreamingChatCompletionsUpdate; +import com.azure.ai.inference.models.StreamingChatResponseToolCallUpdate; import com.azure.core.credential.TokenCredential; import com.azure.core.util.BinaryData; import com.azure.core.util.Configuration; @@ -30,7 +43,7 @@ public static void main(String[] args) { String endpoint = Configuration.getGlobalConfiguration().get("MODEL_ENDPOINT"); ChatCompletionsClient client = new ChatCompletionsClientBuilder() .scopes(scopes) // remove for non-Azure OpenAI models - .credential(defaultCredential) + .credential(defaultCredential) .endpoint(endpoint) .buildClient(); From 89f375ef2e3148630e542d3e9f2335606c83b749 Mon Sep 17 00:00:00 2001 From: glenn Date: Tue, 17 Sep 2024 09:23:47 -0400 Subject: [PATCH 117/128] Add ImageUrlChatSample --- .../inference/usage/ImageUrlChatSample.java | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ImageUrlChatSample.java diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ImageUrlChatSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ImageUrlChatSample.java new file mode 100644 index 000000000000..e0309c4fffc1 --- /dev/null +++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ImageUrlChatSample.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.inference.usage; + +import com.azure.ai.inference.ChatCompletionsClient; +import com.azure.ai.inference.ChatCompletionsClientBuilder; +import com.azure.ai.inference.models.ChatChoice; +import com.azure.ai.inference.models.ChatCompletionsOptions; +import com.azure.ai.inference.models.ChatCompletions; +import com.azure.ai.inference.models.ChatMessageContentItem; +import com.azure.ai.inference.models.ChatMessageTextContentItem; +import com.azure.ai.inference.models.ChatMessageImageContentItem; +import com.azure.ai.inference.models.ChatMessageImageUrl; +import com.azure.ai.inference.models.ChatRequestMessage; +import com.azure.ai.inference.models.ChatRequestSystemMessage; +import com.azure.ai.inference.models.ChatRequestUserMessage; +import com.azure.core.credential.AzureKeyCredential; +import com.azure.core.util.Configuration; + +import java.util.ArrayList; +import java.util.List; + +public final class ImageUrlChatSample { + + private static final String TEST_URL = + "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"; + + /** + * @param args Unused. Arguments to the program. + */ + public static void main(String[] args) { + String key = Configuration.getGlobalConfiguration().get("AZURE_API_KEY"); + String endpoint = Configuration.getGlobalConfiguration().get("MODEL_ENDPOINT"); + ChatCompletionsClient client = new ChatCompletionsClientBuilder() + .credential(new AzureKeyCredential(key)) + .endpoint(endpoint) + .buildClient(); + + List contentItems = new ArrayList<>(); + contentItems.add(new ChatMessageTextContentItem("Describe the image.")); + contentItems.add(new ChatMessageImageContentItem( + new ChatMessageImageUrl(TEST_URL))); + + List chatMessages = new ArrayList<>(); + chatMessages.add(new ChatRequestSystemMessage("You are a helpful assistant.")); + chatMessages.add(ChatRequestUserMessage.fromContentItems(contentItems)); + + ChatCompletions completions = client.complete(new ChatCompletionsOptions(chatMessages)); + + for (ChatChoice choice : completions.getChoices()) { + System.out.printf("%s.%n", choice.getMessage().getContent()); + } + } +} From a299d5db400f6bfc84d02c529d3cb08e9102cfcb Mon Sep 17 00:00:00 2001 From: glenn Date: Tue, 17 Sep 2024 11:33:34 -0400 Subject: [PATCH 118/128] update dependency version --- sdk/ai/azure-ai-inference/CHANGELOG.md | 2 +- sdk/ai/azure-ai-inference/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/ai/azure-ai-inference/CHANGELOG.md b/sdk/ai/azure-ai-inference/CHANGELOG.md index 822b80162399..56fe2aa6db74 100644 --- a/sdk/ai/azure-ai-inference/CHANGELOG.md +++ b/sdk/ai/azure-ai-inference/CHANGELOG.md @@ -2,7 +2,7 @@ ## 1.0.0-beta.1 (Unreleased) -- Azure AI Inference client library for Java. This package contains Microsoft Azure AI Inference client library. +- Azure AI Inference client library for Java. This package contains Microsoft Azure AI Inference client library. ### Features Added diff --git a/sdk/ai/azure-ai-inference/pom.xml b/sdk/ai/azure-ai-inference/pom.xml index 641c84e897d1..2a9ba4711a69 100644 --- a/sdk/ai/azure-ai-inference/pom.xml +++ b/sdk/ai/azure-ai-inference/pom.xml @@ -72,7 +72,7 @@ com.azure azure-identity - 1.13.2 + 1.13.3 test From 48316e3aab240d44536b117260b912f9fdbfe75c Mon Sep 17 00:00:00 2001 From: glenn Date: Tue, 17 Sep 2024 11:59:36 -0400 Subject: [PATCH 119/128] typespec sync --- .../azure/ai/inference/models/ChatMessageImageContentItem.java | 2 +- .../com/azure/ai/inference/models/ChatRequestUserMessage.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageContentItem.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageContentItem.java index aac9367cae0e..eab18cc2a0cf 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageContentItem.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatMessageImageContentItem.java @@ -9,8 +9,8 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; -import java.nio.charset.StandardCharsets; import java.util.Base64; +import java.nio.charset.StandardCharsets; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java index f20f6d02b6d8..6700a91db85b 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java @@ -10,9 +10,9 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.List; import com.azure.json.JsonProviders; import java.io.StringReader; -import java.util.List; /** * A request chat message representing user input to the assistant. From e16676f12ecb82d477715c3343df29291a46e831 Mon Sep 17 00:00:00 2001 From: glenn Date: Tue, 17 Sep 2024 15:59:26 -0400 Subject: [PATCH 120/128] review feedback --- sdk/ai/azure-ai-inference/README.md | 6 +-- .../main/java/InferenceCustomizations.java | 3 ++ .../inference/ChatCompletionsAsyncClient.java | 50 ++----------------- .../ai/inference/ChatCompletionsClient.java | 9 ++-- .../inference/ImageEmbeddingsAsyncClient.java | 14 +++--- .../ai/inference/ImageEmbeddingsClient.java | 14 +++--- ...edRequest1.java => ImageEmbedRequest.java} | 46 ++++++++--------- .../ChatCompletionsAsyncClientTest.java | 15 ------ .../ChatCompletionsSyncClientTest.java | 5 +- 9 files changed, 52 insertions(+), 110 deletions(-) rename sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/{EmbedRequest1.java => ImageEmbedRequest.java} (84%) diff --git a/sdk/ai/azure-ai-inference/README.md b/sdk/ai/azure-ai-inference/README.md index ae318abd9625..3dc09b22c71d 100644 --- a/sdk/ai/azure-ai-inference/README.md +++ b/sdk/ai/azure-ai-inference/README.md @@ -1,8 +1,8 @@ -# Azure Model client library for Java +# Azure AI Inference client library for Java -Azure Model client library for Java. +Azure AI Inference client library for Java. -This package contains Microsoft Azure Model client library. +This package contains the Azure AI Inference client library. ## Documentation diff --git a/sdk/ai/azure-ai-inference/customization/src/main/java/InferenceCustomizations.java b/sdk/ai/azure-ai-inference/customization/src/main/java/InferenceCustomizations.java index e9da4e489972..2e62dd29985b 100644 --- a/sdk/ai/azure-ai-inference/customization/src/main/java/InferenceCustomizations.java +++ b/sdk/ai/azure-ai-inference/customization/src/main/java/InferenceCustomizations.java @@ -16,6 +16,9 @@ public class InferenceCustomizations extends Customization { public void customize(LibraryCustomization customization, Logger logger) { // remove unused class (no reference to them, after partial-update) customization.getRawEditor().removeFile("src/main/java/com/azure/ai/inference/implementation/models/CompleteOptions.java"); + PackageCustomization implModels = customization.getPackage("com.azure.ai.inference.implementation.models"); + ClassCustomization embedRequest1 = implModels.getClass("EmbedRequest1"); + embedRequest1.rename("ImageEmbedRequest"); customizeChatCompletionsBaseClasses(customization, logger); } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java index ec64ca2bf59f..1ae61a24cad7 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java @@ -19,7 +19,6 @@ import com.azure.core.http.HttpHeaderName; import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; import reactor.core.publisher.Flux; @@ -150,54 +149,11 @@ public final class ChatCompletionsAsyncClient { * provided prompt data along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> completeWithBinaryResponse(BinaryData completeRequest, + private Mono> completeWithResponse(BinaryData completeRequest, RequestOptions requestOptions) { return this.serviceClient.completeWithResponseAsync(completeRequest, requestOptions); } - /** - * Gets chat completions for the provided chat messages. - * Completions support a wide variety of tasks and generate text that continues from or "completes" - * provided prompt data. The method makes a REST API call to the `/chat/completions` route - * on the given endpoint. - * - * @param options The configuration information for a chat completions request. Completions support a - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return chat completions for the provided chat messages. - * Completions support a wide variety of tasks and generate text that continues from or "completes" - * provided prompt data along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> completeWithResponse(ChatCompletionsOptions options) { - RequestOptions requestOptions = new RequestOptions(); - CompleteRequest completeRequestObj - = new CompleteRequest(options.getMessages()).setFrequencyPenalty(options.getFrequencyPenalty()) - .setStream(options.isStream()) - .setPresencePenalty(options.getPresencePenalty()) - .setTemperature(options.getTemperature()) - .setTopP(options.getTopP()) - .setMaxTokens(options.getMaxTokens()) - .setResponseFormat(options.getResponseFormat()) - .setStop(options.getStop()) - .setTools(options.getTools()) - .setToolChoice(options.getToolChoice()) - .setSeed(options.getSeed()) - .setModel(options.getModel()); - BinaryData completeRequest = BinaryData.fromObject(completeRequestObj); - ExtraParameters extraParams = options.getExtraParams(); - if (extraParams != null) { - requestOptions.setHeader(HttpHeaderName.fromString("extra-parameters"), extraParams.toString()); - } - return completeWithBinaryResponse(completeRequest, requestOptions) - .map(methodDataResponse -> new SimpleResponse<>(methodDataResponse, - methodDataResponse.getValue().toObject(ChatCompletions.class))); - } - /** * Returns information about the AI model. * The method makes a REST API call to the `/info` route on the given endpoint. @@ -244,7 +200,7 @@ Mono> getModelInfoWithResponse(RequestOptions requestOption public Flux completeStream(ChatCompletionsOptions options) { options.setStream(true); RequestOptions requestOptions = new RequestOptions(); - Flux responseStream = completeWithBinaryResponse(BinaryData.fromObject(options), requestOptions) + Flux responseStream = completeWithResponse(BinaryData.fromObject(options), requestOptions) .flatMapMany(response -> response.getValue().toFluxByteBuffer()); InferenceServerSentEvents chatCompletionsStream = new InferenceServerSentEvents<>(responseStream, StreamingChatCompletionsUpdate.class); @@ -309,7 +265,7 @@ public Mono complete(ChatCompletionsOptions options) { if (extraParams != null) { requestOptions.setHeader(HttpHeaderName.fromString("extra-parameters"), extraParams.toString()); } - return completeWithBinaryResponse(completeRequest, requestOptions).flatMap(FluxUtil::toMono) + return completeWithResponse(completeRequest, requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(ChatCompletions.class)); } diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java index 189be4bf9248..9bd781007938 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java @@ -19,9 +19,7 @@ import com.azure.core.http.HttpHeaderName; import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.BinaryData; -import java.util.Objects; import com.azure.ai.inference.implementation.InferenceServerSentEvents; import com.azure.ai.inference.models.ChatCompletionsOptions; import com.azure.ai.inference.implementation.ChatCompletionsUtils; @@ -150,9 +148,8 @@ public final class ChatCompletionsClient { * provided prompt data along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response completeWithResponse(BinaryData completeRequest, RequestOptions requestOptions) { - Response response = serviceClient.completeWithResponse(completeRequest, requestOptions); - return new SimpleResponse<>(response, response.getValue().toObject(ChatCompletions.class)); + public Response completeWithResponse(BinaryData completeRequest, RequestOptions requestOptions) { + return this.serviceClient.completeWithResponse(completeRequest, requestOptions); } /** @@ -220,7 +217,7 @@ public ChatCompletions complete(ChatCompletionsOptions options) { if (extraParams != null) { requestOptions.setHeader(HttpHeaderName.fromString("extra-parameters"), extraParams.toString()); } - return Objects.requireNonNull(completeWithResponse(completeRequest, requestOptions)).getValue(); + return completeWithResponse(completeRequest, requestOptions).getValue().toObject(ChatCompletions.class); } /** diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java index 89703b235b53..33d0d77de121 100644 --- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java +++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsAsyncClient.java @@ -4,7 +4,7 @@ package com.azure.ai.inference; import com.azure.ai.inference.implementation.ImageEmbeddingsClientImpl; -import com.azure.ai.inference.implementation.models.EmbedRequest1; +import com.azure.ai.inference.implementation.models.ImageEmbedRequest; import com.azure.ai.inference.models.EmbeddingEncodingFormat; import com.azure.ai.inference.models.EmbeddingInput; import com.azure.ai.inference.models.EmbeddingInputType; @@ -60,7 +60,7 @@ public final class ImageEmbeddingsAsyncClient { * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

- * + * *
{@code
      * {
      *     input (Required): [
@@ -78,9 +78,9 @@ public final class ImageEmbeddingsAsyncClient {
      *     }
      * }
      * }
- * + * *

Response Body Schema

- * + * *
{@code
      * {
      *     data (Required): [
@@ -118,7 +118,7 @@ Mono> embedWithResponse(BinaryData embedRequest1, RequestOp
      * Returns information about the AI model.
      * The method makes a REST API call to the `/info` route on the given endpoint.
      * 

Response Body Schema

- * + * *
{@code
      * {
      *     model_name: String (Required)
@@ -162,7 +162,7 @@ Mono> getModelInfoWithResponse(RequestOptions requestOption
     Mono embed(List input) {
         // Generated convenience method for embedWithResponse
         RequestOptions requestOptions = new RequestOptions();
-        EmbedRequest1 embedRequest1Obj = new EmbedRequest1(input);
+        ImageEmbedRequest embedRequest1Obj = new ImageEmbedRequest(input);
         BinaryData embedRequest1 = BinaryData.fromObject(embedRequest1Obj);
         return embedWithResponse(embedRequest1, requestOptions).flatMap(FluxUtil::toMono)
             .map(protocolMethodData -> protocolMethodData.toObject(EmbeddingsResult.class));
@@ -222,7 +222,7 @@ Mono embed(List input, ExtraParameters extraPa
         EmbeddingEncodingFormat encodingFormat, EmbeddingInputType inputType, String model) {
         // Generated convenience method for embedWithResponse
         RequestOptions requestOptions = new RequestOptions();
-        EmbedRequest1 embedRequest1Obj = new EmbedRequest1(input).setDimensions(dimensions)
+        ImageEmbedRequest embedRequest1Obj = new ImageEmbedRequest(input).setDimensions(dimensions)
             .setEncodingFormat(encodingFormat)
             .setInputType(inputType)
             .setModel(model);
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClient.java
index fac96389eedc..e776ffae7096 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ImageEmbeddingsClient.java
@@ -4,7 +4,7 @@
 package com.azure.ai.inference;
 
 import com.azure.ai.inference.implementation.ImageEmbeddingsClientImpl;
-import com.azure.ai.inference.implementation.models.EmbedRequest1;
+import com.azure.ai.inference.implementation.models.ImageEmbedRequest;
 import com.azure.ai.inference.models.EmbeddingEncodingFormat;
 import com.azure.ai.inference.models.EmbeddingInput;
 import com.azure.ai.inference.models.EmbeddingInputType;
@@ -58,7 +58,7 @@ public final class ImageEmbeddingsClient {
      * 
      * You can add these to a request with {@link RequestOptions#addHeader}
      * 

Request Body Schema

- * + * *
{@code
      * {
      *     input (Required): [
@@ -76,9 +76,9 @@ public final class ImageEmbeddingsClient {
      *     }
      * }
      * }
- * + * *

Response Body Schema

- * + * *
{@code
      * {
      *     data (Required): [
@@ -115,7 +115,7 @@ Response embedWithResponse(BinaryData embedRequest1, RequestOptions
      * Returns information about the AI model.
      * The method makes a REST API call to the `/info` route on the given endpoint.
      * 

Response Body Schema

- * + * *
{@code
      * {
      *     model_name: String (Required)
@@ -158,7 +158,7 @@ Response getModelInfoWithResponse(RequestOptions requestOptions) {
     EmbeddingsResult embed(List input) {
         // Generated convenience method for embedWithResponse
         RequestOptions requestOptions = new RequestOptions();
-        EmbedRequest1 embedRequest1Obj = new EmbedRequest1(input);
+        ImageEmbedRequest embedRequest1Obj = new ImageEmbedRequest(input);
         BinaryData embedRequest1 = BinaryData.fromObject(embedRequest1Obj);
         return embedWithResponse(embedRequest1, requestOptions).getValue().toObject(EmbeddingsResult.class);
     }
@@ -216,7 +216,7 @@ EmbeddingsResult embed(List input, ExtraParameters extraParams,
         EmbeddingEncodingFormat encodingFormat, EmbeddingInputType inputType, String model) {
         // Generated convenience method for embedWithResponse
         RequestOptions requestOptions = new RequestOptions();
-        EmbedRequest1 embedRequest1Obj = new EmbedRequest1(input).setDimensions(dimensions)
+        ImageEmbedRequest embedRequest1Obj = new ImageEmbedRequest(input).setDimensions(dimensions)
             .setEncodingFormat(encodingFormat)
             .setInputType(inputType)
             .setModel(model);
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/EmbedRequest1.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/ImageEmbedRequest.java
similarity index 84%
rename from sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/EmbedRequest1.java
rename to sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/ImageEmbedRequest.java
index 615c7018b9bf..931a49454098 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/EmbedRequest1.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/ImageEmbedRequest.java
@@ -18,10 +18,10 @@
 import java.util.Map;
 
 /**
- * The EmbedRequest1 model.
+ * The ImageEmbedRequest model.
  */
 @Fluent
-public final class EmbedRequest1 implements JsonSerializable {
+public final class ImageEmbedRequest implements JsonSerializable {
 
     /*
      * Input image to embed. To embed multiple inputs in a single request, pass an array.
@@ -71,7 +71,7 @@ public final class EmbedRequest1 implements JsonSerializable {
      * @param input the input value to set.
      */
     @Generated
-    public EmbedRequest1(List input) {
+    public ImageEmbedRequest(List input) {
         this.input = input;
     }
 
@@ -104,10 +104,10 @@ public Integer getDimensions() {
      * Returns a 422 error if the model doesn't support the value or parameter.
      *
      * @param dimensions the dimensions value to set.
-     * @return the EmbedRequest1 object itself.
+     * @return the ImageEmbedRequest object itself.
      */
     @Generated
-    public EmbedRequest1 setDimensions(Integer dimensions) {
+    public ImageEmbedRequest setDimensions(Integer dimensions) {
         this.dimensions = dimensions;
         return this;
     }
@@ -130,10 +130,10 @@ public EmbeddingEncodingFormat getEncodingFormat() {
      * Returns a 422 error if the model doesn't support the value or parameter.
      *
      * @param encodingFormat the encodingFormat value to set.
-     * @return the EmbedRequest1 object itself.
+     * @return the ImageEmbedRequest object itself.
      */
     @Generated
-    public EmbedRequest1 setEncodingFormat(EmbeddingEncodingFormat encodingFormat) {
+    public ImageEmbedRequest setEncodingFormat(EmbeddingEncodingFormat encodingFormat) {
         this.encodingFormat = encodingFormat;
         return this;
     }
@@ -154,10 +154,10 @@ public EmbeddingInputType getInputType() {
      * Returns a 422 error if the model doesn't support the value or parameter.
      *
      * @param inputType the inputType value to set.
-     * @return the EmbedRequest1 object itself.
+     * @return the ImageEmbedRequest object itself.
      */
     @Generated
-    public EmbedRequest1 setInputType(EmbeddingInputType inputType) {
+    public ImageEmbedRequest setInputType(EmbeddingInputType inputType) {
         this.inputType = inputType;
         return this;
     }
@@ -176,10 +176,10 @@ public String getModel() {
      * Set the model property: ID of the specific AI model to use, if more than one model is available on the endpoint.
      *
      * @param model the model value to set.
-     * @return the EmbedRequest1 object itself.
+     * @return the ImageEmbedRequest object itself.
      */
     @Generated
-    public EmbedRequest1 setModel(String model) {
+    public ImageEmbedRequest setModel(String model) {
         this.model = model;
         return this;
     }
@@ -198,10 +198,10 @@ public Map getAdditionalProperties() {
      * Set the additionalProperties property: Additional properties.
      *
      * @param additionalProperties the additionalProperties value to set.
-     * @return the EmbedRequest1 object itself.
+     * @return the ImageEmbedRequest object itself.
      */
     @Generated
-    public EmbedRequest1 setAdditionalProperties(Map additionalProperties) {
+    public ImageEmbedRequest setAdditionalProperties(Map additionalProperties) {
         this.additionalProperties = additionalProperties;
         return this;
     }
@@ -228,16 +228,16 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
     }
 
     /**
-     * Reads an instance of EmbedRequest1 from the JsonReader.
+     * Reads an instance of ImageEmbedRequest from the JsonReader.
      *
      * @param jsonReader The JsonReader being read.
-     * @return An instance of EmbedRequest1 if the JsonReader was pointing to an instance of it, or null if it was
+     * @return An instance of ImageEmbedRequest if the JsonReader was pointing to an instance of it, or null if it was
      * pointing to JSON null.
      * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
      * @throws IOException If an error occurs while reading the EmbedRequest1.
      */
     @Generated
-    public static EmbedRequest1 fromJson(JsonReader jsonReader) throws IOException {
+    public static ImageEmbedRequest fromJson(JsonReader jsonReader) throws IOException {
         return jsonReader.readObject(reader -> {
             List input = null;
             Integer dimensions = null;
@@ -265,13 +265,13 @@ public static EmbedRequest1 fromJson(JsonReader jsonReader) throws IOException {
                     additionalProperties.put(fieldName, reader.readUntyped());
                 }
             }
-            EmbedRequest1 deserializedEmbedRequest1 = new EmbedRequest1(input);
-            deserializedEmbedRequest1.dimensions = dimensions;
-            deserializedEmbedRequest1.encodingFormat = encodingFormat;
-            deserializedEmbedRequest1.inputType = inputType;
-            deserializedEmbedRequest1.model = model;
-            deserializedEmbedRequest1.additionalProperties = additionalProperties;
-            return deserializedEmbedRequest1;
+            ImageEmbedRequest deserializedImageEmbedRequest = new ImageEmbedRequest(input);
+            deserializedImageEmbedRequest.dimensions = dimensions;
+            deserializedImageEmbedRequest.encodingFormat = encodingFormat;
+            deserializedImageEmbedRequest.inputType = inputType;
+            deserializedImageEmbedRequest.model = model;
+            deserializedImageEmbedRequest.additionalProperties = additionalProperties;
+            return deserializedImageEmbedRequest;
         });
     }
 }
diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsAsyncClientTest.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsAsyncClientTest.java
index bee632bcacf7..c7f205933c4c 100644
--- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsAsyncClientTest.java
+++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsAsyncClientTest.java
@@ -66,19 +66,4 @@ public void testGetCompletionsStream(HttpClient httpClient) {
                 .verifyComplete();
         });
     }
-    @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS)
-    @MethodSource("com.azure.ai.inference.TestUtils#getTestParameters")
-    public void testGetChatCompletionsFromResponse(HttpClient httpClient) {
-        client = getChatCompletionsAsyncClient(httpClient);
-        getChatCompletionsFromOptionsRunner((options) -> {
-            StepVerifier.create(
-                client.completeWithResponse(options))
-                .assertNext(resultCompletionsResponse -> {
-                    assertNotNull(resultCompletionsResponse.getValue().getUsage());
-                    assertCompletions(1, resultCompletionsResponse.getValue());
-                })
-                .verifyComplete();
-        });
-    }
-
 }
diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java
index ae16cc4128c7..e4cf8f7b35c8 100644
--- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java
+++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java
@@ -68,9 +68,10 @@ public void testGetCompletionsFromOptions(HttpClient httpClient) {
     public void testGetCompletionsWithResponse(HttpClient httpClient) {
         client = getChatCompletionsClient(httpClient);
         getChatCompletionsFromOptionsRunner((options) -> {
-            Response response = client.completeWithResponse(
+            Response binaryDataResponse = client.completeWithResponse(
                 BinaryData.fromObject(options), new RequestOptions());
-            assertCompletions(1, response.getValue());
+            ChatCompletions response = binaryDataResponse.getValue().toObject(ChatCompletions.class);
+            assertCompletions(1, response);
         });
     }
 

From 3177d597142f53082393b87eb3785d9420b06a2d Mon Sep 17 00:00:00 2001
From: Glenn Harper <64209257+glharper@users.noreply.github.com>
Date: Tue, 17 Sep 2024 16:01:47 -0400
Subject: [PATCH 121/128] Update sdk/ai/azure-ai-inference/README.md

Co-authored-by: Bill Wert 
---
 sdk/ai/azure-ai-inference/README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sdk/ai/azure-ai-inference/README.md b/sdk/ai/azure-ai-inference/README.md
index 3dc09b22c71d..bbaac73e497c 100644
--- a/sdk/ai/azure-ai-inference/README.md
+++ b/sdk/ai/azure-ai-inference/README.md
@@ -226,6 +226,6 @@ For details on contributing to this repository, see the [contributing guide](htt
 [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
 [performance_tuning]: https://github.com/Azure/azure-sdk-for-java/wiki/Performance-Tuning
 [troubleshooting]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/openai/azure-ai-openai/TROUBLESHOOTING.md
-[wiki_identity]: https://github.com/Azure/azure-sdk-for-java/wiki/Identity-and-Authentication
+[wiki_identity]: https://learn.microsoft.com/azure/developer/java/sdk/identity
 
 ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fai%2Fazure-ai-inference%2FREADME.png)

From 9049cc2a69592a3f25fdfd778adbbd11ba1d0952 Mon Sep 17 00:00:00 2001
From: Glenn Harper <64209257+glharper@users.noreply.github.com>
Date: Tue, 17 Sep 2024 16:01:57 -0400
Subject: [PATCH 122/128] Update sdk/ai/azure-ai-inference/README.md

Co-authored-by: Bill Wert 
---
 sdk/ai/azure-ai-inference/README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sdk/ai/azure-ai-inference/README.md b/sdk/ai/azure-ai-inference/README.md
index bbaac73e497c..b0586eb5433d 100644
--- a/sdk/ai/azure-ai-inference/README.md
+++ b/sdk/ai/azure-ai-inference/README.md
@@ -212,7 +212,7 @@ For details on contributing to this repository, see the [contributing guide](htt
 [product_documentation]: https://azure.microsoft.com/services/
 [docs]: https://azure.github.io/azure-sdk-for-java/
 [jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/
-[azure_identity_credential_type]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials
+[azure_identity_credential_type]: https://learn.microsoft.com/java/api/overview/azure/identity-readme?view=azure-java-stable#credentials
 [aad_authorization]: https://docs.microsoft.com/azure/cognitive-services/authentication#authenticate-with-azure-active-directory
 [azure_subscription]: https://azure.microsoft.com/free/
 [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity

From 4c7e0b1f5ccdf75277f001d7c5fe40a996ee11ad Mon Sep 17 00:00:00 2001
From: glenn 
Date: Tue, 17 Sep 2024 16:44:42 -0400
Subject: [PATCH 123/128] fix TypeSpec crash

---
 .../customization/src/main/java/InferenceCustomizations.java     | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sdk/ai/azure-ai-inference/customization/src/main/java/InferenceCustomizations.java b/sdk/ai/azure-ai-inference/customization/src/main/java/InferenceCustomizations.java
index 2e62dd29985b..088f3e38c582 100644
--- a/sdk/ai/azure-ai-inference/customization/src/main/java/InferenceCustomizations.java
+++ b/sdk/ai/azure-ai-inference/customization/src/main/java/InferenceCustomizations.java
@@ -1,6 +1,7 @@
 import com.azure.autorest.customization.ClassCustomization;
 import com.azure.autorest.customization.Customization;
 import com.azure.autorest.customization.LibraryCustomization;
+import com.azure.autorest.customization.PackageCustomization;
 import org.slf4j.Logger;
 
 import java.lang.reflect.Modifier;

From bcc6cef948714903e4401b0c03c8eea5fd8701e4 Mon Sep 17 00:00:00 2001
From: glenn 
Date: Tue, 17 Sep 2024 16:48:30 -0400
Subject: [PATCH 124/128] remove unneeded paragraph

---
 sdk/ai/azure-ai-inference/README.md | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/sdk/ai/azure-ai-inference/README.md b/sdk/ai/azure-ai-inference/README.md
index b0586eb5433d..75b1b3ed6754 100644
--- a/sdk/ai/azure-ai-inference/README.md
+++ b/sdk/ai/azure-ai-inference/README.md
@@ -72,11 +72,6 @@ Authentication with AAD requires some initial setup:
 ```
 [//]: # ({x-version-update-end})
 
-After setup, you can choose which type of [credential][azure_identity_credential_type] from azure.identity to use.
-As an example, [DefaultAzureCredential][wiki_identity] can be used to authenticate the client:
-Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:
-`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.
-
 Authorization is easiest using [DefaultAzureCredential][wiki_identity]. It finds the best credential to use in its
 running environment. For more information about using Azure Active Directory authorization with OpenAI service, please
 refer to [the associated documentation][aad_authorization].
@@ -212,7 +207,6 @@ For details on contributing to this repository, see the [contributing guide](htt
 [product_documentation]: https://azure.microsoft.com/services/
 [docs]: https://azure.github.io/azure-sdk-for-java/
 [jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/
-[azure_identity_credential_type]: https://learn.microsoft.com/java/api/overview/azure/identity-readme?view=azure-java-stable#credentials
 [aad_authorization]: https://docs.microsoft.com/azure/cognitive-services/authentication#authenticate-with-azure-active-directory
 [azure_subscription]: https://azure.microsoft.com/free/
 [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity

From 75b1bc68d489aa088f9b0c0c6638e70fe4c9de4c Mon Sep 17 00:00:00 2001
From: glenn 
Date: Tue, 17 Sep 2024 16:57:59 -0400
Subject: [PATCH 125/128] make TypeSpec sync happy

---
 .../com/azure/ai/inference/ChatCompletionsAsyncClient.java     | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java
index 1ae61a24cad7..1008fc51f152 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java
@@ -149,8 +149,7 @@ public final class ChatCompletionsAsyncClient {
      * provided prompt data along with {@link Response} on successful completion of {@link Mono}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
-    private Mono> completeWithResponse(BinaryData completeRequest,
-        RequestOptions requestOptions) {
+    private Mono> completeWithResponse(BinaryData completeRequest, RequestOptions requestOptions) {
         return this.serviceClient.completeWithResponseAsync(completeRequest, requestOptions);
     }
 

From 7defa2a6bb0fa24f4a9e2a25dab45545fd04e8c1 Mon Sep 17 00:00:00 2001
From: glenn 
Date: Tue, 17 Sep 2024 17:44:01 -0400
Subject: [PATCH 126/128] add access helper to ChatCompletionsOptions

---
 .../inference/ChatCompletionsAsyncClient.java |  3 +-
 .../ai/inference/ChatCompletionsClient.java   |  3 +-
 .../ChatCompletionsOptionsAccessHelper.java   | 47 +++++++++++++++++++
 .../models/ChatCompletionsOptions.java        | 12 ++++-
 .../ChatCompletionsSyncClientTest.java        |  3 +-
 5 files changed, 63 insertions(+), 5 deletions(-)
 create mode 100644 sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/accesshelpers/ChatCompletionsOptionsAccessHelper.java

diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java
index 1008fc51f152..5425949586e5 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java
@@ -4,6 +4,7 @@
 package com.azure.ai.inference;
 
 import com.azure.ai.inference.implementation.ChatCompletionsClientImpl;
+import com.azure.ai.inference.implementation.accesshelpers.ChatCompletionsOptionsAccessHelper;
 import com.azure.ai.inference.implementation.models.CompleteRequest;
 import com.azure.ai.inference.models.ChatCompletions;
 import com.azure.ai.inference.models.ExtraParameters;
@@ -197,7 +198,7 @@ Mono> getModelInfoWithResponse(RequestOptions requestOption
      */
     @ServiceMethod(returns = ReturnType.COLLECTION)
     public Flux completeStream(ChatCompletionsOptions options) {
-        options.setStream(true);
+        ChatCompletionsOptionsAccessHelper.setStream(options, true);
         RequestOptions requestOptions = new RequestOptions();
         Flux responseStream = completeWithResponse(BinaryData.fromObject(options), requestOptions)
             .flatMapMany(response -> response.getValue().toFluxByteBuffer());
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java
index 9bd781007938..50690c95ee34 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java
@@ -4,6 +4,7 @@
 package com.azure.ai.inference;
 
 import com.azure.ai.inference.implementation.ChatCompletionsClientImpl;
+import com.azure.ai.inference.implementation.accesshelpers.ChatCompletionsOptionsAccessHelper;
 import com.azure.ai.inference.implementation.models.CompleteRequest;
 import com.azure.ai.inference.models.ChatCompletions;
 import com.azure.ai.inference.models.ExtraParameters;
@@ -257,7 +258,7 @@ public ChatCompletions complete(String prompt) {
      */
     @ServiceMethod(returns = ReturnType.COLLECTION)
     public IterableStream completeStream(ChatCompletionsOptions options) {
-        options.setStream(true);
+        ChatCompletionsOptionsAccessHelper.setStream(options, true);
         RequestOptions requestOptions = new RequestOptions();
         CompleteRequest completeRequestObj
             = new CompleteRequest(options.getMessages()).setFrequencyPenalty(options.getFrequencyPenalty())
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/accesshelpers/ChatCompletionsOptionsAccessHelper.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/accesshelpers/ChatCompletionsOptionsAccessHelper.java
new file mode 100644
index 000000000000..b15bef638bee
--- /dev/null
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/accesshelpers/ChatCompletionsOptionsAccessHelper.java
@@ -0,0 +1,47 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+package com.azure.ai.inference.implementation.accesshelpers;
+
+import com.azure.ai.inference.models.ChatCompletionsOptions;
+
+/**
+ * Class containing helper methods for accessing private members of {@link ChatCompletionsOptions}.
+ */
+public final class ChatCompletionsOptionsAccessHelper {
+    private static ChatCompletionsOptionsAccessor accessor;
+
+    /**
+     * Type defining the methods to set the non-public properties of an {@link ChatCompletionsOptions} instance.
+     */
+    public interface ChatCompletionsOptionsAccessor {
+        /**
+         * Sets the stream property of the {@link ChatCompletionsOptions}.
+         *
+         * @param chatCompletionsOptions The {@link ChatCompletionsOptions} instance
+         * @param stream The boolean value to set private stream property
+         */
+        void setStream(ChatCompletionsOptions chatCompletionsOptions, boolean stream);
+    }
+
+    /**
+     * The method called from {@link ChatCompletionsOptions} to set it's accessor.
+     *
+     * @param chatCompletionsOptionsAccessor The accessor.
+     */
+    public static void setAccessor(final ChatCompletionsOptionsAccessor chatCompletionsOptionsAccessor) {
+        accessor = chatCompletionsOptionsAccessor;
+    }
+
+    /**
+     * Sets the stream property of the {@link ChatCompletionsOptions}.
+     *
+     * @param options The {@link ChatCompletionsOptions} instance
+     * @param stream The boolean value to set private stream property
+     */
+    public static void setStream(ChatCompletionsOptions options, boolean stream) {
+        accessor.setStream(options, stream);
+    }
+
+    private ChatCompletionsOptionsAccessHelper() {
+    }
+}
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsOptions.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsOptions.java
index c8b39c03502c..b408b4d53fcb 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsOptions.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsOptions.java
@@ -4,6 +4,7 @@
 
 package com.azure.ai.inference.models;
 
+import com.azure.ai.inference.implementation.accesshelpers.ChatCompletionsOptionsAccessHelper;
 import com.azure.core.annotation.Fluent;
 import com.azure.core.annotation.Generated;
 import com.azure.core.util.BinaryData;
@@ -20,6 +21,14 @@
  */
 @Fluent
 public final class ChatCompletionsOptions implements JsonSerializable {
+    static {
+        ChatCompletionsOptionsAccessHelper.setAccessor(new ChatCompletionsOptionsAccessHelper.ChatCompletionsOptionsAccessor() {
+            @Override
+            public void setStream(ChatCompletionsOptions options, boolean stream) {
+                options.setStream(stream);
+            }
+        });
+    }
     /*
      * The collection of context messages associated with this chat completions request.
      * Typical usage begins with a chat message for the System role that provides instructions for
@@ -202,8 +211,7 @@ public Boolean isStream() {
      * @param stream the stream value to set.
      * @return the ChatCompletionsOptions object itself.
      */
-    @Generated
-    public ChatCompletionsOptions setStream(Boolean stream) {
+    private ChatCompletionsOptions setStream(Boolean stream) {
         this.stream = stream;
         return this;
     }
diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java
index e4cf8f7b35c8..a951d595eefa 100644
--- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java
+++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java
@@ -3,6 +3,7 @@
 package com.azure.ai.inference;
 
 import com.azure.ai.inference.implementation.InferenceServerSentEvents;
+import com.azure.ai.inference.implementation.accesshelpers.ChatCompletionsOptionsAccessHelper;
 import com.azure.ai.inference.models.*;
 import com.azure.core.http.HttpClient;
 
@@ -108,7 +109,7 @@ public void testGetCompletionsTokenCutoff(HttpClient httpClient) {
     public void testGetChatCompletionsStreamWithResponse(HttpClient httpClient) {
         client = getChatCompletionsClient(httpClient);
         getChatCompletionsFromOptionsRunner(options -> {
-            options.setStream(true);
+            ChatCompletionsOptionsAccessHelper.setStream(options, true);
             Response response = client.completeStreamWithResponse(
                 BinaryData.fromObject(options), new RequestOptions());
             assertResponseRequestHeader(response.getRequest());

From 171931a5b5a5e93fb63dd6d3457f8c926d5c9c4f Mon Sep 17 00:00:00 2001
From: glenn 
Date: Tue, 17 Sep 2024 17:54:02 -0400
Subject: [PATCH 127/128] typespec sync

---
 .../java/com/azure/ai/inference/ChatCompletionsAsyncClient.java | 2 +-
 .../main/java/com/azure/ai/inference/ChatCompletionsClient.java | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java
index 5425949586e5..8f2c0ae8672f 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsAsyncClient.java
@@ -4,7 +4,6 @@
 package com.azure.ai.inference;
 
 import com.azure.ai.inference.implementation.ChatCompletionsClientImpl;
-import com.azure.ai.inference.implementation.accesshelpers.ChatCompletionsOptionsAccessHelper;
 import com.azure.ai.inference.implementation.models.CompleteRequest;
 import com.azure.ai.inference.models.ChatCompletions;
 import com.azure.ai.inference.models.ExtraParameters;
@@ -24,6 +23,7 @@
 import com.azure.core.util.FluxUtil;
 import reactor.core.publisher.Flux;
 import reactor.core.publisher.Mono;
+import com.azure.ai.inference.implementation.accesshelpers.ChatCompletionsOptionsAccessHelper;
 import com.azure.ai.inference.implementation.InferenceServerSentEvents;
 import com.azure.ai.inference.implementation.ChatCompletionsUtils;
 import com.azure.ai.inference.models.ChatCompletionsOptions;
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java
index 50690c95ee34..39f3af27bdf4 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java
@@ -4,7 +4,6 @@
 package com.azure.ai.inference;
 
 import com.azure.ai.inference.implementation.ChatCompletionsClientImpl;
-import com.azure.ai.inference.implementation.accesshelpers.ChatCompletionsOptionsAccessHelper;
 import com.azure.ai.inference.implementation.models.CompleteRequest;
 import com.azure.ai.inference.models.ChatCompletions;
 import com.azure.ai.inference.models.ExtraParameters;
@@ -21,6 +20,7 @@
 import com.azure.core.http.rest.RequestOptions;
 import com.azure.core.http.rest.Response;
 import com.azure.core.util.BinaryData;
+import com.azure.ai.inference.implementation.accesshelpers.ChatCompletionsOptionsAccessHelper;
 import com.azure.ai.inference.implementation.InferenceServerSentEvents;
 import com.azure.ai.inference.models.ChatCompletionsOptions;
 import com.azure.ai.inference.implementation.ChatCompletionsUtils;

From 17a970413c91f30cfa192e03d6e49f66928ba371 Mon Sep 17 00:00:00 2001
From: glenn 
Date: Wed, 18 Sep 2024 14:52:27 -0400
Subject: [PATCH 128/128] review feedback

---
 .../ai/inference/ChatCompletionsClient.java   | 82 +------------------
 .../ChatCompletionsSyncClientTest.java        | 32 ++------
 sdk/ai/tests.yml                              |  0
 3 files changed, 8 insertions(+), 106 deletions(-)
 delete mode 100644 sdk/ai/tests.yml

diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java
index 39f3af27bdf4..040646a2496d 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ChatCompletionsClient.java
@@ -279,92 +279,12 @@ public IterableStream completeStream(ChatComplet
             requestOptions.setHeader(HttpHeaderName.fromString("extra-parameters"), extraParams.toString());
         }
         Flux responseStream
-            = completeStreamWithResponse(completeRequest, requestOptions).getValue().toFluxByteBuffer();
+            = completeWithResponse(completeRequest, requestOptions).getValue().toFluxByteBuffer();
         InferenceServerSentEvents chatCompletionsStream
             = new InferenceServerSentEvents<>(responseStream, StreamingChatCompletionsUpdate.class);
         return new IterableStream<>(chatCompletionsStream.getEvents());
     }
 
-    /**
-     * Gets chat completions for the provided chat messages. Completions support a wide variety of tasks and generate
-     * text that continues from or "completes" provided prompt data.
-     *
-     * 

- * Request Body Schema - * - *

{@code
-     * {
-     *     messages (Required): [
-     *          (Required){
-     *             role: String(system/assistant/user) (Required)
-     *             content: String (Optional)
-     *         }
-     *     ]
-     *     max_tokens: Integer (Optional)
-     *     temperature: Double (Optional)
-     *     top_p: Double (Optional)
-     *     logit_bias (Optional): {
-     *         String: int (Optional)
-     *     }
-     *     user: String (Optional)
-     *     n: Integer (Optional)
-     *     stop (Optional): [
-     *         String (Optional)
-     *     ]
-     *     presence_penalty: Double (Optional)
-     *     frequency_penalty: Double (Optional)
-     *     stream: Boolean (Optional)
-     *     model: String (Optional)
-     * }
-     * }
- * - *

- * Response Body Schema - * - *

{@code
-     * {
-     *     id: String (Required)
-     *     created: int (Required)
-     *     choices (Required): [
-     *          (Required){
-     *             message (Optional): {
-     *                 role: String(system/assistant/user) (Required)
-     *                 content: String (Optional)
-     *             }
-     *             index: int (Required)
-     *             finish_reason: String(stopped/tokenLimitReached/contentFiltered) (Required)
-     *             delta (Optional): {
-     *                 role: String(system/assistant/user) (Optional)
-     *                 content: String (Optional)
-     *             }
-     *         }
-     *     ]
-     *     usage (Required): {
-     *         completion_tokens: int (Required)
-     *         prompt_tokens: int (Required)
-     *         total_tokens: int (Required)
-     *     }
-     * }
-     * }
- * - * (when using non-Azure OpenAI) to use for this request. - * - * @param chatCompletionsOptions The configuration information for a chat completions request. Completions support a - * wide variety of tasks and generate text that continues from or "completes" provided prompt data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return chat completions for the provided chat messages. Completions support a wide variety of tasks and generate - * text that continues from or "completes" provided prompt data along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response completeStreamWithResponse(BinaryData chatCompletionsOptions, - RequestOptions requestOptions) { - return serviceClient.completeWithResponse(chatCompletionsOptions, requestOptions); - } - /** * Returns information about the AI model. * The method makes a REST API call to the `/info` route on the given endpoint. diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java index a951d595eefa..8d4d8f5ac893 100644 --- a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java +++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionsSyncClientTest.java @@ -2,9 +2,12 @@ // Licensed under the MIT License. package com.azure.ai.inference; -import com.azure.ai.inference.implementation.InferenceServerSentEvents; -import com.azure.ai.inference.implementation.accesshelpers.ChatCompletionsOptionsAccessHelper; -import com.azure.ai.inference.models.*; +import com.azure.ai.inference.models.ChatCompletions; +import com.azure.ai.inference.models.ChatCompletionsOptions; +import com.azure.ai.inference.models.ChatRequestMessage; +import com.azure.ai.inference.models.ChatRequestUserMessage; +import com.azure.ai.inference.models.CompletionsUsage; +import com.azure.ai.inference.models.StreamingChatCompletionsUpdate; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.RequestOptions; @@ -13,9 +16,7 @@ import com.azure.core.util.IterableStream; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -import reactor.core.publisher.Flux; -import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; @@ -103,24 +104,5 @@ public void testGetCompletionsTokenCutoff(HttpClient httpClient) { assertCompletions(1, resultCompletions); }); } - - @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) - @MethodSource("com.azure.ai.inference.TestUtils#getTestParameters") - public void testGetChatCompletionsStreamWithResponse(HttpClient httpClient) { - client = getChatCompletionsClient(httpClient); - getChatCompletionsFromOptionsRunner(options -> { - ChatCompletionsOptionsAccessHelper.setStream(options, true); - Response response = client.completeStreamWithResponse( - BinaryData.fromObject(options), new RequestOptions()); - assertResponseRequestHeader(response.getRequest()); - Flux responseStream - = response.getValue().toFluxByteBuffer(); - InferenceServerSentEvents chatCompletionsStream - = new InferenceServerSentEvents<>(responseStream, StreamingChatCompletionsUpdate.class); - IterableStream value = new IterableStream<>(chatCompletionsStream.getEvents()); - assertTrue(value.stream().toArray().length > 1); - value.forEach(ChatCompletionsClientTestBase::assertCompletionsStream); - }); - } - } + diff --git a/sdk/ai/tests.yml b/sdk/ai/tests.yml deleted file mode 100644 index e69de29bb2d1..000000000000