> completeWithResponse(BinaryData completeReque
* 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_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat_completion) (Required)
* model_provider_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 77671227e57c..6eb7d2787c15 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
@@ -163,12 +163,12 @@ public Response completeWithResponse(BinaryData completeRequest, Req
* 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_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat_completion) (Required)
* model_provider_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 652c4d207fa0..38c69d036fbc 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
@@ -83,6 +83,7 @@ public final class EmbeddingsAsyncClient {
*
* {@code
* {
+ * id: String (Required)
* data (Required): [
* (Required){
* embedding: BinaryData (Required)
@@ -98,7 +99,7 @@ public final class EmbeddingsAsyncClient {
* }
*
*
- * @param embedRequest The embedRequest parameter.
+ * @param body request options to pass to the endpoint using embeddings path.
* @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.
@@ -111,8 +112,8 @@ public final class EmbeddingsAsyncClient {
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- Mono> embedWithResponse(BinaryData embedRequest, RequestOptions requestOptions) {
- return this.serviceClient.embedWithResponseAsync(embedRequest, requestOptions);
+ Mono> embedWithResponse(BinaryData body, RequestOptions requestOptions) {
+ return this.serviceClient.embedWithResponseAsync(body, requestOptions);
}
/**
@@ -124,7 +125,7 @@ Mono> embedWithResponse(BinaryData embedRequest, RequestOpt
* {@code
* {
* model_name: String (Required)
- * model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat) (Required)
+ * model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat_completion) (Required)
* model_provider_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 7acec4c86e0f..d7406a0ba33a 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
@@ -81,6 +81,7 @@ public final class EmbeddingsClient {
*
* {@code
* {
+ * id: String (Required)
* data (Required): [
* (Required){
* embedding: BinaryData (Required)
@@ -96,7 +97,7 @@ public final class EmbeddingsClient {
* }
*
*
- * @param embedRequest The embedRequest parameter.
+ * @param body request options to pass to the endpoint using embeddings path.
* @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.
@@ -108,8 +109,8 @@ public final class EmbeddingsClient {
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- Response embedWithResponse(BinaryData embedRequest, RequestOptions requestOptions) {
- return this.serviceClient.embedWithResponse(embedRequest, requestOptions);
+ Response embedWithResponse(BinaryData body, RequestOptions requestOptions) {
+ return this.serviceClient.embedWithResponse(body, requestOptions);
}
/**
@@ -121,7 +122,7 @@ Response embedWithResponse(BinaryData embedRequest, RequestOptions r
* {@code
* {
* model_name: String (Required)
- * model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat) (Required)
+ * model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat_completion) (Required)
* model_provider_name: String (Required)
* }
* }
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 47e2136b727c..f71af3a95c51 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
@@ -205,7 +205,7 @@ public EmbeddingsClientBuilder credential(TokenCredential tokenCredential) {
* Sets auth domain scopes for client authentication.
*
* @param scopes domain scope to authenticate against.
- * @return the ChatCompletionsClientBuilder.
+ * @return the EmbeddingsClientBuilder.
*/
public EmbeddingsClientBuilder scopes(String[] scopes) {
this.scopes = scopes;
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 4ecafd484b61..a6df9a2e45a5 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,9 @@
import com.azure.ai.inference.implementation.ImageEmbeddingsClientImpl;
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;
import com.azure.ai.inference.models.EmbeddingsResult;
import com.azure.ai.inference.models.ExtraParameters;
+import com.azure.ai.inference.models.ImageEmbeddingInput;
import com.azure.ai.inference.models.ModelInfo;
import com.azure.core.annotation.Generated;
import com.azure.core.annotation.ReturnType;
@@ -86,6 +84,7 @@ public final class ImageEmbeddingsAsyncClient {
*
* {@code
* {
+ * id: String (Required)
* data (Required): [
* (Required){
* embedding: BinaryData (Required)
@@ -101,7 +100,7 @@ public final class ImageEmbeddingsAsyncClient {
* }
*
*
- * @param embedRequest1 The embedRequest1 parameter.
+ * @param body request options to pass to the endpoint using images embeddings path.
* @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.
@@ -114,8 +113,8 @@ public final class ImageEmbeddingsAsyncClient {
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- Mono> embedWithResponse(BinaryData embedRequest1, RequestOptions requestOptions) {
- return this.serviceClient.embedWithResponseAsync(embedRequest1, requestOptions);
+ Mono> embedWithResponse(BinaryData body, RequestOptions requestOptions) {
+ return this.serviceClient.embedWithResponseAsync(body, requestOptions);
}
/**
@@ -127,7 +126,7 @@ Mono> embedWithResponse(BinaryData embedRequest1, RequestOp
* {@code
* {
* model_name: String (Required)
- * model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat) (Required)
+ * model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat_completion) (Required)
* model_provider_name: String (Required)
* }
* }
@@ -148,11 +147,12 @@ 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.
+ * 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 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 input Inputs, instances of ImageEmbeddingsInput.
+ * 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.
@@ -160,17 +160,16 @@ Mono> getModelInfoWithResponse(RequestOptions requestOption
* @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,
+ * Image embeddings measure the relatedness of images 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) {
+ public Mono embed(List input) {
// Generated convenience method for embedWithResponse
RequestOptions requestOptions = new RequestOptions();
- ImageEmbedRequest embedRequest1Obj = new ImageEmbedRequest(input);
- BinaryData embedRequest1 = BinaryData.fromObject(embedRequest1Obj);
- return embedWithResponse(embedRequest1, requestOptions).flatMap(FluxUtil::toMono)
+ ImageEmbedRequest embedRequestObj = new ImageEmbedRequest(input);
+ BinaryData embedRequest = BinaryData.fromObject(embedRequestObj);
+ return embedWithResponse(embedRequest, requestOptions).flatMap(FluxUtil::toMono)
.map(protocolMethodData -> protocolMethodData.toObject(EmbeddingsResult.class));
}
@@ -198,20 +197,10 @@ Mono getModelInfo() {
* 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 body request options to pass to the endpoint using images embeddings path.
* @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.
@@ -224,19 +213,37 @@ Mono getModelInfo() {
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- Mono embed(List input, ExtraParameters extraParams, Integer dimensions,
- EmbeddingEncodingFormat encodingFormat, EmbeddingInputType inputType, String model) {
+ Mono embed(ImageEmbedRequest body, ExtraParameters extraParams) {
// Generated convenience method for embedWithResponse
RequestOptions requestOptions = new RequestOptions();
- ImageEmbedRequest embedRequest1Obj = new ImageEmbedRequest(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)
+ return embedWithResponse(BinaryData.fromObject(body), 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 body request options to pass to the endpoint using images embeddings path.
+ * @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(ImageEmbedRequest body) {
+ // Generated convenience method for embedWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return embedWithResponse(BinaryData.fromObject(body), 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 7f3cd6f5314f..49bce791e378 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,9 @@
import com.azure.ai.inference.implementation.ImageEmbeddingsClientImpl;
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;
import com.azure.ai.inference.models.EmbeddingsResult;
import com.azure.ai.inference.models.ExtraParameters;
+import com.azure.ai.inference.models.ImageEmbeddingInput;
import com.azure.ai.inference.models.ModelInfo;
import com.azure.core.annotation.Generated;
import com.azure.core.annotation.ReturnType;
@@ -84,6 +82,7 @@ public final class ImageEmbeddingsClient {
*
* {@code
* {
+ * id: String (Required)
* data (Required): [
* (Required){
* embedding: BinaryData (Required)
@@ -99,7 +98,7 @@ public final class ImageEmbeddingsClient {
* }
*
*
- * @param embedRequest1 The embedRequest1 parameter.
+ * @param body request options to pass to the endpoint using images embeddings path.
* @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.
@@ -111,8 +110,34 @@ public final class ImageEmbeddingsClient {
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- Response embedWithResponse(BinaryData embedRequest1, RequestOptions requestOptions) {
- return this.serviceClient.embedWithResponse(embedRequest1, requestOptions);
+ Response embedWithResponse(BinaryData body, RequestOptions requestOptions) {
+ return this.serviceClient.embedWithResponse(body, 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 inputs ImageEmbeddingInput instances 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public EmbeddingsResult embed(List inputs) {
+ // Generated convenience method for embedWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ ImageEmbedRequest embedRequestObj = new ImageEmbedRequest(inputs);
+ BinaryData embedRequest = BinaryData.fromObject(embedRequestObj);
+ return embedWithResponse(embedRequest, requestOptions).getValue().toObject(EmbeddingsResult.class);
}
/**
@@ -124,7 +149,7 @@ Response embedWithResponse(BinaryData embedRequest1, RequestOptions
* {@code
* {
* model_name: String (Required)
- * model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat) (Required)
+ * model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat_completion) (Required)
* model_provider_name: String (Required)
* }
* }
@@ -144,68 +169,59 @@ 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.
+ * 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();
- ImageEmbedRequest embedRequest1Obj = new ImageEmbedRequest(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 body request options to pass to the endpoint using images embeddings path.
+ * @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 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(ImageEmbedRequest body, ExtraParameters extraParams) {
+ // Generated convenience method for embedWithResponse
RequestOptions requestOptions = new RequestOptions();
- return getModelInfoWithResponse(requestOptions).getValue().toObject(ModelInfo.class);
+ if (extraParams != null) {
+ requestOptions.setHeader(HttpHeaderName.fromString("extra-parameters"), extraParams.toString());
+ }
+ return embedWithResponse(BinaryData.fromObject(body), 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.
- * @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.
+ * @param body request options to pass to the endpoint using images embeddings path.
* @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.
@@ -218,18 +234,10 @@ ModelInfo getModelInfo() {
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- EmbeddingsResult embed(List input, ExtraParameters extraParams, Integer dimensions,
- EmbeddingEncodingFormat encodingFormat, EmbeddingInputType inputType, String model) {
+ EmbeddingsResult embed(ImageEmbedRequest body) {
// Generated convenience method for embedWithResponse
RequestOptions requestOptions = new RequestOptions();
- ImageEmbedRequest embedRequest1Obj = new ImageEmbedRequest(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 embedWithResponse(BinaryData.fromObject(body), requestOptions).getValue()
+ .toObject(EmbeddingsResult.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
index a9ea0a28beac..e77ba83f5d7b 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
@@ -65,6 +65,8 @@ public final class ImageEmbeddingsClientBuilder implements HttpTrait pipelinePolicies;
+ private String[] scopes = DEFAULT_SCOPES;
+
/**
* Create an instance of the ImageEmbeddingsClientBuilder.
*/
@@ -267,6 +269,17 @@ public ImageEmbeddingsClientBuilder retryPolicy(RetryPolicy retryPolicy) {
return this;
}
+ /**
+ * Sets auth domain scopes for client authentication.
+ *
+ * @param scopes domain scope to authenticate against.
+ * @return the ImageEmbeddingsClientBuilder.
+ */
+ public ImageEmbeddingsClientBuilder scopes(String[] scopes) {
+ this.scopes = scopes;
+ return this;
+ }
+
/**
* Builds an instance of ImageEmbeddingsClientImpl with the provided parameters.
*
@@ -317,7 +330,7 @@ private HttpPipeline createHttpPipeline() {
policies.add(new KeyCredentialPolicy("Authorization", 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/ModelServiceVersion.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/ModelServiceVersion.java
index 269914beaec8..398e1893d764 100644
--- 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
@@ -13,7 +13,12 @@ public enum ModelServiceVersion 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-08-01-preview.
+ */
+ V2024_08_01_PREVIEW("2024-08-01-preview");
private final String version;
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 6d104cd366f5..6a89faaedaea 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
@@ -155,7 +155,7 @@ public interface ChatCompletionsClientService {
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> complete(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
- @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData completeRequest,
+ @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body,
RequestOptions requestOptions, Context context);
@Post("/chat/completions")
@@ -166,7 +166,7 @@ Mono> complete(@HostParam("endpoint") String endpoint,
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response completeSync(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
- @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData completeRequest,
+ @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body,
RequestOptions requestOptions, Context context);
@Get("/info")
@@ -212,7 +212,7 @@ Response getModelInfoSync(@HostParam("endpoint") String endpoint,
* {
* messages (Required): [
* (Required){
- * role: String(system/user/assistant/tool) (Required)
+ * role: String(system/user/assistant/tool/developer) (Required)
* }
* ]
* frequency_penalty: Double (Optional)
@@ -265,7 +265,7 @@ Response getModelInfoSync(@HostParam("endpoint") String endpoint,
* index: int (Required)
* finish_reason: String(stop/length/content_filter/tool_calls) (Required)
* message (Required): {
- * role: String(system/user/assistant/tool) (Required)
+ * role: String(system/user/assistant/tool/developer) (Required)
* content: String (Required)
* tool_calls (Optional): [
* (Optional){
@@ -284,7 +284,7 @@ Response getModelInfoSync(@HostParam("endpoint") String endpoint,
* }
*
*
- * @param completeRequest The completeRequest parameter.
+ * @param body request options to pass to the endpoint using complete path.
* @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.
@@ -295,12 +295,11 @@ Response getModelInfoSync(@HostParam("endpoint") String endpoint,
* provided prompt data along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono> completeWithResponseAsync(BinaryData completeRequest,
- RequestOptions requestOptions) {
+ public Mono> completeWithResponseAsync(BinaryData body, RequestOptions requestOptions) {
final String contentType = "application/json";
final String accept = "application/json";
return FluxUtil.withContext(context -> service.complete(this.getEndpoint(),
- this.getServiceVersion().getVersion(), contentType, accept, completeRequest, requestOptions, context));
+ this.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, context));
}
/**
@@ -325,7 +324,7 @@ public Mono> completeWithResponseAsync(BinaryData completeR
* {
* messages (Required): [
* (Required){
- * role: String(system/user/assistant/tool) (Required)
+ * role: String(system/user/assistant/tool/developer) (Required)
* }
* ]
* frequency_penalty: Double (Optional)
@@ -378,7 +377,7 @@ public Mono> completeWithResponseAsync(BinaryData completeR
* index: int (Required)
* finish_reason: String(stop/length/content_filter/tool_calls) (Required)
* message (Required): {
- * role: String(system/user/assistant/tool) (Required)
+ * role: String(system/user/assistant/tool/developer) (Required)
* content: String (Required)
* tool_calls (Optional): [
* (Optional){
@@ -397,7 +396,7 @@ public Mono> completeWithResponseAsync(BinaryData completeR
* }
*
*
- * @param completeRequest The completeRequest parameter.
+ * @param body request options to pass to the endpoint using complete path.
* @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.
@@ -408,11 +407,11 @@ public Mono> completeWithResponseAsync(BinaryData completeR
* provided prompt data along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response completeWithResponse(BinaryData completeRequest, RequestOptions requestOptions) {
+ public Response completeWithResponse(BinaryData body, RequestOptions requestOptions) {
final String contentType = "application/json";
final String accept = "application/json";
return service.completeSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, accept,
- completeRequest, requestOptions, Context.NONE);
+ body, requestOptions, Context.NONE);
}
/**
@@ -424,7 +423,7 @@ public Response completeWithResponse(BinaryData completeRequest, Req
* {@code
* {
* model_name: String (Required)
- * model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat) (Required)
+ * model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat_completion) (Required)
* model_provider_name: String (Required)
* }
* }
@@ -454,7 +453,7 @@ public Mono> getModelInfoWithResponseAsync(RequestOptions r
* {@code
* {
* model_name: String (Required)
- * model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat) (Required)
+ * model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat_completion) (Required)
* model_provider_name: 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
index bd4e3a445921..3ff757182bbd 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
@@ -154,7 +154,7 @@ public interface EmbeddingsClientService {
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> embed(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
- @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData embedRequest,
+ @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body,
RequestOptions requestOptions, Context context);
@Post("/embeddings")
@@ -165,7 +165,7 @@ Mono> embed(@HostParam("endpoint") String endpoint,
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response embedSync(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
- @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData embedRequest,
+ @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body,
RequestOptions requestOptions, Context context);
@Get("/info")
@@ -226,6 +226,7 @@ Response getModelInfoSync(@HostParam("endpoint") String endpoint,
*
* {@code
* {
+ * id: String (Required)
* data (Required): [
* (Required){
* embedding: BinaryData (Required)
@@ -241,7 +242,7 @@ Response getModelInfoSync(@HostParam("endpoint") String endpoint,
* }
*
*
- * @param embedRequest The embedRequest parameter.
+ * @param body request options to pass to the endpoint using embeddings path.
* @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.
@@ -253,11 +254,11 @@ Response getModelInfoSync(@HostParam("endpoint") String endpoint,
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono> embedWithResponseAsync(BinaryData embedRequest, RequestOptions requestOptions) {
+ public Mono> embedWithResponseAsync(BinaryData body, RequestOptions requestOptions) {
final String contentType = "application/json";
final String accept = "application/json";
return FluxUtil.withContext(context -> service.embed(this.getEndpoint(), this.getServiceVersion().getVersion(),
- contentType, accept, embedRequest, requestOptions, context));
+ contentType, accept, body, requestOptions, context));
}
/**
@@ -297,6 +298,7 @@ public Mono> embedWithResponseAsync(BinaryData embedRequest
*
* {@code
* {
+ * id: String (Required)
* data (Required): [
* (Required){
* embedding: BinaryData (Required)
@@ -312,7 +314,7 @@ public Mono> embedWithResponseAsync(BinaryData embedRequest
* }
*
*
- * @param embedRequest The embedRequest parameter.
+ * @param body request options to pass to the endpoint using embeddings path.
* @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.
@@ -323,11 +325,11 @@ public Mono> embedWithResponseAsync(BinaryData embedRequest
* recommendations, and other similar scenarios along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response embedWithResponse(BinaryData embedRequest, RequestOptions requestOptions) {
+ public Response embedWithResponse(BinaryData body, RequestOptions requestOptions) {
final String contentType = "application/json";
final String accept = "application/json";
- return service.embedSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, accept,
- embedRequest, requestOptions, Context.NONE);
+ return service.embedSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, accept, body,
+ requestOptions, Context.NONE);
}
/**
@@ -339,7 +341,7 @@ public Response embedWithResponse(BinaryData embedRequest, RequestOp
* {@code
* {
* model_name: String (Required)
- * model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat) (Required)
+ * model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat_completion) (Required)
* model_provider_name: String (Required)
* }
* }
@@ -369,7 +371,7 @@ public Mono> getModelInfoWithResponseAsync(RequestOptions r
* {@code
* {
* model_name: String (Required)
- * model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat) (Required)
+ * model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat_completion) (Required)
* model_provider_name: String (Required)
* }
* }
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 06c682f920c2..739594285376 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
@@ -155,7 +155,7 @@ public interface ImageEmbeddingsClientService {
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> embed(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
- @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData embedRequest1,
+ @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body,
RequestOptions requestOptions, Context context);
@Post("/images/embeddings")
@@ -166,7 +166,7 @@ Mono> embed(@HostParam("endpoint") String endpoint,
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response embedSync(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
- @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData embedRequest1,
+ @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body,
RequestOptions requestOptions, Context context);
@Get("/info")
@@ -230,6 +230,7 @@ Response getModelInfoSync(@HostParam("endpoint") String endpoint,
*
* {@code
* {
+ * id: String (Required)
* data (Required): [
* (Required){
* embedding: BinaryData (Required)
@@ -245,7 +246,7 @@ Response getModelInfoSync(@HostParam("endpoint") String endpoint,
* }
*
*
- * @param embedRequest1 The embedRequest1 parameter.
+ * @param body request options to pass to the endpoint using images embeddings path.
* @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.
@@ -257,11 +258,11 @@ Response getModelInfoSync(@HostParam("endpoint") String endpoint,
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono> embedWithResponseAsync(BinaryData embedRequest1, RequestOptions requestOptions) {
+ public Mono> embedWithResponseAsync(BinaryData body, RequestOptions requestOptions) {
final String contentType = "application/json";
final String accept = "application/json";
return FluxUtil.withContext(context -> service.embed(this.getEndpoint(), this.getServiceVersion().getVersion(),
- contentType, accept, embedRequest1, requestOptions, context));
+ contentType, accept, body, requestOptions, context));
}
/**
@@ -304,6 +305,7 @@ public Mono> embedWithResponseAsync(BinaryData embedRequest
*
* {@code
* {
+ * id: String (Required)
* data (Required): [
* (Required){
* embedding: BinaryData (Required)
@@ -319,7 +321,7 @@ public Mono> embedWithResponseAsync(BinaryData embedRequest
* }
*
*
- * @param embedRequest1 The embedRequest1 parameter.
+ * @param body request options to pass to the endpoint using images embeddings path.
* @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.
@@ -330,11 +332,11 @@ public Mono> embedWithResponseAsync(BinaryData embedRequest
* recommendations, and other similar scenarios along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response embedWithResponse(BinaryData embedRequest1, RequestOptions requestOptions) {
+ public Response embedWithResponse(BinaryData body, RequestOptions requestOptions) {
final String contentType = "application/json";
final String accept = "application/json";
- return service.embedSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, accept,
- embedRequest1, requestOptions, Context.NONE);
+ return service.embedSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, accept, body,
+ requestOptions, Context.NONE);
}
/**
@@ -346,7 +348,7 @@ public Response embedWithResponse(BinaryData embedRequest1, RequestO
* {@code
* {
* model_name: String (Required)
- * model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat) (Required)
+ * model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat_completion) (Required)
* model_provider_name: String (Required)
* }
* }
@@ -376,7 +378,7 @@ public Mono> getModelInfoWithResponseAsync(RequestOptions r
* {@code
* {
* model_name: String (Required)
- * model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat) (Required)
+ * model_type: String(embeddings/image_generation/text_generation/image_embeddings/audio_generation/chat_completion) (Required)
* model_provider_name: String (Required)
* }
* }
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/ImageEmbedRequest.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/ImageEmbedRequest.java
index dea09778466c..b5535023e2f5 100644
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/ImageEmbedRequest.java
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/ImageEmbedRequest.java
@@ -4,8 +4,8 @@
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.ai.inference.models.ImageEmbeddingInput;
import com.azure.core.annotation.Fluent;
import com.azure.core.annotation.Generated;
import com.azure.core.util.BinaryData;
@@ -29,7 +29,7 @@ public final class ImageEmbedRequest implements JsonSerializable input;
+ private final List input;
/*
* Optional. The number of dimensions the resulting output embeddings should have.
@@ -72,7 +72,7 @@ public final class ImageEmbedRequest implements JsonSerializable input) {
+ public ImageEmbedRequest(List input) {
this.input = input;
}
@@ -83,7 +83,7 @@ public ImageEmbedRequest(List input) {
* @return the input value.
*/
@Generated
- public List getInput() {
+ public List getInput() {
return this.input;
}
@@ -245,7 +245,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
@Generated
public static ImageEmbedRequest fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
- List input = null;
+ List input = null;
Integer dimensions = null;
EmbeddingEncodingFormat encodingFormat = null;
EmbeddingInputType inputType = null;
@@ -255,7 +255,7 @@ public static ImageEmbedRequest fromJson(JsonReader jsonReader) throws IOExcepti
String fieldName = reader.getFieldName();
reader.nextToken();
if ("input".equals(fieldName)) {
- input = reader.readArray(reader1 -> EmbeddingInput.fromJson(reader1));
+ input = reader.readArray(reader1 -> ImageEmbeddingInput.fromJson(reader1));
} else if ("dimensions".equals(fieldName)) {
dimensions = reader.getNullable(JsonReader::getInt);
} else if ("encoding_format".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
deleted file mode 100644
index 9db5a33e0b92..000000000000
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsFunctionToolSelection.java
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
-package com.azure.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
deleted file mode 100644
index 8bd85b26b30c..000000000000
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsNamedFunctionToolSelection.java
+++ /dev/null
@@ -1,107 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
-
-package com.azure.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 ChatCompletionsFunctionToolSelection function;
-
- /**
- * Creates an instance of ChatCompletionsNamedFunctionToolSelection class.
- *
- * @param function the function value to set.
- */
- @Generated
- public ChatCompletionsNamedFunctionToolSelection(ChatCompletionsFunctionToolSelection function) {
- super(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/ChatCompletionsNamedToolChoice.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsNamedToolChoice.java
new file mode 100644
index 000000000000..d8b43f29a025
--- /dev/null
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsNamedToolChoice.java
@@ -0,0 +1,99 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+package com.azure.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 class ChatCompletionsNamedToolChoice implements JsonSerializable {
+
+ /*
+ * The type of the tool. Currently, only `function` is supported.
+ */
+ @Generated
+ private final String type = "function";
+
+ /*
+ * The function that should be called.
+ */
+ @Generated
+ private final ChatCompletionsNamedToolChoiceFunction function;
+
+ /**
+ * Creates an instance of ChatCompletionsNamedToolChoice class.
+ *
+ * @param function the function value to set.
+ */
+ @Generated
+ public ChatCompletionsNamedToolChoice(ChatCompletionsNamedToolChoiceFunction function) {
+ this.function = function;
+ }
+
+ /**
+ * Get the type property: The type of the tool. Currently, only `function` is supported.
+ *
+ * @return the type value.
+ */
+ @Generated
+ public String getType() {
+ return this.type;
+ }
+
+ /**
+ * Get the function property: The function that should be called.
+ *
+ * @return the function value.
+ */
+ @Generated
+ public ChatCompletionsNamedToolChoiceFunction getFunction() {
+ return this.function;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Generated
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("type", this.type);
+ jsonWriter.writeJsonField("function", this.function);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ChatCompletionsNamedToolChoice from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ChatCompletionsNamedToolChoice if the JsonReader was pointing to an instance of it, or
+ * null if it was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the ChatCompletionsNamedToolChoice.
+ */
+ @Generated
+ public static ChatCompletionsNamedToolChoice fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ChatCompletionsNamedToolChoiceFunction function = null;
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+ if ("function".equals(fieldName)) {
+ function = ChatCompletionsNamedToolChoiceFunction.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+ return new ChatCompletionsNamedToolChoice(function);
+ });
+ }
+}
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsNamedToolChoiceFunction.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsNamedToolChoiceFunction.java
new file mode 100644
index 000000000000..24115a4bca04
--- /dev/null
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsNamedToolChoiceFunction.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.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 ChatCompletionsNamedToolChoiceFunction
+ implements JsonSerializable {
+
+ /*
+ * The name of the function that should be called.
+ */
+ @Generated
+ private final String name;
+
+ /**
+ * Creates an instance of ChatCompletionsNamedToolChoiceFunction class.
+ *
+ * @param name the name value to set.
+ */
+ @Generated
+ public ChatCompletionsNamedToolChoiceFunction(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 ChatCompletionsNamedToolChoiceFunction from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ChatCompletionsNamedToolChoiceFunction if the JsonReader was pointing to an instance of
+ * it, or null if it was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the ChatCompletionsNamedToolChoiceFunction.
+ */
+ @Generated
+ public static ChatCompletionsNamedToolChoiceFunction 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 ChatCompletionsNamedToolChoiceFunction(name);
+ });
+ }
+}
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
deleted file mode 100644
index 3eb8ccaf531a..000000000000
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsNamedToolSelection.java
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
-package com.azure.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 class ChatCompletionsNamedToolSelection implements JsonSerializable {
-
- /*
- * The type of the tool. Currently, only `function` is supported.
- */
- @Generated
- 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(ChatCompletionsFunctionToolSelection function) {
- this.function = function;
- }
-
- /**
- * Get the type property: The type of the tool. Currently, only `function` is supported.
- *
- * @return the type value.
- */
- @Generated
- 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.writeStringField("type", this.type);
- jsonWriter.writeJsonField("function", this.function);
- 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 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 -> {
- ChatCompletionsFunctionToolSelection function = null;
- while (reader.nextToken() != JsonToken.END_OBJECT) {
- String fieldName = reader.getFieldName();
- reader.nextToken();
- if ("function".equals(fieldName)) {
- function = ChatCompletionsFunctionToolSelection.fromJson(reader);
- } else {
- reader.skipChildren();
- }
- }
- return new ChatCompletionsNamedToolSelection(function);
- });
- }
-}
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 d3a382d9e169..8f5bac952b09 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
@@ -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.ai.inference.implementation.accesshelpers.ChatCompletionsOptionsAccessHelper;
@@ -12,24 +11,28 @@
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;
/**
- * Options for complete API.
+ * The ChatCompletionsOptions model.
*/
@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
@@ -95,9 +98,19 @@ public void setStream(ChatCompletionsOptions options, boolean stream) {
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.
+ * An object specifying the format that the model must output.
+ *
+ * Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model
+ * will match your supplied JSON schema.
+ *
+ * Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid
+ * JSON.
+ *
+ * **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system
+ * or user message. Without this, the model may generate an unending stream of whitespace until the generation
+ * reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message
+ * content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded
+ * `max_tokens` or the conversation exceeded the max context length.
*/
@Generated
private ChatCompletionsResponseFormat responseFormat;
@@ -109,7 +122,8 @@ public void setStream(ChatCompletionsOptions options, boolean stream) {
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;
@@ -138,7 +152,6 @@ public void setStream(ChatCompletionsOptions options, boolean stream) {
* are passed in the JSON request payload.
* This sets the HTTP request header `extra-parameters`.
*/
- @Generated
private ExtraParameters extraParams;
/**
@@ -340,10 +353,19 @@ public ChatCompletionsOptions setMaxTokens(Integer maxTokens) {
}
/**
- * 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.
+ * Get the responseFormat property: An object specifying the format that the model must output.
+ *
+ * Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model
+ * will match your supplied JSON schema.
+ *
+ * Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid
+ * JSON.
+ *
+ * **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system
+ * or user message. Without this, the model may generate an unending stream of whitespace until the generation
+ * reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message
+ * content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded
+ * `max_tokens` or the conversation exceeded the max context length.
*
* @return the responseFormat value.
*/
@@ -353,10 +375,19 @@ public ChatCompletionsResponseFormat getResponseFormat() {
}
/**
- * 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.
+ * Set the responseFormat property: An object specifying the format that the model must output.
+ *
+ * Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model
+ * will match your supplied JSON schema.
+ *
+ * Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid
+ * JSON.
+ *
+ * **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system
+ * or user message. Without this, the model may generate an unending stream of whitespace until the generation
+ * reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message
+ * content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded
+ * `max_tokens` or the conversation exceeded the max context length.
*
* @param responseFormat the responseFormat value to set.
* @return the ChatCompletionsOptions object itself.
@@ -367,6 +398,20 @@ public ChatCompletionsOptions setResponseFormat(ChatCompletionsResponseFormat re
return this;
}
+ /**
+ * Set the responseFormat to a given JSON schema: The format that the model must output. Use this to enable JSON
+ * mode instead of
+ *
+ * @param name the name of the schema.
+ * @param jsonSchema the JSON schema value to set.
+ * @return the ChatCompletionsOptions object itself.
+ */
+ public ChatCompletionsOptions setJsonFormat(String name, Map jsonSchema) {
+ this.responseFormat = new ChatCompletionsResponseFormatJsonSchema(
+ new ChatCompletionsResponseFormatJsonSchemaDefinition(name, jsonSchema));
+ return this;
+ }
+
/**
* Get the stop property: A collection of textual sequences that will end completions generation.
*
@@ -390,8 +435,9 @@ public ChatCompletionsOptions 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.
*/
@@ -401,8 +447,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 ChatCompletionsOptions object itself.
@@ -492,7 +539,6 @@ public ChatCompletionsOptions setModel(String model) {
*
* @return the extraParams value.
*/
- @Generated
public ExtraParameters getExtraParams() {
return this.extraParams;
}
@@ -505,7 +551,6 @@ public ExtraParameters getExtraParams() {
* @param extraParams the extraParams value to set.
* @return the ChatCompletionsOptions object itself.
*/
- @Generated
public ChatCompletionsOptions setExtraParams(ExtraParameters extraParams) {
this.extraParams = extraParams;
return this;
@@ -513,6 +558,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 {
@@ -548,66 +594,100 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
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;
+ 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;
+ Map additionalProperties = 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);
+ 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 ("model".equals(fieldName)) {
- model = reader.getString();
- } else if ("seed".equals(fieldName)) {
- seed = reader.getNullable(JsonReader::getLong);
+ } 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(ChatCompletionsToolDefinition::fromJson);
+ 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();
+ if (additionalProperties == null) {
+ additionalProperties = new LinkedHashMap<>();
+ }
+ additionalProperties.put(fieldName,
+ reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())));
}
}
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.presencePenalty = presencePenalty;
+ deserializedChatCompletionsOptions.temperature = temperature;
+ deserializedChatCompletionsOptions.topP = topP;
+ deserializedChatCompletionsOptions.maxTokens = maxTokens;
deserializedChatCompletionsOptions.responseFormat = responseFormat;
+ deserializedChatCompletionsOptions.stop = stop;
deserializedChatCompletionsOptions.tools = tools;
deserializedChatCompletionsOptions.toolChoice = toolChoice;
+ deserializedChatCompletionsOptions.seed = seed;
+ deserializedChatCompletionsOptions.model = model;
+ deserializedChatCompletionsOptions.additionalProperties = additionalProperties;
return deserializedChatCompletionsOptions;
});
}
+
+ /*
+ * The ChatCompletionsOptions model
+ */
+ @Generated
+ private Map additionalProperties;
+
+ /**
+ * Get the additionalProperties property: The ChatCompletionsOptions model.
+ *
+ * @return the additionalProperties value.
+ */
+ @Generated
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ /**
+ * Set the additionalProperties property: The ChatCompletionsOptions model.
+ *
+ * @param additionalProperties the additionalProperties value to set.
+ * @return the ChatCompletionsOptions object itself.
+ */
+ @Generated
+ public ChatCompletionsOptions setAdditionalProperties(Map additionalProperties) {
+ this.additionalProperties = additionalProperties;
+ return this;
+ }
}
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 984ba391e541..e3a9759f3330 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
@@ -82,7 +82,9 @@ 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 ChatCompletionsResponseFormatJsonObject.fromJson(readerToUse.reset());
+ } else if ("json_schema".equals(discriminatorValue)) {
+ return ChatCompletionsResponseFormatJsonSchema.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
deleted file mode 100644
index 86db6bdbea4f..000000000000
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatJson.java
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
-package com.azure.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/ChatCompletionsResponseFormatJsonObject.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatJsonObject.java
new file mode 100644
index 000000000000..bbf7092bfd23
--- /dev/null
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatJsonObject.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 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 ChatCompletionsResponseFormatJsonObject extends ChatCompletionsResponseFormat {
+
+ /*
+ * The response format type to use for chat completions.
+ */
+ @Generated
+ private String type = "json_object";
+
+ /**
+ * Creates an instance of ChatCompletionsResponseFormatJsonObject class.
+ */
+ @Generated
+ public ChatCompletionsResponseFormatJsonObject() {
+ }
+
+ /**
+ * 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 ChatCompletionsResponseFormatJsonObject from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ChatCompletionsResponseFormatJsonObject if the JsonReader was pointing to an instance of
+ * it, or null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the ChatCompletionsResponseFormatJsonObject.
+ */
+ @Generated
+ public static ChatCompletionsResponseFormatJsonObject fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ChatCompletionsResponseFormatJsonObject deserializedChatCompletionsResponseFormatJsonObject
+ = new ChatCompletionsResponseFormatJsonObject();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+ if ("type".equals(fieldName)) {
+ deserializedChatCompletionsResponseFormatJsonObject.type = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+ return deserializedChatCompletionsResponseFormatJsonObject;
+ });
+ }
+}
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatJsonSchema.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatJsonSchema.java
new file mode 100644
index 000000000000..607d671b6439
--- /dev/null
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatJsonSchema.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 response format for Chat Completions that restricts responses to emitting valid JSON objects, with a
+ * JSON schema specified by the caller.
+ */
+@Immutable
+public final class ChatCompletionsResponseFormatJsonSchema extends ChatCompletionsResponseFormat {
+
+ /*
+ * The response format type to use for chat completions.
+ */
+ @Generated
+ private String type = "json_schema";
+
+ /*
+ * The definition of the required JSON schema in the response, and associated metadata.
+ */
+ @Generated
+ private final ChatCompletionsResponseFormatJsonSchemaDefinition jsonSchema;
+
+ /**
+ * Creates an instance of ChatCompletionsResponseFormatJsonSchema class.
+ *
+ * @param jsonSchema the jsonSchema value to set.
+ */
+ @Generated
+ public ChatCompletionsResponseFormatJsonSchema(ChatCompletionsResponseFormatJsonSchemaDefinition jsonSchema) {
+ this.jsonSchema = jsonSchema;
+ }
+
+ /**
+ * 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;
+ }
+
+ /**
+ * Get the jsonSchema property: The definition of the required JSON schema in the response, and associated metadata.
+ *
+ * @return the jsonSchema value.
+ */
+ @Generated
+ public ChatCompletionsResponseFormatJsonSchemaDefinition getJsonSchema() {
+ return this.jsonSchema;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Generated
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("json_schema", this.jsonSchema);
+ jsonWriter.writeStringField("type", this.type);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ChatCompletionsResponseFormatJsonSchema from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ChatCompletionsResponseFormatJsonSchema if the JsonReader was pointing to an instance of
+ * it, or null if it was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the ChatCompletionsResponseFormatJsonSchema.
+ */
+ @Generated
+ public static ChatCompletionsResponseFormatJsonSchema fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ChatCompletionsResponseFormatJsonSchemaDefinition jsonSchema = null;
+ String type = "json_schema";
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+ if ("json_schema".equals(fieldName)) {
+ jsonSchema = ChatCompletionsResponseFormatJsonSchemaDefinition.fromJson(reader);
+ } else if ("type".equals(fieldName)) {
+ type = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+ ChatCompletionsResponseFormatJsonSchema deserializedChatCompletionsResponseFormatJsonSchema
+ = new ChatCompletionsResponseFormatJsonSchema(jsonSchema);
+ deserializedChatCompletionsResponseFormatJsonSchema.type = type;
+ return deserializedChatCompletionsResponseFormatJsonSchema;
+ });
+ }
+}
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatJsonSchemaDefinition.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatJsonSchemaDefinition.java
new file mode 100644
index 000000000000..a78011ea77be
--- /dev/null
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsResponseFormatJsonSchemaDefinition.java
@@ -0,0 +1,198 @@
+// 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.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.Map;
+
+/**
+ * Defines the response format for chat completions as JSON with a given schema. The AI model
+ * will need to adhere to this schema when generating completions.
+ */
+@Fluent
+public final class ChatCompletionsResponseFormatJsonSchemaDefinition
+ implements JsonSerializable {
+
+ /*
+ * A name that labels this JSON schema. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum
+ * length of 64.
+ */
+ @Generated
+ private final String name;
+
+ /*
+ * The definition of the JSON schema. See https://json-schema.org/overview/what-is-jsonschema.
+ * Note that AI models usually only support a subset of the keywords defined by JSON schema. Consult your AI model
+ * documentation
+ * to determine what is supported.
+ */
+ @Generated
+ private final Map schema;
+
+ /*
+ * A description of the response format, used by the AI model to determine how to generate responses in this format.
+ */
+ @Generated
+ private String description;
+
+ /*
+ * If set to true, the service will error out if the provided JSON schema contains keywords
+ * not supported by the AI model. An example of such keyword may be `maxLength` for JSON type `string`.
+ * If false, and the provided JSON schema contains keywords not supported
+ * by the AI model, the AI model will not error out. Instead it will ignore the unsupported keywords.
+ */
+ @Generated
+ private Boolean strict;
+
+ /**
+ * Creates an instance of ChatCompletionsResponseFormatJsonSchemaDefinition class.
+ *
+ * @param name the name value to set.
+ * @param schema the schema value to set.
+ */
+ @Generated
+ public ChatCompletionsResponseFormatJsonSchemaDefinition(String name, Map schema) {
+ this.name = name;
+ this.schema = schema;
+ }
+
+ /**
+ * Get the name property: A name that labels this JSON schema. Must be a-z, A-Z, 0-9, or contain underscores and
+ * dashes, with a maximum length of 64.
+ *
+ * @return the name value.
+ */
+ @Generated
+ public String getName() {
+ return this.name;
+ }
+
+ /**
+ * Get the schema property: The definition of the JSON schema. See
+ * https://json-schema.org/overview/what-is-jsonschema.
+ * Note that AI models usually only support a subset of the keywords defined by JSON schema. Consult your AI model
+ * documentation
+ * to determine what is supported.
+ *
+ * @return the schema value.
+ */
+ @Generated
+ public Map getSchema() {
+ return this.schema;
+ }
+
+ /**
+ * Get the description property: A description of the response format, used by the AI model to determine how to
+ * generate responses in this format.
+ *
+ * @return the description value.
+ */
+ @Generated
+ public String getDescription() {
+ return this.description;
+ }
+
+ /**
+ * Set the description property: A description of the response format, used by the AI model to determine how to
+ * generate responses in this format.
+ *
+ * @param description the description value to set.
+ * @return the ChatCompletionsResponseFormatJsonSchemaDefinition object itself.
+ */
+ @Generated
+ public ChatCompletionsResponseFormatJsonSchemaDefinition setDescription(String description) {
+ this.description = description;
+ return this;
+ }
+
+ /**
+ * Get the strict property: If set to true, the service will error out if the provided JSON schema contains keywords
+ * not supported by the AI model. An example of such keyword may be `maxLength` for JSON type `string`.
+ * If false, and the provided JSON schema contains keywords not supported
+ * by the AI model, the AI model will not error out. Instead it will ignore the unsupported keywords.
+ *
+ * @return the strict value.
+ */
+ @Generated
+ public Boolean isStrict() {
+ return this.strict;
+ }
+
+ /**
+ * Set the strict property: If set to true, the service will error out if the provided JSON schema contains keywords
+ * not supported by the AI model. An example of such keyword may be `maxLength` for JSON type `string`.
+ * If false, and the provided JSON schema contains keywords not supported
+ * by the AI model, the AI model will not error out. Instead it will ignore the unsupported keywords.
+ *
+ * @param strict the strict value to set.
+ * @return the ChatCompletionsResponseFormatJsonSchemaDefinition object itself.
+ */
+ @Generated
+ public ChatCompletionsResponseFormatJsonSchemaDefinition setStrict(Boolean strict) {
+ this.strict = strict;
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Generated
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("name", this.name);
+ jsonWriter.writeMapField("schema", this.schema,
+ (writer, element) -> writer.writeUntyped(element == null ? null : element.toObject(Object.class)));
+ jsonWriter.writeStringField("description", this.description);
+ jsonWriter.writeBooleanField("strict", this.strict);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ChatCompletionsResponseFormatJsonSchemaDefinition from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ChatCompletionsResponseFormatJsonSchemaDefinition if the JsonReader was pointing to an
+ * instance of it, or null if it was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the ChatCompletionsResponseFormatJsonSchemaDefinition.
+ */
+ @Generated
+ public static ChatCompletionsResponseFormatJsonSchemaDefinition fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ String name = null;
+ Map schema = null;
+ String description = null;
+ Boolean strict = null;
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+ if ("name".equals(fieldName)) {
+ name = reader.getString();
+ } else if ("schema".equals(fieldName)) {
+ schema = reader.readMap(reader1 -> reader1
+ .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())));
+ } else if ("description".equals(fieldName)) {
+ description = reader.getString();
+ } else if ("strict".equals(fieldName)) {
+ strict = reader.getNullable(JsonReader::getBoolean);
+ } else {
+ reader.skipChildren();
+ }
+ }
+ ChatCompletionsResponseFormatJsonSchemaDefinition deserializedChatCompletionsResponseFormatJsonSchemaDefinition
+ = new ChatCompletionsResponseFormatJsonSchemaDefinition(name, schema);
+ deserializedChatCompletionsResponseFormatJsonSchemaDefinition.description = description;
+ deserializedChatCompletionsResponseFormatJsonSchemaDefinition.strict = strict;
+ return deserializedChatCompletionsResponseFormatJsonSchemaDefinition;
+ });
+ }
+}
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsToolChoicePreset.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsToolChoicePreset.java
new file mode 100644
index 000000000000..e21aa21ad081
--- /dev/null
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsToolChoicePreset.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 ChatCompletionsToolChoicePreset 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 ChatCompletionsToolChoicePreset 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 ChatCompletionsToolChoicePreset NONE = fromString("none");
+
+ /**
+ * Specifies that the model should respond with a call to one or more tools.
+ */
+ @Generated
+ public static final ChatCompletionsToolChoicePreset REQUIRED = fromString("required");
+
+ /**
+ * Creates a new instance of ChatCompletionsToolChoicePreset value.
+ *
+ * @deprecated Use the {@link #fromString(String)} factory method.
+ */
+ @Generated
+ @Deprecated
+ public ChatCompletionsToolChoicePreset() {
+ }
+
+ /**
+ * Creates or finds a ChatCompletionsToolChoicePreset from its string representation.
+ *
+ * @param name a name to look for.
+ * @return the corresponding ChatCompletionsToolChoicePreset.
+ */
+ @Generated
+ public static ChatCompletionsToolChoicePreset fromString(String name) {
+ return fromString(name, ChatCompletionsToolChoicePreset.class);
+ }
+
+ /**
+ * Gets known ChatCompletionsToolChoicePreset values.
+ *
+ * @return known ChatCompletionsToolChoicePreset values.
+ */
+ @Generated
+ public static Collection values() {
+ return values(ChatCompletionsToolChoicePreset.class);
+ }
+}
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
deleted file mode 100644
index c67d318b47e1..000000000000
--- a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatCompletionsToolSelectionPreset.java
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
-package com.azure.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/ChatRequestDeveloperMessage.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestDeveloperMessage.java
new file mode 100644
index 000000000000..971003bcb062
--- /dev/null
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestDeveloperMessage.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 developer instructions that influence how the model will generate a chat
+ * completions
+ * response. Some AI models support a developer message instead of a system message.
+ */
+@Immutable
+public final class ChatRequestDeveloperMessage extends ChatRequestMessage {
+
+ /*
+ * The chat role associated with this message.
+ */
+ @Generated
+ private ChatRole role = ChatRole.DEVELOPER;
+
+ /*
+ * The contents of the developer message.
+ */
+ @Generated
+ private final String content;
+
+ /**
+ * Creates an instance of ChatRequestDeveloperMessage class.
+ *
+ * @param content the content value to set.
+ */
+ @Generated
+ public ChatRequestDeveloperMessage(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 developer 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 ChatRequestDeveloperMessage from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ChatRequestDeveloperMessage if the JsonReader was pointing to an instance of it, or null
+ * if it was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the ChatRequestDeveloperMessage.
+ */
+ @Generated
+ public static ChatRequestDeveloperMessage fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ String content = null;
+ ChatRole role = ChatRole.DEVELOPER;
+ 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();
+ }
+ }
+ ChatRequestDeveloperMessage deserializedChatRequestDeveloperMessage
+ = new ChatRequestDeveloperMessage(content);
+ deserializedChatRequestDeveloperMessage.role = role;
+ return deserializedChatRequestDeveloperMessage;
+ });
+ }
+}
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
index e6a9e1868b74..6c53e10404b5 100644
--- 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
@@ -79,6 +79,8 @@ public static ChatRequestMessage fromJson(JsonReader jsonReader) throws IOExcept
// Use the discriminator value to determine which subtype should be deserialized.
if ("system".equals(discriminatorValue)) {
return ChatRequestSystemMessage.fromJson(readerToUse.reset());
+ } else if ("developer".equals(discriminatorValue)) {
+ return ChatRequestDeveloperMessage.fromJson(readerToUse.reset());
} else if ("user".equals(discriminatorValue)) {
return ChatRequestUserMessage.fromJson(readerToUse.reset());
} else if ("assistant".equals(discriminatorValue)) {
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 16dca9ee729d..2f22977d8f1b 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
@@ -3,8 +3,8 @@
// 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.core.annotation.Immutable;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
@@ -13,7 +13,7 @@
/**
* A request chat message representing requested output from a configured tool.
*/
-@Immutable
+@Fluent
public final class ChatRequestToolMessage extends ChatRequestMessage {
/*
@@ -26,7 +26,7 @@ public final class ChatRequestToolMessage extends ChatRequestMessage {
* The content of the message.
*/
@Generated
- private final String content;
+ private String content;
/*
* The ID of the tool call resolved by the provided content.
@@ -34,18 +34,6 @@ public final class ChatRequestToolMessage extends ChatRequestMessage {
@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.
*
@@ -84,9 +72,9 @@ public String getToolCallId() {
@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());
+ jsonWriter.writeStringField("content", this.content);
return jsonWriter.writeEndObject();
}
@@ -99,28 +87,50 @@ 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 ChatRequestToolMessage.
*/
- @Generated
public static ChatRequestToolMessage fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
- String content = null;
String toolCallId = null;
ChatRole role = ChatRole.TOOL;
+ String content = null;
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)) {
+ if ("tool_call_id".equals(fieldName)) {
toolCallId = reader.getString();
} else if ("role".equals(fieldName)) {
role = ChatRole.fromString(reader.getString());
+ } else if ("content".equals(fieldName)) {
+ content = reader.getString();
} else {
reader.skipChildren();
}
}
- ChatRequestToolMessage deserializedChatRequestToolMessage = new ChatRequestToolMessage(content, toolCallId);
+ ChatRequestToolMessage deserializedChatRequestToolMessage
+ = new ChatRequestToolMessage(toolCallId).setContent(content);
deserializedChatRequestToolMessage.role = role;
return deserializedChatRequestToolMessage;
});
}
+
+ /**
+ * Creates an instance of ChatRequestToolMessage class.
+ *
+ * @param toolCallId the toolCallId value to set.
+ */
+ @Generated
+ public ChatRequestToolMessage(String toolCallId) {
+ this.toolCallId = toolCallId;
+ }
+
+ /**
+ * Set the content property: The content of the message.
+ *
+ * @param content the content value to set.
+ * @return the ChatRequestToolMessage object itself.
+ */
+ @Generated
+ public ChatRequestToolMessage setContent(String content) {
+ this.content = content;
+ return this;
+ }
}
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
index 10faab5bd750..2e8a1f4373db 100644
--- 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
@@ -66,4 +66,11 @@ public static ChatRole fromString(String name) {
public static Collection values() {
return values(ChatRole.class);
}
+
+ /**
+ * The role that instructs or sets the behavior of the assistant. Some AI models support this role instead of the
+ * 'system' role.
+ */
+ @Generated
+ public static final ChatRole DEVELOPER = fromString("developer");
}
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 2fbe119da216..c3c33976e136 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
@@ -13,19 +13,19 @@
public final class EmbeddingInputType extends ExpandableStringEnum {
/**
- * to do.
+ * Indicates the input is a general text input.
*/
@Generated
public static final EmbeddingInputType TEXT = fromString("text");
/**
- * to do.
+ * Indicates the input represents a search query to find the most relevant documents in your vector database.
*/
@Generated
public static final EmbeddingInputType QUERY = fromString("query");
/**
- * to do.
+ * Indicates the input represents a document that is stored in a vector database.
*/
@Generated
public static final EmbeddingInputType DOCUMENT = fromString("document");
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 486fb8b128ab..c35121aa75a9 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
@@ -38,20 +38,6 @@ public final class EmbeddingsResult implements JsonSerializable 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.
*
@@ -89,6 +75,7 @@ public String getModel() {
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("id", this.id);
jsonWriter.writeArrayField("data", this.data, (writer, element) -> writer.writeJson(element));
jsonWriter.writeJsonField("usage", this.usage);
jsonWriter.writeStringField("model", this.model);
@@ -107,13 +94,16 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
@Generated
public static EmbeddingsResult fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
+ String id = null;
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)) {
+ if ("id".equals(fieldName)) {
+ id = reader.getString();
+ } else if ("data".equals(fieldName)) {
data = reader.readArray(reader1 -> EmbeddingItem.fromJson(reader1));
} else if ("usage".equals(fieldName)) {
usage = EmbeddingsUsage.fromJson(reader);
@@ -123,7 +113,39 @@ public static EmbeddingsResult fromJson(JsonReader jsonReader) throws IOExceptio
reader.skipChildren();
}
}
- return new EmbeddingsResult(data, usage, model);
+ return new EmbeddingsResult(id, data, usage, model);
});
}
+
+ /*
+ * Unique identifier for the embeddings result.
+ */
+ @Generated
+ private final String id;
+
+ /**
+ * Creates an instance of EmbeddingsResult class.
+ *
+ * @param id the id value to set.
+ * @param data the data value to set.
+ * @param usage the usage value to set.
+ * @param model the model value to set.
+ */
+ @Generated
+ private EmbeddingsResult(String id, List data, EmbeddingsUsage usage, String model) {
+ this.id = id;
+ this.data = data;
+ this.usage = usage;
+ this.model = model;
+ }
+
+ /**
+ * Get the id property: Unique identifier for the embeddings result.
+ *
+ * @return the id value.
+ */
+ @Generated
+ public String getId() {
+ return this.id;
+ }
}
diff --git a/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ImageEmbeddingInput.java b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ImageEmbeddingInput.java
new file mode 100644
index 000000000000..269cce4595a2
--- /dev/null
+++ b/sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ImageEmbeddingInput.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.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.FileNotFoundException;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.Base64;
+
+/**
+ * Represents an image with optional text.
+ */
+@Fluent
+public final class ImageEmbeddingInput implements JsonSerializable {
+
+ /*
+ * The input image encoded in base64 string as a data URL. Example: `data:image/{format};base64,{data}`.
+ */
+ @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 ImageEmbeddingInput class.
+ *
+ * @param filePath path to the imageFile.
+ * @param imageFormatType format of the image
+ * @throws RuntimeException If an error occurs while reading the file or file not found.
+ */
+ public ImageEmbeddingInput(Path filePath, String imageFormatType) {
+ try {
+ byte[] bytes = Files.readAllBytes(filePath);
+ String encodedFile = new String(Base64.getEncoder().encode(bytes), StandardCharsets.UTF_8);
+ String urlTemplate = "data:image/%s;base64,%s";
+ this.image = String.format(urlTemplate, imageFormatType, encodedFile);
+ } catch (FileNotFoundException e) {
+ throw new RuntimeException("Local file not found.", e);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * Creates an instance of ImageEmbeddingInput class.
+ *
+ * @param image the image value to set.
+ */
+ @Generated
+ public ImageEmbeddingInput(String image) {
+ this.image = image;
+ }
+
+ /**
+ * Get the image property: The input image encoded in base64 string as a data URL. Example:
+ * `data:image/{format};base64,{data}`.
+ *
+ * @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 ImageEmbeddingInput object itself.
+ */
+ @Generated
+ public ImageEmbeddingInput 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 ImageEmbeddingInput from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ImageEmbeddingInput if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the ImageEmbeddingInput.
+ */
+ @Generated
+ public static ImageEmbeddingInput 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();
+ }
+ }
+ ImageEmbeddingInput deserializedImageEmbeddingInput = new ImageEmbeddingInput(image);
+ deserializedImageEmbeddingInput.text = text;
+ return deserializedImageEmbeddingInput;
+ });
+ }
+}
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 be9e52d19d3a..21950a99b797 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
@@ -13,41 +13,35 @@
public final class ModelType extends ExpandableStringEnum {
/**
- * Embeddings.
+ * A model capable of generating embeddings from a text.
*/
@Generated
public static final ModelType EMBEDDINGS = fromString("embeddings");
/**
- * Image generation.
+ * A model capable of generating images from an image and text description.
*/
@Generated
public static final ModelType IMAGE_GENERATION = fromString("image_generation");
/**
- * Text generation.
+ * A text generation model.
*/
@Generated
public static final ModelType TEXT_GENERATION = fromString("text_generation");
/**
- * Image embeddings.
+ * A model capable of generating embeddings from an image.
*/
@Generated
public static final ModelType IMAGE_EMBEDDINGS = fromString("image_embeddings");
/**
- * Audio generation.
+ * A text-to-audio generative model.
*/
@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.
*
@@ -78,4 +72,10 @@ public static ModelType fromString(String name) {
public static Collection values() {
return values(ModelType.class);
}
+
+ /**
+ * A model capable of taking chat-formatted messages and generate responses.
+ */
+ @Generated
+ public static final ModelType CHAT_COMPLETION = fromString("chat_completion");
}
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 01ba4716738e..a471885c492c 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
@@ -34,26 +34,28 @@
"com.azure.ai.inference.ImageEmbeddingsClient.getModelInfo": "Customizations.Client3.getModelInfo",
"com.azure.ai.inference.ImageEmbeddingsClient.getModelInfoWithResponse": "Customizations.Client3.getModelInfo",
"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",
"com.azure.ai.inference.implementation.models.EmbedRequest1": "Customizations.embed.Request.anonymous",
"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",
- "com.azure.ai.inference.models.ChatCompletionsNamedToolSelection": "AI.Model.ChatCompletionsNamedToolSelection",
+ "com.azure.ai.inference.models.ChatCompletionsNamedToolChoice": "AI.Model.ChatCompletionsNamedToolChoice",
+ "com.azure.ai.inference.models.ChatCompletionsNamedToolChoiceFunction": "AI.Model.ChatCompletionsNamedToolChoiceFunction",
+ "com.azure.ai.inference.models.ChatCompletionsOptions": "AI.Model.ChatCompletionsOptions",
"com.azure.ai.inference.models.ChatCompletionsResponseFormat": "AI.Model.ChatCompletionsResponseFormat",
- "com.azure.ai.inference.models.ChatCompletionsResponseFormatJson": "AI.Model.ChatCompletionsResponseFormatJSON",
+ "com.azure.ai.inference.models.ChatCompletionsResponseFormatJsonObject": "AI.Model.ChatCompletionsResponseFormatJsonObject",
+ "com.azure.ai.inference.models.ChatCompletionsResponseFormatJsonSchema": "AI.Model.ChatCompletionsResponseFormatJsonSchema",
+ "com.azure.ai.inference.models.ChatCompletionsResponseFormatJsonSchemaDefinition": "AI.Model.ChatCompletionsResponseFormatJsonSchemaDefinition",
"com.azure.ai.inference.models.ChatCompletionsResponseFormatText": "AI.Model.ChatCompletionsResponseFormatText",
"com.azure.ai.inference.models.ChatCompletionsToolCall": "AI.Model.ChatCompletionsToolCall",
+ "com.azure.ai.inference.models.ChatCompletionsToolChoicePreset": "AI.Model.ChatCompletionsToolChoicePreset",
"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.ChatRequestDeveloperMessage": "AI.Model.ChatRequestDeveloperMessage",
"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",
@@ -63,7 +65,6 @@
"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",
@@ -71,11 +72,8 @@
"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.ImageEmbeddingInput": "AI.Model.ImageEmbeddingInput",
"com.azure.ai.inference.models.ModelInfo": "AI.Model.ModelInfo",
- "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"
+ "com.azure.ai.inference.models.ModelType": "AI.Model.ModelType"
}
}
diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ChatCompletionsToolCallSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ChatCompletionsToolCallSample.java
index 90c9d515dbc0..982e980671b2 100644
--- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ChatCompletionsToolCallSample.java
+++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ChatCompletionsToolCallSample.java
@@ -98,7 +98,7 @@ private static List handleFunctionCallResponse(List inputList = new ArrayList<>();
+ Path testFilePath = Paths.get(TEST_IMAGE_PATH);
+ inputList.add(new ImageEmbeddingInput(testFilePath, TEST_IMAGE_FORMAT));
+
+ client.embed(inputList).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.getEmbeddingList()) {
+ System.out.printf("%f;", embedding);
+ }
+ }
+ 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());
+ },
+ 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);
+
+ }
+}
diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ImageEmbeddingsSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ImageEmbeddingsSample.java
new file mode 100644
index 000000000000..06d6fe0fea6c
--- /dev/null
+++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/ImageEmbeddingsSample.java
@@ -0,0 +1,47 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.inference.usage;
+
+import com.azure.ai.inference.ImageEmbeddingsClient;
+import com.azure.ai.inference.ImageEmbeddingsClientBuilder;
+import com.azure.ai.inference.models.EmbeddingsResult;
+import com.azure.ai.inference.models.ImageEmbeddingInput;
+import com.azure.ai.inference.models.EmbeddingItem;
+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 ImageEmbeddingsSample {
+ 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_IMAGE_EMBEDDINGS_KEY");
+ String endpoint = Configuration.getGlobalConfiguration().get("IMAGE_EMBEDDINGS_MODEL_ENDPOINT");
+ ImageEmbeddingsClient client = new ImageEmbeddingsClientBuilder()
+ .credential(new AzureKeyCredential(key))
+ .endpoint(endpoint)
+ .buildClient();
+
+ List inputList = new ArrayList<>();
+ Path testFilePath = Paths.get(TEST_IMAGE_PATH);
+ inputList.add(new ImageEmbeddingInput(testFilePath, TEST_IMAGE_FORMAT));
+
+ EmbeddingsResult embeddings = client.embed(inputList);
+
+ for (EmbeddingItem item : embeddings.getData()) {
+ System.out.printf("Index: %d.%n", item.getIndex());
+ 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/StreamingToolCallSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingToolCallSample.java
index fe3384ee028a..a88280e8e82a 100644
--- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingToolCallSample.java
+++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StreamingToolCallSample.java
@@ -122,7 +122,7 @@ public static void main(String[] args) {
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);
+ ChatRequestToolMessage toolRequestMessage = new ChatRequestToolMessage(toolCallId).setContent(functionCallResult);
List followUpMessages = Arrays.asList(
// We add the original messages from the request
chatMessages.get(0),
diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StructuredJsonChatSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StructuredJsonChatSample.java
new file mode 100644
index 000000000000..14a76117d32d
--- /dev/null
+++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/StructuredJsonChatSample.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.ChatCompletionsClient;
+import com.azure.ai.inference.ChatCompletionsClientBuilder;
+import com.azure.ai.inference.ModelServiceVersion;
+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.ChatRequestSystemMessage;
+import com.azure.ai.inference.models.ChatRequestUserMessage;
+import com.azure.core.credential.AzureKeyCredential;
+import com.azure.core.util.BinaryData;
+import com.azure.core.util.Configuration;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.HashMap;
+
+public final class StructuredJsonChatSample {
+ /**
+ * @param args Unused. Arguments to the program.
+ */
+ public static void main(String[] args) {
+ String jsonSchema = "{ \"ingredients\": {"
+ + "\"type\": \"array\","
+ + "\"items\": { \"type\": \"string\" } },"
+ + "\"steps\": { \"type\": \"array\", \"items\": {"
+ + "\"type\": \"object\", \"properties\": {"
+ + "\"ingredients\": {"
+ + "\"type\": \"array\","
+ + "\"items\": {"
+ + "\"type\": \"string\""
+ + "}"
+ + "},"
+ + "\"directions\": {"
+ + "\"type\": \"string\""
+ + "}"
+ + "}"
+ + "}"
+ + "},"
+ + "\"prep_time\": {"
+ + "\"type\": \"string\""
+ + "},"
+ + "\"bake_time\": {"
+ + "\"type\": \"string\""
+ + "} }";
+
+ Map recipeSchema = new HashMap() {{
+ put("type", BinaryData.fromString("\"object\""));
+ put("properties", BinaryData.fromString(jsonSchema));
+ put("required", BinaryData.fromString("[\"ingredients\", \"steps\", \"bake_time\"]"));
+ put("additionalProperties", BinaryData.fromString("false"));
+ }};
+
+ 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)
+ .serviceVersion(ModelServiceVersion.V2024_08_01_PREVIEW)
+ .buildClient();
+
+ List chatMessages = new ArrayList<>();
+ chatMessages.add(new ChatRequestSystemMessage("You are a helpful assistant."));
+ chatMessages.add(new ChatRequestUserMessage("Please give me directions and ingredients to bake a chocolate cake."));
+
+ ChatCompletionsOptions chatCompletionsOptions = new ChatCompletionsOptions(chatMessages).setJsonFormat("cakeBakingDirections", recipeSchema);
+
+ ChatCompletions completions = client.complete(chatCompletionsOptions);
+
+ System.out.printf("%s.%n", completions.getChoice().getMessage().getContent());
+ }
+}
diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TraceChatCompletionsToolCallSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TraceChatCompletionsToolCallSample.java
index cace3c7c8a72..d4dd98ec5767 100644
--- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TraceChatCompletionsToolCallSample.java
+++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TraceChatCompletionsToolCallSample.java
@@ -191,7 +191,7 @@ private Optional tryInvoke(ChatCompletionsToolCall toolC
} else {
functionResponse = "Unavailable";
}
- return Optional.of(new ChatRequestToolMessage(functionResponse, toolCall.getId()));
+ return Optional.of(new ChatRequestToolMessage(toolCall.getId()).setContent(functionResponse));
}
return Optional.empty();
}
@@ -248,7 +248,7 @@ private Optional tryInvoke(ChatCompletionsToolCall toolC
} else {
functionResponse = "Unavailable";
}
- return Optional.of(new ChatRequestToolMessage(functionResponse, toolCall.getId()));
+ return Optional.of(new ChatRequestToolMessage(toolCall.getId()).setContent(functionResponse));
}
return Optional.empty();
}
diff --git a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TraceStreamingChatCompletionsToolCallSample.java b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TraceStreamingChatCompletionsToolCallSample.java
index 367e696a463e..ac5df2320668 100644
--- a/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TraceStreamingChatCompletionsToolCallSample.java
+++ b/sdk/ai/azure-ai-inference/src/samples/java/com/azure/ai/inference/usage/TraceStreamingChatCompletionsToolCallSample.java
@@ -226,7 +226,7 @@ private Optional tryInvoke(ChatCompletionsToolCall toolC
} else {
functionResponse = "{\"error\": \"No flights found between the cities\"}";
}
- return Optional.of(new ChatRequestToolMessage(functionResponse, toolCallId));
+ return Optional.of(new ChatRequestToolMessage(toolCallId).setContent(functionResponse));
}
return Optional.empty();
}
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 3ce620fbe67d..88ed5f128435 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
@@ -32,10 +32,7 @@
import com.azure.core.util.ConfigurationBuilder;
import com.azure.core.util.IterableStream;
import com.azure.core.util.logging.ClientLogger;
-import com.azure.json.JsonReader;
-import com.azure.json.JsonSerializable;
-import com.azure.json.JsonToken;
-import com.azure.json.JsonWriter;
+import com.azure.json.*;
import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.context.Context;
import io.opentelemetry.sdk.OpenTelemetrySdk;
@@ -51,7 +48,9 @@
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.concurrent.ConcurrentLinkedDeque;
import java.util.stream.Collectors;
@@ -61,6 +60,8 @@
import static com.azure.ai.inference.ChatCompletionClientTracerTest.assertNoChatEventsCaptured;
import static com.azure.ai.inference.ChatCompletionClientTracerTest.getChatSpan;
import static com.azure.ai.inference.TestUtils.DISPLAY_NAME_WITH_ARGUMENTS;
+import static com.azure.ai.inference.TestUtils.TEST_IMAGE_PATH;
+import static com.azure.ai.inference.TestUtils.TEST_IMAGE_FORMAT;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertSame;
@@ -72,8 +73,6 @@ public class ChatCompletionsSyncClientTest extends ChatCompletionsClientTestBase
private static final String FUNCTION_RETURN = "-7";
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";
- private static final String TEST_IMAGE_PATH = "./src/samples/resources/sample-images/sample.png";
- private static final String TEST_IMAGE_FORMAT = "png";
private ChatCompletionsClientBuilder getBuilder(HttpClient httpClient) {
return getChatCompletionsClientBuilder(
@@ -84,6 +83,10 @@ private ChatCompletionsClient getChatCompletionsClient(HttpClient httpClient) {
return getBuilder(httpClient).buildClient();
}
+ private ChatCompletionsClient getChatCompletionsClientForStructuredJSON(HttpClient httpClient) {
+ return getBuilder(httpClient).serviceVersion(ModelServiceVersion.V2024_08_01_PREVIEW).buildClient();
+ }
+
private ChatCompletionsClient getChatCompletionsClientWithTracing(HttpClient httpClient,
SpanProcessor spanProcessor, boolean captureContent) {
final OpenTelemetryTracingOptions tracingOptions
@@ -210,6 +213,38 @@ public void testGetCompletionsWithImageUrl(HttpClient httpClient) {
assertCompletions(1, completions);
}
+ @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS)
+ @MethodSource("com.azure.ai.inference.TestUtils#getTestParameters")
+ public void testGetCompletionsWithStructuredJSON(HttpClient httpClient) {
+ String jsonSchema = "{ \"ingredients\": {" + "\"type\": \"array\"," + "\"items\": { \"type\": \"string\" } },"
+ + "\"steps\": { \"type\": \"array\", \"items\": {" + "\"type\": \"object\", \"properties\": {"
+ + "\"ingredients\": {" + "\"type\": \"array\"," + "\"items\": {" + "\"type\": \"string\"" + "}" + "},"
+ + "\"directions\": {" + "\"type\": \"string\"" + "}" + "}" + "}" + "}," + "\"prep_time\": {"
+ + "\"type\": \"string\"" + "}," + "\"bake_time\": {" + "\"type\": \"string\"" + "} }";
+
+ Map recipeSchema = new HashMap() {
+ {
+ put("type", BinaryData.fromString("\"object\""));
+ put("properties", BinaryData.fromString(jsonSchema));
+ put("required", BinaryData.fromString("[\"ingredients\", \"steps\", \"bake_time\"]"));
+ put("additionalProperties", BinaryData.fromString("false"));
+ }
+ };
+ client = getChatCompletionsClientForStructuredJSON(httpClient);
+
+ List chatMessages = new ArrayList<>();
+ chatMessages.add(new ChatRequestSystemMessage("You are a helpful assistant."));
+ chatMessages
+ .add(new ChatRequestUserMessage("Please give me directions and ingredients to bake a chocolate cake."));
+
+ ChatCompletionsOptions chatCompletionsOptions
+ = new ChatCompletionsOptions(chatMessages).setJsonFormat("cakeBakingDirections", recipeSchema);
+
+ ChatCompletions completions = client.complete(chatCompletionsOptions);
+
+ assertCompletions(1, completions);
+ }
+
@ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS)
@MethodSource("com.azure.ai.inference.TestUtils#getTestParameters")
public void testGetCompletionsStreamWithFunctionCalls(HttpClient httpClient) {
@@ -288,7 +323,8 @@ public void testGetCompletionsStreamWithFunctionCalls(HttpClient httpClient) {
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);
+ ChatRequestToolMessage toolRequestMessage
+ = new ChatRequestToolMessage(toolCallId).setContent(functionCallResult);
List followUpMessages = Arrays.asList(
// We add the original messages from the request
chatMessages.get(0), chatMessages.get(1), assistantRequestMessage, toolRequestMessage);
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 702812ef536a..ee95be2c662a 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
@@ -19,14 +19,19 @@
import com.azure.core.util.Configuration;
import org.junit.jupiter.api.Test;
+import java.nio.file.Path;
+import java.nio.file.Paths;
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 com.azure.ai.inference.TestUtils.*;
import static org.junit.jupiter.api.Assertions.*;
+import static com.azure.ai.inference.TestUtils.TEST_IMAGE_PATH;
+import static com.azure.ai.inference.TestUtils.TEST_IMAGE_FORMAT;
+
public abstract class EmbeddingsClientTestBase extends TestProxyTestBase {
protected EmbeddingsClient embeddingsClient;
protected ImageEmbeddingsClient imageEmbeddingsClient;
@@ -75,11 +80,13 @@ ImageEmbeddingsClientBuilder getImageEmbeddingsClientBuilder(HttpClient httpClie
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")));
+ .endpoint(Configuration.getGlobalConfiguration().get("IMAGE_EMBEDDINGS_MODEL_ENDPOINT"))
+ .credential(
+ new AzureKeyCredential(Configuration.getGlobalConfiguration().get("AZURE_IMAGE_EMBEDDINGS_KEY")));
} else {
- builder.endpoint(Configuration.getGlobalConfiguration().get("EMBEDDINGS_MODEL_ENDPOINT"))
- .credential(new AzureKeyCredential(Configuration.getGlobalConfiguration().get("AZURE_EMBEDDINGS_KEY")));
+ builder.endpoint(Configuration.getGlobalConfiguration().get("IMAGE_EMBEDDINGS_MODEL_ENDPOINT"))
+ .credential(
+ new AzureKeyCredential(Configuration.getGlobalConfiguration().get("AZURE_IMAGE_EMBEDDINGS_KEY")));
}
return builder;
}
@@ -106,6 +113,10 @@ void getEmbeddingsRunner(Consumer> testRunner) {
testRunner.accept(getPrompts());
}
+ void getImageEmbeddingsRunner(Consumer> testRunner) {
+ testRunner.accept(getInputs());
+ }
+
static void assertEmbeddings(EmbeddingsResult actual) {
List data = actual.getData();
assertNotNull(data);
@@ -125,4 +136,11 @@ private List getPrompts() {
prompts.add("What's the best way to train a parrot?");
return prompts;
}
+
+ private List getInputs() {
+ Path testFilePath = Paths.get(TEST_IMAGE_PATH);
+ List inputList = new ArrayList<>();
+ inputList.add(new ImageEmbeddingInput(testFilePath, TEST_IMAGE_FORMAT));
+ return inputList;
+ }
}
diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ImageEmbeddingsAsyncClientTest.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ImageEmbeddingsAsyncClientTest.java
new file mode 100644
index 000000000000..6f8766dfd92a
--- /dev/null
+++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ImageEmbeddingsAsyncClientTest.java
@@ -0,0 +1,33 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+package com.azure.ai.inference;
+
+import com.azure.core.http.HttpClient;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
+import reactor.test.StepVerifier;
+
+import static com.azure.ai.inference.TestUtils.DISPLAY_NAME_WITH_ARGUMENTS;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+public class ImageEmbeddingsAsyncClientTest extends EmbeddingsClientTestBase {
+ private ImageEmbeddingsAsyncClient client;
+
+ private ImageEmbeddingsAsyncClient getImageEmbeddingsAsyncClient(HttpClient httpClient) {
+ return getImageEmbeddingsClientBuilder(
+ 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 = getImageEmbeddingsAsyncClient(httpClient);
+ getImageEmbeddingsRunner((inputList) -> {
+ StepVerifier.create(client.embed(inputList)).assertNext(result -> {
+ assertNotNull(result.getUsage());
+ assertEmbeddings(result);
+ }).verifyComplete();
+ });
+ }
+}
diff --git a/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ImageEmbeddingsSyncClientTest.java b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ImageEmbeddingsSyncClientTest.java
new file mode 100644
index 000000000000..dac6b35157f8
--- /dev/null
+++ b/sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ImageEmbeddingsSyncClientTest.java
@@ -0,0 +1,30 @@
+// 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 static com.azure.ai.inference.TestUtils.DISPLAY_NAME_WITH_ARGUMENTS;
+
+public class ImageEmbeddingsSyncClientTest extends EmbeddingsClientTestBase {
+ private ImageEmbeddingsClient client;
+
+ private ImageEmbeddingsClient getImageEmbeddingsClient(HttpClient httpClient) {
+ return getImageEmbeddingsClientBuilder(
+ 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 = getImageEmbeddingsClient(httpClient);
+ getImageEmbeddingsRunner((inputList) -> {
+ EmbeddingsResult result = client.embed(inputList);
+ assertEmbeddings(result);
+ });
+ }
+
+}
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 ac5ced527df7..1ea00580fe05 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
@@ -15,6 +15,8 @@
public class TestUtils {
static final String DISPLAY_NAME_WITH_ARGUMENTS = "{displayName} with [{arguments}]";
static final String FAKE_API_KEY = "fakeKeyPlaceholder";
+ static final String TEST_IMAGE_PATH = "./src/samples/resources/sample-images/sample.png";
+ static final String TEST_IMAGE_FORMAT = "png";
/**
* Returns a stream of arguments that includes all combinations of eligible {@link HttpClient HttpClients}
diff --git a/sdk/ai/azure-ai-inference/tsp-location.yaml b/sdk/ai/azure-ai-inference/tsp-location.yaml
index b4f13dd78be3..87e875fdb0ff 100644
--- a/sdk/ai/azure-ai-inference/tsp-location.yaml
+++ b/sdk/ai/azure-ai-inference/tsp-location.yaml
@@ -1,4 +1,4 @@
-commit: 016b80ae90f5fabc1e572efabd3ecb1030d444c0
+commit: 8f5ad43ec297181e26d5c10f2ebbdc9ce636fd0c
additionalDirectories: []
repo: Azure/azure-rest-api-specs
directory: specification/ai/ModelClient
diff --git a/sdk/alertsmanagement/azure-resourcemanager-alertsmanagement/README.md b/sdk/alertsmanagement/azure-resourcemanager-alertsmanagement/README.md
index b17182628b61..5076998a7f1e 100644
--- a/sdk/alertsmanagement/azure-resourcemanager-alertsmanagement/README.md
+++ b/sdk/alertsmanagement/azure-resourcemanager-alertsmanagement/README.md
@@ -32,7 +32,7 @@ Various documentation is available to help you get started
com.azure.resourcemanager
azure-resourcemanager-alertsmanagement
- 1.0.0-beta.2
+ 1.0.0-beta.3
```
[//]: # ({x-version-update-end})
@@ -101,4 +101,4 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
[coc]: https://opensource.microsoft.com/codeofconduct/
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
-
+
diff --git a/sdk/alertsmanagement/azure-resourcemanager-alertsmanagement/pom.xml b/sdk/alertsmanagement/azure-resourcemanager-alertsmanagement/pom.xml
index 1220eb3d9b36..567613f477c8 100644
--- a/sdk/alertsmanagement/azure-resourcemanager-alertsmanagement/pom.xml
+++ b/sdk/alertsmanagement/azure-resourcemanager-alertsmanagement/pom.xml
@@ -51,23 +51,23 @@
com.azure
azure-core
- 1.54.1
+ 1.55.3
com.azure
azure-core-management
- 1.15.6
+ 1.17.0
com.azure
azure-core-test
- 1.27.0-beta.4
+ 1.27.0-beta.8
test
com.azure
azure-identity
- 1.15.0
+ 1.15.4
test
diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/README.md b/sdk/anomalydetector/azure-ai-anomalydetector/README.md
index 61687fd170f4..166af7a5f334 100644
--- a/sdk/anomalydetector/azure-ai-anomalydetector/README.md
+++ b/sdk/anomalydetector/azure-ai-anomalydetector/README.md
@@ -23,7 +23,7 @@ For more information about creating the resource or how to get the location and
com.azure
azure-ai-anomalydetector
- 3.0.0-beta.5
+ 3.0.0-beta.6
```
@@ -61,7 +61,7 @@ with the Azure SDK, please include the `azure-identity` package:
com.azure
azure-identity
- 1.14.2
+ 1.15.3
```
@@ -241,4 +241,4 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con
[package]: https://central.sonatype.com/artifact/com.azure/azure-ai-anomalydetector
[samples_readme]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/README.md
[logging]: https://github.com/Azure/azure-sdk-for-java/wiki/Logging-in-Azure-SDK
-
+
diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/pom.xml b/sdk/anomalydetector/azure-ai-anomalydetector/pom.xml
index 96c84a317f44..87512c2f0866 100644
--- a/sdk/anomalydetector/azure-ai-anomalydetector/pom.xml
+++ b/sdk/anomalydetector/azure-ai-anomalydetector/pom.xml
@@ -49,25 +49,25 @@
com.azure
azure-core
- 1.54.1
+ 1.55.3
com.azure
azure-core-http-netty
- 1.15.7
+ 1.15.11
com.azure
azure-core-test
- 1.27.0-beta.4
+ 1.27.0-beta.8
test
com.azure
azure-identity
- 1.15.0
+ 1.15.4
test
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/README.md b/sdk/apicenter/azure-resourcemanager-apicenter/README.md
index ef73f8838e72..651eae7b5027 100644
--- a/sdk/apicenter/azure-resourcemanager-apicenter/README.md
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/README.md
@@ -32,7 +32,7 @@ Various documentation is available to help you get started
com.azure.resourcemanager
azure-resourcemanager-apicenter
- 1.1.0
+ 1.2.0-beta.1
```
[//]: # ({x-version-update-end})
@@ -108,4 +108,4 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
[coc]: https://opensource.microsoft.com/codeofconduct/
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
-
+
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/pom.xml b/sdk/apicenter/azure-resourcemanager-apicenter/pom.xml
index 11e7f33b98cd..d298a5190604 100644
--- a/sdk/apicenter/azure-resourcemanager-apicenter/pom.xml
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/pom.xml
@@ -51,29 +51,29 @@
com.azure
azure-core
- 1.54.1
+ 1.55.3
com.azure
azure-core-management
- 1.15.6
+ 1.17.0
com.azure
azure-core-test
- 1.27.0-beta.4
+ 1.27.0-beta.8
test
com.azure
azure-identity
- 1.15.0
+ 1.15.4
test
com.azure.resourcemanager
azure-resourcemanager-resources
- 2.46.0
+ 2.48.0
test
diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/README.md b/sdk/apimanagement/azure-resourcemanager-apimanagement/README.md
index 789cc12790d5..eb79dde88444 100644
--- a/sdk/apimanagement/azure-resourcemanager-apimanagement/README.md
+++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/README.md
@@ -32,7 +32,7 @@ Various documentation is available to help you get started
com.azure.resourcemanager
azure-resourcemanager-apimanagement
- 1.0.0
+ 1.1.0-beta.1
```
[//]: # ({x-version-update-end})
@@ -112,4 +112,4 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
[coc]: https://opensource.microsoft.com/codeofconduct/
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
-
+
diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/pom.xml b/sdk/apimanagement/azure-resourcemanager-apimanagement/pom.xml
index 00204b74c572..12f729d00e43 100644
--- a/sdk/apimanagement/azure-resourcemanager-apimanagement/pom.xml
+++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/pom.xml
@@ -51,23 +51,23 @@
com.azure
azure-core
- 1.54.1
+ 1.55.3
com.azure
azure-core-management
- 1.15.6
+ 1.17.0
com.azure
azure-core-test
- 1.27.0-beta.4
+ 1.27.0-beta.8
test
com.azure
azure-identity
- 1.15.0
+ 1.15.4
test
@@ -91,7 +91,7 @@
com.azure.resourcemanager
azure-resourcemanager-resources
- 2.46.0
+ 2.48.0
test
diff --git a/sdk/appcomplianceautomation/azure-resourcemanager-appcomplianceautomation/README.md b/sdk/appcomplianceautomation/azure-resourcemanager-appcomplianceautomation/README.md
index 137018fb9503..1119b51b802e 100644
--- a/sdk/appcomplianceautomation/azure-resourcemanager-appcomplianceautomation/README.md
+++ b/sdk/appcomplianceautomation/azure-resourcemanager-appcomplianceautomation/README.md
@@ -32,7 +32,7 @@ Various documentation is available to help you get started
com.azure.resourcemanager
azure-resourcemanager-appcomplianceautomation
- 1.0.0
+ 1.1.0-beta.1
```
[//]: # ({x-version-update-end})
@@ -101,4 +101,4 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
[coc]: https://opensource.microsoft.com/codeofconduct/
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
-
+
diff --git a/sdk/appcomplianceautomation/azure-resourcemanager-appcomplianceautomation/pom.xml b/sdk/appcomplianceautomation/azure-resourcemanager-appcomplianceautomation/pom.xml
index 3ade13d01278..c3798981b941 100644
--- a/sdk/appcomplianceautomation/azure-resourcemanager-appcomplianceautomation/pom.xml
+++ b/sdk/appcomplianceautomation/azure-resourcemanager-appcomplianceautomation/pom.xml
@@ -50,28 +50,28 @@
com.azure
azure-json
- 1.3.0
+ 1.5.0
com.azure
azure-core
- 1.54.1
+ 1.55.3
com.azure
azure-core-management
- 1.15.6
+ 1.17.0
com.azure
azure-core-test
- 1.27.0-beta.4
+ 1.27.0-beta.8
test
com.azure
azure-identity
- 1.15.0
+ 1.15.4
test
diff --git a/sdk/appconfiguration/azure-data-appconfiguration-perf/pom.xml b/sdk/appconfiguration/azure-data-appconfiguration-perf/pom.xml
index b112bd455161..ed797e7894e3 100644
--- a/sdk/appconfiguration/azure-data-appconfiguration-perf/pom.xml
+++ b/sdk/appconfiguration/azure-data-appconfiguration-perf/pom.xml
@@ -32,18 +32,18 @@
com.azure
azure-data-appconfiguration
- 1.8.0-beta.1
+ 1.8.0
com.azure
azure-core
- 1.54.1
+ 1.55.3
com.azure
azure-core-http-netty
- 1.15.7
+ 1.15.11
diff --git a/sdk/appconfiguration/azure-data-appconfiguration/CHANGELOG.md b/sdk/appconfiguration/azure-data-appconfiguration/CHANGELOG.md
index 2280c4074741..b328c984c370 100644
--- a/sdk/appconfiguration/azure-data-appconfiguration/CHANGELOG.md
+++ b/sdk/appconfiguration/azure-data-appconfiguration/CHANGELOG.md
@@ -1,23 +1,40 @@
# Release History
-## 1.8.0-beta.1 (Unreleased)
+## 1.8.0 (2025-03-12)
### Features Added
-### Breaking Changes
+- Added support for specifying the token credential's Microsoft Entra audience when creating a client.
-### Bugs Fixed
+### Other Changes
+
+#### Dependency Updates
+
+- Upgraded `azure-core-http-netty` from `1.15.10` to version `1.15.11`.
+- Upgraded `azure-json` from `1.4.0` to version `1.5.0`.
+- Upgraded `azure-core` from `1.55.2` to version `1.55.3`.
+
+## 1.7.4 (2025-02-25)
### Other Changes
+#### Dependency Updates
+
+- Upgraded `azure-core-http-netty` from `1.15.7` to version `1.15.10`.
+- Upgraded `azure-json` from `1.3.0` to version `1.4.0`.
+- Upgraded `azure-core` from `1.54.1` to version `1.55.2`.
+
+
## 1.7.3 (2024-12-04)
### Other Changes
#### Dependency Updates
+
- Upgraded `azure-core` from `1.53.0` to version `1.54.1`.
- Upgraded `azure-core-http-netty` from `1.15.5` to version `1.15.7`.
+
## 1.7.2 (2024-10-27)
### Other Changes
@@ -37,6 +54,7 @@
- Upgraded `azure-core-http-netty` from `1.15.3` to version `1.15.4`.
- Upgraded `azure-core` from `1.51.0` to version `1.52.0`.
+
## 1.7.0 (2024-08-07)
### Features Added
diff --git a/sdk/appconfiguration/azure-data-appconfiguration/README.md b/sdk/appconfiguration/azure-data-appconfiguration/README.md
index 6bfa7bcf63a8..c76ced0a26ba 100644
--- a/sdk/appconfiguration/azure-data-appconfiguration/README.md
+++ b/sdk/appconfiguration/azure-data-appconfiguration/README.md
@@ -56,7 +56,7 @@ add the direct dependency to your project as follows.
com.azure
azure-data-appconfiguration
- 1.7.0
+ 1.8.0
```
[//]: # ({x-version-update-end})
@@ -80,7 +80,7 @@ az appconfig create --name --resource-group com.azure
azure-data-appconfiguration
- 1.8.0-beta.1
+ 1.8.0
Microsoft Azure client library for App Configuration
This package contains the Microsoft Azure App Configuration client library.
@@ -54,29 +54,29 @@
com.azure
azure-core
- 1.54.1
+ 1.55.3
com.azure
azure-json
- 1.3.0
+ 1.5.0
com.azure
azure-core-http-netty
- 1.15.7
+ 1.15.11
com.azure
azure-core-test
- 1.27.0-beta.4
+ 1.27.0-beta.8
test
com.azure
azure-identity
- 1.15.0
+ 1.15.4
test
diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationAsyncClient.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationAsyncClient.java
index 9e649fd36493..1fee78715b51 100644
--- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationAsyncClient.java
+++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationAsyncClient.java
@@ -71,7 +71,7 @@
*
* In order to interact with the App Configuration service you'll need to create an instance of the
* {@link com.azure.data.appconfiguration.ConfigurationAsyncClient} class. To make this possible you'll need the
- * connection string of the configuration store. Alternatively, you can use AAD authentication via
+ * connection string of the configuration store. Alternatively, you can use Entra authentication via
* Azure Identity
* to connect to the service.
*
diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClient.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClient.java
index 850f3ff24d33..e09a97c5d6d9 100644
--- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClient.java
+++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClient.java
@@ -71,7 +71,7 @@
*
* In order to interact with the App Configuration service you'll need to create an instance of the
* {@link ConfigurationClient} class. To make this possible you'll need the connection
- * string of the configuration store. Alternatively, you can use AAD authentication via
+ * string of the configuration store. Alternatively, you can use Entra authentication via
* Azure Identity
* to connect to the service.
*
diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClientBuilder.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClientBuilder.java
index 864f7402064d..79c0bb5c80f2 100644
--- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClientBuilder.java
+++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClientBuilder.java
@@ -43,6 +43,7 @@
import com.azure.data.appconfiguration.implementation.ConfigurationClientCredentials;
import com.azure.data.appconfiguration.implementation.ConfigurationCredentialsPolicy;
import com.azure.data.appconfiguration.implementation.SyncTokenPolicy;
+import com.azure.data.appconfiguration.models.ConfigurationAudience;
import java.net.MalformedURLException;
import java.net.URL;
@@ -144,6 +145,8 @@ public final class ConfigurationClientBuilder implements TokenCredentialTrait {
+ /**
+ * The Azure App Configuration service audience for China Cloud.
+ */
+ public static final ConfigurationAudience AZURE_CHINA = fromString("https://appconfig.azure.cn");
+
+ /**
+ * The Azure App Configuration service audience for US Government Cloud.
+ */
+ public static final ConfigurationAudience AZURE_GOVERNMENT = fromString("https://appconfig.azure.us");
+
+ /**
+ * The Azure App Configuration service audience for Public Cloud.
+ */
+ public static final ConfigurationAudience AZURE_PUBLIC_CLOUD = fromString("https://appconfig.azure.com");
+
+ /**
+ * Creates a new instance of ConfigurationAudience value.
+ *
+ * @deprecated Use the {@link #fromString(String)} factory method.
+ */
+ @Deprecated
+ public ConfigurationAudience() {
+ }
+
+ /**
+ * Creates or finds a ConfigurationAudience from its string representation.
+ *
+ * @param name a name to look for.
+ * @return the corresponding ConfigurationAudience.
+ */
+ public static ConfigurationAudience fromString(String name) {
+ return fromString(name, ConfigurationAudience.class);
+ }
+
+ /**
+ * Gets known ConfigurationAudience values.
+ *
+ * @return known ConfigurationAudience values.
+ */
+ public static Collection values() {
+ return values(ConfigurationAudience.class);
+ }
+}
diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/package-info.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/package-info.java
index f7445ef79b18..284c471a8cd7 100644
--- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/package-info.java
+++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/package-info.java
@@ -17,7 +17,7 @@
*
* In order to interact with the App Configuration service you'll need to create an instance of the Configuration
* Client class. To make this possible you'll need the connection string of the configuration store. Alternatively,
- * you can use AAD authentication via
+ * you can use Entra authentication via
* Azure Identity
* to connect to the service.
*
diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/samples/README.md b/sdk/appconfiguration/azure-data-appconfiguration/src/samples/README.md
index 400d3a9d381c..006a530a4932 100644
--- a/sdk/appconfiguration/azure-data-appconfiguration/src/samples/README.md
+++ b/sdk/appconfiguration/azure-data-appconfiguration/src/samples/README.md
@@ -32,7 +32,7 @@ The following sections provide several code snippets covering some of the most c
- [Set a configuration setting to read only][sample_read_only]
- [Clear read only from a configuration setting][sample_read_only]
- [Conditional request a configuration setting][sample_conditional_request]
-- [AAD Authentication][sample_aad]
+- [Entra Authentication][sample_entra_authentication]
- [HTTP client with proxy option][proxy_option]
- [Feature Flag configuration setting][sample_feature_flag_setting]
- [Secret Reference configuration setting][sample_secret_reference_setting]
@@ -65,10 +65,10 @@ This project welcomes contributions and suggestions. Find [more contributing][SD
[sample_read_only]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/appconfiguration/azure-data-appconfiguration/src/samples/java/com/azure/data/appconfiguration/ReadOnlySample.java
[sample_read_revision_history]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/appconfiguration/azure-data-appconfiguration/src/samples/java/com/azure/data/appconfiguration/ReadRevisionHistory.java
[sample_read_revision_history_tags]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/appconfiguration/azure-data-appconfiguration/src/samples/java/com/azure/data/appconfiguration/ReadRevisionHistoryWIthTagsFilter.java
-[sample_aad]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/appconfiguration/azure-data-appconfiguration/src/samples/java/com/azure/data/appconfiguration/AadAuthentication.java
+[sample_entra_authentication]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/appconfiguration/azure-data-appconfiguration/src/samples/java/com/azure/data/appconfiguration/EntraIdAuthentication.java
[sample_feature_flag_setting]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/appconfiguration/azure-data-appconfiguration/src/samples/java/com/azure/data/appconfiguration/FeatureFlagConfigurationSettingSample.java
[sample_secret_reference_setting]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/appconfiguration/azure-data-appconfiguration/src/samples/java/com/azure/data/appconfiguration/SecretReferenceConfigurationSettingSample.java
[sample_snapshot_CRU_usage]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/appconfiguration/azure-data-appconfiguration/src/samples/java/com/azure/data/appconfiguration/CreateSnapshot.java
[sample_snapshot_create_with_tags]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/appconfiguration/azure-data-appconfiguration/src/samples/java/com/azure/data/appconfiguration/CreateSnapshotWithTagsFilter.java
[sample_list_snapshots]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/appconfiguration/azure-data-appconfiguration/src/samples/java/com/azure/data/appconfiguration/ListSnapshots.java
-
+
diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/samples/java/com/azure/data/appconfiguration/EntraIdAuthentication.java b/sdk/appconfiguration/azure-data-appconfiguration/src/samples/java/com/azure/data/appconfiguration/EntraIdAuthentication.java
new file mode 100644
index 000000000000..7511c12372bb
--- /dev/null
+++ b/sdk/appconfiguration/azure-data-appconfiguration/src/samples/java/com/azure/data/appconfiguration/EntraIdAuthentication.java
@@ -0,0 +1,55 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.data.appconfiguration;
+
+import com.azure.core.util.Configuration;
+import com.azure.data.appconfiguration.models.ConfigurationSetting;
+import com.azure.identity.DefaultAzureCredential;
+import com.azure.identity.DefaultAzureCredentialBuilder;
+
+/**
+ * Sample demonstrates how to use Entra token to build a configuration client.
+ */
+public class EntraIdAuthentication {
+ /**
+ * Sample for how to use Entra token Authentication.
+ *
+ * @param args Unused. Arguments to the program.
+ */
+ public static void main(String[] args) {
+ // The endpoint can be obtained by going to your App Configuration instance in the Azure portal
+ // and navigating to "Overview" page. Looking for the "Endpoint" keyword.
+ String endpoint = Configuration.getGlobalConfiguration().get("AZ_CONFIG_ENDPOINT");
+
+ // Default token credential could be obtained from Identity service.
+ // It tries to create a valid credential in the following order:
+ // EnvironmentCredential
+ // ManagedIdentityCredential
+ // SharedTokenCacheCredential
+ // Fails if none of the credentials above could be created.
+ DefaultAzureCredential tokenCredential = new DefaultAzureCredentialBuilder().build();
+
+ final ConfigurationClient client = new ConfigurationClientBuilder()
+ .credential(tokenCredential) // Entra authentication
+ .endpoint(endpoint)
+ .buildClient();
+
+ // Name of the key to add to the configuration service.
+ final String key = "hello";
+ final String value = "world";
+
+ System.out.println("Beginning of synchronous sample...");
+
+ ConfigurationSetting setting = client.setConfigurationSetting(key, null, value);
+ System.out.printf("[SetConfigurationSetting] Key: %s, Value: %s", setting.getKey(), setting.getValue());
+
+ setting = client.getConfigurationSetting(key, null, null);
+ System.out.printf("[GetConfigurationSetting] Key: %s, Value: %s", setting.getKey(), setting.getValue());
+
+ setting = client.deleteConfigurationSetting(key, null);
+ System.out.printf("[DeleteConfigurationSetting] Key: %s, Value: %s", setting.getKey(), setting.getValue());
+
+ System.out.println("End of synchronous sample.");
+ }
+}
diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/samples/java/com/azure/data/appconfiguration/ReadmeSamples.java b/sdk/appconfiguration/azure-data-appconfiguration/src/samples/java/com/azure/data/appconfiguration/ReadmeSamples.java
index 5c03ce43ee30..83e41145e1be 100644
--- a/sdk/appconfiguration/azure-data-appconfiguration/src/samples/java/com/azure/data/appconfiguration/ReadmeSamples.java
+++ b/sdk/appconfiguration/azure-data-appconfiguration/src/samples/java/com/azure/data/appconfiguration/ReadmeSamples.java
@@ -69,14 +69,14 @@ public void createAsyncClient() {
// END: readme-sample-createAsyncClient
}
- public void aadAuthentication() {
- // BEGIN: readme-sample-aadAuthentication
+ public void entraAuthentication() {
+ // BEGIN: readme-sample-entraAuthentication
DefaultAzureCredential credential = new DefaultAzureCredentialBuilder().build();
ConfigurationClient configurationClient = new ConfigurationClientBuilder()
.credential(credential)
.endpoint(endpoint)
.buildClient();
- // END: readme-sample-aadAuthentication
+ // END: readme-sample-entraAuthentication
}
public void sqlExample() {
@@ -364,7 +364,7 @@ public void enableHttpLogging() {
.buildClient();
// or
DefaultAzureCredential credential = new DefaultAzureCredentialBuilder().build();
- ConfigurationClient configurationClientAad = new ConfigurationClientBuilder()
+ ConfigurationClient configurationClientEntraId = new ConfigurationClientBuilder()
.credential(credential)
.endpoint(endpoint)
.httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS))
diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/test/java/com/azure/data/appconfiguration/ConfigurationClientBuilderTest.java b/sdk/appconfiguration/azure-data-appconfiguration/src/test/java/com/azure/data/appconfiguration/ConfigurationClientBuilderTest.java
index 11eafb605ce0..7712bff35a0a 100644
--- a/sdk/appconfiguration/azure-data-appconfiguration/src/test/java/com/azure/data/appconfiguration/ConfigurationClientBuilderTest.java
+++ b/sdk/appconfiguration/azure-data-appconfiguration/src/test/java/com/azure/data/appconfiguration/ConfigurationClientBuilderTest.java
@@ -23,12 +23,15 @@
import com.azure.core.util.Header;
import com.azure.data.appconfiguration.implementation.ClientConstants;
import com.azure.data.appconfiguration.implementation.ConfigurationClientCredentials;
+import com.azure.data.appconfiguration.models.ConfigurationAudience;
import com.azure.data.appconfiguration.models.ConfigurationSetting;
+import com.azure.identity.DefaultAzureCredentialBuilder;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import reactor.core.publisher.Mono;
+import java.lang.reflect.Method;
import java.net.URI;
import java.net.URISyntaxException;
import java.time.Duration;
@@ -146,7 +149,7 @@ public void invalidConnectionStringSegmentCount() {
@Test
@DoNotRecord
- public void nullAADCredential() {
+ public void nullEntraCredential() {
assertThrows(NullPointerException.class, () -> {
final ConfigurationClientBuilder builder = new ConfigurationClientBuilder();
builder.endpoint(ENDPOINT).credential(null).buildAsyncClient();
@@ -299,4 +302,74 @@ private static URI getURI(String endpointFormat, String namespace, String domain
exception);
}
}
+
+ @Test
+ @DoNotRecord
+ public void testGetUsGovScope() throws Exception {
+ ConfigurationClientBuilder builder = new ConfigurationClientBuilder();
+ Method method = ConfigurationClientBuilder.class.getDeclaredMethod("getDefaultScope", String.class);
+ method.setAccessible(true);
+
+ String expectedScope = "https://appconfig.azure.us/.default";
+
+ String legacyEndpoint = "https://example1.azconfig.azure.us";
+ String actualScope = (String) method.invoke(builder, legacyEndpoint);
+ assertEquals(expectedScope, actualScope);
+
+ String endpoint = "https://example1.appconfig.azure.us";
+ actualScope = (String) method.invoke(builder, endpoint);
+ assertEquals(expectedScope, actualScope);
+ }
+
+ @Test
+ @DoNotRecord
+ public void testGetDefaultScope() throws Exception {
+ ConfigurationClientBuilder builder = new ConfigurationClientBuilder();
+ Method method = ConfigurationClientBuilder.class.getDeclaredMethod("getDefaultScope", String.class);
+ method.setAccessible(true);
+
+ String expectedScope = "https://appconfig.azure.com/.default";
+
+ String legacyEndpoint = "https://example1.azconfig.azure.com";
+ String actualScope = (String) method.invoke(builder, legacyEndpoint);
+ assertEquals(expectedScope, actualScope);
+
+ String endpoint = "https://example1.appconfig.azure.com";
+ actualScope = (String) method.invoke(builder, endpoint);
+ assertEquals(expectedScope, actualScope);
+ }
+
+ @Test
+ @DoNotRecord
+ public void testGetChinaScope() throws Exception {
+ ConfigurationClientBuilder builder = new ConfigurationClientBuilder();
+ Method method = ConfigurationClientBuilder.class.getDeclaredMethod("getDefaultScope", String.class);
+ method.setAccessible(true);
+
+ String expectedScope = "https://appconfig.azure.cn/.default";
+
+ String legacyEndpoint = "https://example1.azconfig.azure.cn";
+ String actualScope = (String) method.invoke(builder, legacyEndpoint);
+ assertEquals(expectedScope, actualScope);
+
+ String endpoint = "https://example1.appconfig.azure.cn";
+ actualScope = (String) method.invoke(builder, endpoint);
+ assertEquals(expectedScope, actualScope);
+ }
+
+ @Test
+ @DoNotRecord
+ public void testUserDefinedScope() throws Exception {
+ String fakeEndpoint = "https://example1.azconfig.azure.com";
+ ConfigurationClientBuilder builder
+ = new ConfigurationClientBuilder().endpoint("https://example1.azconfig.azure.com")
+ .credential(new DefaultAzureCredentialBuilder().build())
+ .audience(ConfigurationAudience.AZURE_CHINA);
+ builder.buildClient();
+ Method method = ConfigurationClientBuilder.class.getDeclaredMethod("getDefaultScope", String.class);
+ method.setAccessible(true);
+
+ String actualScope = (String) method.invoke(builder, fakeEndpoint);
+ assertEquals(ConfigurationAudience.AZURE_CHINA + "/.default", actualScope);
+ }
}
diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/README.md b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/README.md
index 771ab49267b7..b592b659c3f0 100644
--- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/README.md
+++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/README.md
@@ -32,7 +32,7 @@ Various documentation is available to help you get started
com.azure.resourcemanager
azure-resourcemanager-appconfiguration
- 1.0.0
+ 1.1.0-beta.1
```
[//]: # ({x-version-update-end})
@@ -101,4 +101,4 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
[coc]: https://opensource.microsoft.com/codeofconduct/
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
-
+
diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/pom.xml b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/pom.xml
index 88f61e69f5bf..f5e83be1a1ff 100644
--- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/pom.xml
+++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/pom.xml
@@ -51,23 +51,23 @@
com.azure
azure-core
- 1.54.1
+ 1.55.3
com.azure
azure-core-management
- 1.15.6
+ 1.17.0
com.azure
azure-core-test
- 1.27.0-beta.4
+ 1.27.0-beta.8
test
com.azure
azure-identity
- 1.15.0
+ 1.15.4
test
diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/README.md b/sdk/appcontainers/azure-resourcemanager-appcontainers/README.md
index 9d05f22b6128..3c7c1dc62405 100644
--- a/sdk/appcontainers/azure-resourcemanager-appcontainers/README.md
+++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/README.md
@@ -32,7 +32,7 @@ Various documentation is available to help you get started
com.azure.resourcemanager
azure-resourcemanager-appcontainers
- 1.1.0-beta.1
+ 1.1.0-beta.2
```
[//]: # ({x-version-update-end})
@@ -101,4 +101,4 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
[coc]: https://opensource.microsoft.com/codeofconduct/
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
-
+
diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/pom.xml b/sdk/appcontainers/azure-resourcemanager-appcontainers/pom.xml
index 310677329381..87a29ede6c70 100644
--- a/sdk/appcontainers/azure-resourcemanager-appcontainers/pom.xml
+++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/pom.xml
@@ -51,29 +51,29 @@
com.azure
azure-core
- 1.54.1
+ 1.55.3
com.azure
azure-core-management
- 1.15.6
+ 1.17.0
com.azure
azure-core-test
- 1.27.0-beta.4
+ 1.27.0-beta.8
test
com.azure
azure-identity
- 1.15.0
+ 1.15.4
test
com.azure
azure-json
- 1.3.0
+ 1.5.0
diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/CHANGELOG.md b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/CHANGELOG.md
index 0e135f5473ab..d896746fb3e3 100644
--- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/CHANGELOG.md
+++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/CHANGELOG.md
@@ -1,6 +1,6 @@
# Release History
-## 1.2.0-beta.1 (Unreleased)
+## 1.2.0-beta.2 (Unreleased)
### Features Added
@@ -10,6 +10,81 @@
### Other Changes
+## 1.2.0-beta.1 (2025-02-18)
+
+- Azure Resource Manager ApplicationInsights client library for Java. This package contains Microsoft Azure SDK for ApplicationInsights Management SDK. Composite Swagger for Application Insights Management Client. Package tag package-2024-08-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
+
+### Breaking Changes
+
+#### `models.MyWorkbooksListResult` was removed
+
+#### `models.MyWorkbookManagedIdentityType` was removed
+
+#### `models.MyWorkbook` was removed
+
+#### `models.MyWorkbookUserAssignedIdentities` was removed
+
+#### `models.MyWorkbookResource` was removed
+
+#### `models.MyWorkbookManagedIdentity` was removed
+
+#### `models.MyWorkbooks` was removed
+
+#### `models.MyWorkbook$UpdateStages` was removed
+
+#### `models.MyWorkbook$DefinitionStages` was removed
+
+#### `models.Kind` was removed
+
+#### `models.MyWorkbook$Update` was removed
+
+#### `models.MyWorkbook$Definition` was removed
+
+#### `models.ErrorDefinitionException` was removed
+
+#### `models.ErrorDefinition` was removed
+
+#### `ApplicationInsightsManager` was modified
+
+* `myWorkbooks()` was removed
+
+### Features Added
+
+* `models.ComponentLinkedStorageAccounts` was added
+
+* `models.ComponentLinkedStorageAccounts$Update` was added
+
+* `models.ComponentLinkedStorageAccounts$DefinitionStages` was added
+
+* `models.DeletedWorkbookResource` was added
+
+* `models.DeletedWorkbooks` was added
+
+* `models.ComponentLinkedStorageAccountsOperations` was added
+
+* `models.DeletedWorkbooksListResult` was added
+
+* `models.DeletedWorkbookErrorDefinitionException` was added
+
+* `models.ComponentLinkedStorageAccountsPatch` was added
+
+* `models.DeletedWorkbookInnerErrorTrace` was added
+
+* `models.StorageType` was added
+
+* `models.DeletedWorkbookErrorDefinition` was added
+
+* `models.DeletedWorkbook` was added
+
+* `models.ComponentLinkedStorageAccounts$Definition` was added
+
+* `models.ComponentLinkedStorageAccounts$UpdateStages` was added
+
+#### `ApplicationInsightsManager` was modified
+
+* `deletedWorkbooks()` was added
+* `componentLinkedStorageAccountsOperations()` was added
+
## 1.1.0 (2024-12-13)
- Azure Resource Manager ApplicationInsights client library for Java. This package contains Microsoft Azure SDK for ApplicationInsights Management SDK. Composite Swagger for Application Insights Management Client. Package tag package-2022-06-15-java. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/README.md b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/README.md
index 92aeefa55c61..cf8babd1affd 100644
--- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/README.md
+++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/README.md
@@ -2,7 +2,7 @@
Azure Resource Manager ApplicationInsights client library for Java.
-This package contains Microsoft Azure SDK for ApplicationInsights Management SDK. Composite Swagger for Application Insights Management Client. Package tag package-2022-06-15-java. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
+This package contains Microsoft Azure SDK for ApplicationInsights Management SDK. Composite Swagger for Application Insights Management Client. Package tag package-2024-08-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
## We'd love to hear your feedback
@@ -32,7 +32,7 @@ Various documentation is available to help you get started
com.azure.resourcemanager
azure-resourcemanager-applicationinsights
- 1.1.0
+ 1.2.0-beta.2
```
[//]: # ({x-version-update-end})
@@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment
Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code:
```java
-AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
+AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD);
TokenCredential credential = new DefaultAzureCredentialBuilder()
.authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint())
.build();
@@ -60,7 +60,7 @@ ApplicationInsightsManager manager = ApplicationInsightsManager
.authenticate(credential, profile);
```
-The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise.
+The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise.
See [Authentication][authenticate] for more options.
@@ -117,5 +117,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md
[coc]: https://opensource.microsoft.com/codeofconduct/
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
-
-
diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/SAMPLE.md b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/SAMPLE.md
index 5ffd6e0ca48f..1d02c647db82 100644
--- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/SAMPLE.md
+++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/SAMPLE.md
@@ -35,6 +35,13 @@
- [Get](#componentfeaturecapabilities_get)
+## ComponentLinkedStorageAccountsOperation
+
+- [CreateAndUpdate](#componentlinkedstorageaccountsoperation_createandupdate)
+- [Delete](#componentlinkedstorageaccountsoperation_delete)
+- [Get](#componentlinkedstorageaccountsoperation_get)
+- [Update](#componentlinkedstorageaccountsoperation_update)
+
## ComponentQuotaStatus
- [Get](#componentquotastatus_get)
@@ -50,6 +57,10 @@
- [Purge](#components_purge)
- [UpdateTags](#components_updatetags)
+## DeletedWorkbooks
+
+- [List](#deletedworkbooks_list)
+
## ExportConfigurations
- [Create](#exportconfigurations_create)
@@ -70,15 +81,6 @@
- [Get](#livetoken_get)
-## MyWorkbooks
-
-- [CreateOrUpdate](#myworkbooks_createorupdate)
-- [Delete](#myworkbooks_delete)
-- [GetByResourceGroup](#myworkbooks_getbyresourcegroup)
-- [List](#myworkbooks_list)
-- [ListByResourceGroup](#myworkbooks_listbyresourcegroup)
-- [Update](#myworkbooks_update)
-
## ProactiveDetectionConfigurations
- [Get](#proactivedetectionconfigurations_get)
@@ -571,6 +573,127 @@ public final class ComponentFeatureCapabilitiesGetSamples {
}
```
+### ComponentLinkedStorageAccountsOperation_CreateAndUpdate
+
+```java
+import com.azure.resourcemanager.applicationinsights.models.StorageType;
+
+/**
+ * Samples for ComponentLinkedStorageAccountsOperation CreateAndUpdate.
+ */
+public final class ComponentLinkedStorageAccountsOperationCreateAndUpdateSamples {
+ /*
+ * x-ms-original-file:
+ * specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2020-03-01-preview/examples/
+ * ComponentLinkedStorageAccountsCreateAndUpdate.json
+ */
+ /**
+ * Sample code: ComponentLinkedStorageAccountsCreateAndUpdate.
+ *
+ * @param manager Entry point to ApplicationInsightsManager.
+ */
+ public static void componentLinkedStorageAccountsCreateAndUpdate(
+ com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) {
+ manager.componentLinkedStorageAccountsOperations()
+ .define(StorageType.SERVICE_PROFILER)
+ .withExistingComponent("someResourceGroupName", "myComponent")
+ .withLinkedStorageAccount(
+ "/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4918/resourceGroups/someResourceGroupName/providers/Microsoft.Storage/storageAccounts/storageaccountname")
+ .create();
+ }
+}
+```
+
+### ComponentLinkedStorageAccountsOperation_Delete
+
+```java
+import com.azure.resourcemanager.applicationinsights.models.StorageType;
+
+/**
+ * Samples for ComponentLinkedStorageAccountsOperation Delete.
+ */
+public final class ComponentLinkedStorageAccountsOperationDeleteSamples {
+ /*
+ * x-ms-original-file:
+ * specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2020-03-01-preview/examples/
+ * ComponentLinkedStorageAccountsDelete.json
+ */
+ /**
+ * Sample code: ComponentLinkedStorageAccountsDelete.
+ *
+ * @param manager Entry point to ApplicationInsightsManager.
+ */
+ public static void componentLinkedStorageAccountsDelete(
+ com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) {
+ manager.componentLinkedStorageAccountsOperations()
+ .deleteWithResponse("someResourceGroupName", "myComponent", StorageType.SERVICE_PROFILER,
+ com.azure.core.util.Context.NONE);
+ }
+}
+```
+
+### ComponentLinkedStorageAccountsOperation_Get
+
+```java
+import com.azure.resourcemanager.applicationinsights.models.StorageType;
+
+/**
+ * Samples for ComponentLinkedStorageAccountsOperation Get.
+ */
+public final class ComponentLinkedStorageAccountsOperationGetSamples {
+ /*
+ * x-ms-original-file:
+ * specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2020-03-01-preview/examples/
+ * ComponentLinkedStorageAccountsGet.json
+ */
+ /**
+ * Sample code: ComponentLinkedStorageAccountsGet.
+ *
+ * @param manager Entry point to ApplicationInsightsManager.
+ */
+ public static void componentLinkedStorageAccountsGet(
+ com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) {
+ manager.componentLinkedStorageAccountsOperations()
+ .getWithResponse("someResourceGroupName", "myComponent", StorageType.SERVICE_PROFILER,
+ com.azure.core.util.Context.NONE);
+ }
+}
+```
+
+### ComponentLinkedStorageAccountsOperation_Update
+
+```java
+import com.azure.resourcemanager.applicationinsights.models.ComponentLinkedStorageAccounts;
+import com.azure.resourcemanager.applicationinsights.models.StorageType;
+
+/**
+ * Samples for ComponentLinkedStorageAccountsOperation Update.
+ */
+public final class ComponentLinkedStorageAccountsOperationUpdateSamples {
+ /*
+ * x-ms-original-file:
+ * specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2020-03-01-preview/examples/
+ * ComponentLinkedStorageAccountsUpdate.json
+ */
+ /**
+ * Sample code: ComponentLinkedStorageAccountsUpdate.
+ *
+ * @param manager Entry point to ApplicationInsightsManager.
+ */
+ public static void componentLinkedStorageAccountsUpdate(
+ com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) {
+ ComponentLinkedStorageAccounts resource = manager.componentLinkedStorageAccountsOperations()
+ .getWithResponse("someResourceGroupName", "myComponent", StorageType.SERVICE_PROFILER,
+ com.azure.core.util.Context.NONE)
+ .getValue();
+ resource.update()
+ .withLinkedStorageAccount(
+ "/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4918/resourceGroups/someResourceGroupName/providers/Microsoft.Storage/storageAccounts/storageaccountname")
+ .apply();
+ }
+}
+```
+
### ComponentQuotaStatus_Get
```java
@@ -872,6 +995,31 @@ public final class ComponentsUpdateTagsSamples {
}
```
+### DeletedWorkbooks_List
+
+```java
+
+/**
+ * Samples for DeletedWorkbooks List.
+ */
+public final class DeletedWorkbooksListSamples {
+ /*
+ * x-ms-original-file:
+ * specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2024-02-01-preview/examples/
+ * DeletedWorkbooksList.json
+ */
+ /**
+ * Sample code: WorkbooksListSub.
+ *
+ * @param manager Entry point to ApplicationInsightsManager.
+ */
+ public static void
+ workbooksListSub(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) {
+ manager.deletedWorkbooks().list(null, null, com.azure.core.util.Context.NONE);
+ }
+}
+```
+
### ExportConfigurations_Create
```java
@@ -1202,218 +1350,6 @@ public final class LiveTokenGetSamples {
}
```
-### MyWorkbooks_CreateOrUpdate
-
-```java
-import com.azure.resourcemanager.applicationinsights.models.Kind;
-
-/**
- * Samples for MyWorkbooks CreateOrUpdate.
- */
-public final class MyWorkbooksCreateOrUpdateSamples {
- /*
- * x-ms-original-file:
- * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-03-08/examples/MyWorkbookAdd.
- * json
- */
- /**
- * Sample code: WorkbookAdd.
- *
- * @param manager Entry point to ApplicationInsightsManager.
- */
- public static void workbookAdd(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) {
- manager.myWorkbooks()
- .define("deadb33f-8bee-4d3b-a059-9be8dac93960")
- .withRegion("west us")
- .withExistingResourceGroup("my-resource-group")
- .withName("deadb33f-8bee-4d3b-a059-9be8dac93960")
- .withKind(Kind.USER)
- .withDisplayName("Blah Blah Blah")
- .withSerializedData(
- "{\"version\":\"Notebook/1.0\",\"items\":[{\"type\":1,\"content\":\"{\"json\":\"## New workbook\\r\\n---\\r\\n\\r\\nWelcome to your new workbook. This area will display text formatted as markdown.\\r\\n\\r\\n\\r\\nWe've included a basic analytics query to get you started. Use the `Edit` button below each section to configure it or add more sections.\"}\",\"halfWidth\":null,\"conditionalVisibility\":null},{\"type\":3,\"content\":\"{\"version\":\"KqlItem/1.0\",\"query\":\"union withsource=TableName *\\n| summarize Count=count() by TableName\\n| render barchart\",\"showQuery\":false,\"size\":1,\"aggregation\":0,\"showAnnotations\":false}\",\"halfWidth\":null,\"conditionalVisibility\":null}],\"isLocked\":false}")
- .withCategory("workbook")
- .withSourceId(
- "/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/MyGroup/providers/Microsoft.Web/sites/MyTestApp-CodeLens")
- .create();
- }
-}
-```
-
-### MyWorkbooks_Delete
-
-```java
-/**
- * Samples for MyWorkbooks Delete.
- */
-public final class MyWorkbooksDeleteSamples {
- /*
- * x-ms-original-file:
- * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-03-08/examples/MyWorkbookDelete
- * .json
- */
- /**
- * Sample code: WorkbookDelete.
- *
- * @param manager Entry point to ApplicationInsightsManager.
- */
- public static void
- workbookDelete(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) {
- manager.myWorkbooks()
- .deleteByResourceGroupWithResponse("my-resource-group", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2",
- com.azure.core.util.Context.NONE);
- }
-}
-```
-
-### MyWorkbooks_GetByResourceGroup
-
-```java
-/**
- * Samples for MyWorkbooks GetByResourceGroup.
- */
-public final class MyWorkbooksGetByResourceGroupSamples {
- /*
- * x-ms-original-file:
- * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-03-08/examples/MyWorkbookGet.
- * json
- */
- /**
- * Sample code: WorkbookGet.
- *
- * @param manager Entry point to ApplicationInsightsManager.
- */
- public static void workbookGet(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) {
- manager.myWorkbooks()
- .getByResourceGroupWithResponse("my-resource-group", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2",
- com.azure.core.util.Context.NONE);
- }
-}
-```
-
-### MyWorkbooks_List
-
-```java
-import com.azure.resourcemanager.applicationinsights.models.CategoryType;
-
-/**
- * Samples for MyWorkbooks List.
- */
-public final class MyWorkbooksListSamples {
- /*
- * x-ms-original-file:
- * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-03-08/examples/MyWorkbooksList.
- * json
- */
- /**
- * Sample code: WorkbooksList.
- *
- * @param manager Entry point to ApplicationInsightsManager.
- */
- public static void workbooksList(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) {
- manager.myWorkbooks().list(CategoryType.WORKBOOK, null, null, com.azure.core.util.Context.NONE);
- }
-
- /*
- * x-ms-original-file:
- * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-03-08/examples/MyWorkbooksList2
- * .json
- */
- /**
- * Sample code: WorkbooksList2.
- *
- * @param manager Entry point to ApplicationInsightsManager.
- */
- public static void
- workbooksList2(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) {
- manager.myWorkbooks().list(CategoryType.WORKBOOK, null, null, com.azure.core.util.Context.NONE);
- }
-}
-```
-
-### MyWorkbooks_ListByResourceGroup
-
-```java
-import com.azure.resourcemanager.applicationinsights.models.CategoryType;
-
-/**
- * Samples for MyWorkbooks ListByResourceGroup.
- */
-public final class MyWorkbooksListByResourceGroupSamples {
- /*
- * x-ms-original-file:
- * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-03-08/examples/MyWorkbooksList.
- * json
- */
- /**
- * Sample code: WorkbooksList.
- *
- * @param manager Entry point to ApplicationInsightsManager.
- */
- public static void workbooksList(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) {
- manager.myWorkbooks()
- .listByResourceGroup("my-resource-group", CategoryType.WORKBOOK, null, null, null,
- com.azure.core.util.Context.NONE);
- }
-
- /*
- * x-ms-original-file:
- * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-03-08/examples/MyWorkbooksList2
- * .json
- */
- /**
- * Sample code: WorkbooksList2.
- *
- * @param manager Entry point to ApplicationInsightsManager.
- */
- public static void
- workbooksList2(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) {
- manager.myWorkbooks()
- .listByResourceGroup("my-resource-group", CategoryType.WORKBOOK, null, null, null,
- com.azure.core.util.Context.NONE);
- }
-}
-```
-
-### MyWorkbooks_Update
-
-```java
-import com.azure.resourcemanager.applicationinsights.models.Kind;
-import com.azure.resourcemanager.applicationinsights.models.MyWorkbook;
-
-/**
- * Samples for MyWorkbooks Update.
- */
-public final class MyWorkbooksUpdateSamples {
- /*
- * x-ms-original-file:
- * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-03-08/examples/MyWorkbookUpdate
- * .json
- */
- /**
- * Sample code: WorkbookUpdate.
- *
- * @param manager Entry point to ApplicationInsightsManager.
- */
- public static void
- workbookUpdate(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) {
- MyWorkbook resource = manager.myWorkbooks()
- .getByResourceGroupWithResponse("my-resource-group", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2",
- com.azure.core.util.Context.NONE)
- .getValue();
- resource.update()
- .withKind(Kind.USER)
- .withDisplayName("Blah Blah Blah")
- .withSerializedData(
- "{\"version\":\"Notebook/1.0\",\"items\":[{\"type\":1,\"content\":\"{\"json\":\"## New workbook\\r\\n---\\r\\n\\r\\nWelcome to your new workbook. This area will display text formatted as markdown.\\r\\n\\r\\n\\r\\nWe've included a basic analytics query to get you started. Use the `Edit` button below each section to configure it or add more sections.\"}\",\"halfWidth\":null,\"conditionalVisibility\":null},{\"type\":3,\"content\":\"{\"version\":\"KqlItem/1.0\",\"query\":\"union withsource=TableName *\\n| summarize Count=count() by TableName\\n| render barchart\",\"showQuery\":false,\"size\":1,\"aggregation\":0,\"showAnnotations\":false}\",\"halfWidth\":null,\"conditionalVisibility\":null}],\"isLocked\":false}")
- .withVersion("ME")
- .withCategory("workbook")
- .withSourceId(
- "/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/MyGroup/providers/Microsoft.Web/sites/MyTestApp-CodeLens")
- .apply();
- }
-}
-```
-
### ProactiveDetectionConfigurations_Get
```java
@@ -2171,7 +2107,7 @@ import java.util.Map;
public final class WorkbooksCreateOrUpdateSamples {
/*
* x-ms-original-file:
- * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2022-04-01/examples/
+ * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2023-06-01/examples/
* WorkbookManagedAdd.json
*/
/**
@@ -2205,7 +2141,7 @@ public final class WorkbooksCreateOrUpdateSamples {
/*
* x-ms-original-file:
- * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2022-04-01/examples/WorkbookAdd.json
+ * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2023-06-01/examples/WorkbookAdd.json
*/
/**
* Sample code: WorkbookAdd.
@@ -2252,7 +2188,7 @@ public final class WorkbooksCreateOrUpdateSamples {
public final class WorkbooksDeleteSamples {
/*
* x-ms-original-file:
- * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2022-04-01/examples/WorkbookDelete.
+ * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2023-06-01/examples/WorkbookDelete.
* json
*/
/**
@@ -2278,7 +2214,7 @@ public final class WorkbooksDeleteSamples {
public final class WorkbooksGetByResourceGroupSamples {
/*
* x-ms-original-file:
- * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2022-04-01/examples/WorkbookGet1.
+ * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2023-06-01/examples/WorkbookGet1.
* json
*/
/**
@@ -2294,7 +2230,7 @@ public final class WorkbooksGetByResourceGroupSamples {
/*
* x-ms-original-file:
- * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2022-04-01/examples/
+ * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2023-06-01/examples/
* WorkbookManagedGet.json
*/
/**
@@ -2311,7 +2247,7 @@ public final class WorkbooksGetByResourceGroupSamples {
/*
* x-ms-original-file:
- * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2022-04-01/examples/WorkbookGet.json
+ * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2023-06-01/examples/WorkbookGet.json
*/
/**
* Sample code: WorkbookGet.
@@ -2337,7 +2273,7 @@ import com.azure.resourcemanager.applicationinsights.models.CategoryType;
public final class WorkbooksListSamples {
/*
* x-ms-original-file:
- * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2022-04-01/examples/WorkbooksListSub
+ * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2023-06-01/examples/WorkbooksListSub
* .json
*/
/**
@@ -2352,7 +2288,7 @@ public final class WorkbooksListSamples {
/*
* x-ms-original-file:
- * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2022-04-01/examples/WorkbooksList2.
+ * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2023-06-01/examples/WorkbooksList2.
* json
*/
/**
@@ -2378,7 +2314,7 @@ import com.azure.resourcemanager.applicationinsights.models.CategoryType;
public final class WorkbooksListByResourceGroupSamples {
/*
* x-ms-original-file:
- * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2022-04-01/examples/
+ * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2023-06-01/examples/
* WorkbooksManagedList.json
*/
/**
@@ -2396,7 +2332,7 @@ public final class WorkbooksListByResourceGroupSamples {
/*
* x-ms-original-file:
- * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2022-04-01/examples/WorkbooksList.
+ * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2023-06-01/examples/WorkbooksList.
* json
*/
/**
@@ -2422,7 +2358,7 @@ public final class WorkbooksListByResourceGroupSamples {
public final class WorkbooksRevisionGetSamples {
/*
* x-ms-original-file:
- * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2022-04-01/examples/
+ * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2023-06-01/examples/
* WorkbookRevisionGet.json
*/
/**
@@ -2448,7 +2384,7 @@ public final class WorkbooksRevisionGetSamples {
public final class WorkbooksRevisionsListSamples {
/*
* x-ms-original-file:
- * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2022-04-01/examples/
+ * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2023-06-01/examples/
* WorkbookRevisionsList.json
*/
/**
@@ -2476,7 +2412,7 @@ import com.azure.resourcemanager.applicationinsights.models.Workbook;
public final class WorkbooksUpdateSamples {
/*
* x-ms-original-file:
- * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2022-04-01/examples/WorkbookUpdate.
+ * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2023-06-01/examples/WorkbookUpdate.
* json
*/
/**
@@ -2498,7 +2434,7 @@ public final class WorkbooksUpdateSamples {
/*
* x-ms-original-file:
- * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2022-04-01/examples/
+ * specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2023-06-01/examples/
* WorkbookManagedUpdate.json
*/
/**
diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/pom.xml b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/pom.xml
index 9f2ca2b107fc..434bfe637dcd 100644
--- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/pom.xml
+++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/pom.xml
@@ -14,11 +14,11 @@
com.azure.resourcemanager
azure-resourcemanager-applicationinsights
- 1.2.0-beta.1
+ 1.2.0-beta.2
jar
Microsoft Azure SDK for ApplicationInsights Management
- This package contains Microsoft Azure SDK for ApplicationInsights Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Composite Swagger for Application Insights Management Client. Package tag package-2022-06-15-java.
+ This package contains Microsoft Azure SDK for ApplicationInsights Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Composite Swagger for Application Insights Management Client. Package tag package-2024-08-01.
https://github.com/Azure/azure-sdk-for-java
@@ -45,29 +45,30 @@
UTF-8
0
0
+ true
false
com.azure
azure-core
- 1.54.1
+ 1.55.3
com.azure
azure-core-management
- 1.15.6
+ 1.17.0
com.azure
azure-core-test
- 1.27.0-beta.4
+ 1.27.0-beta.8
test
com.azure
azure-identity
- 1.15.0
+ 1.15.4
test
@@ -91,7 +92,7 @@
com.azure.resourcemanager
azure-resourcemanager-resources
- 2.46.0
+ 2.48.0
test
diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/ApplicationInsightsManager.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/ApplicationInsightsManager.java
index 6fffe10b8c0a..ef037815398b 100644
--- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/ApplicationInsightsManager.java
+++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/ApplicationInsightsManager.java
@@ -22,6 +22,7 @@
import com.azure.core.http.policy.UserAgentPolicy;
import com.azure.core.management.profile.AzureProfile;
import com.azure.core.util.Configuration;
+import com.azure.core.util.CoreUtils;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.applicationinsights.fluent.ApplicationInsightsManagementClient;
import com.azure.resourcemanager.applicationinsights.implementation.AnalyticsItemsImpl;
@@ -31,12 +32,13 @@
import com.azure.resourcemanager.applicationinsights.implementation.ComponentAvailableFeaturesImpl;
import com.azure.resourcemanager.applicationinsights.implementation.ComponentCurrentBillingFeaturesImpl;
import com.azure.resourcemanager.applicationinsights.implementation.ComponentFeatureCapabilitiesImpl;
+import com.azure.resourcemanager.applicationinsights.implementation.ComponentLinkedStorageAccountsOperationsImpl;
import com.azure.resourcemanager.applicationinsights.implementation.ComponentQuotaStatusImpl;
import com.azure.resourcemanager.applicationinsights.implementation.ComponentsImpl;
+import com.azure.resourcemanager.applicationinsights.implementation.DeletedWorkbooksImpl;
import com.azure.resourcemanager.applicationinsights.implementation.ExportConfigurationsImpl;
import com.azure.resourcemanager.applicationinsights.implementation.FavoritesImpl;
import com.azure.resourcemanager.applicationinsights.implementation.LiveTokensImpl;
-import com.azure.resourcemanager.applicationinsights.implementation.MyWorkbooksImpl;
import com.azure.resourcemanager.applicationinsights.implementation.OperationsImpl;
import com.azure.resourcemanager.applicationinsights.implementation.ProactiveDetectionConfigurationsImpl;
import com.azure.resourcemanager.applicationinsights.implementation.WebTestLocationsImpl;
@@ -50,12 +52,13 @@
import com.azure.resourcemanager.applicationinsights.models.ComponentAvailableFeatures;
import com.azure.resourcemanager.applicationinsights.models.ComponentCurrentBillingFeatures;
import com.azure.resourcemanager.applicationinsights.models.ComponentFeatureCapabilities;
+import com.azure.resourcemanager.applicationinsights.models.ComponentLinkedStorageAccountsOperations;
import com.azure.resourcemanager.applicationinsights.models.ComponentQuotaStatus;
import com.azure.resourcemanager.applicationinsights.models.Components;
+import com.azure.resourcemanager.applicationinsights.models.DeletedWorkbooks;
import com.azure.resourcemanager.applicationinsights.models.ExportConfigurations;
import com.azure.resourcemanager.applicationinsights.models.Favorites;
import com.azure.resourcemanager.applicationinsights.models.LiveTokens;
-import com.azure.resourcemanager.applicationinsights.models.MyWorkbooks;
import com.azure.resourcemanager.applicationinsights.models.Operations;
import com.azure.resourcemanager.applicationinsights.models.ProactiveDetectionConfigurations;
import com.azure.resourcemanager.applicationinsights.models.WebTestLocations;
@@ -67,6 +70,7 @@
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
@@ -107,12 +111,14 @@ public final class ApplicationInsightsManager {
private WorkbookTemplates workbookTemplates;
- private MyWorkbooks myWorkbooks;
-
private Workbooks workbooks;
private LiveTokens liveTokens;
+ private ComponentLinkedStorageAccountsOperations componentLinkedStorageAccountsOperations;
+
+ private DeletedWorkbooks deletedWorkbooks;
+
private final ApplicationInsightsManagementClient clientObject;
private ApplicationInsightsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) {
@@ -165,6 +171,9 @@ public static Configurable configure() {
*/
public static final class Configurable {
private static final ClientLogger LOGGER = new ClientLogger(Configurable.class);
+ private static final String SDK_VERSION = "version";
+ private static final Map PROPERTIES
+ = CoreUtils.getProperties("azure-resourcemanager-applicationinsights.properties");
private HttpClient httpClient;
private HttpLogOptions httpLogOptions;
@@ -272,12 +281,14 @@ public ApplicationInsightsManager authenticate(TokenCredential credential, Azure
Objects.requireNonNull(credential, "'credential' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");
+ String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion");
+
StringBuilder userAgentBuilder = new StringBuilder();
userAgentBuilder.append("azsdk-java")
.append("-")
.append("com.azure.resourcemanager.applicationinsights")
.append("/")
- .append("1.1.0");
+ .append(clientVersion);
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder.append(" (")
.append(Configuration.getGlobalConfiguration().get("java.version"))
@@ -520,18 +531,6 @@ public WorkbookTemplates workbookTemplates() {
return workbookTemplates;
}
- /**
- * Gets the resource collection API of MyWorkbooks. It manages MyWorkbook.
- *
- * @return Resource collection API of MyWorkbooks.
- */
- public MyWorkbooks myWorkbooks() {
- if (this.myWorkbooks == null) {
- this.myWorkbooks = new MyWorkbooksImpl(clientObject.getMyWorkbooks(), this);
- }
- return myWorkbooks;
- }
-
/**
* Gets the resource collection API of Workbooks. It manages Workbook.
*
@@ -556,6 +555,32 @@ public LiveTokens liveTokens() {
return liveTokens;
}
+ /**
+ * Gets the resource collection API of ComponentLinkedStorageAccountsOperations. It manages
+ * ComponentLinkedStorageAccounts.
+ *
+ * @return Resource collection API of ComponentLinkedStorageAccountsOperations.
+ */
+ public ComponentLinkedStorageAccountsOperations componentLinkedStorageAccountsOperations() {
+ if (this.componentLinkedStorageAccountsOperations == null) {
+ this.componentLinkedStorageAccountsOperations = new ComponentLinkedStorageAccountsOperationsImpl(
+ clientObject.getComponentLinkedStorageAccountsOperations(), this);
+ }
+ return componentLinkedStorageAccountsOperations;
+ }
+
+ /**
+ * Gets the resource collection API of DeletedWorkbooks.
+ *
+ * @return Resource collection API of DeletedWorkbooks.
+ */
+ public DeletedWorkbooks deletedWorkbooks() {
+ if (this.deletedWorkbooks == null) {
+ this.deletedWorkbooks = new DeletedWorkbooksImpl(clientObject.getDeletedWorkbooks(), this);
+ }
+ return deletedWorkbooks;
+ }
+
/**
* Gets wrapped service client ApplicationInsightsManagementClient providing direct access to the underlying
* auto-generated API implementation, based on Azure REST API.
diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/ApplicationInsightsManagementClient.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/ApplicationInsightsManagementClient.java
index 4ef1517c09ca..e97e7ecefe1a 100644
--- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/ApplicationInsightsManagementClient.java
+++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/ApplicationInsightsManagementClient.java
@@ -151,13 +151,6 @@ public interface ApplicationInsightsManagementClient {
*/
WorkbookTemplatesClient getWorkbookTemplates();
- /**
- * Gets the MyWorkbooksClient object to access its operations.
- *
- * @return the MyWorkbooksClient object.
- */
- MyWorkbooksClient getMyWorkbooks();
-
/**
* Gets the WorkbooksClient object to access its operations.
*
@@ -171,4 +164,18 @@ public interface ApplicationInsightsManagementClient {
* @return the LiveTokensClient object.
*/
LiveTokensClient getLiveTokens();
+
+ /**
+ * Gets the ComponentLinkedStorageAccountsOperationsClient object to access its operations.
+ *
+ * @return the ComponentLinkedStorageAccountsOperationsClient object.
+ */
+ ComponentLinkedStorageAccountsOperationsClient getComponentLinkedStorageAccountsOperations();
+
+ /**
+ * Gets the DeletedWorkbooksClient object to access its operations.
+ *
+ * @return the DeletedWorkbooksClient object.
+ */
+ DeletedWorkbooksClient getDeletedWorkbooks();
}
diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/ComponentLinkedStorageAccountsOperationsClient.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/ComponentLinkedStorageAccountsOperationsClient.java
new file mode 100644
index 000000000000..063a8694a6ff
--- /dev/null
+++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/ComponentLinkedStorageAccountsOperationsClient.java
@@ -0,0 +1,149 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.applicationinsights.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.applicationinsights.fluent.models.ComponentLinkedStorageAccountsInner;
+import com.azure.resourcemanager.applicationinsights.models.ComponentLinkedStorageAccountsPatch;
+import com.azure.resourcemanager.applicationinsights.models.StorageType;
+
+/**
+ * An instance of this class provides access to all the operations defined in
+ * ComponentLinkedStorageAccountsOperationsClient.
+ */
+public interface ComponentLinkedStorageAccountsOperationsClient {
+ /**
+ * Returns the current linked storage settings for an Application Insights component.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param resourceName The name of the Application Insights component resource.
+ * @param storageType The type of the Application Insights component data source for the linked storage account.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Application Insights component linked storage accounts along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(String resourceGroupName, String resourceName,
+ StorageType storageType, Context context);
+
+ /**
+ * Returns the current linked storage settings for an Application Insights component.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param resourceName The name of the Application Insights component resource.
+ * @param storageType The type of the Application Insights component data source for the linked storage account.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Application Insights component linked storage accounts.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ComponentLinkedStorageAccountsInner get(String resourceGroupName, String resourceName, StorageType storageType);
+
+ /**
+ * Replace current linked storage account for an Application Insights component.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param resourceName The name of the Application Insights component resource.
+ * @param storageType The type of the Application Insights component data source for the linked storage account.
+ * @param linkedStorageAccountsProperties Properties that need to be specified to update linked storage accounts for
+ * an Application Insights component.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Application Insights component linked storage accounts along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response createAndUpdateWithResponse(String resourceGroupName,
+ String resourceName, StorageType storageType,
+ ComponentLinkedStorageAccountsInner linkedStorageAccountsProperties, Context context);
+
+ /**
+ * Replace current linked storage account for an Application Insights component.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param resourceName The name of the Application Insights component resource.
+ * @param storageType The type of the Application Insights component data source for the linked storage account.
+ * @param linkedStorageAccountsProperties Properties that need to be specified to update linked storage accounts for
+ * an Application Insights component.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Application Insights component linked storage accounts.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ComponentLinkedStorageAccountsInner createAndUpdate(String resourceGroupName, String resourceName,
+ StorageType storageType, ComponentLinkedStorageAccountsInner linkedStorageAccountsProperties);
+
+ /**
+ * Update linked storage accounts for an Application Insights component.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param resourceName The name of the Application Insights component resource.
+ * @param storageType The type of the Application Insights component data source for the linked storage account.
+ * @param linkedStorageAccountsProperties Properties that need to be specified to update a linked storage accounts
+ * for an Application Insights component.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Application Insights component linked storage accounts along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response updateWithResponse(String resourceGroupName, String resourceName,
+ StorageType storageType, ComponentLinkedStorageAccountsPatch linkedStorageAccountsProperties, Context context);
+
+ /**
+ * Update linked storage accounts for an Application Insights component.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param resourceName The name of the Application Insights component resource.
+ * @param storageType The type of the Application Insights component data source for the linked storage account.
+ * @param linkedStorageAccountsProperties Properties that need to be specified to update a linked storage accounts
+ * for an Application Insights component.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Application Insights component linked storage accounts.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ComponentLinkedStorageAccountsInner update(String resourceGroupName, String resourceName, StorageType storageType,
+ ComponentLinkedStorageAccountsPatch linkedStorageAccountsProperties);
+
+ /**
+ * Delete linked storage accounts for an Application Insights component.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param resourceName The name of the Application Insights component resource.
+ * @param storageType The type of the Application Insights component data source for the linked storage account.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response deleteWithResponse(String resourceGroupName, String resourceName, StorageType storageType,
+ Context context);
+
+ /**
+ * Delete linked storage accounts for an Application Insights component.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param resourceName The name of the Application Insights component resource.
+ * @param storageType The type of the Application Insights component data source for the linked storage account.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String resourceName, StorageType storageType);
+}
diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/DeletedWorkbooksClient.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/DeletedWorkbooksClient.java
new file mode 100644
index 000000000000..c94029912c53
--- /dev/null
+++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/DeletedWorkbooksClient.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.applicationinsights.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.applicationinsights.fluent.models.DeletedWorkbookInner;
+import com.azure.resourcemanager.applicationinsights.models.CategoryType;
+import java.util.List;
+
+/**
+ * An instance of this class provides access to all the operations defined in DeletedWorkbooksClient.
+ */
+public interface DeletedWorkbooksClient {
+ /**
+ * Get all recently deleted Workbooks in a specified subscription.
+ *
+ * @throws com.azure.resourcemanager.applicationinsights.models.DeletedWorkbookErrorDefinitionException thrown if
+ * the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all recently deleted Workbooks in a specified subscription as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * Get all recently deleted Workbooks in a specified subscription.
+ *
+ * @param category Category of workbook to return.
+ * @param tags Tags presents on each workbook returned.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.applicationinsights.models.DeletedWorkbookErrorDefinitionException thrown if
+ * the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all recently deleted Workbooks in a specified subscription as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(CategoryType category, List tags, Context context);
+}
diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/MyWorkbooksClient.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/MyWorkbooksClient.java
deleted file mode 100644
index b1e8e8684a2a..000000000000
--- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/MyWorkbooksClient.java
+++ /dev/null
@@ -1,212 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.resourcemanager.applicationinsights.fluent;
-
-import com.azure.core.annotation.ReturnType;
-import com.azure.core.annotation.ServiceMethod;
-import com.azure.core.http.rest.PagedIterable;
-import com.azure.core.http.rest.Response;
-import com.azure.core.util.Context;
-import com.azure.resourcemanager.applicationinsights.fluent.models.MyWorkbookInner;
-import com.azure.resourcemanager.applicationinsights.models.CategoryType;
-import java.util.List;
-
-/**
- * An instance of this class provides access to all the operations defined in MyWorkbooksClient.
- */
-public interface MyWorkbooksClient {
- /**
- * Get all private workbooks defined within a specified resource group and category.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param category Category of workbook to return.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is
- * rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return all private workbooks defined within a specified resource group and category as paginated response with
- * {@link PagedIterable}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- PagedIterable listByResourceGroup(String resourceGroupName, CategoryType category);
-
- /**
- * Get all private workbooks defined within a specified resource group and category.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param category Category of workbook to return.
- * @param tags Tags presents on each workbook returned.
- * @param sourceId Azure Resource Id that will fetch all linked workbooks.
- * @param canFetchContent Flag indicating whether or not to return the full content for each applicable workbook. If
- * false, only return summary content for workbooks.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is
- * rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return all private workbooks defined within a specified resource group and category as paginated response with
- * {@link PagedIterable}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- PagedIterable listByResourceGroup(String resourceGroupName, CategoryType category,
- List tags, String sourceId, Boolean canFetchContent, Context context);
-
- /**
- * Get all private workbooks defined within a specified subscription and category.
- *
- * @param category Category of workbook to return.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is
- * rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return all private workbooks defined within a specified subscription and category as paginated response with
- * {@link PagedIterable}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- PagedIterable list(CategoryType category);
-
- /**
- * Get all private workbooks defined within a specified subscription and category.
- *
- * @param category Category of workbook to return.
- * @param tags Tags presents on each workbook returned.
- * @param canFetchContent Flag indicating whether or not to return the full content for each applicable workbook. If
- * false, only return summary content for workbooks.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is
- * rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return all private workbooks defined within a specified subscription and category as paginated response with
- * {@link PagedIterable}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- PagedIterable list(CategoryType category, List tags, Boolean canFetchContent,
- Context context);
-
- /**
- * Get a single private workbook by its resourceName.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param resourceName The name of the Application Insights component resource.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is
- * rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a single private workbook by its resourceName along with {@link Response}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName,
- Context context);
-
- /**
- * Get a single private workbook by its resourceName.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param resourceName The name of the Application Insights component resource.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is
- * rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a single private workbook by its resourceName.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- MyWorkbookInner getByResourceGroup(String resourceGroupName, String resourceName);
-
- /**
- * Delete a private workbook.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param resourceName The name of the Application Insights component resource.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is
- * rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the {@link Response}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- Response deleteWithResponse(String resourceGroupName, String resourceName, Context context);
-
- /**
- * Delete a private workbook.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param resourceName The name of the Application Insights component resource.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is
- * rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- void delete(String resourceGroupName, String resourceName);
-
- /**
- * Create a new private workbook.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param resourceName The name of the Application Insights component resource.
- * @param workbookProperties Properties that need to be specified to create a new private workbook.
- * @param sourceId Azure Resource Id that will fetch all linked workbooks.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is
- * rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return an Application Insights private workbook definition along with {@link Response}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- Response createOrUpdateWithResponse(String resourceGroupName, String resourceName,
- MyWorkbookInner workbookProperties, String sourceId, Context context);
-
- /**
- * Create a new private workbook.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param resourceName The name of the Application Insights component resource.
- * @param workbookProperties Properties that need to be specified to create a new private workbook.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is
- * rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return an Application Insights private workbook definition.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- MyWorkbookInner createOrUpdate(String resourceGroupName, String resourceName, MyWorkbookInner workbookProperties);
-
- /**
- * Updates a private workbook that has already been added.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param resourceName The name of the Application Insights component resource.
- * @param workbookProperties Properties that need to be specified to create a new private workbook.
- * @param sourceId Azure Resource Id that will fetch all linked workbooks.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is
- * rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return an Application Insights private workbook definition along with {@link Response}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- Response updateWithResponse(String resourceGroupName, String resourceName,
- MyWorkbookInner workbookProperties, String sourceId, Context context);
-
- /**
- * Updates a private workbook that has already been added.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param resourceName The name of the Application Insights component resource.
- * @param workbookProperties Properties that need to be specified to create a new private workbook.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is
- * rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return an Application Insights private workbook definition.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- MyWorkbookInner update(String resourceGroupName, String resourceName, MyWorkbookInner workbookProperties);
-}
diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/WorkbooksClient.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/WorkbooksClient.java
index 8c0b98e303f1..e9c78c0be394 100644
--- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/WorkbooksClient.java
+++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/WorkbooksClient.java
@@ -91,7 +91,7 @@ PagedIterable listByResourceGroup(String resourceGroupName, Categ
* Get a single workbook by its resourceName.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param resourceName The name of the resource.
+ * @param resourceName The name of the workbook resource. The value must be an UUID.
* @param canFetchContent Flag indicating whether or not to return the full content for each applicable workbook. If
* false, only return summary content for workbooks.
* @param context The context to associate with this operation.
@@ -109,7 +109,7 @@ Response getByResourceGroupWithResponse(String resourceGroupName,
* Get a single workbook by its resourceName.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param resourceName The name of the resource.
+ * @param resourceName The name of the workbook resource. The value must be an UUID.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException thrown if the
* request is rejected by server.
@@ -123,7 +123,7 @@ Response getByResourceGroupWithResponse(String resourceGroupName,
* Delete a workbook.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param resourceName The name of the resource.
+ * @param resourceName The name of the workbook resource. The value must be an UUID.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException thrown if the
@@ -138,7 +138,7 @@ Response getByResourceGroupWithResponse(String resourceGroupName,
* Delete a workbook.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param resourceName The name of the resource.
+ * @param resourceName The name of the workbook resource. The value must be an UUID.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException thrown if the
* request is rejected by server.
@@ -151,7 +151,7 @@ Response getByResourceGroupWithResponse(String resourceGroupName,
* Create a new workbook.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param resourceName The name of the resource.
+ * @param resourceName The name of the workbook resource. The value must be an UUID.
* @param workbookProperties Properties that need to be specified to create a new workbook.
* @param sourceId Azure Resource Id that will fetch all linked workbooks.
* @param context The context to associate with this operation.
@@ -169,7 +169,7 @@ Response createOrUpdateWithResponse(String resourceGroupName, Str
* Create a new workbook.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param resourceName The name of the resource.
+ * @param resourceName The name of the workbook resource. The value must be an UUID.
* @param workbookProperties Properties that need to be specified to create a new workbook.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException thrown if the
@@ -184,7 +184,7 @@ Response createOrUpdateWithResponse(String resourceGroupName, Str
* Updates a workbook that has already been added.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param resourceName The name of the resource.
+ * @param resourceName The name of the workbook resource. The value must be an UUID.
* @param sourceId Azure Resource Id that will fetch all linked workbooks.
* @param workbookUpdateParameters Properties that need to be specified to create a new workbook.
* @param context The context to associate with this operation.
@@ -202,7 +202,7 @@ Response updateWithResponse(String resourceGroupName, String reso
* Updates a workbook that has already been added.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param resourceName The name of the resource.
+ * @param resourceName The name of the workbook resource. The value must be an UUID.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException thrown if the
* request is rejected by server.
@@ -216,7 +216,7 @@ Response updateWithResponse(String resourceGroupName, String reso
* Get the revisions for the workbook defined by its resourceName.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param resourceName The name of the resource.
+ * @param resourceName The name of the workbook resource. The value must be an UUID.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException thrown if the
* request is rejected by server.
@@ -231,7 +231,7 @@ Response updateWithResponse(String resourceGroupName, String reso
* Get the revisions for the workbook defined by its resourceName.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param resourceName The name of the resource.
+ * @param resourceName The name of the workbook resource. The value must be an UUID.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException thrown if the
@@ -247,7 +247,7 @@ Response updateWithResponse(String resourceGroupName, String reso
* Get a single workbook revision defined by its revisionId.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param resourceName The name of the resource.
+ * @param resourceName The name of the workbook resource. The value must be an UUID.
* @param revisionId The id of the workbook's revision.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -264,7 +264,7 @@ Response revisionGetWithResponse(String resourceGroupName, String
* Get a single workbook revision defined by its revisionId.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param resourceName The name of the resource.
+ * @param resourceName The name of the workbook resource. The value must be an UUID.
* @param revisionId The id of the workbook's revision.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException thrown if the
diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/ApplicationInsightsComponentProactiveDetectionConfigurationInner.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/ApplicationInsightsComponentProactiveDetectionConfigurationInner.java
index 56fde977cf2d..529c4eadb4ec 100644
--- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/ApplicationInsightsComponentProactiveDetectionConfigurationInner.java
+++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/ApplicationInsightsComponentProactiveDetectionConfigurationInner.java
@@ -200,12 +200,12 @@ public void validate() {
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
- jsonWriter.writeStringField("Name", this.name);
- jsonWriter.writeBooleanField("Enabled", this.enabled);
- jsonWriter.writeBooleanField("SendEmailsToSubscriptionOwners", this.sendEmailsToSubscriptionOwners);
- jsonWriter.writeArrayField("CustomEmails", this.customEmails, (writer, element) -> writer.writeString(element));
- jsonWriter.writeStringField("LastUpdatedTime", this.lastUpdatedTime);
- jsonWriter.writeJsonField("RuleDefinitions", this.ruleDefinitions);
+ jsonWriter.writeStringField("name", this.name);
+ jsonWriter.writeBooleanField("enabled", this.enabled);
+ jsonWriter.writeBooleanField("sendEmailsToSubscriptionOwners", this.sendEmailsToSubscriptionOwners);
+ jsonWriter.writeArrayField("customEmails", this.customEmails, (writer, element) -> writer.writeString(element));
+ jsonWriter.writeStringField("lastUpdatedTime", this.lastUpdatedTime);
+ jsonWriter.writeJsonField("ruleDefinitions", this.ruleDefinitions);
return jsonWriter.writeEndObject();
}
@@ -227,23 +227,23 @@ public static ApplicationInsightsComponentProactiveDetectionConfigurationInner f
String fieldName = reader.getFieldName();
reader.nextToken();
- if ("Name".equals(fieldName)) {
+ if ("name".equals(fieldName)) {
deserializedApplicationInsightsComponentProactiveDetectionConfigurationInner.name
= reader.getString();
- } else if ("Enabled".equals(fieldName)) {
+ } else if ("enabled".equals(fieldName)) {
deserializedApplicationInsightsComponentProactiveDetectionConfigurationInner.enabled
= reader.getNullable(JsonReader::getBoolean);
- } else if ("SendEmailsToSubscriptionOwners".equals(fieldName)) {
+ } else if ("sendEmailsToSubscriptionOwners".equals(fieldName)) {
deserializedApplicationInsightsComponentProactiveDetectionConfigurationInner.sendEmailsToSubscriptionOwners
= reader.getNullable(JsonReader::getBoolean);
- } else if ("CustomEmails".equals(fieldName)) {
+ } else if ("customEmails".equals(fieldName)) {
List customEmails = reader.readArray(reader1 -> reader1.getString());
deserializedApplicationInsightsComponentProactiveDetectionConfigurationInner.customEmails
= customEmails;
- } else if ("LastUpdatedTime".equals(fieldName)) {
+ } else if ("lastUpdatedTime".equals(fieldName)) {
deserializedApplicationInsightsComponentProactiveDetectionConfigurationInner.lastUpdatedTime
= reader.getString();
- } else if ("RuleDefinitions".equals(fieldName)) {
+ } else if ("ruleDefinitions".equals(fieldName)) {
deserializedApplicationInsightsComponentProactiveDetectionConfigurationInner.ruleDefinitions
= ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions.fromJson(reader);
} else {
diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/ComponentLinkedStorageAccountsInner.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/ComponentLinkedStorageAccountsInner.java
new file mode 100644
index 000000000000..21645a9765a6
--- /dev/null
+++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/ComponentLinkedStorageAccountsInner.java
@@ -0,0 +1,162 @@
+// 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.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+
+/**
+ * An Application Insights component linked storage accounts.
+ */
+@Fluent
+public final class ComponentLinkedStorageAccountsInner extends ProxyResource {
+ /*
+ * The properties of the linked storage accounts.
+ */
+ private LinkedStorageAccountsProperties innerProperties;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /**
+ * Creates an instance of ComponentLinkedStorageAccountsInner class.
+ */
+ public ComponentLinkedStorageAccountsInner() {
+ }
+
+ /**
+ * Get the innerProperties property: The properties of the linked storage accounts.
+ *
+ * @return the innerProperties value.
+ */
+ private LinkedStorageAccountsProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the linkedStorageAccount property: Linked storage account resource ID.
+ *
+ * @return the linkedStorageAccount value.
+ */
+ public String linkedStorageAccount() {
+ return this.innerProperties() == null ? null : this.innerProperties().linkedStorageAccount();
+ }
+
+ /**
+ * Set the linkedStorageAccount property: Linked storage account resource ID.
+ *
+ * @param linkedStorageAccount the linkedStorageAccount value to set.
+ * @return the ComponentLinkedStorageAccountsInner object itself.
+ */
+ public ComponentLinkedStorageAccountsInner withLinkedStorageAccount(String linkedStorageAccount) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new LinkedStorageAccountsProperties();
+ }
+ this.innerProperties().withLinkedStorageAccount(linkedStorageAccount);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() != null) {
+ innerProperties().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("properties", this.innerProperties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ComponentLinkedStorageAccountsInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ComponentLinkedStorageAccountsInner if the JsonReader was pointing to an instance of it,
+ * or null if it was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the ComponentLinkedStorageAccountsInner.
+ */
+ public static ComponentLinkedStorageAccountsInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ComponentLinkedStorageAccountsInner deserializedComponentLinkedStorageAccountsInner
+ = new ComponentLinkedStorageAccountsInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedComponentLinkedStorageAccountsInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedComponentLinkedStorageAccountsInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedComponentLinkedStorageAccountsInner.type = reader.getString();
+ } else if ("properties".equals(fieldName)) {
+ deserializedComponentLinkedStorageAccountsInner.innerProperties
+ = LinkedStorageAccountsProperties.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedComponentLinkedStorageAccountsInner;
+ });
+ }
+}
diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/DeletedWorkbookInner.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/DeletedWorkbookInner.java
new file mode 100644
index 000000000000..09eb5417b8ba
--- /dev/null
+++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/DeletedWorkbookInner.java
@@ -0,0 +1,425 @@
+// 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.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.SystemData;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.applicationinsights.models.DeletedWorkbookResource;
+import com.azure.resourcemanager.applicationinsights.models.WorkbookSharedTypeKind;
+import java.io.IOException;
+import java.time.OffsetDateTime;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * A workbook definition.
+ */
+@Fluent
+public final class DeletedWorkbookInner extends DeletedWorkbookResource {
+ /*
+ * Metadata describing a workbook for an Azure resource.
+ */
+ private DeletedWorkbookProperties innerProperties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ private SystemData systemData;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /**
+ * Creates an instance of DeletedWorkbookInner class.
+ */
+ public DeletedWorkbookInner() {
+ }
+
+ /**
+ * Get the innerProperties property: Metadata describing a workbook for an Azure resource.
+ *
+ * @return the innerProperties value.
+ */
+ private DeletedWorkbookProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ @Override
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DeletedWorkbookInner withKind(WorkbookSharedTypeKind kind) {
+ super.withKind(kind);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DeletedWorkbookInner withEtag(String etag) {
+ super.withEtag(etag);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DeletedWorkbookInner withLocation(String location) {
+ super.withLocation(location);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DeletedWorkbookInner withTags(Map tags) {
+ super.withTags(tags);
+ return this;
+ }
+
+ /**
+ * Get the displayName property: The user-defined name (display name) of the workbook.
+ *
+ * @return the displayName value.
+ */
+ public String displayName() {
+ return this.innerProperties() == null ? null : this.innerProperties().displayName();
+ }
+
+ /**
+ * Set the displayName property: The user-defined name (display name) of the workbook.
+ *
+ * @param displayName the displayName value to set.
+ * @return the DeletedWorkbookInner object itself.
+ */
+ public DeletedWorkbookInner withDisplayName(String displayName) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new DeletedWorkbookProperties();
+ }
+ this.innerProperties().withDisplayName(displayName);
+ return this;
+ }
+
+ /**
+ * Get the serializedData property: Configuration of this particular workbook. Configuration data is a string
+ * containing valid JSON.
+ *
+ * @return the serializedData value.
+ */
+ public String serializedData() {
+ return this.innerProperties() == null ? null : this.innerProperties().serializedData();
+ }
+
+ /**
+ * Set the serializedData property: Configuration of this particular workbook. Configuration data is a string
+ * containing valid JSON.
+ *
+ * @param serializedData the serializedData value to set.
+ * @return the DeletedWorkbookInner object itself.
+ */
+ public DeletedWorkbookInner withSerializedData(String serializedData) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new DeletedWorkbookProperties();
+ }
+ this.innerProperties().withSerializedData(serializedData);
+ return this;
+ }
+
+ /**
+ * Get the version property: Workbook schema version format, like 'Notebook/1.0', which should match the workbook in
+ * serializedData.
+ *
+ * @return the version value.
+ */
+ public String version() {
+ return this.innerProperties() == null ? null : this.innerProperties().version();
+ }
+
+ /**
+ * Set the version property: Workbook schema version format, like 'Notebook/1.0', which should match the workbook in
+ * serializedData.
+ *
+ * @param version the version value to set.
+ * @return the DeletedWorkbookInner object itself.
+ */
+ public DeletedWorkbookInner withVersion(String version) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new DeletedWorkbookProperties();
+ }
+ this.innerProperties().withVersion(version);
+ return this;
+ }
+
+ /**
+ * Get the timeModified property: Date and time in UTC of the last modification that was made to this workbook
+ * definition.
+ *
+ * @return the timeModified value.
+ */
+ public OffsetDateTime timeModified() {
+ return this.innerProperties() == null ? null : this.innerProperties().timeModified();
+ }
+
+ /**
+ * Get the category property: Workbook category, as defined by the user at creation time.
+ *
+ * @return the category value.
+ */
+ public String category() {
+ return this.innerProperties() == null ? null : this.innerProperties().category();
+ }
+
+ /**
+ * Set the category property: Workbook category, as defined by the user at creation time.
+ *
+ * @param category the category value to set.
+ * @return the DeletedWorkbookInner object itself.
+ */
+ public DeletedWorkbookInner withCategory(String category) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new DeletedWorkbookProperties();
+ }
+ this.innerProperties().withCategory(category);
+ return this;
+ }
+
+ /**
+ * Get the tags property: Being deprecated, please use the other tags field.
+ *
+ * @return the tags value.
+ */
+ public List tagsPropertiesTags() {
+ return this.innerProperties() == null ? null : this.innerProperties().tags();
+ }
+
+ /**
+ * Set the tags property: Being deprecated, please use the other tags field.
+ *
+ * @param tags the tags value to set.
+ * @return the DeletedWorkbookInner object itself.
+ */
+ public DeletedWorkbookInner withTagsPropertiesTags(List tags) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new DeletedWorkbookProperties();
+ }
+ this.innerProperties().withTags(tags);
+ return this;
+ }
+
+ /**
+ * Get the userId property: Unique user id of the specific user that owns this workbook.
+ *
+ * @return the userId value.
+ */
+ public String userId() {
+ return this.innerProperties() == null ? null : this.innerProperties().userId();
+ }
+
+ /**
+ * Get the sourceId property: ResourceId for a source resource.
+ *
+ * @return the sourceId value.
+ */
+ public String sourceId() {
+ return this.innerProperties() == null ? null : this.innerProperties().sourceId();
+ }
+
+ /**
+ * Set the sourceId property: ResourceId for a source resource.
+ *
+ * @param sourceId the sourceId value to set.
+ * @return the DeletedWorkbookInner object itself.
+ */
+ public DeletedWorkbookInner withSourceId(String sourceId) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new DeletedWorkbookProperties();
+ }
+ this.innerProperties().withSourceId(sourceId);
+ return this;
+ }
+
+ /**
+ * Get the storageUri property: The resourceId to the storage account when bring your own storage is used.
+ *
+ * @return the storageUri value.
+ */
+ public String storageUri() {
+ return this.innerProperties() == null ? null : this.innerProperties().storageUri();
+ }
+
+ /**
+ * Set the storageUri property: The resourceId to the storage account when bring your own storage is used.
+ *
+ * @param storageUri the storageUri value to set.
+ * @return the DeletedWorkbookInner object itself.
+ */
+ public DeletedWorkbookInner withStorageUri(String storageUri) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new DeletedWorkbookProperties();
+ }
+ this.innerProperties().withStorageUri(storageUri);
+ return this;
+ }
+
+ /**
+ * Get the description property: The description of the workbook.
+ *
+ * @return the description value.
+ */
+ public String description() {
+ return this.innerProperties() == null ? null : this.innerProperties().description();
+ }
+
+ /**
+ * Set the description property: The description of the workbook.
+ *
+ * @param description the description value to set.
+ * @return the DeletedWorkbookInner object itself.
+ */
+ public DeletedWorkbookInner withDescription(String description) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new DeletedWorkbookProperties();
+ }
+ this.innerProperties().withDescription(description);
+ return this;
+ }
+
+ /**
+ * Get the revision property: The unique revision id for this workbook definition.
+ *
+ * @return the revision value.
+ */
+ public String revision() {
+ return this.innerProperties() == null ? null : this.innerProperties().revision();
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ if (innerProperties() != null) {
+ innerProperties().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("location", location());
+ jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeStringField("kind", kind() == null ? null : kind().toString());
+ jsonWriter.writeStringField("etag", etag());
+ jsonWriter.writeJsonField("properties", this.innerProperties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of DeletedWorkbookInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DeletedWorkbookInner if the JsonReader was pointing to an instance of it, or null if it
+ * was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the DeletedWorkbookInner.
+ */
+ public static DeletedWorkbookInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ DeletedWorkbookInner deserializedDeletedWorkbookInner = new DeletedWorkbookInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedDeletedWorkbookInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedDeletedWorkbookInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedDeletedWorkbookInner.type = reader.getString();
+ } else if ("location".equals(fieldName)) {
+ deserializedDeletedWorkbookInner.withLocation(reader.getString());
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedDeletedWorkbookInner.withTags(tags);
+ } else if ("kind".equals(fieldName)) {
+ deserializedDeletedWorkbookInner.withKind(WorkbookSharedTypeKind.fromString(reader.getString()));
+ } else if ("etag".equals(fieldName)) {
+ deserializedDeletedWorkbookInner.withEtag(reader.getString());
+ } else if ("systemData".equals(fieldName)) {
+ deserializedDeletedWorkbookInner.systemData = SystemData.fromJson(reader);
+ } else if ("properties".equals(fieldName)) {
+ deserializedDeletedWorkbookInner.innerProperties = DeletedWorkbookProperties.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedDeletedWorkbookInner;
+ });
+ }
+}
diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/DeletedWorkbookProperties.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/DeletedWorkbookProperties.java
new file mode 100644
index 000000000000..fa4f0aface5b
--- /dev/null
+++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/DeletedWorkbookProperties.java
@@ -0,0 +1,366 @@
+// 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.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.CoreUtils;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.time.OffsetDateTime;
+import java.util.List;
+
+/**
+ * Properties that contain a workbook.
+ */
+@Fluent
+public final class DeletedWorkbookProperties implements JsonSerializable {
+ /*
+ * The user-defined name (display name) of the workbook.
+ */
+ private String displayName;
+
+ /*
+ * Configuration of this particular workbook. Configuration data is a string containing valid JSON
+ */
+ private String serializedData;
+
+ /*
+ * Workbook schema version format, like 'Notebook/1.0', which should match the workbook in serializedData
+ */
+ private String version;
+
+ /*
+ * Date and time in UTC of the last modification that was made to this workbook definition.
+ */
+ private OffsetDateTime timeModified;
+
+ /*
+ * Workbook category, as defined by the user at creation time.
+ */
+ private String category;
+
+ /*
+ * Being deprecated, please use the other tags field
+ */
+ private List tags;
+
+ /*
+ * Unique user id of the specific user that owns this workbook.
+ */
+ private String userId;
+
+ /*
+ * ResourceId for a source resource.
+ */
+ private String sourceId;
+
+ /*
+ * The resourceId to the storage account when bring your own storage is used
+ */
+ private String storageUri;
+
+ /*
+ * The description of the workbook.
+ */
+ private String description;
+
+ /*
+ * The unique revision id for this workbook definition
+ */
+ private String revision;
+
+ /**
+ * Creates an instance of DeletedWorkbookProperties class.
+ */
+ public DeletedWorkbookProperties() {
+ }
+
+ /**
+ * Get the displayName property: The user-defined name (display name) of the workbook.
+ *
+ * @return the displayName value.
+ */
+ public String displayName() {
+ return this.displayName;
+ }
+
+ /**
+ * Set the displayName property: The user-defined name (display name) of the workbook.
+ *
+ * @param displayName the displayName value to set.
+ * @return the DeletedWorkbookProperties object itself.
+ */
+ public DeletedWorkbookProperties withDisplayName(String displayName) {
+ this.displayName = displayName;
+ return this;
+ }
+
+ /**
+ * Get the serializedData property: Configuration of this particular workbook. Configuration data is a string
+ * containing valid JSON.
+ *
+ * @return the serializedData value.
+ */
+ public String serializedData() {
+ return this.serializedData;
+ }
+
+ /**
+ * Set the serializedData property: Configuration of this particular workbook. Configuration data is a string
+ * containing valid JSON.
+ *
+ * @param serializedData the serializedData value to set.
+ * @return the DeletedWorkbookProperties object itself.
+ */
+ public DeletedWorkbookProperties withSerializedData(String serializedData) {
+ this.serializedData = serializedData;
+ return this;
+ }
+
+ /**
+ * Get the version property: Workbook schema version format, like 'Notebook/1.0', which should match the workbook in
+ * serializedData.
+ *
+ * @return the version value.
+ */
+ public String version() {
+ return this.version;
+ }
+
+ /**
+ * Set the version property: Workbook schema version format, like 'Notebook/1.0', which should match the workbook in
+ * serializedData.
+ *
+ * @param version the version value to set.
+ * @return the DeletedWorkbookProperties object itself.
+ */
+ public DeletedWorkbookProperties withVersion(String version) {
+ this.version = version;
+ return this;
+ }
+
+ /**
+ * Get the timeModified property: Date and time in UTC of the last modification that was made to this workbook
+ * definition.
+ *
+ * @return the timeModified value.
+ */
+ public OffsetDateTime timeModified() {
+ return this.timeModified;
+ }
+
+ /**
+ * Get the category property: Workbook category, as defined by the user at creation time.
+ *
+ * @return the category value.
+ */
+ public String category() {
+ return this.category;
+ }
+
+ /**
+ * Set the category property: Workbook category, as defined by the user at creation time.
+ *
+ * @param category the category value to set.
+ * @return the DeletedWorkbookProperties object itself.
+ */
+ public DeletedWorkbookProperties withCategory(String category) {
+ this.category = category;
+ return this;
+ }
+
+ /**
+ * Get the tags property: Being deprecated, please use the other tags field.
+ *
+ * @return the tags value.
+ */
+ public List tags() {
+ return this.tags;
+ }
+
+ /**
+ * Set the tags property: Being deprecated, please use the other tags field.
+ *
+ * @param tags the tags value to set.
+ * @return the DeletedWorkbookProperties object itself.
+ */
+ public DeletedWorkbookProperties withTags(List tags) {
+ this.tags = tags;
+ return this;
+ }
+
+ /**
+ * Get the userId property: Unique user id of the specific user that owns this workbook.
+ *
+ * @return the userId value.
+ */
+ public String userId() {
+ return this.userId;
+ }
+
+ /**
+ * Get the sourceId property: ResourceId for a source resource.
+ *
+ * @return the sourceId value.
+ */
+ public String sourceId() {
+ return this.sourceId;
+ }
+
+ /**
+ * Set the sourceId property: ResourceId for a source resource.
+ *
+ * @param sourceId the sourceId value to set.
+ * @return the DeletedWorkbookProperties object itself.
+ */
+ public DeletedWorkbookProperties withSourceId(String sourceId) {
+ this.sourceId = sourceId;
+ return this;
+ }
+
+ /**
+ * Get the storageUri property: The resourceId to the storage account when bring your own storage is used.
+ *
+ * @return the storageUri value.
+ */
+ public String storageUri() {
+ return this.storageUri;
+ }
+
+ /**
+ * Set the storageUri property: The resourceId to the storage account when bring your own storage is used.
+ *
+ * @param storageUri the storageUri value to set.
+ * @return the DeletedWorkbookProperties object itself.
+ */
+ public DeletedWorkbookProperties withStorageUri(String storageUri) {
+ this.storageUri = storageUri;
+ return this;
+ }
+
+ /**
+ * Get the description property: The description of the workbook.
+ *
+ * @return the description value.
+ */
+ public String description() {
+ return this.description;
+ }
+
+ /**
+ * Set the description property: The description of the workbook.
+ *
+ * @param description the description value to set.
+ * @return the DeletedWorkbookProperties object itself.
+ */
+ public DeletedWorkbookProperties withDescription(String description) {
+ this.description = description;
+ return this;
+ }
+
+ /**
+ * Get the revision property: The unique revision id for this workbook definition.
+ *
+ * @return the revision value.
+ */
+ public String revision() {
+ return this.revision;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (displayName() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property displayName in model DeletedWorkbookProperties"));
+ }
+ if (serializedData() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property serializedData in model DeletedWorkbookProperties"));
+ }
+ if (category() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property category in model DeletedWorkbookProperties"));
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(DeletedWorkbookProperties.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("displayName", this.displayName);
+ jsonWriter.writeStringField("serializedData", this.serializedData);
+ jsonWriter.writeStringField("category", this.category);
+ jsonWriter.writeStringField("version", this.version);
+ jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeString(element));
+ jsonWriter.writeStringField("sourceId", this.sourceId);
+ jsonWriter.writeStringField("storageUri", this.storageUri);
+ jsonWriter.writeStringField("description", this.description);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of DeletedWorkbookProperties from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DeletedWorkbookProperties if the JsonReader was pointing to an instance of it, or null if
+ * it was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the DeletedWorkbookProperties.
+ */
+ public static DeletedWorkbookProperties fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ DeletedWorkbookProperties deserializedDeletedWorkbookProperties = new DeletedWorkbookProperties();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("displayName".equals(fieldName)) {
+ deserializedDeletedWorkbookProperties.displayName = reader.getString();
+ } else if ("serializedData".equals(fieldName)) {
+ deserializedDeletedWorkbookProperties.serializedData = reader.getString();
+ } else if ("category".equals(fieldName)) {
+ deserializedDeletedWorkbookProperties.category = reader.getString();
+ } else if ("version".equals(fieldName)) {
+ deserializedDeletedWorkbookProperties.version = reader.getString();
+ } else if ("timeModified".equals(fieldName)) {
+ deserializedDeletedWorkbookProperties.timeModified = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("tags".equals(fieldName)) {
+ List tags = reader.readArray(reader1 -> reader1.getString());
+ deserializedDeletedWorkbookProperties.tags = tags;
+ } else if ("userId".equals(fieldName)) {
+ deserializedDeletedWorkbookProperties.userId = reader.getString();
+ } else if ("sourceId".equals(fieldName)) {
+ deserializedDeletedWorkbookProperties.sourceId = reader.getString();
+ } else if ("storageUri".equals(fieldName)) {
+ deserializedDeletedWorkbookProperties.storageUri = reader.getString();
+ } else if ("description".equals(fieldName)) {
+ deserializedDeletedWorkbookProperties.description = reader.getString();
+ } else if ("revision".equals(fieldName)) {
+ deserializedDeletedWorkbookProperties.revision = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedDeletedWorkbookProperties;
+ });
+ }
+}
diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/LinkedStorageAccountsProperties.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/LinkedStorageAccountsProperties.java
new file mode 100644
index 000000000000..7bed63396e80
--- /dev/null
+++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/LinkedStorageAccountsProperties.java
@@ -0,0 +1,94 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.applicationinsights.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+
+/**
+ * An Application Insights component linked storage account.
+ */
+@Fluent
+public final class LinkedStorageAccountsProperties implements JsonSerializable {
+ /*
+ * Linked storage account resource ID
+ */
+ private String linkedStorageAccount;
+
+ /**
+ * Creates an instance of LinkedStorageAccountsProperties class.
+ */
+ public LinkedStorageAccountsProperties() {
+ }
+
+ /**
+ * Get the linkedStorageAccount property: Linked storage account resource ID.
+ *
+ * @return the linkedStorageAccount value.
+ */
+ public String linkedStorageAccount() {
+ return this.linkedStorageAccount;
+ }
+
+ /**
+ * Set the linkedStorageAccount property: Linked storage account resource ID.
+ *
+ * @param linkedStorageAccount the linkedStorageAccount value to set.
+ * @return the LinkedStorageAccountsProperties object itself.
+ */
+ public LinkedStorageAccountsProperties withLinkedStorageAccount(String linkedStorageAccount) {
+ this.linkedStorageAccount = linkedStorageAccount;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("linkedStorageAccount", this.linkedStorageAccount);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of LinkedStorageAccountsProperties from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of LinkedStorageAccountsProperties if the JsonReader was pointing to an instance of it, or
+ * null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the LinkedStorageAccountsProperties.
+ */
+ public static LinkedStorageAccountsProperties fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ LinkedStorageAccountsProperties deserializedLinkedStorageAccountsProperties
+ = new LinkedStorageAccountsProperties();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("linkedStorageAccount".equals(fieldName)) {
+ deserializedLinkedStorageAccountsProperties.linkedStorageAccount = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedLinkedStorageAccountsProperties;
+ });
+ }
+}
diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/MyWorkbookInner.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/MyWorkbookInner.java
deleted file mode 100644
index f5a7c6494f27..000000000000
--- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/MyWorkbookInner.java
+++ /dev/null
@@ -1,409 +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.fluent.models;
-
-import com.azure.core.annotation.Fluent;
-import com.azure.core.management.SystemData;
-import com.azure.json.JsonReader;
-import com.azure.json.JsonToken;
-import com.azure.json.JsonWriter;
-import com.azure.resourcemanager.applicationinsights.models.Kind;
-import com.azure.resourcemanager.applicationinsights.models.MyWorkbookManagedIdentity;
-import com.azure.resourcemanager.applicationinsights.models.MyWorkbookResource;
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-
-/**
- * An Application Insights private workbook definition.
- */
-@Fluent
-public final class MyWorkbookInner extends MyWorkbookResource {
- /*
- * The kind of workbook. Choices are user and shared.
- */
- private Kind kind;
-
- /*
- * Metadata describing a workbook for an Azure resource.
- */
- private MyWorkbookProperties innerProperties;
-
- /*
- * Metadata pertaining to creation and last modification of the resource.
- */
- private SystemData systemData;
-
- /**
- * Creates an instance of MyWorkbookInner class.
- */
- public MyWorkbookInner() {
- }
-
- /**
- * Get the kind property: The kind of workbook. Choices are user and shared.
- *
- * @return the kind value.
- */
- public Kind kind() {
- return this.kind;
- }
-
- /**
- * Set the kind property: The kind of workbook. Choices are user and shared.
- *
- * @param kind the kind value to set.
- * @return the MyWorkbookInner object itself.
- */
- public MyWorkbookInner withKind(Kind kind) {
- this.kind = kind;
- return this;
- }
-
- /**
- * Get the innerProperties property: Metadata describing a workbook for an Azure resource.
- *
- * @return the innerProperties value.
- */
- private MyWorkbookProperties innerProperties() {
- return this.innerProperties;
- }
-
- /**
- * Get the systemData property: Metadata pertaining to creation and last modification of the resource.
- *
- * @return the systemData value.
- */
- public SystemData systemData() {
- return this.systemData;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public MyWorkbookInner withIdentity(MyWorkbookManagedIdentity identity) {
- super.withIdentity(identity);
- return this;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public MyWorkbookInner withId(String id) {
- super.withId(id);
- return this;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public MyWorkbookInner withName(String name) {
- super.withName(name);
- return this;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public MyWorkbookInner withType(String type) {
- super.withType(type);
- return this;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public MyWorkbookInner withEtag(Map etag) {
- super.withEtag(etag);
- return this;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public MyWorkbookInner withLocation(String location) {
- super.withLocation(location);
- return this;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public MyWorkbookInner withTags(Map tags) {
- super.withTags(tags);
- return this;
- }
-
- /**
- * Get the displayName property: The user-defined name of the private workbook.
- *
- * @return the displayName value.
- */
- public String displayName() {
- return this.innerProperties() == null ? null : this.innerProperties().displayName();
- }
-
- /**
- * Set the displayName property: The user-defined name of the private workbook.
- *
- * @param displayName the displayName value to set.
- * @return the MyWorkbookInner object itself.
- */
- public MyWorkbookInner withDisplayName(String displayName) {
- if (this.innerProperties() == null) {
- this.innerProperties = new MyWorkbookProperties();
- }
- this.innerProperties().withDisplayName(displayName);
- return this;
- }
-
- /**
- * Get the serializedData property: Configuration of this particular private workbook. Configuration data is a
- * string containing valid JSON.
- *
- * @return the serializedData value.
- */
- public String serializedData() {
- return this.innerProperties() == null ? null : this.innerProperties().serializedData();
- }
-
- /**
- * Set the serializedData property: Configuration of this particular private workbook. Configuration data is a
- * string containing valid JSON.
- *
- * @param serializedData the serializedData value to set.
- * @return the MyWorkbookInner object itself.
- */
- public MyWorkbookInner withSerializedData(String serializedData) {
- if (this.innerProperties() == null) {
- this.innerProperties = new MyWorkbookProperties();
- }
- this.innerProperties().withSerializedData(serializedData);
- return this;
- }
-
- /**
- * Get the version property: This instance's version of the data model. This can change as new features are added
- * that can be marked private workbook.
- *
- * @return the version value.
- */
- public String version() {
- return this.innerProperties() == null ? null : this.innerProperties().version();
- }
-
- /**
- * Set the version property: This instance's version of the data model. This can change as new features are added
- * that can be marked private workbook.
- *
- * @param version the version value to set.
- * @return the MyWorkbookInner object itself.
- */
- public MyWorkbookInner withVersion(String version) {
- if (this.innerProperties() == null) {
- this.innerProperties = new MyWorkbookProperties();
- }
- this.innerProperties().withVersion(version);
- return this;
- }
-
- /**
- * Get the timeModified property: Date and time in UTC of the last modification that was made to this private
- * workbook definition.
- *
- * @return the timeModified value.
- */
- public String timeModified() {
- return this.innerProperties() == null ? null : this.innerProperties().timeModified();
- }
-
- /**
- * Get the category property: Workbook category, as defined by the user at creation time.
- *
- * @return the category value.
- */
- public String category() {
- return this.innerProperties() == null ? null : this.innerProperties().category();
- }
-
- /**
- * Set the category property: Workbook category, as defined by the user at creation time.
- *
- * @param category the category value to set.
- * @return the MyWorkbookInner object itself.
- */
- public MyWorkbookInner withCategory(String category) {
- if (this.innerProperties() == null) {
- this.innerProperties = new MyWorkbookProperties();
- }
- this.innerProperties().withCategory(category);
- return this;
- }
-
- /**
- * Get the tags property: A list of 0 or more tags that are associated with this private workbook definition.
- *
- * @return the tags value.
- */
- public List tagsPropertiesTags() {
- return this.innerProperties() == null ? null : this.innerProperties().tags();
- }
-
- /**
- * Set the tags property: A list of 0 or more tags that are associated with this private workbook definition.
- *
- * @param tags the tags value to set.
- * @return the MyWorkbookInner object itself.
- */
- public MyWorkbookInner withTagsPropertiesTags(List tags) {
- if (this.innerProperties() == null) {
- this.innerProperties = new MyWorkbookProperties();
- }
- this.innerProperties().withTags(tags);
- return this;
- }
-
- /**
- * Get the userId property: Unique user id of the specific user that owns this private workbook.
- *
- * @return the userId value.
- */
- public String userId() {
- return this.innerProperties() == null ? null : this.innerProperties().userId();
- }
-
- /**
- * Get the sourceId property: Optional resourceId for a source resource.
- *
- * @return the sourceId value.
- */
- public String sourceId() {
- return this.innerProperties() == null ? null : this.innerProperties().sourceId();
- }
-
- /**
- * Set the sourceId property: Optional resourceId for a source resource.
- *
- * @param sourceId the sourceId value to set.
- * @return the MyWorkbookInner object itself.
- */
- public MyWorkbookInner withSourceId(String sourceId) {
- if (this.innerProperties() == null) {
- this.innerProperties = new MyWorkbookProperties();
- }
- this.innerProperties().withSourceId(sourceId);
- return this;
- }
-
- /**
- * Get the storageUri property: BYOS Storage Account URI.
- *
- * @return the storageUri value.
- */
- public String storageUri() {
- return this.innerProperties() == null ? null : this.innerProperties().storageUri();
- }
-
- /**
- * Set the storageUri property: BYOS Storage Account URI.
- *
- * @param storageUri the storageUri value to set.
- * @return the MyWorkbookInner object itself.
- */
- public MyWorkbookInner withStorageUri(String storageUri) {
- if (this.innerProperties() == null) {
- this.innerProperties = new MyWorkbookProperties();
- }
- this.innerProperties().withStorageUri(storageUri);
- return this;
- }
-
- /**
- * Validates the instance.
- *
- * @throws IllegalArgumentException thrown if the instance is not valid.
- */
- @Override
- public void validate() {
- if (innerProperties() != null) {
- innerProperties().validate();
- }
- if (identity() != null) {
- identity().validate();
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
- jsonWriter.writeStartObject();
- jsonWriter.writeStringField("location", location());
- jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
- jsonWriter.writeJsonField("identity", identity());
- jsonWriter.writeStringField("id", id());
- jsonWriter.writeStringField("name", name());
- jsonWriter.writeStringField("type", type());
- jsonWriter.writeMapField("etag", etag(), (writer, element) -> writer.writeString(element));
- jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString());
- jsonWriter.writeJsonField("properties", this.innerProperties);
- return jsonWriter.writeEndObject();
- }
-
- /**
- * Reads an instance of MyWorkbookInner from the JsonReader.
- *
- * @param jsonReader The JsonReader being read.
- * @return An instance of MyWorkbookInner if the JsonReader was pointing to an instance of it, or null if it was
- * pointing to JSON null.
- * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
- * @throws IOException If an error occurs while reading the MyWorkbookInner.
- */
- public static MyWorkbookInner fromJson(JsonReader jsonReader) throws IOException {
- return jsonReader.readObject(reader -> {
- MyWorkbookInner deserializedMyWorkbookInner = new MyWorkbookInner();
- while (reader.nextToken() != JsonToken.END_OBJECT) {
- String fieldName = reader.getFieldName();
- reader.nextToken();
-
- if ("location".equals(fieldName)) {
- deserializedMyWorkbookInner.withLocation(reader.getString());
- } else if ("tags".equals(fieldName)) {
- Map tags = reader.readMap(reader1 -> reader1.getString());
- deserializedMyWorkbookInner.withTags(tags);
- } else if ("identity".equals(fieldName)) {
- deserializedMyWorkbookInner.withIdentity(MyWorkbookManagedIdentity.fromJson(reader));
- } else if ("id".equals(fieldName)) {
- deserializedMyWorkbookInner.withId(reader.getString());
- } else if ("name".equals(fieldName)) {
- deserializedMyWorkbookInner.withName(reader.getString());
- } else if ("type".equals(fieldName)) {
- deserializedMyWorkbookInner.withType(reader.getString());
- } else if ("etag".equals(fieldName)) {
- Map etag = reader.readMap(reader1 -> reader1.getString());
- deserializedMyWorkbookInner.withEtag(etag);
- } else if ("kind".equals(fieldName)) {
- deserializedMyWorkbookInner.kind = Kind.fromString(reader.getString());
- } else if ("properties".equals(fieldName)) {
- deserializedMyWorkbookInner.innerProperties = MyWorkbookProperties.fromJson(reader);
- } else if ("systemData".equals(fieldName)) {
- deserializedMyWorkbookInner.systemData = SystemData.fromJson(reader);
- } else {
- reader.skipChildren();
- }
- }
-
- return deserializedMyWorkbookInner;
- });
- }
-}
diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/MyWorkbookProperties.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/MyWorkbookProperties.java
deleted file mode 100644
index 344c82805f14..000000000000
--- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/MyWorkbookProperties.java
+++ /dev/null
@@ -1,319 +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.fluent.models;
-
-import com.azure.core.annotation.Fluent;
-import com.azure.core.util.logging.ClientLogger;
-import com.azure.json.JsonReader;
-import com.azure.json.JsonSerializable;
-import com.azure.json.JsonToken;
-import com.azure.json.JsonWriter;
-import java.io.IOException;
-import java.util.List;
-
-/**
- * Properties that contain a private workbook.
- */
-@Fluent
-public final class MyWorkbookProperties implements JsonSerializable {
- /*
- * The user-defined name of the private workbook.
- */
- private String displayName;
-
- /*
- * Configuration of this particular private workbook. Configuration data is a string containing valid JSON
- */
- private String serializedData;
-
- /*
- * This instance's version of the data model. This can change as new features are added that can be marked private
- * workbook.
- */
- private String version;
-
- /*
- * Date and time in UTC of the last modification that was made to this private workbook definition.
- */
- private String timeModified;
-
- /*
- * Workbook category, as defined by the user at creation time.
- */
- private String category;
-
- /*
- * A list of 0 or more tags that are associated with this private workbook definition
- */
- private List tags;
-
- /*
- * Unique user id of the specific user that owns this private workbook.
- */
- private String userId;
-
- /*
- * Optional resourceId for a source resource.
- */
- private String sourceId;
-
- /*
- * BYOS Storage Account URI
- */
- private String storageUri;
-
- /**
- * Creates an instance of MyWorkbookProperties class.
- */
- public MyWorkbookProperties() {
- }
-
- /**
- * Get the displayName property: The user-defined name of the private workbook.
- *
- * @return the displayName value.
- */
- public String displayName() {
- return this.displayName;
- }
-
- /**
- * Set the displayName property: The user-defined name of the private workbook.
- *
- * @param displayName the displayName value to set.
- * @return the MyWorkbookProperties object itself.
- */
- public MyWorkbookProperties withDisplayName(String displayName) {
- this.displayName = displayName;
- return this;
- }
-
- /**
- * Get the serializedData property: Configuration of this particular private workbook. Configuration data is a
- * string containing valid JSON.
- *
- * @return the serializedData value.
- */
- public String serializedData() {
- return this.serializedData;
- }
-
- /**
- * Set the serializedData property: Configuration of this particular private workbook. Configuration data is a
- * string containing valid JSON.
- *
- * @param serializedData the serializedData value to set.
- * @return the MyWorkbookProperties object itself.
- */
- public MyWorkbookProperties withSerializedData(String serializedData) {
- this.serializedData = serializedData;
- return this;
- }
-
- /**
- * Get the version property: This instance's version of the data model. This can change as new features are added
- * that can be marked private workbook.
- *
- * @return the version value.
- */
- public String version() {
- return this.version;
- }
-
- /**
- * Set the version property: This instance's version of the data model. This can change as new features are added
- * that can be marked private workbook.
- *
- * @param version the version value to set.
- * @return the MyWorkbookProperties object itself.
- */
- public MyWorkbookProperties withVersion(String version) {
- this.version = version;
- return this;
- }
-
- /**
- * Get the timeModified property: Date and time in UTC of the last modification that was made to this private
- * workbook definition.
- *
- * @return the timeModified value.
- */
- public String timeModified() {
- return this.timeModified;
- }
-
- /**
- * Get the category property: Workbook category, as defined by the user at creation time.
- *
- * @return the category value.
- */
- public String category() {
- return this.category;
- }
-
- /**
- * Set the category property: Workbook category, as defined by the user at creation time.
- *
- * @param category the category value to set.
- * @return the MyWorkbookProperties object itself.
- */
- public MyWorkbookProperties withCategory(String category) {
- this.category = category;
- return this;
- }
-
- /**
- * Get the tags property: A list of 0 or more tags that are associated with this private workbook definition.
- *
- * @return the tags value.
- */
- public List tags() {
- return this.tags;
- }
-
- /**
- * Set the tags property: A list of 0 or more tags that are associated with this private workbook definition.
- *
- * @param tags the tags value to set.
- * @return the MyWorkbookProperties object itself.
- */
- public MyWorkbookProperties withTags(List tags) {
- this.tags = tags;
- return this;
- }
-
- /**
- * Get the userId property: Unique user id of the specific user that owns this private workbook.
- *
- * @return the userId value.
- */
- public String userId() {
- return this.userId;
- }
-
- /**
- * Get the sourceId property: Optional resourceId for a source resource.
- *
- * @return the sourceId value.
- */
- public String sourceId() {
- return this.sourceId;
- }
-
- /**
- * Set the sourceId property: Optional resourceId for a source resource.
- *
- * @param sourceId the sourceId value to set.
- * @return the MyWorkbookProperties object itself.
- */
- public MyWorkbookProperties withSourceId(String sourceId) {
- this.sourceId = sourceId;
- return this;
- }
-
- /**
- * Get the storageUri property: BYOS Storage Account URI.
- *
- * @return the storageUri value.
- */
- public String storageUri() {
- return this.storageUri;
- }
-
- /**
- * Set the storageUri property: BYOS Storage Account URI.
- *
- * @param storageUri the storageUri value to set.
- * @return the MyWorkbookProperties object itself.
- */
- public MyWorkbookProperties withStorageUri(String storageUri) {
- this.storageUri = storageUri;
- return this;
- }
-
- /**
- * Validates the instance.
- *
- * @throws IllegalArgumentException thrown if the instance is not valid.
- */
- public void validate() {
- if (displayName() == null) {
- throw LOGGER.atError()
- .log(new IllegalArgumentException(
- "Missing required property displayName in model MyWorkbookProperties"));
- }
- if (serializedData() == null) {
- throw LOGGER.atError()
- .log(new IllegalArgumentException(
- "Missing required property serializedData in model MyWorkbookProperties"));
- }
- if (category() == null) {
- throw LOGGER.atError()
- .log(new IllegalArgumentException("Missing required property category in model MyWorkbookProperties"));
- }
- }
-
- private static final ClientLogger LOGGER = new ClientLogger(MyWorkbookProperties.class);
-
- /**
- * {@inheritDoc}
- */
- @Override
- public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
- jsonWriter.writeStartObject();
- jsonWriter.writeStringField("displayName", this.displayName);
- jsonWriter.writeStringField("serializedData", this.serializedData);
- jsonWriter.writeStringField("category", this.category);
- jsonWriter.writeStringField("version", this.version);
- jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeString(element));
- jsonWriter.writeStringField("sourceId", this.sourceId);
- jsonWriter.writeStringField("storageUri", this.storageUri);
- return jsonWriter.writeEndObject();
- }
-
- /**
- * Reads an instance of MyWorkbookProperties from the JsonReader.
- *
- * @param jsonReader The JsonReader being read.
- * @return An instance of MyWorkbookProperties if the JsonReader was pointing to an instance of it, or null if it
- * was pointing to JSON null.
- * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
- * @throws IOException If an error occurs while reading the MyWorkbookProperties.
- */
- public static MyWorkbookProperties fromJson(JsonReader jsonReader) throws IOException {
- return jsonReader.readObject(reader -> {
- MyWorkbookProperties deserializedMyWorkbookProperties = new MyWorkbookProperties();
- while (reader.nextToken() != JsonToken.END_OBJECT) {
- String fieldName = reader.getFieldName();
- reader.nextToken();
-
- if ("displayName".equals(fieldName)) {
- deserializedMyWorkbookProperties.displayName = reader.getString();
- } else if ("serializedData".equals(fieldName)) {
- deserializedMyWorkbookProperties.serializedData = reader.getString();
- } else if ("category".equals(fieldName)) {
- deserializedMyWorkbookProperties.category = reader.getString();
- } else if ("version".equals(fieldName)) {
- deserializedMyWorkbookProperties.version = reader.getString();
- } else if ("timeModified".equals(fieldName)) {
- deserializedMyWorkbookProperties.timeModified = reader.getString();
- } else if ("tags".equals(fieldName)) {
- List tags = reader.readArray(reader1 -> reader1.getString());
- deserializedMyWorkbookProperties.tags = tags;
- } else if ("userId".equals(fieldName)) {
- deserializedMyWorkbookProperties.userId = reader.getString();
- } else if ("sourceId".equals(fieldName)) {
- deserializedMyWorkbookProperties.sourceId = reader.getString();
- } else if ("storageUri".equals(fieldName)) {
- deserializedMyWorkbookProperties.storageUri = reader.getString();
- } else {
- reader.skipChildren();
- }
- }
-
- return deserializedMyWorkbookProperties;
- });
- }
-}
diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ApplicationInsightsManagementClientImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ApplicationInsightsManagementClientImpl.java
index e6a761bfc326..1dbd4e2df68e 100644
--- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ApplicationInsightsManagementClientImpl.java
+++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ApplicationInsightsManagementClientImpl.java
@@ -30,12 +30,13 @@
import com.azure.resourcemanager.applicationinsights.fluent.ComponentAvailableFeaturesClient;
import com.azure.resourcemanager.applicationinsights.fluent.ComponentCurrentBillingFeaturesClient;
import com.azure.resourcemanager.applicationinsights.fluent.ComponentFeatureCapabilitiesClient;
+import com.azure.resourcemanager.applicationinsights.fluent.ComponentLinkedStorageAccountsOperationsClient;
import com.azure.resourcemanager.applicationinsights.fluent.ComponentQuotaStatusClient;
import com.azure.resourcemanager.applicationinsights.fluent.ComponentsClient;
+import com.azure.resourcemanager.applicationinsights.fluent.DeletedWorkbooksClient;
import com.azure.resourcemanager.applicationinsights.fluent.ExportConfigurationsClient;
import com.azure.resourcemanager.applicationinsights.fluent.FavoritesClient;
import com.azure.resourcemanager.applicationinsights.fluent.LiveTokensClient;
-import com.azure.resourcemanager.applicationinsights.fluent.MyWorkbooksClient;
import com.azure.resourcemanager.applicationinsights.fluent.OperationsClient;
import com.azure.resourcemanager.applicationinsights.fluent.ProactiveDetectionConfigurationsClient;
import com.azure.resourcemanager.applicationinsights.fluent.WebTestLocationsClient;
@@ -351,20 +352,6 @@ public WorkbookTemplatesClient getWorkbookTemplates() {
return this.workbookTemplates;
}
- /**
- * The MyWorkbooksClient object to access its operations.
- */
- private final MyWorkbooksClient myWorkbooks;
-
- /**
- * Gets the MyWorkbooksClient object to access its operations.
- *
- * @return the MyWorkbooksClient object.
- */
- public MyWorkbooksClient getMyWorkbooks() {
- return this.myWorkbooks;
- }
-
/**
* The WorkbooksClient object to access its operations.
*/
@@ -393,6 +380,34 @@ public LiveTokensClient getLiveTokens() {
return this.liveTokens;
}
+ /**
+ * The ComponentLinkedStorageAccountsOperationsClient object to access its operations.
+ */
+ private final ComponentLinkedStorageAccountsOperationsClient componentLinkedStorageAccountsOperations;
+
+ /**
+ * Gets the ComponentLinkedStorageAccountsOperationsClient object to access its operations.
+ *
+ * @return the ComponentLinkedStorageAccountsOperationsClient object.
+ */
+ public ComponentLinkedStorageAccountsOperationsClient getComponentLinkedStorageAccountsOperations() {
+ return this.componentLinkedStorageAccountsOperations;
+ }
+
+ /**
+ * The DeletedWorkbooksClient object to access its operations.
+ */
+ private final DeletedWorkbooksClient deletedWorkbooks;
+
+ /**
+ * Gets the DeletedWorkbooksClient object to access its operations.
+ *
+ * @return the DeletedWorkbooksClient object.
+ */
+ public DeletedWorkbooksClient getDeletedWorkbooks() {
+ return this.deletedWorkbooks;
+ }
+
/**
* Initializes an instance of ApplicationInsightsManagementClient client.
*
@@ -426,9 +441,10 @@ public LiveTokensClient getLiveTokens() {
this.analyticsItems = new AnalyticsItemsClientImpl(this);
this.operations = new OperationsClientImpl(this);
this.workbookTemplates = new WorkbookTemplatesClientImpl(this);
- this.myWorkbooks = new MyWorkbooksClientImpl(this);
this.workbooks = new WorkbooksClientImpl(this);
this.liveTokens = new LiveTokensClientImpl(this);
+ this.componentLinkedStorageAccountsOperations = new ComponentLinkedStorageAccountsOperationsClientImpl(this);
+ this.deletedWorkbooks = new DeletedWorkbooksClientImpl(this);
}
/**
diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ComponentLinkedStorageAccountsImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ComponentLinkedStorageAccountsImpl.java
new file mode 100644
index 000000000000..0cc408da97b9
--- /dev/null
+++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ComponentLinkedStorageAccountsImpl.java
@@ -0,0 +1,146 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.applicationinsights.implementation;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.applicationinsights.fluent.models.ComponentLinkedStorageAccountsInner;
+import com.azure.resourcemanager.applicationinsights.models.ComponentLinkedStorageAccounts;
+import com.azure.resourcemanager.applicationinsights.models.ComponentLinkedStorageAccountsPatch;
+import com.azure.resourcemanager.applicationinsights.models.StorageType;
+
+public final class ComponentLinkedStorageAccountsImpl implements ComponentLinkedStorageAccounts,
+ ComponentLinkedStorageAccounts.Definition, ComponentLinkedStorageAccounts.Update {
+ private ComponentLinkedStorageAccountsInner innerObject;
+
+ private final com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager serviceManager;
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public String linkedStorageAccount() {
+ return this.innerModel().linkedStorageAccount();
+ }
+
+ public String resourceGroupName() {
+ return resourceGroupName;
+ }
+
+ public ComponentLinkedStorageAccountsInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String resourceName;
+
+ private StorageType storageType;
+
+ private ComponentLinkedStorageAccountsPatch updateLinkedStorageAccountsProperties;
+
+ public ComponentLinkedStorageAccountsImpl withExistingComponent(String resourceGroupName, String resourceName) {
+ this.resourceGroupName = resourceGroupName;
+ this.resourceName = resourceName;
+ return this;
+ }
+
+ public ComponentLinkedStorageAccounts create() {
+ this.innerObject = serviceManager.serviceClient()
+ .getComponentLinkedStorageAccountsOperations()
+ .createAndUpdateWithResponse(resourceGroupName, resourceName, storageType, this.innerModel(), Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public ComponentLinkedStorageAccounts create(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getComponentLinkedStorageAccountsOperations()
+ .createAndUpdateWithResponse(resourceGroupName, resourceName, storageType, this.innerModel(), context)
+ .getValue();
+ return this;
+ }
+
+ ComponentLinkedStorageAccountsImpl(StorageType name,
+ com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager serviceManager) {
+ this.innerObject = new ComponentLinkedStorageAccountsInner();
+ this.serviceManager = serviceManager;
+ this.storageType = name;
+ }
+
+ public ComponentLinkedStorageAccountsImpl update() {
+ this.updateLinkedStorageAccountsProperties = new ComponentLinkedStorageAccountsPatch();
+ return this;
+ }
+
+ public ComponentLinkedStorageAccounts apply() {
+ this.innerObject = serviceManager.serviceClient()
+ .getComponentLinkedStorageAccountsOperations()
+ .updateWithResponse(resourceGroupName, resourceName, storageType, updateLinkedStorageAccountsProperties,
+ Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public ComponentLinkedStorageAccounts apply(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getComponentLinkedStorageAccountsOperations()
+ .updateWithResponse(resourceGroupName, resourceName, storageType, updateLinkedStorageAccountsProperties,
+ context)
+ .getValue();
+ return this;
+ }
+
+ ComponentLinkedStorageAccountsImpl(ComponentLinkedStorageAccountsInner innerObject,
+ com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups");
+ this.resourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "components");
+ this.storageType = StorageType
+ .fromString(ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "linkedStorageAccounts"));
+ }
+
+ public ComponentLinkedStorageAccounts refresh() {
+ this.innerObject = serviceManager.serviceClient()
+ .getComponentLinkedStorageAccountsOperations()
+ .getWithResponse(resourceGroupName, resourceName, storageType, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public ComponentLinkedStorageAccounts refresh(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getComponentLinkedStorageAccountsOperations()
+ .getWithResponse(resourceGroupName, resourceName, storageType, context)
+ .getValue();
+ return this;
+ }
+
+ public ComponentLinkedStorageAccountsImpl withLinkedStorageAccount(String linkedStorageAccount) {
+ if (isInCreateMode()) {
+ this.innerModel().withLinkedStorageAccount(linkedStorageAccount);
+ return this;
+ } else {
+ this.updateLinkedStorageAccountsProperties.withLinkedStorageAccount(linkedStorageAccount);
+ return this;
+ }
+ }
+
+ private boolean isInCreateMode() {
+ return this.innerModel().id() == null;
+ }
+}
diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ComponentLinkedStorageAccountsOperationsClientImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ComponentLinkedStorageAccountsOperationsClientImpl.java
new file mode 100644
index 000000000000..9149b7318810
--- /dev/null
+++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ComponentLinkedStorageAccountsOperationsClientImpl.java
@@ -0,0 +1,701 @@
+// 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.implementation;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.Delete;
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.Patch;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.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.applicationinsights.fluent.ComponentLinkedStorageAccountsOperationsClient;
+import com.azure.resourcemanager.applicationinsights.fluent.models.ComponentLinkedStorageAccountsInner;
+import com.azure.resourcemanager.applicationinsights.models.ComponentLinkedStorageAccountsPatch;
+import com.azure.resourcemanager.applicationinsights.models.StorageType;
+import reactor.core.publisher.Mono;
+
+/**
+ * An instance of this class provides access to all the operations defined in
+ * ComponentLinkedStorageAccountsOperationsClient.
+ */
+public final class ComponentLinkedStorageAccountsOperationsClientImpl
+ implements ComponentLinkedStorageAccountsOperationsClient {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final ComponentLinkedStorageAccountsOperationsService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final ApplicationInsightsManagementClientImpl client;
+
+ /**
+ * Initializes an instance of ComponentLinkedStorageAccountsOperationsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ ComponentLinkedStorageAccountsOperationsClientImpl(ApplicationInsightsManagementClientImpl client) {
+ this.service = RestProxy.create(ComponentLinkedStorageAccountsOperationsService.class, client.getHttpPipeline(),
+ client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for
+ * ApplicationInsightsManagementClientComponentLinkedStorageAccountsOperations to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "ApplicationInsightsM")
+ public interface ComponentLinkedStorageAccountsOperationsService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> get(@HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceName") String resourceName,
+ @PathParam("storageType") StorageType storageType, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> createAndUpdate(@HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceName") String resourceName,
+ @PathParam("storageType") StorageType storageType,
+ @BodyParam("application/json") ComponentLinkedStorageAccountsInner linkedStorageAccountsProperties,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> update(@HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceName") String resourceName,
+ @PathParam("storageType") StorageType storageType,
+ @BodyParam("application/json") ComponentLinkedStorageAccountsPatch linkedStorageAccountsProperties,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}")
+ @ExpectedResponses({ 200, 204 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> delete(@HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceName") String resourceName,
+ @PathParam("storageType") StorageType storageType, @HeaderParam("Accept") String accept, Context context);
+ }
+
+ /**
+ * Returns the current linked storage settings for an Application Insights component.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param resourceName The name of the Application Insights component resource.
+ * @param storageType The type of the Application Insights component data source for the linked storage account.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Application Insights component linked storage accounts along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(String resourceGroupName,
+ String resourceName, StorageType storageType) {
+ 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 (resourceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
+ }
+ if (storageType == null) {
+ return Mono.error(new IllegalArgumentException("Parameter storageType is required and cannot be null."));
+ }
+ final String apiVersion = "2020-03-01-preview";
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, apiVersion,
+ this.client.getSubscriptionId(), resourceName, storageType, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Returns the current linked storage settings for an Application Insights component.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param resourceName The name of the Application Insights component resource.
+ * @param storageType The type of the Application Insights component data source for the linked storage account.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Application Insights component linked storage accounts along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(String resourceGroupName,
+ String resourceName, StorageType storageType, 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 (resourceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
+ }
+ if (storageType == null) {
+ return Mono.error(new IllegalArgumentException("Parameter storageType is required and cannot be null."));
+ }
+ final String apiVersion = "2020-03-01-preview";
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.get(this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(),
+ resourceName, storageType, accept, context);
+ }
+
+ /**
+ * Returns the current linked storage settings for an Application Insights component.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param resourceName The name of the Application Insights component resource.
+ * @param storageType The type of the Application Insights component data source for the linked storage account.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Application Insights component linked storage accounts on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getAsync(String resourceGroupName, String resourceName,
+ StorageType storageType) {
+ return getWithResponseAsync(resourceGroupName, resourceName, storageType)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Returns the current linked storage settings for an Application Insights component.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param resourceName The name of the Application Insights component resource.
+ * @param storageType The type of the Application Insights component data source for the linked storage account.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Application Insights component linked storage accounts along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getWithResponse(String resourceGroupName, String resourceName,
+ StorageType storageType, Context context) {
+ return getWithResponseAsync(resourceGroupName, resourceName, storageType, context).block();
+ }
+
+ /**
+ * Returns the current linked storage settings for an Application Insights component.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param resourceName The name of the Application Insights component resource.
+ * @param storageType The type of the Application Insights component data source for the linked storage account.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Application Insights component linked storage accounts.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ComponentLinkedStorageAccountsInner get(String resourceGroupName, String resourceName,
+ StorageType storageType) {
+ return getWithResponse(resourceGroupName, resourceName, storageType, Context.NONE).getValue();
+ }
+
+ /**
+ * Replace current linked storage account for an Application Insights component.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param resourceName The name of the Application Insights component resource.
+ * @param storageType The type of the Application Insights component data source for the linked storage account.
+ * @param linkedStorageAccountsProperties Properties that need to be specified to update linked storage accounts for
+ * an Application Insights component.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Application Insights component linked storage accounts along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> createAndUpdateWithResponseAsync(
+ String resourceGroupName, String resourceName, StorageType storageType,
+ ComponentLinkedStorageAccountsInner linkedStorageAccountsProperties) {
+ 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 (resourceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
+ }
+ if (storageType == null) {
+ return Mono.error(new IllegalArgumentException("Parameter storageType is required and cannot be null."));
+ }
+ if (linkedStorageAccountsProperties == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter linkedStorageAccountsProperties is required and cannot be null."));
+ } else {
+ linkedStorageAccountsProperties.validate();
+ }
+ final String apiVersion = "2020-03-01-preview";
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.createAndUpdate(this.client.getEndpoint(), resourceGroupName, apiVersion,
+ this.client.getSubscriptionId(), resourceName, storageType, linkedStorageAccountsProperties, accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Replace current linked storage account for an Application Insights component.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param resourceName The name of the Application Insights component resource.
+ * @param storageType The type of the Application Insights component data source for the linked storage account.
+ * @param linkedStorageAccountsProperties Properties that need to be specified to update linked storage accounts for
+ * an Application Insights component.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Application Insights component linked storage accounts along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> createAndUpdateWithResponseAsync(
+ String resourceGroupName, String resourceName, StorageType storageType,
+ ComponentLinkedStorageAccountsInner linkedStorageAccountsProperties, 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 (resourceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
+ }
+ if (storageType == null) {
+ return Mono.error(new IllegalArgumentException("Parameter storageType is required and cannot be null."));
+ }
+ if (linkedStorageAccountsProperties == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter linkedStorageAccountsProperties is required and cannot be null."));
+ } else {
+ linkedStorageAccountsProperties.validate();
+ }
+ final String apiVersion = "2020-03-01-preview";
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.createAndUpdate(this.client.getEndpoint(), resourceGroupName, apiVersion,
+ this.client.getSubscriptionId(), resourceName, storageType, linkedStorageAccountsProperties, accept,
+ context);
+ }
+
+ /**
+ * Replace current linked storage account for an Application Insights component.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param resourceName The name of the Application Insights component resource.
+ * @param storageType The type of the Application Insights component data source for the linked storage account.
+ * @param linkedStorageAccountsProperties Properties that need to be specified to update linked storage accounts for
+ * an Application Insights component.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Application Insights component linked storage accounts on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createAndUpdateAsync(String resourceGroupName,
+ String resourceName, StorageType storageType,
+ ComponentLinkedStorageAccountsInner linkedStorageAccountsProperties) {
+ return createAndUpdateWithResponseAsync(resourceGroupName, resourceName, storageType,
+ linkedStorageAccountsProperties).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Replace current linked storage account for an Application Insights component.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param resourceName The name of the Application Insights component resource.
+ * @param storageType The type of the Application Insights component data source for the linked storage account.
+ * @param linkedStorageAccountsProperties Properties that need to be specified to update linked storage accounts for
+ * an Application Insights component.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Application Insights component linked storage accounts along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response createAndUpdateWithResponse(String resourceGroupName,
+ String resourceName, StorageType storageType,
+ ComponentLinkedStorageAccountsInner linkedStorageAccountsProperties, Context context) {
+ return createAndUpdateWithResponseAsync(resourceGroupName, resourceName, storageType,
+ linkedStorageAccountsProperties, context).block();
+ }
+
+ /**
+ * Replace current linked storage account for an Application Insights component.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param resourceName The name of the Application Insights component resource.
+ * @param storageType The type of the Application Insights component data source for the linked storage account.
+ * @param linkedStorageAccountsProperties Properties that need to be specified to update linked storage accounts for
+ * an Application Insights component.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Application Insights component linked storage accounts.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ComponentLinkedStorageAccountsInner createAndUpdate(String resourceGroupName, String resourceName,
+ StorageType storageType, ComponentLinkedStorageAccountsInner linkedStorageAccountsProperties) {
+ return createAndUpdateWithResponse(resourceGroupName, resourceName, storageType,
+ linkedStorageAccountsProperties, Context.NONE).getValue();
+ }
+
+ /**
+ * Update linked storage accounts for an Application Insights component.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param resourceName The name of the Application Insights component resource.
+ * @param storageType The type of the Application Insights component data source for the linked storage account.
+ * @param linkedStorageAccountsProperties Properties that need to be specified to update a linked storage accounts
+ * for an Application Insights component.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Application Insights component linked storage accounts along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> updateWithResponseAsync(String resourceGroupName,
+ String resourceName, StorageType storageType,
+ ComponentLinkedStorageAccountsPatch linkedStorageAccountsProperties) {
+ 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 (resourceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
+ }
+ if (storageType == null) {
+ return Mono.error(new IllegalArgumentException("Parameter storageType is required and cannot be null."));
+ }
+ if (linkedStorageAccountsProperties == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter linkedStorageAccountsProperties is required and cannot be null."));
+ } else {
+ linkedStorageAccountsProperties.validate();
+ }
+ final String apiVersion = "2020-03-01-preview";
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, apiVersion,
+ this.client.getSubscriptionId(), resourceName, storageType, linkedStorageAccountsProperties, accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Update linked storage accounts for an Application Insights component.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param resourceName The name of the Application Insights component resource.
+ * @param storageType The type of the Application Insights component data source for the linked storage account.
+ * @param linkedStorageAccountsProperties Properties that need to be specified to update a linked storage accounts
+ * for an Application Insights component.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Application Insights component linked storage accounts along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> updateWithResponseAsync(String resourceGroupName,
+ String resourceName, StorageType storageType,
+ ComponentLinkedStorageAccountsPatch linkedStorageAccountsProperties, 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 (resourceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
+ }
+ if (storageType == null) {
+ return Mono.error(new IllegalArgumentException("Parameter storageType is required and cannot be null."));
+ }
+ if (linkedStorageAccountsProperties == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter linkedStorageAccountsProperties is required and cannot be null."));
+ } else {
+ linkedStorageAccountsProperties.validate();
+ }
+ final String apiVersion = "2020-03-01-preview";
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.update(this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(),
+ resourceName, storageType, linkedStorageAccountsProperties, accept, context);
+ }
+
+ /**
+ * Update linked storage accounts for an Application Insights component.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param resourceName The name of the Application Insights component resource.
+ * @param storageType The type of the Application Insights component data source for the linked storage account.
+ * @param linkedStorageAccountsProperties Properties that need to be specified to update a linked storage accounts
+ * for an Application Insights component.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Application Insights component linked storage accounts on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(String resourceGroupName, String resourceName,
+ StorageType storageType, ComponentLinkedStorageAccountsPatch linkedStorageAccountsProperties) {
+ return updateWithResponseAsync(resourceGroupName, resourceName, storageType, linkedStorageAccountsProperties)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Update linked storage accounts for an Application Insights component.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param resourceName The name of the Application Insights component resource.
+ * @param storageType The type of the Application Insights component data source for the linked storage account.
+ * @param linkedStorageAccountsProperties Properties that need to be specified to update a linked storage accounts
+ * for an Application Insights component.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Application Insights component linked storage accounts along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response updateWithResponse(String resourceGroupName,
+ String resourceName, StorageType storageType,
+ ComponentLinkedStorageAccountsPatch linkedStorageAccountsProperties, Context context) {
+ return updateWithResponseAsync(resourceGroupName, resourceName, storageType, linkedStorageAccountsProperties,
+ context).block();
+ }
+
+ /**
+ * Update linked storage accounts for an Application Insights component.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param resourceName The name of the Application Insights component resource.
+ * @param storageType The type of the Application Insights component data source for the linked storage account.
+ * @param linkedStorageAccountsProperties Properties that need to be specified to update a linked storage accounts
+ * for an Application Insights component.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Application Insights component linked storage accounts.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ComponentLinkedStorageAccountsInner update(String resourceGroupName, String resourceName,
+ StorageType storageType, ComponentLinkedStorageAccountsPatch linkedStorageAccountsProperties) {
+ return updateWithResponse(resourceGroupName, resourceName, storageType, linkedStorageAccountsProperties,
+ Context.NONE).getValue();
+ }
+
+ /**
+ * Delete linked storage accounts for an Application Insights component.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param resourceName The name of the Application Insights component resource.
+ * @param storageType The type of the Application Insights component data source for the linked storage account.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> deleteWithResponseAsync(String resourceGroupName, String resourceName,
+ StorageType storageType) {
+ 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 (resourceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
+ }
+ if (storageType == null) {
+ return Mono.error(new IllegalArgumentException("Parameter storageType is required and cannot be null."));
+ }
+ final String apiVersion = "2020-03-01-preview";
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, apiVersion,
+ this.client.getSubscriptionId(), resourceName, storageType, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Delete linked storage accounts for an Application Insights component.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param resourceName The name of the Application Insights component resource.
+ * @param storageType The type of the Application Insights component data source for the linked storage account.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> deleteWithResponseAsync(String resourceGroupName, String resourceName,
+ StorageType storageType, 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 (resourceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
+ }
+ if (storageType == null) {
+ return Mono.error(new IllegalArgumentException("Parameter storageType is required and cannot be null."));
+ }
+ final String apiVersion = "2020-03-01-preview";
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.delete(this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(),
+ resourceName, storageType, accept, context);
+ }
+
+ /**
+ * Delete linked storage accounts for an Application Insights component.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param resourceName The name of the Application Insights component resource.
+ * @param storageType The type of the Application Insights component data source for the linked storage account.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String resourceName, StorageType storageType) {
+ return deleteWithResponseAsync(resourceGroupName, resourceName, storageType).flatMap(ignored -> Mono.empty());
+ }
+
+ /**
+ * Delete linked storage accounts for an Application Insights component.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param resourceName The name of the Application Insights component resource.
+ * @param storageType The type of the Application Insights component data source for the linked storage account.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response deleteWithResponse(String resourceGroupName, String resourceName, StorageType storageType,
+ Context context) {
+ return deleteWithResponseAsync(resourceGroupName, resourceName, storageType, context).block();
+ }
+
+ /**
+ * Delete linked storage accounts for an Application Insights component.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param resourceName The name of the Application Insights component resource.
+ * @param storageType The type of the Application Insights component data source for the linked storage account.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void delete(String resourceGroupName, String resourceName, StorageType storageType) {
+ deleteWithResponse(resourceGroupName, resourceName, storageType, Context.NONE);
+ }
+}
diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ComponentLinkedStorageAccountsOperationsImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ComponentLinkedStorageAccountsOperationsImpl.java
new file mode 100644
index 000000000000..5ea29b91b337
--- /dev/null
+++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ComponentLinkedStorageAccountsOperationsImpl.java
@@ -0,0 +1,152 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.applicationinsights.implementation;
+
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.SimpleResponse;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.applicationinsights.fluent.ComponentLinkedStorageAccountsOperationsClient;
+import com.azure.resourcemanager.applicationinsights.fluent.models.ComponentLinkedStorageAccountsInner;
+import com.azure.resourcemanager.applicationinsights.models.ComponentLinkedStorageAccounts;
+import com.azure.resourcemanager.applicationinsights.models.ComponentLinkedStorageAccountsOperations;
+import com.azure.resourcemanager.applicationinsights.models.StorageType;
+
+public final class ComponentLinkedStorageAccountsOperationsImpl implements ComponentLinkedStorageAccountsOperations {
+ private static final ClientLogger LOGGER = new ClientLogger(ComponentLinkedStorageAccountsOperationsImpl.class);
+
+ private final ComponentLinkedStorageAccountsOperationsClient innerClient;
+
+ private final com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager serviceManager;
+
+ public ComponentLinkedStorageAccountsOperationsImpl(ComponentLinkedStorageAccountsOperationsClient innerClient,
+ com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public Response getWithResponse(String resourceGroupName, String resourceName,
+ StorageType storageType, Context context) {
+ Response inner
+ = this.serviceClient().getWithResponse(resourceGroupName, resourceName, storageType, context);
+ if (inner != null) {
+ return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
+ new ComponentLinkedStorageAccountsImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public ComponentLinkedStorageAccounts get(String resourceGroupName, String resourceName, StorageType storageType) {
+ ComponentLinkedStorageAccountsInner inner
+ = this.serviceClient().get(resourceGroupName, resourceName, storageType);
+ if (inner != null) {
+ return new ComponentLinkedStorageAccountsImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Response deleteWithResponse(String resourceGroupName, String resourceName, StorageType storageType,
+ Context context) {
+ return this.serviceClient().deleteWithResponse(resourceGroupName, resourceName, storageType, context);
+ }
+
+ public void delete(String resourceGroupName, String resourceName, StorageType storageType) {
+ this.serviceClient().delete(resourceGroupName, resourceName, storageType);
+ }
+
+ public ComponentLinkedStorageAccounts getById(String id) {
+ String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "components");
+ if (resourceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id)));
+ }
+ String storageTypeLocal = ResourceManagerUtils.getValueFromIdByName(id, "linkedStorageAccounts");
+ if (storageTypeLocal == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'linkedStorageAccounts'.", id)));
+ }
+ StorageType storageType = StorageType.fromString(storageTypeLocal);
+ return this.getWithResponse(resourceGroupName, resourceName, storageType, Context.NONE).getValue();
+ }
+
+ public Response getByIdWithResponse(String id, Context context) {
+ String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "components");
+ if (resourceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id)));
+ }
+ String storageTypeLocal = ResourceManagerUtils.getValueFromIdByName(id, "linkedStorageAccounts");
+ if (storageTypeLocal == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'linkedStorageAccounts'.", id)));
+ }
+ StorageType storageType = StorageType.fromString(storageTypeLocal);
+ return this.getWithResponse(resourceGroupName, resourceName, storageType, context);
+ }
+
+ public void deleteById(String id) {
+ String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "components");
+ if (resourceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id)));
+ }
+ String storageTypeLocal = ResourceManagerUtils.getValueFromIdByName(id, "linkedStorageAccounts");
+ if (storageTypeLocal == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'linkedStorageAccounts'.", id)));
+ }
+ StorageType storageType = StorageType.fromString(storageTypeLocal);
+ this.deleteWithResponse(resourceGroupName, resourceName, storageType, Context.NONE);
+ }
+
+ public Response deleteByIdWithResponse(String id, Context context) {
+ String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "components");
+ if (resourceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id)));
+ }
+ String storageTypeLocal = ResourceManagerUtils.getValueFromIdByName(id, "linkedStorageAccounts");
+ if (storageTypeLocal == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'linkedStorageAccounts'.", id)));
+ }
+ StorageType storageType = StorageType.fromString(storageTypeLocal);
+ return this.deleteWithResponse(resourceGroupName, resourceName, storageType, context);
+ }
+
+ private ComponentLinkedStorageAccountsOperationsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager() {
+ return this.serviceManager;
+ }
+
+ public ComponentLinkedStorageAccountsImpl define(StorageType name) {
+ return new ComponentLinkedStorageAccountsImpl(name, this.manager());
+ }
+}
diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/DeletedWorkbookImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/DeletedWorkbookImpl.java
new file mode 100644
index 000000000000..7edceb7de842
--- /dev/null
+++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/DeletedWorkbookImpl.java
@@ -0,0 +1,120 @@
+// 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.implementation;
+
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.applicationinsights.fluent.models.DeletedWorkbookInner;
+import com.azure.resourcemanager.applicationinsights.models.DeletedWorkbook;
+import com.azure.resourcemanager.applicationinsights.models.WorkbookSharedTypeKind;
+import java.time.OffsetDateTime;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+public final class DeletedWorkbookImpl implements DeletedWorkbook {
+ private DeletedWorkbookInner innerObject;
+
+ private final com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager serviceManager;
+
+ DeletedWorkbookImpl(DeletedWorkbookInner innerObject,
+ com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public String location() {
+ return this.innerModel().location();
+ }
+
+ public Map tags() {
+ Map inner = this.innerModel().tags();
+ if (inner != null) {
+ return Collections.unmodifiableMap(inner);
+ } else {
+ return Collections.emptyMap();
+ }
+ }
+
+ public WorkbookSharedTypeKind kind() {
+ return this.innerModel().kind();
+ }
+
+ public String etag() {
+ return this.innerModel().etag();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public String displayName() {
+ return this.innerModel().displayName();
+ }
+
+ public String serializedData() {
+ return this.innerModel().serializedData();
+ }
+
+ public String version() {
+ return this.innerModel().version();
+ }
+
+ public OffsetDateTime timeModified() {
+ return this.innerModel().timeModified();
+ }
+
+ public String category() {
+ return this.innerModel().category();
+ }
+
+ public List tagsPropertiesTags() {
+ List inner = this.innerModel().tagsPropertiesTags();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public String userId() {
+ return this.innerModel().userId();
+ }
+
+ public String sourceId() {
+ return this.innerModel().sourceId();
+ }
+
+ public String storageUri() {
+ return this.innerModel().storageUri();
+ }
+
+ public String description() {
+ return this.innerModel().description();
+ }
+
+ public String revision() {
+ return this.innerModel().revision();
+ }
+
+ public DeletedWorkbookInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/DeletedWorkbooksClientImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/DeletedWorkbooksClientImpl.java
new file mode 100644
index 000000000000..29a846f1c57d
--- /dev/null
+++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/DeletedWorkbooksClientImpl.java
@@ -0,0 +1,294 @@
+// 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.implementation;
+
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.resourcemanager.applicationinsights.fluent.DeletedWorkbooksClient;
+import com.azure.resourcemanager.applicationinsights.fluent.models.DeletedWorkbookInner;
+import com.azure.resourcemanager.applicationinsights.models.CategoryType;
+import com.azure.resourcemanager.applicationinsights.models.DeletedWorkbookErrorDefinitionException;
+import com.azure.resourcemanager.applicationinsights.models.DeletedWorkbooksListResult;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+import reactor.core.publisher.Mono;
+
+/**
+ * An instance of this class provides access to all the operations defined in DeletedWorkbooksClient.
+ */
+public final class DeletedWorkbooksClientImpl implements DeletedWorkbooksClient {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final DeletedWorkbooksService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final ApplicationInsightsManagementClientImpl client;
+
+ /**
+ * Initializes an instance of DeletedWorkbooksClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ DeletedWorkbooksClientImpl(ApplicationInsightsManagementClientImpl client) {
+ this.service
+ = RestProxy.create(DeletedWorkbooksService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for ApplicationInsightsManagementClientDeletedWorkbooks to be used by the
+ * proxy service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "ApplicationInsightsM")
+ public interface DeletedWorkbooksService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/deletedWorkbooks")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(DeletedWorkbookErrorDefinitionException.class)
+ Mono> list(@HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId, @QueryParam("category") CategoryType category,
+ @QueryParam("tags") String tags, @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(DeletedWorkbookErrorDefinitionException.class)
+ Mono> listBySubscriptionNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept, Context context);
+ }
+
+ /**
+ * Get all recently deleted Workbooks in a specified subscription.
+ *
+ * @param category Category of workbook to return.
+ * @param tags Tags presents on each workbook returned.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws DeletedWorkbookErrorDefinitionException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all recently deleted Workbooks in a specified subscription along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(CategoryType category, List tags) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String apiVersion = "2024-02-01-preview";
+ final String accept = "application/json";
+ String tagsConverted = (tags == null)
+ ? null
+ : tags.stream()
+ .map(paramItemValue -> Objects.toString(paramItemValue, ""))
+ .collect(Collectors.joining(","));
+ return FluxUtil
+ .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), category,
+ tagsConverted, apiVersion, accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(),
+ res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get all recently deleted Workbooks in a specified subscription.
+ *
+ * @param category Category of workbook to return.
+ * @param tags Tags presents on each workbook returned.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws DeletedWorkbookErrorDefinitionException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all recently deleted Workbooks in a specified subscription along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(CategoryType category, List tags,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String apiVersion = "2024-02-01-preview";
+ final String accept = "application/json";
+ String tagsConverted = (tags == null)
+ ? null
+ : tags.stream()
+ .map(paramItemValue -> Objects.toString(paramItemValue, ""))
+ .collect(Collectors.joining(","));
+ context = this.client.mergeContext(context);
+ return service
+ .list(this.client.getEndpoint(), this.client.getSubscriptionId(), category, tagsConverted, apiVersion,
+ accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+
+ /**
+ * Get all recently deleted Workbooks in a specified subscription.
+ *
+ * @param category Category of workbook to return.
+ * @param tags Tags presents on each workbook returned.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws DeletedWorkbookErrorDefinitionException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all recently deleted Workbooks in a specified subscription as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(CategoryType category, List tags) {
+ return new PagedFlux<>(() -> listSinglePageAsync(category, tags),
+ nextLink -> listBySubscriptionNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Get all recently deleted Workbooks in a specified subscription.
+ *
+ * @throws DeletedWorkbookErrorDefinitionException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all recently deleted Workbooks in a specified subscription as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ final CategoryType category = null;
+ final List tags = null;
+ return new PagedFlux<>(() -> listSinglePageAsync(category, tags),
+ nextLink -> listBySubscriptionNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Get all recently deleted Workbooks in a specified subscription.
+ *
+ * @param category Category of workbook to return.
+ * @param tags Tags presents on each workbook returned.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws DeletedWorkbookErrorDefinitionException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all recently deleted Workbooks in a specified subscription as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(CategoryType category, List tags, Context context) {
+ return new PagedFlux<>(() -> listSinglePageAsync(category, tags, context),
+ nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Get all recently deleted Workbooks in a specified subscription.
+ *
+ * @throws DeletedWorkbookErrorDefinitionException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all recently deleted Workbooks in a specified subscription as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ final CategoryType category = null;
+ final List tags = null;
+ return new PagedIterable<>(listAsync(category, tags));
+ }
+
+ /**
+ * Get all recently deleted Workbooks in a specified subscription.
+ *
+ * @param category Category of workbook to return.
+ * @param tags Tags presents on each workbook returned.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws DeletedWorkbookErrorDefinitionException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all recently deleted Workbooks in a specified subscription as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(CategoryType category, List tags, Context context) {
+ return new PagedIterable<>(listAsync(category, tags, context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws DeletedWorkbookErrorDefinitionException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return workbook list result along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(),
+ res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws DeletedWorkbookErrorDefinitionException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return workbook list result along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listBySubscriptionNextSinglePageAsync(String nextLink,
+ Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+}
diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/DeletedWorkbooksImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/DeletedWorkbooksImpl.java
new file mode 100644
index 000000000000..03f377018a6f
--- /dev/null
+++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/DeletedWorkbooksImpl.java
@@ -0,0 +1,47 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.applicationinsights.implementation;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.applicationinsights.fluent.DeletedWorkbooksClient;
+import com.azure.resourcemanager.applicationinsights.fluent.models.DeletedWorkbookInner;
+import com.azure.resourcemanager.applicationinsights.models.CategoryType;
+import com.azure.resourcemanager.applicationinsights.models.DeletedWorkbook;
+import com.azure.resourcemanager.applicationinsights.models.DeletedWorkbooks;
+import java.util.List;
+
+public final class DeletedWorkbooksImpl implements DeletedWorkbooks {
+ private static final ClientLogger LOGGER = new ClientLogger(DeletedWorkbooksImpl.class);
+
+ private final DeletedWorkbooksClient innerClient;
+
+ private final com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager serviceManager;
+
+ public DeletedWorkbooksImpl(DeletedWorkbooksClient innerClient,
+ com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new DeletedWorkbookImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(CategoryType category, List tags, Context context) {
+ PagedIterable inner = this.serviceClient().list(category, tags, context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new DeletedWorkbookImpl(inner1, this.manager()));
+ }
+
+ private DeletedWorkbooksClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/MyWorkbookImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/MyWorkbookImpl.java
deleted file mode 100644
index fec18f6e236a..000000000000
--- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/MyWorkbookImpl.java
+++ /dev/null
@@ -1,301 +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.implementation;
-
-import com.azure.core.management.Region;
-import com.azure.core.management.SystemData;
-import com.azure.core.util.Context;
-import com.azure.resourcemanager.applicationinsights.fluent.models.MyWorkbookInner;
-import com.azure.resourcemanager.applicationinsights.models.Kind;
-import com.azure.resourcemanager.applicationinsights.models.MyWorkbook;
-import com.azure.resourcemanager.applicationinsights.models.MyWorkbookManagedIdentity;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-public final class MyWorkbookImpl implements MyWorkbook, MyWorkbook.Definition, MyWorkbook.Update {
- private MyWorkbookInner innerObject;
-
- private final com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager serviceManager;
-
- public String location() {
- return this.innerModel().location();
- }
-
- public Map tags() {
- Map inner = this.innerModel().tags();
- if (inner != null) {
- return Collections.unmodifiableMap(inner);
- } else {
- return Collections.emptyMap();
- }
- }
-
- public MyWorkbookManagedIdentity identity() {
- return this.innerModel().identity();
- }
-
- public String id() {
- return this.innerModel().id();
- }
-
- public String name() {
- return this.innerModel().name();
- }
-
- public String type() {
- return this.innerModel().type();
- }
-
- public Map etag() {
- Map inner = this.innerModel().etag();
- if (inner != null) {
- return Collections.unmodifiableMap(inner);
- } else {
- return Collections.emptyMap();
- }
- }
-
- public Kind kind() {
- return this.innerModel().kind();
- }
-
- public SystemData systemData() {
- return this.innerModel().systemData();
- }
-
- public String displayName() {
- return this.innerModel().displayName();
- }
-
- public String serializedData() {
- return this.innerModel().serializedData();
- }
-
- public String version() {
- return this.innerModel().version();
- }
-
- public String timeModified() {
- return this.innerModel().timeModified();
- }
-
- public String category() {
- return this.innerModel().category();
- }
-
- public List tagsPropertiesTags() {
- List inner = this.innerModel().tagsPropertiesTags();
- if (inner != null) {
- return Collections.unmodifiableList(inner);
- } else {
- return Collections.emptyList();
- }
- }
-
- public String userId() {
- return this.innerModel().userId();
- }
-
- public String sourceId() {
- return this.innerModel().sourceId();
- }
-
- public String storageUri() {
- return this.innerModel().storageUri();
- }
-
- public Region region() {
- return Region.fromName(this.regionName());
- }
-
- public String regionName() {
- return this.location();
- }
-
- public String resourceGroupName() {
- return resourceGroupName;
- }
-
- public MyWorkbookInner innerModel() {
- return this.innerObject;
- }
-
- private com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager() {
- return this.serviceManager;
- }
-
- private String resourceGroupName;
-
- private String resourceName;
-
- private String createSourceId;
-
- private String updateSourceId;
-
- public MyWorkbookImpl withExistingResourceGroup(String resourceGroupName) {
- this.resourceGroupName = resourceGroupName;
- return this;
- }
-
- public MyWorkbook create() {
- this.innerObject = serviceManager.serviceClient()
- .getMyWorkbooks()
- .createOrUpdateWithResponse(resourceGroupName, resourceName, this.innerModel(), createSourceId,
- Context.NONE)
- .getValue();
- return this;
- }
-
- public MyWorkbook create(Context context) {
- this.innerObject = serviceManager.serviceClient()
- .getMyWorkbooks()
- .createOrUpdateWithResponse(resourceGroupName, resourceName, this.innerModel(), createSourceId, context)
- .getValue();
- return this;
- }
-
- MyWorkbookImpl(String name,
- com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager serviceManager) {
- this.innerObject = new MyWorkbookInner();
- this.serviceManager = serviceManager;
- this.resourceName = name;
- this.createSourceId = null;
- }
-
- public MyWorkbookImpl update() {
- this.updateSourceId = null;
- return this;
- }
-
- public MyWorkbook apply() {
- this.innerObject = serviceManager.serviceClient()
- .getMyWorkbooks()
- .updateWithResponse(resourceGroupName, resourceName, this.innerModel(), updateSourceId, Context.NONE)
- .getValue();
- return this;
- }
-
- public MyWorkbook apply(Context context) {
- this.innerObject = serviceManager.serviceClient()
- .getMyWorkbooks()
- .updateWithResponse(resourceGroupName, resourceName, this.innerModel(), updateSourceId, context)
- .getValue();
- return this;
- }
-
- MyWorkbookImpl(MyWorkbookInner innerObject,
- com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager serviceManager) {
- this.innerObject = innerObject;
- this.serviceManager = serviceManager;
- this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups");
- this.resourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "myWorkbooks");
- }
-
- public MyWorkbook refresh() {
- this.innerObject = serviceManager.serviceClient()
- .getMyWorkbooks()
- .getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE)
- .getValue();
- return this;
- }
-
- public MyWorkbook refresh(Context context) {
- this.innerObject = serviceManager.serviceClient()
- .getMyWorkbooks()
- .getByResourceGroupWithResponse(resourceGroupName, resourceName, context)
- .getValue();
- return this;
- }
-
- public MyWorkbookImpl withRegion(Region location) {
- this.innerModel().withLocation(location.toString());
- return this;
- }
-
- public MyWorkbookImpl withRegion(String location) {
- this.innerModel().withLocation(location);
- return this;
- }
-
- public MyWorkbookImpl withTags(Map tags) {
- this.innerModel().withTags(tags);
- return this;
- }
-
- public MyWorkbookImpl withIdentity(MyWorkbookManagedIdentity identity) {
- this.innerModel().withIdentity(identity);
- return this;
- }
-
- public MyWorkbookImpl withName(String name) {
- this.innerModel().withName(name);
- return this;
- }
-
- public MyWorkbookImpl withType(String type) {
- this.innerModel().withType(type);
- return this;
- }
-
- public MyWorkbookImpl withEtag(Map