Skip to content

Commit

Permalink
Image Analysis SDK - Add missing @ServiceMethod tags; Move ImageAnaly…
Browse files Browse the repository at this point in the history
…sisOptions to models pacakge (Azure#38292)

* Add missing @ServiceMethod tags

* Move ImageAnalysisOptions class to the `models` pacakge
  • Loading branch information
dargilco authored Jan 11, 2024
1 parent be30f37 commit 7322035
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 10 deletions.
4 changes: 2 additions & 2 deletions sdk/vision/azure-ai-vision-imageanalysis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Notes:
* Caption is only supported in English at the moment.

```java imports-caption-file-snippet
import com.azure.ai.vision.imageanalysis.ImageAnalysisOptions;
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.util.BinaryData;
Expand All @@ -167,7 +167,7 @@ To generate captions for additional images, simply call `analyze` multiple times
This example is similar to the above, except it calls the `analyze` method and provides a [publicly accessible image URL](https://aka.ms/azsdk/image-analysis/sample.jpg) instead of a file name.

```java imports-caption-url-snippet
import com.azure.ai.vision.imageanalysis.ImageAnalysisOptions;
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 java.net.URL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ import java.net.URL;
*
* @return represents the outcome of an Image Analysis operation.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ImageAnalysisResult analyze(URL imageUrl, List<VisualFeatures> visualFeatures,
ImageAnalysisOptions options) {
if (options == null) {
Expand Down Expand Up @@ -90,6 +91,7 @@ import java.net.URL;
*
* @return represents the outcome of an Image Analysis operation.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ImageAnalysisResult analyze(BinaryData imageData, List<VisualFeatures> visualFeatures,
ImageAnalysisOptions options) {
if (options == null) {
Expand Down Expand Up @@ -126,6 +128,7 @@ import java.net.URL;
*
* @return represents the outcome of an Image Analysis operation on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<ImageAnalysisResult> analyze(URL imageUrl, List<VisualFeatures> visualFeatures,
ImageAnalysisOptions options) {
if (options == null) {
Expand Down Expand Up @@ -154,6 +157,7 @@ import java.net.URL;
*
* @return represents the outcome of an Image Analysis operation on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<ImageAnalysisResult> analyze(BinaryData imageData, List<VisualFeatures> visualFeatures,
ImageAnalysisOptions options) {
if (options == null) {
Expand Down
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 Down Expand Up @@ -572,6 +573,7 @@ Mono<ImageAnalysisResult> analyzeFromUrl(List<VisualFeatures> visualFeatures, Im
*
* @return represents the outcome of an Image Analysis operation on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<ImageAnalysisResult> analyze(URL imageUrl, List<VisualFeatures> visualFeatures,
ImageAnalysisOptions options) {
if (options == null) {
Expand Down Expand Up @@ -600,6 +602,7 @@ public Mono<ImageAnalysisResult> analyze(URL imageUrl, List<VisualFeatures> visu
*
* @return represents the outcome of an Image Analysis operation on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<ImageAnalysisResult> analyze(BinaryData imageData, List<VisualFeatures> visualFeatures,
ImageAnalysisOptions options) {
if (options == null) {
Expand Down
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 Down Expand Up @@ -564,6 +565,7 @@ ImageAnalysisResult analyzeFromUrl(List<VisualFeatures> visualFeatures, ImageUrl
*
* @return represents the outcome of an Image Analysis operation.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ImageAnalysisResult analyze(URL imageUrl, List<VisualFeatures> visualFeatures,
ImageAnalysisOptions options) {
if (options == null) {
Expand Down Expand Up @@ -592,6 +594,7 @@ public ImageAnalysisResult analyze(URL imageUrl, List<VisualFeatures> visualFeat
*
* @return represents the outcome of an Image Analysis operation.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ImageAnalysisResult analyze(BinaryData imageData, List<VisualFeatures> visualFeatures,
ImageAnalysisOptions options) {
if (options == null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.azure.ai.vision.imageanalysis;
package com.azure.ai.vision.imageanalysis.models;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@

import com.azure.ai.vision.imageanalysis.ImageAnalysisClient;
import com.azure.ai.vision.imageanalysis.ImageAnalysisClientBuilder;
import com.azure.ai.vision.imageanalysis.ImageAnalysisOptions;
import com.azure.ai.vision.imageanalysis.models.CropRegion;
import com.azure.ai.vision.imageanalysis.models.DenseCaption;
import com.azure.ai.vision.imageanalysis.models.DetectedObject;
import com.azure.ai.vision.imageanalysis.models.DetectedPerson;
import com.azure.ai.vision.imageanalysis.models.DetectedTag;
import com.azure.ai.vision.imageanalysis.models.DetectedTextLine;
import com.azure.ai.vision.imageanalysis.models.DetectedTextWord;
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.credential.KeyCredential;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
// END: imports-for-create-client-snippet

// BEGIN: imports-caption-file-snippet
import com.azure.ai.vision.imageanalysis.ImageAnalysisOptions;
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.util.BinaryData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

import com.azure.ai.vision.imageanalysis.ImageAnalysisAsyncClient;
import com.azure.ai.vision.imageanalysis.ImageAnalysisClientBuilder;
import com.azure.ai.vision.imageanalysis.ImageAnalysisOptions;
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.credential.KeyCredential;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import java.net.MalformedURLException;

// BEGIN: imports-caption-url-snippet
import com.azure.ai.vision.imageanalysis.ImageAnalysisOptions;
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 java.net.URL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@

import com.azure.ai.vision.imageanalysis.ImageAnalysisClient;
import com.azure.ai.vision.imageanalysis.ImageAnalysisClientBuilder;
import com.azure.ai.vision.imageanalysis.ImageAnalysisOptions;
import com.azure.ai.vision.imageanalysis.models.DenseCaption;
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.credential.KeyCredential;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@

import com.azure.ai.vision.imageanalysis.ImageAnalysisClient;
import com.azure.ai.vision.imageanalysis.ImageAnalysisClientBuilder;
import com.azure.ai.vision.imageanalysis.ImageAnalysisOptions;
import com.azure.ai.vision.imageanalysis.models.CropRegion;
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.credential.KeyCredential;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@

import com.azure.ai.vision.imageanalysis.ImageAnalysisClient;
import com.azure.ai.vision.imageanalysis.ImageAnalysisClientBuilder;
import com.azure.ai.vision.imageanalysis.ImageAnalysisOptions;
import com.azure.ai.vision.imageanalysis.models.DetectedTag;
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.credential.KeyCredential;
Expand Down

0 comments on commit 7322035

Please sign in to comment.