Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import com.azure.ai.vision.imageanalysis.implementation.ImageAnalysisClientImpl;
import com.azure.ai.vision.imageanalysis.implementation.models.ImageUrl;
import com.azure.ai.vision.imageanalysis.models.ImageAnalysisOptions;
import com.azure.ai.vision.imageanalysis.models.ImageAnalysisResult;
import com.azure.ai.vision.imageanalysis.models.VisualFeatures;
import com.azure.core.annotation.Generated;
Expand All @@ -26,33 +27,9 @@
import java.util.Objects;
import java.util.stream.Collectors;
import reactor.core.publisher.Mono;
import com.azure.ai.vision.imageanalysis.models.ImageAnalysisOptions;

/**
* Initializes a new instance of the asynchronous ImageAnalysisClient type.
*
* <!-- src_embed com.azure.ai.vision.imageanalysis.async-client-api-key-auth -->
* <pre>
* &#47;&#47;
* &#47;&#47; Create an asynchronous Image Analysis client with API key authentication.
* &#47;&#47;
* ImageAnalysisAsyncClient client = new ImageAnalysisClientBuilder&#40;&#41;
* .endpoint&#40;endpoint&#41;
* .credential&#40;new KeyCredential&#40;key&#41;&#41;
* .buildAsyncClient&#40;&#41;;
* </pre>
* <!-- end com.azure.ai.vision.imageanalysis.async-client-api-key-auth -->
* <!-- src_embed com.azure.ai.vision.imageanalysis.async-client-entra-id-auth -->
* <pre>
* &#47;&#47;
* &#47;&#47; Create an asynchronous Image Analysis client with Entra ID authentication.
* &#47;&#47;
* ImageAnalysisAsyncClient client = new ImageAnalysisClientBuilder&#40;&#41;
* .endpoint&#40;endpoint&#41;
* .credential&#40;new DefaultAzureCredentialBuilder&#40;&#41;.build&#40;&#41;&#41;
* .buildAsyncClient&#40;&#41;;
* </pre>
* <!-- end com.azure.ai.vision.imageanalysis.async-client-entra-id-auth -->
*/
@ServiceClient(builder = ImageAnalysisClientBuilder.class, isAsync = true)
public final class ImageAnalysisAsyncClient {
Expand Down Expand Up @@ -101,15 +78,18 @@ public final class ImageAnalysisAsyncClient {
* You can add these to a request with {@link RequestOptions#addQueryParam}
* <p><strong>Request Body Schema</strong></p>
*
* <pre>{@code
* <pre>
* {@code
* {
* url: String (Required)
* }
* }</pre>
* }
* </pre>
*
* <p><strong>Response Body Schema</strong></p>
*
* <pre>{@code
* <pre>
* {@code
* {
* captionResult (Optional): {
* confidence: double (Required)
Expand Down Expand Up @@ -195,7 +175,8 @@ public final class ImageAnalysisAsyncClient {
* ]
* }
* }
* }</pre>
* }
* </pre>
*
* @param visualFeatures A list of visual features to analyze.
* Seven visual features are supported: Caption, DenseCaptions, Read (OCR), Tags, Objects, SmartCrops, and People.
Expand Down Expand Up @@ -271,7 +252,7 @@ Mono<ImageAnalysisResult> analyzeFromUrl(List<VisualFeatures> visualFeatures, Im
return analyzeFromUrlWithResponse(visualFeatures.stream()
.map(paramItemValue -> Objects.toString(paramItemValue, ""))
.collect(Collectors.toList()), BinaryData.fromObject(imageUrl), requestOptions).flatMap(FluxUtil::toMono)
.map(protocolMethodData -> protocolMethodData.toObject(ImageAnalysisResult.class));
.map(protocolMethodData -> protocolMethodData.toObject(ImageAnalysisResult.class));
}

/**
Expand All @@ -297,7 +278,7 @@ Mono<ImageAnalysisResult> analyzeFromUrl(List<VisualFeatures> visualFeatures, Im
return analyzeFromUrlWithResponse(visualFeatures.stream()
.map(paramItemValue -> Objects.toString(paramItemValue, ""))
.collect(Collectors.toList()), BinaryData.fromObject(imageUrl), requestOptions).flatMap(FluxUtil::toMono)
.map(protocolMethodData -> protocolMethodData.toObject(ImageAnalysisResult.class));
.map(protocolMethodData -> protocolMethodData.toObject(ImageAnalysisResult.class));
}

/**
Expand Down Expand Up @@ -331,13 +312,16 @@ Mono<ImageAnalysisResult> analyzeFromUrl(List<VisualFeatures> visualFeatures, Im
* You can add these to a request with {@link RequestOptions#addQueryParam}
* <p><strong>Request Body Schema</strong></p>
*
* <pre>{@code
* <pre>
* {@code
* BinaryData
* }</pre>
* }
* </pre>
*
* <p><strong>Response Body Schema</strong></p>
*
* <pre>{@code
* <pre>
* {@code
* {
* captionResult (Optional): {
* confidence: double (Required)
Expand Down Expand Up @@ -423,7 +407,8 @@ Mono<ImageAnalysisResult> analyzeFromUrl(List<VisualFeatures> visualFeatures, Im
* ]
* }
* }
* }</pre>
* }
* </pre>
*
* @param visualFeatures A list of visual features to analyze.
* Seven visual features are supported: Caption, DenseCaptions, Read (OCR), Tags, Objects, SmartCrops, and People.
Expand Down Expand Up @@ -499,7 +484,7 @@ Mono<ImageAnalysisResult> analyzeFromImageData(List<VisualFeatures> visualFeatur
return analyzeFromImageDataWithResponse(visualFeatures.stream()
.map(paramItemValue -> Objects.toString(paramItemValue, ""))
.collect(Collectors.toList()), imageData, requestOptions).flatMap(FluxUtil::toMono)
.map(protocolMethodData -> protocolMethodData.toObject(ImageAnalysisResult.class));
.map(protocolMethodData -> protocolMethodData.toObject(ImageAnalysisResult.class));
}

/**
Expand All @@ -525,7 +510,7 @@ Mono<ImageAnalysisResult> analyzeFromImageData(List<VisualFeatures> visualFeatur
return analyzeFromImageDataWithResponse(visualFeatures.stream()
.map(paramItemValue -> Objects.toString(paramItemValue, ""))
.collect(Collectors.toList()), imageData, requestOptions).flatMap(FluxUtil::toMono)
.map(protocolMethodData -> protocolMethodData.toObject(ImageAnalysisResult.class));
.map(protocolMethodData -> protocolMethodData.toObject(ImageAnalysisResult.class));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,6 @@

/**
* Initializes a new instance of the synchronous ImageAnalysisClient type.
* <!-- src_embed com.azure.ai.vision.imageanalysis.sync-client-api-key-auth -->
* <pre>
* &#47;&#47;
* &#47;&#47; Create a synchronous Image Analysis client with API key authentication.
* &#47;&#47;
* ImageAnalysisClient client = new ImageAnalysisClientBuilder&#40;&#41;
* .endpoint&#40;endpoint&#41;
* .credential&#40;new KeyCredential&#40;key&#41;&#41;
* .buildClient&#40;&#41;;
* </pre>
* <!-- end com.azure.ai.vision.imageanalysis.sync-client-api-key-auth -->
* <!-- src_embed com.azure.ai.vision.imageanalysis.sync-client-entra-id-auth -->
* <pre>
* &#47;&#47;
* &#47;&#47; Create a synchronous Image Analysis client with Entra ID authentication.
* &#47;&#47;
* ImageAnalysisClient client = new ImageAnalysisClientBuilder&#40;&#41;
* .endpoint&#40;endpoint&#41;
* .credential&#40;new DefaultAzureCredentialBuilder&#40;&#41;.build&#40;&#41;&#41;
* .buildClient&#40;&#41;;
* </pre>
* <!-- end com.azure.ai.vision.imageanalysis.sync-client-entra-id-auth -->
*/
@ServiceClient(builder = ImageAnalysisClientBuilder.class)
public final class ImageAnalysisClient {
Expand Down Expand Up @@ -98,15 +76,18 @@ public final class ImageAnalysisClient {
* You can add these to a request with {@link RequestOptions#addQueryParam}
* <p><strong>Request Body Schema</strong></p>
*
* <pre>{@code
* <pre>
* {@code
* {
* url: String (Required)
* }
* }</pre>
* }
* </pre>
*
* <p><strong>Response Body Schema</strong></p>
*
* <pre>{@code
* <pre>
* {@code
* {
* captionResult (Optional): {
* confidence: double (Required)
Expand Down Expand Up @@ -192,7 +173,8 @@ public final class ImageAnalysisClient {
* ]
* }
* }
* }</pre>
* }
* </pre>
*
* @param visualFeatures A list of visual features to analyze.
* Seven visual features are supported: Caption, DenseCaptions, Read (OCR), Tags, Objects, SmartCrops, and People.
Expand Down Expand Up @@ -267,7 +249,7 @@ ImageAnalysisResult analyzeFromUrl(List<VisualFeatures> visualFeatures, ImageUrl
return analyzeFromUrlWithResponse(visualFeatures.stream()
.map(paramItemValue -> Objects.toString(paramItemValue, ""))
.collect(Collectors.toList()), BinaryData.fromObject(imageUrl), requestOptions).getValue()
.toObject(ImageAnalysisResult.class);
.toObject(ImageAnalysisResult.class);
}

/**
Expand All @@ -293,7 +275,7 @@ ImageAnalysisResult analyzeFromUrl(List<VisualFeatures> visualFeatures, ImageUrl
return analyzeFromUrlWithResponse(visualFeatures.stream()
.map(paramItemValue -> Objects.toString(paramItemValue, ""))
.collect(Collectors.toList()), BinaryData.fromObject(imageUrl), requestOptions).getValue()
.toObject(ImageAnalysisResult.class);
.toObject(ImageAnalysisResult.class);
}

/**
Expand Down Expand Up @@ -327,13 +309,16 @@ ImageAnalysisResult analyzeFromUrl(List<VisualFeatures> visualFeatures, ImageUrl
* You can add these to a request with {@link RequestOptions#addQueryParam}
* <p><strong>Request Body Schema</strong></p>
*
* <pre>{@code
* <pre>
* {@code
* BinaryData
* }</pre>
* }
* </pre>
*
* <p><strong>Response Body Schema</strong></p>
*
* <pre>{@code
* <pre>
* {@code
* {
* captionResult (Optional): {
* confidence: double (Required)
Expand Down Expand Up @@ -419,7 +404,8 @@ ImageAnalysisResult analyzeFromUrl(List<VisualFeatures> visualFeatures, ImageUrl
* ]
* }
* }
* }</pre>
* }
* </pre>
*
* @param visualFeatures A list of visual features to analyze.
* Seven visual features are supported: Caption, DenseCaptions, Read (OCR), Tags, Objects, SmartCrops, and People.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
import com.azure.core.http.policy.AddHeadersPolicy;
import com.azure.core.http.policy.BearerTokenAuthenticationPolicy;
import com.azure.core.http.policy.HttpLoggingPolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
import com.azure.core.http.policy.HttpPipelinePolicy;
import com.azure.core.http.policy.HttpPolicyProviders;
import com.azure.core.http.policy.KeyCredentialPolicy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,16 @@ Response<BinaryData> analyzeFromUrlSync(@HostParam("endpoint") String endpoint,
* You can add these to a request with {@link RequestOptions#addQueryParam}
* <p><strong>Request Body Schema</strong></p>
*
* <pre>{@code
* <pre>
* {@code
* BinaryData
* }</pre>
* }
* </pre>
*
* <p><strong>Response Body Schema</strong></p>
*
* <pre>{@code
* <pre>
* {@code
* {
* captionResult (Optional): {
* confidence: double (Required)
Expand Down Expand Up @@ -325,7 +328,8 @@ Response<BinaryData> analyzeFromUrlSync(@HostParam("endpoint") String endpoint,
* ]
* }
* }
* }</pre>
* }
* </pre>
*
* @param visualFeatures A list of visual features to analyze.
* Seven visual features are supported: Caption, DenseCaptions, Read (OCR), Tags, Objects, SmartCrops, and People.
Expand Down Expand Up @@ -383,13 +387,16 @@ public Mono<Response<BinaryData>> analyzeFromImageDataWithResponseAsync(List<Str
* You can add these to a request with {@link RequestOptions#addQueryParam}
* <p><strong>Request Body Schema</strong></p>
*
* <pre>{@code
* <pre>
* {@code
* BinaryData
* }</pre>
* }
* </pre>
*
* <p><strong>Response Body Schema</strong></p>
*
* <pre>{@code
* <pre>
* {@code
* {
* captionResult (Optional): {
* confidence: double (Required)
Expand Down Expand Up @@ -475,7 +482,8 @@ public Mono<Response<BinaryData>> analyzeFromImageDataWithResponseAsync(List<Str
* ]
* }
* }
* }</pre>
* }
* </pre>
*
* @param visualFeatures A list of visual features to analyze.
* Seven visual features are supported: Caption, DenseCaptions, Read (OCR), Tags, Objects, SmartCrops, and People.
Expand Down Expand Up @@ -531,15 +539,18 @@ public Response<BinaryData> analyzeFromImageDataWithResponse(List<String> visual
* You can add these to a request with {@link RequestOptions#addQueryParam}
* <p><strong>Request Body Schema</strong></p>
*
* <pre>{@code
* <pre>
* {@code
* {
* url: String (Required)
* }
* }</pre>
* }
* </pre>
*
* <p><strong>Response Body Schema</strong></p>
*
* <pre>{@code
* <pre>
* {@code
* {
* captionResult (Optional): {
* confidence: double (Required)
Expand Down Expand Up @@ -625,7 +636,8 @@ public Response<BinaryData> analyzeFromImageDataWithResponse(List<String> visual
* ]
* }
* }
* }</pre>
* }
* </pre>
*
* @param visualFeatures A list of visual features to analyze.
* Seven visual features are supported: Caption, DenseCaptions, Read (OCR), Tags, Objects, SmartCrops, and People.
Expand Down Expand Up @@ -683,15 +695,18 @@ public Mono<Response<BinaryData>> analyzeFromUrlWithResponseAsync(List<String> v
* You can add these to a request with {@link RequestOptions#addQueryParam}
* <p><strong>Request Body Schema</strong></p>
*
* <pre>{@code
* <pre>
* {@code
* {
* url: String (Required)
* }
* }</pre>
* }
* </pre>
*
* <p><strong>Response Body Schema</strong></p>
*
* <pre>{@code
* <pre>
* {@code
* {
* captionResult (Optional): {
* confidence: double (Required)
Expand Down Expand Up @@ -777,7 +792,8 @@ public Mono<Response<BinaryData>> analyzeFromUrlWithResponseAsync(List<String> v
* ]
* }
* }
* }</pre>
* }
* </pre>
*
* @param visualFeatures A list of visual features to analyze.
* Seven visual features are supported: Caption, DenseCaptions, Read (OCR), Tags, Objects, SmartCrops, and People.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

module com.azure.ai.vision.imageanalysis {
requires transitive com.azure.core;

exports com.azure.ai.vision.imageanalysis;
exports com.azure.ai.vision.imageanalysis.models;

opens com.azure.ai.vision.imageanalysis.models to com.azure.core;
opens com.azure.ai.vision.imageanalysis.implementation.models to com.azure.core;
}
Loading