Skip to content

Commit 9531b6f

Browse files
author
SDKAuto
committed
CodeGen from PR 33441 in Azure/azure-rest-api-specs
Merge 61986c0207f48566fd3f0238305e2ec097cb7ac1 into bc79b816272c7e12d79e8bc63d689327fc37d11f
1 parent fa0cb9b commit 9531b6f

File tree

7 files changed

+71
-95
lines changed

7 files changed

+71
-95
lines changed

sdk/vision/azure-ai-vision-imageanalysis/CHANGELOG.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@
22

33
## 1.1.0-beta.1 (Unreleased)
44

5-
### Features Added
6-
7-
### Breaking Changes
8-
9-
### Bugs Fixed
10-
11-
### Other Changes
12-
135
## 1.0.0 (2024-10-18)
146

157
### Other Changes

sdk/vision/azure-ai-vision-imageanalysis/src/main/java/com/azure/ai/vision/imageanalysis/ImageAnalysisAsyncClient.java

Lines changed: 17 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import com.azure.ai.vision.imageanalysis.implementation.ImageAnalysisClientImpl;
77
import com.azure.ai.vision.imageanalysis.implementation.models.ImageUrl;
8+
import com.azure.ai.vision.imageanalysis.models.ImageAnalysisOptions;
89
import com.azure.ai.vision.imageanalysis.models.ImageAnalysisResult;
910
import com.azure.ai.vision.imageanalysis.models.VisualFeatures;
1011
import com.azure.core.annotation.Generated;
@@ -26,33 +27,9 @@
2627
import java.util.Objects;
2728
import java.util.stream.Collectors;
2829
import reactor.core.publisher.Mono;
29-
import com.azure.ai.vision.imageanalysis.models.ImageAnalysisOptions;
3030

3131
/**
3232
* Initializes a new instance of the asynchronous ImageAnalysisClient type.
33-
*
34-
* <!-- src_embed com.azure.ai.vision.imageanalysis.async-client-api-key-auth -->
35-
* <pre>
36-
* &#47;&#47;
37-
* &#47;&#47; Create an asynchronous Image Analysis client with API key authentication.
38-
* &#47;&#47;
39-
* ImageAnalysisAsyncClient client = new ImageAnalysisClientBuilder&#40;&#41;
40-
* .endpoint&#40;endpoint&#41;
41-
* .credential&#40;new KeyCredential&#40;key&#41;&#41;
42-
* .buildAsyncClient&#40;&#41;;
43-
* </pre>
44-
* <!-- end com.azure.ai.vision.imageanalysis.async-client-api-key-auth -->
45-
* <!-- src_embed com.azure.ai.vision.imageanalysis.async-client-entra-id-auth -->
46-
* <pre>
47-
* &#47;&#47;
48-
* &#47;&#47; Create an asynchronous Image Analysis client with Entra ID authentication.
49-
* &#47;&#47;
50-
* ImageAnalysisAsyncClient client = new ImageAnalysisClientBuilder&#40;&#41;
51-
* .endpoint&#40;endpoint&#41;
52-
* .credential&#40;new DefaultAzureCredentialBuilder&#40;&#41;.build&#40;&#41;&#41;
53-
* .buildAsyncClient&#40;&#41;;
54-
* </pre>
55-
* <!-- end com.azure.ai.vision.imageanalysis.async-client-entra-id-auth -->
5633
*/
5734
@ServiceClient(builder = ImageAnalysisClientBuilder.class, isAsync = true)
5835
public final class ImageAnalysisAsyncClient {
@@ -101,15 +78,18 @@ public final class ImageAnalysisAsyncClient {
10178
* You can add these to a request with {@link RequestOptions#addQueryParam}
10279
* <p><strong>Request Body Schema</strong></p>
10380
*
104-
* <pre>{@code
81+
* <pre>
82+
* {@code
10583
* {
10684
* url: String (Required)
10785
* }
108-
* }</pre>
86+
* }
87+
* </pre>
10988
*
11089
* <p><strong>Response Body Schema</strong></p>
11190
*
112-
* <pre>{@code
91+
* <pre>
92+
* {@code
11393
* {
11494
* captionResult (Optional): {
11595
* confidence: double (Required)
@@ -195,7 +175,8 @@ public final class ImageAnalysisAsyncClient {
195175
* ]
196176
* }
197177
* }
198-
* }</pre>
178+
* }
179+
* </pre>
199180
*
200181
* @param visualFeatures A list of visual features to analyze.
201182
* Seven visual features are supported: Caption, DenseCaptions, Read (OCR), Tags, Objects, SmartCrops, and People.
@@ -331,13 +312,16 @@ Mono<ImageAnalysisResult> analyzeFromUrl(List<VisualFeatures> visualFeatures, Im
331312
* You can add these to a request with {@link RequestOptions#addQueryParam}
332313
* <p><strong>Request Body Schema</strong></p>
333314
*
334-
* <pre>{@code
315+
* <pre>
316+
* {@code
335317
* BinaryData
336-
* }</pre>
318+
* }
319+
* </pre>
337320
*
338321
* <p><strong>Response Body Schema</strong></p>
339322
*
340-
* <pre>{@code
323+
* <pre>
324+
* {@code
341325
* {
342326
* captionResult (Optional): {
343327
* confidence: double (Required)
@@ -423,7 +407,8 @@ Mono<ImageAnalysisResult> analyzeFromUrl(List<VisualFeatures> visualFeatures, Im
423407
* ]
424408
* }
425409
* }
426-
* }</pre>
410+
* }
411+
* </pre>
427412
*
428413
* @param visualFeatures A list of visual features to analyze.
429414
* Seven visual features are supported: Caption, DenseCaptions, Read (OCR), Tags, Objects, SmartCrops, and People.

sdk/vision/azure-ai-vision-imageanalysis/src/main/java/com/azure/ai/vision/imageanalysis/ImageAnalysisClient.java

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,6 @@
2828

2929
/**
3030
* Initializes a new instance of the synchronous ImageAnalysisClient type.
31-
* <!-- src_embed com.azure.ai.vision.imageanalysis.sync-client-api-key-auth -->
32-
* <pre>
33-
* &#47;&#47;
34-
* &#47;&#47; Create a synchronous Image Analysis client with API key authentication.
35-
* &#47;&#47;
36-
* ImageAnalysisClient client = new ImageAnalysisClientBuilder&#40;&#41;
37-
* .endpoint&#40;endpoint&#41;
38-
* .credential&#40;new KeyCredential&#40;key&#41;&#41;
39-
* .buildClient&#40;&#41;;
40-
* </pre>
41-
* <!-- end com.azure.ai.vision.imageanalysis.sync-client-api-key-auth -->
42-
* <!-- src_embed com.azure.ai.vision.imageanalysis.sync-client-entra-id-auth -->
43-
* <pre>
44-
* &#47;&#47;
45-
* &#47;&#47; Create a synchronous Image Analysis client with Entra ID authentication.
46-
* &#47;&#47;
47-
* ImageAnalysisClient client = new ImageAnalysisClientBuilder&#40;&#41;
48-
* .endpoint&#40;endpoint&#41;
49-
* .credential&#40;new DefaultAzureCredentialBuilder&#40;&#41;.build&#40;&#41;&#41;
50-
* .buildClient&#40;&#41;;
51-
* </pre>
52-
* <!-- end com.azure.ai.vision.imageanalysis.sync-client-entra-id-auth -->
5331
*/
5432
@ServiceClient(builder = ImageAnalysisClientBuilder.class)
5533
public final class ImageAnalysisClient {
@@ -98,15 +76,18 @@ public final class ImageAnalysisClient {
9876
* You can add these to a request with {@link RequestOptions#addQueryParam}
9977
* <p><strong>Request Body Schema</strong></p>
10078
*
101-
* <pre>{@code
79+
* <pre>
80+
* {@code
10281
* {
10382
* url: String (Required)
10483
* }
105-
* }</pre>
84+
* }
85+
* </pre>
10686
*
10787
* <p><strong>Response Body Schema</strong></p>
10888
*
109-
* <pre>{@code
89+
* <pre>
90+
* {@code
11091
* {
11192
* captionResult (Optional): {
11293
* confidence: double (Required)
@@ -192,7 +173,8 @@ public final class ImageAnalysisClient {
192173
* ]
193174
* }
194175
* }
195-
* }</pre>
176+
* }
177+
* </pre>
196178
*
197179
* @param visualFeatures A list of visual features to analyze.
198180
* Seven visual features are supported: Caption, DenseCaptions, Read (OCR), Tags, Objects, SmartCrops, and People.
@@ -327,13 +309,16 @@ ImageAnalysisResult analyzeFromUrl(List<VisualFeatures> visualFeatures, ImageUrl
327309
* You can add these to a request with {@link RequestOptions#addQueryParam}
328310
* <p><strong>Request Body Schema</strong></p>
329311
*
330-
* <pre>{@code
312+
* <pre>
313+
* {@code
331314
* BinaryData
332-
* }</pre>
315+
* }
316+
* </pre>
333317
*
334318
* <p><strong>Response Body Schema</strong></p>
335319
*
336-
* <pre>{@code
320+
* <pre>
321+
* {@code
337322
* {
338323
* captionResult (Optional): {
339324
* confidence: double (Required)
@@ -419,7 +404,8 @@ ImageAnalysisResult analyzeFromUrl(List<VisualFeatures> visualFeatures, ImageUrl
419404
* ]
420405
* }
421406
* }
422-
* }</pre>
407+
* }
408+
* </pre>
423409
*
424410
* @param visualFeatures A list of visual features to analyze.
425411
* Seven visual features are supported: Caption, DenseCaptions, Read (OCR), Tags, Objects, SmartCrops, and People.

sdk/vision/azure-ai-vision-imageanalysis/src/main/java/com/azure/ai/vision/imageanalysis/ImageAnalysisClientBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
2323
import com.azure.core.http.policy.AddHeadersPolicy;
2424
import com.azure.core.http.policy.BearerTokenAuthenticationPolicy;
25-
import com.azure.core.http.policy.HttpLoggingPolicy;
2625
import com.azure.core.http.policy.HttpLogOptions;
26+
import com.azure.core.http.policy.HttpLoggingPolicy;
2727
import com.azure.core.http.policy.HttpPipelinePolicy;
2828
import com.azure.core.http.policy.HttpPolicyProviders;
2929
import com.azure.core.http.policy.KeyCredentialPolicy;

sdk/vision/azure-ai-vision-imageanalysis/src/main/java/com/azure/ai/vision/imageanalysis/implementation/ImageAnalysisClientImpl.java

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,16 @@ Response<BinaryData> analyzeFromUrlSync(@HostParam("endpoint") String endpoint,
233233
* You can add these to a request with {@link RequestOptions#addQueryParam}
234234
* <p><strong>Request Body Schema</strong></p>
235235
*
236-
* <pre>{@code
236+
* <pre>
237+
* {@code
237238
* BinaryData
238-
* }</pre>
239+
* }
240+
* </pre>
239241
*
240242
* <p><strong>Response Body Schema</strong></p>
241243
*
242-
* <pre>{@code
244+
* <pre>
245+
* {@code
243246
* {
244247
* captionResult (Optional): {
245248
* confidence: double (Required)
@@ -325,7 +328,8 @@ Response<BinaryData> analyzeFromUrlSync(@HostParam("endpoint") String endpoint,
325328
* ]
326329
* }
327330
* }
328-
* }</pre>
331+
* }
332+
* </pre>
329333
*
330334
* @param visualFeatures A list of visual features to analyze.
331335
* Seven visual features are supported: Caption, DenseCaptions, Read (OCR), Tags, Objects, SmartCrops, and People.
@@ -383,13 +387,16 @@ public Mono<Response<BinaryData>> analyzeFromImageDataWithResponseAsync(List<Str
383387
* You can add these to a request with {@link RequestOptions#addQueryParam}
384388
* <p><strong>Request Body Schema</strong></p>
385389
*
386-
* <pre>{@code
390+
* <pre>
391+
* {@code
387392
* BinaryData
388-
* }</pre>
393+
* }
394+
* </pre>
389395
*
390396
* <p><strong>Response Body Schema</strong></p>
391397
*
392-
* <pre>{@code
398+
* <pre>
399+
* {@code
393400
* {
394401
* captionResult (Optional): {
395402
* confidence: double (Required)
@@ -475,7 +482,8 @@ public Mono<Response<BinaryData>> analyzeFromImageDataWithResponseAsync(List<Str
475482
* ]
476483
* }
477484
* }
478-
* }</pre>
485+
* }
486+
* </pre>
479487
*
480488
* @param visualFeatures A list of visual features to analyze.
481489
* Seven visual features are supported: Caption, DenseCaptions, Read (OCR), Tags, Objects, SmartCrops, and People.
@@ -531,15 +539,18 @@ public Response<BinaryData> analyzeFromImageDataWithResponse(List<String> visual
531539
* You can add these to a request with {@link RequestOptions#addQueryParam}
532540
* <p><strong>Request Body Schema</strong></p>
533541
*
534-
* <pre>{@code
542+
* <pre>
543+
* {@code
535544
* {
536545
* url: String (Required)
537546
* }
538-
* }</pre>
547+
* }
548+
* </pre>
539549
*
540550
* <p><strong>Response Body Schema</strong></p>
541551
*
542-
* <pre>{@code
552+
* <pre>
553+
* {@code
543554
* {
544555
* captionResult (Optional): {
545556
* confidence: double (Required)
@@ -625,7 +636,8 @@ public Response<BinaryData> analyzeFromImageDataWithResponse(List<String> visual
625636
* ]
626637
* }
627638
* }
628-
* }</pre>
639+
* }
640+
* </pre>
629641
*
630642
* @param visualFeatures A list of visual features to analyze.
631643
* Seven visual features are supported: Caption, DenseCaptions, Read (OCR), Tags, Objects, SmartCrops, and People.
@@ -683,15 +695,18 @@ public Mono<Response<BinaryData>> analyzeFromUrlWithResponseAsync(List<String> v
683695
* You can add these to a request with {@link RequestOptions#addQueryParam}
684696
* <p><strong>Request Body Schema</strong></p>
685697
*
686-
* <pre>{@code
698+
* <pre>
699+
* {@code
687700
* {
688701
* url: String (Required)
689702
* }
690-
* }</pre>
703+
* }
704+
* </pre>
691705
*
692706
* <p><strong>Response Body Schema</strong></p>
693707
*
694-
* <pre>{@code
708+
* <pre>
709+
* {@code
695710
* {
696711
* captionResult (Optional): {
697712
* confidence: double (Required)
@@ -777,7 +792,8 @@ public Mono<Response<BinaryData>> analyzeFromUrlWithResponseAsync(List<String> v
777792
* ]
778793
* }
779794
* }
780-
* }</pre>
795+
* }
796+
* </pre>
781797
*
782798
* @param visualFeatures A list of visual features to analyze.
783799
* Seven visual features are supported: Caption, DenseCaptions, Read (OCR), Tags, Objects, SmartCrops, and People.

sdk/vision/azure-ai-vision-imageanalysis/src/test/java/com/azure/ai/vision/imageanalysis/generated/ImageAnalysisClientTestBase.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
import com.azure.ai.vision.imageanalysis.ImageAnalysisClient;
1212
import com.azure.ai.vision.imageanalysis.ImageAnalysisClientBuilder;
13-
import com.azure.core.http.HttpClient;
1413
import com.azure.core.http.policy.HttpLogDetailLevel;
1514
import com.azure.core.http.policy.HttpLogOptions;
1615
import com.azure.core.test.TestMode;
@@ -26,11 +25,10 @@ class ImageAnalysisClientTestBase extends TestProxyTestBase {
2625
protected void beforeTest() {
2726
ImageAnalysisClientBuilder imageAnalysisClientbuilder = new ImageAnalysisClientBuilder()
2827
.endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint"))
29-
.httpClient(HttpClient.createDefault())
28+
.httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null)))
3029
.httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC));
3130
if (getTestMode() == TestMode.PLAYBACK) {
32-
imageAnalysisClientbuilder.httpClient(interceptorManager.getPlaybackClient())
33-
.credential(new MockTokenCredential());
31+
imageAnalysisClientbuilder.credential(new MockTokenCredential());
3432
} else if (getTestMode() == TestMode.RECORD) {
3533
imageAnalysisClientbuilder.addPolicy(interceptorManager.getRecordPolicy())
3634
.credential(new DefaultAzureCredentialBuilder().build());
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
repo: Azure/azure-rest-api-specs
21
directory: specification/ai/ImageAnalysis
3-
additionalDirectories: []
4-
commit: d6be8f199982997f0a94e3e9bbbe8b2f7e304f7d
5-
2+
commit: 9029d073924ec35c84b2973464bdd1f899fed75e
3+
repo: Azure/azure-rest-api-specs
4+
additionalDirectories:

0 commit comments

Comments
 (0)