Skip to content

Commit 3f373c8

Browse files
authored
udpate samples (Azure#32332)
* udpate samples
1 parent c1736f9 commit 3f373c8

File tree

101 files changed

+1474
-1177
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+1474
-1177
lines changed

sdk/maps/azure-maps-search/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ client.searchPointOfInterestWithResponse(
137137

138138
Search Nearby Point Of Interest
139139
```java com.azure.maps.search.sync.search_nearby
140-
System.out.println("Search Nearby:");
140+
System.out.println("Search Nearby Points of Interest:");
141141

142142
// options
143143
client.searchNearbyPointsOfInterest(
@@ -155,7 +155,7 @@ client.searchNearbyPointsOfInterestWithResponse(
155155

156156
Search Point Of Interest Category
157157
```java com.azure.maps.search.sync.search_nearby
158-
System.out.println("Search Nearby:");
158+
System.out.println("Search Nearby Points of Interest:");
159159

160160
// options
161161
client.searchNearbyPointsOfInterest(

sdk/maps/azure-maps-search/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
<src.dir>src/main</src.dir>
5050
<test.dir>src/test</test.dir>
5151
<jacoco.min.linecoverage>0.4</jacoco.min.linecoverage>
52-
<jacoco.min.branchcoverage>0.3</jacoco.min.branchcoverage>
52+
<jacoco.min.branchcoverage>0.2</jacoco.min.branchcoverage>
5353
<jacoco.skip>false</jacoco.skip>
5454
<codesnippet.skip>false</codesnippet.skip>
5555
<javadocDoclet></javadocDoclet>

sdk/maps/azure-maps-search/src/main/java/com/azure/maps/search/MapsSearchAsyncClient.java

Lines changed: 43 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757

5858
import reactor.core.publisher.Mono;
5959

60-
/** Initializes a new instance of the asynchronous SearchClient type.
60+
/** Initializes a new instance of the asynchronous SearchClient type.
6161
* Creating an async client using a {@link com.azure.core.credential.AzureKeyCredential}:
6262
* <!-- src_embed com.azure.maps.search.async.builder.key.instantiation -->
6363
* <pre>
@@ -90,7 +90,7 @@
9090
* MapsSearchAsyncClient client = builder.buildAsyncClient&#40;&#41;;
9191
* </pre>
9292
* <!-- end com.azure.maps.search.async.builder.ad.instantiation -->
93-
*/
93+
*/
9494

9595
@ServiceClient(builder = MapsSearchClientBuilder.class, isAsync = true)
9696
public final class MapsSearchAsyncClient {
@@ -573,7 +573,7 @@ Mono<Response<SearchAddressResult>> searchPointOfInterestWithResponse(SearchPoin
573573
* Search Nearby Points of Interest
574574
* <!-- src_embed com.azure.maps.search.async.search_nearby -->
575575
* <pre>
576-
* System.out.println&#40;&quot;Search Nearby:&quot;&#41;;
576+
* System.out.println&#40;&quot;Search Nearby Points of Interest:&quot;&#41;;
577577
*
578578
* &#47;&#47; options
579579
* asyncClient.searchNearbyPointsOfInterest&#40;
@@ -608,7 +608,7 @@ public Mono<SearchAddressResult> searchNearbyPointsOfInterest(
608608
* Search Nearby Points of Interest
609609
* <!-- src_embed com.azure.maps.search.async.search_nearby -->
610610
* <pre>
611-
* System.out.println&#40;&quot;Search Nearby:&quot;&#41;;
611+
* System.out.println&#40;&quot;Search Nearby Points of Interest:&quot;&#41;;
612612
*
613613
* &#47;&#47; options
614614
* asyncClient.searchNearbyPointsOfInterest&#40;
@@ -643,7 +643,7 @@ public Mono<SearchAddressResult> searchNearbyPointsOfInterest(
643643
* Search Nearby Points of Interest
644644
* <!-- src_embed com.azure.maps.search.async.search_nearby -->
645645
* <pre>
646-
* System.out.println&#40;&quot;Search Nearby:&quot;&#41;;
646+
* System.out.println&#40;&quot;Search Nearby Points of Interest:&quot;&#41;;
647647
*
648648
* &#47;&#47; options
649649
* asyncClient.searchNearbyPointsOfInterest&#40;
@@ -675,7 +675,7 @@ public Mono<Response<SearchAddressResult>> searchNearbyPointsOfInterestWithRespo
675675
* Search Nearby Points of Interest
676676
* <!-- src_embed com.azure.maps.search.async.search_nearby -->
677677
* <pre>
678-
* System.out.println&#40;&quot;Search Nearby:&quot;&#41;;
678+
* System.out.println&#40;&quot;Search Nearby Points of Interest:&quot;&#41;;
679679
*
680680
* &#47;&#47; options
681681
* asyncClient.searchNearbyPointsOfInterest&#40;
@@ -1891,26 +1891,27 @@ Mono<Response<SearchAddressResult>> searchInsideGeometryWithResponse(SearchInsid
18911891
*
18921892
* &#47;&#47; create route points
18931893
* List&lt;GeoPosition&gt; getPolygonPoints = new ArrayList&lt;&gt;&#40;&#41;;
1894-
* points.add&#40;new GeoPosition&#40;-122.143035, 47.653536&#41;&#41;;
1895-
* points.add&#40;new GeoPosition&#40;-122.187164, 47.617556&#41;&#41;;
1896-
* points.add&#40;new GeoPosition&#40;-122.114981, 47.570599&#41;&#41;;
1897-
* points.add&#40;new GeoPosition&#40;-122.132756, 47.654009&#41;&#41;;
1894+
* getPolygonPoints.add&#40;new GeoPosition&#40;-122.143035, 47.653536&#41;&#41;;
1895+
* getPolygonPoints.add&#40;new GeoPosition&#40;-122.187164, 47.617556&#41;&#41;;
1896+
* getPolygonPoints.add&#40;new GeoPosition&#40;-122.114981, 47.570599&#41;&#41;;
1897+
* getPolygonPoints.add&#40;new GeoPosition&#40;-122.132756, 47.654009&#41;&#41;;
18981898
* GeoLineString getPolygonRoute = new GeoLineString&#40;getPolygonPoints&#41;;
18991899
*
19001900
* &#47;&#47; simple
1901-
* asyncClient.searchAlongRoute&#40;new SearchAlongRouteOptions&#40;&quot;burger&quot;, 1000, getPolygonRoute&#41;&#41;;
1901+
* SearchAddressResult result = asyncClient.searchAlongRoute&#40;
1902+
* new SearchAlongRouteOptions&#40;&quot;burger&quot;, 1000, getPolygonRoute&#41;&#41;.block&#40;&#41;;
19021903
*
19031904
* &#47;&#47; options
19041905
* asyncClient.searchAlongRoute&#40;
19051906
* new SearchAlongRouteOptions&#40;&quot;burger&quot;, 1000, getPolygonRoute&#41;
19061907
* .setCategoryFilter&#40;Arrays.asList&#40;7315&#41;&#41;
1907-
* .setTop&#40;5&#41;&#41;;
1908+
* .setTop&#40;5&#41;&#41;.block&#40;&#41;;
19081909
*
19091910
* &#47;&#47; complete
19101911
* asyncClient.searchAlongRouteWithResponse&#40;
19111912
* new SearchAlongRouteOptions&#40;&quot;burger&quot;, 1000, getPolygonRoute&#41;
1912-
* .setCategoryFilter&#40;Arrays.asList&#40;7315&#41;&#41;
1913-
* .setTop&#40;5&#41;&#41;.block&#40;&#41;.getStatusCode&#40;&#41;;
1913+
* .setCategoryFilter&#40;Arrays.asList&#40;7315&#41;&#41;.setOperatingHours&#40;OperatingHoursRange.NEXT_SEVEN_DAYS&#41;
1914+
* .setTop&#40;5&#41;&#41;.block&#40;&#41;.getStatusCode&#40;&#41;;
19141915
* </pre>
19151916
* <!-- end com.azure.maps.search.async.search_along_route -->
19161917
*
@@ -1936,26 +1937,27 @@ public Mono<SearchAddressResult> searchAlongRoute(SearchAlongRouteOptions option
19361937
*
19371938
* &#47;&#47; create route points
19381939
* List&lt;GeoPosition&gt; getPolygonPoints = new ArrayList&lt;&gt;&#40;&#41;;
1939-
* points.add&#40;new GeoPosition&#40;-122.143035, 47.653536&#41;&#41;;
1940-
* points.add&#40;new GeoPosition&#40;-122.187164, 47.617556&#41;&#41;;
1941-
* points.add&#40;new GeoPosition&#40;-122.114981, 47.570599&#41;&#41;;
1942-
* points.add&#40;new GeoPosition&#40;-122.132756, 47.654009&#41;&#41;;
1940+
* getPolygonPoints.add&#40;new GeoPosition&#40;-122.143035, 47.653536&#41;&#41;;
1941+
* getPolygonPoints.add&#40;new GeoPosition&#40;-122.187164, 47.617556&#41;&#41;;
1942+
* getPolygonPoints.add&#40;new GeoPosition&#40;-122.114981, 47.570599&#41;&#41;;
1943+
* getPolygonPoints.add&#40;new GeoPosition&#40;-122.132756, 47.654009&#41;&#41;;
19431944
* GeoLineString getPolygonRoute = new GeoLineString&#40;getPolygonPoints&#41;;
19441945
*
19451946
* &#47;&#47; simple
1946-
* asyncClient.searchAlongRoute&#40;new SearchAlongRouteOptions&#40;&quot;burger&quot;, 1000, getPolygonRoute&#41;&#41;;
1947+
* SearchAddressResult result = asyncClient.searchAlongRoute&#40;
1948+
* new SearchAlongRouteOptions&#40;&quot;burger&quot;, 1000, getPolygonRoute&#41;&#41;.block&#40;&#41;;
19471949
*
19481950
* &#47;&#47; options
19491951
* asyncClient.searchAlongRoute&#40;
19501952
* new SearchAlongRouteOptions&#40;&quot;burger&quot;, 1000, getPolygonRoute&#41;
19511953
* .setCategoryFilter&#40;Arrays.asList&#40;7315&#41;&#41;
1952-
* .setTop&#40;5&#41;&#41;;
1954+
* .setTop&#40;5&#41;&#41;.block&#40;&#41;;
19531955
*
19541956
* &#47;&#47; complete
19551957
* asyncClient.searchAlongRouteWithResponse&#40;
19561958
* new SearchAlongRouteOptions&#40;&quot;burger&quot;, 1000, getPolygonRoute&#41;
1957-
* .setCategoryFilter&#40;Arrays.asList&#40;7315&#41;&#41;
1958-
* .setTop&#40;5&#41;&#41;.block&#40;&#41;.getStatusCode&#40;&#41;;
1959+
* .setCategoryFilter&#40;Arrays.asList&#40;7315&#41;&#41;.setOperatingHours&#40;OperatingHoursRange.NEXT_SEVEN_DAYS&#41;
1960+
* .setTop&#40;5&#41;&#41;.block&#40;&#41;.getStatusCode&#40;&#41;;
19591961
* </pre>
19601962
* <!-- end com.azure.maps.search.async.search_along_route -->
19611963
*
@@ -1982,26 +1984,27 @@ public Mono<SearchAddressResult> searchAlongRoute(String query, int maxDetourTim
19821984
*
19831985
* &#47;&#47; create route points
19841986
* List&lt;GeoPosition&gt; getPolygonPoints = new ArrayList&lt;&gt;&#40;&#41;;
1985-
* points.add&#40;new GeoPosition&#40;-122.143035, 47.653536&#41;&#41;;
1986-
* points.add&#40;new GeoPosition&#40;-122.187164, 47.617556&#41;&#41;;
1987-
* points.add&#40;new GeoPosition&#40;-122.114981, 47.570599&#41;&#41;;
1988-
* points.add&#40;new GeoPosition&#40;-122.132756, 47.654009&#41;&#41;;
1987+
* getPolygonPoints.add&#40;new GeoPosition&#40;-122.143035, 47.653536&#41;&#41;;
1988+
* getPolygonPoints.add&#40;new GeoPosition&#40;-122.187164, 47.617556&#41;&#41;;
1989+
* getPolygonPoints.add&#40;new GeoPosition&#40;-122.114981, 47.570599&#41;&#41;;
1990+
* getPolygonPoints.add&#40;new GeoPosition&#40;-122.132756, 47.654009&#41;&#41;;
19891991
* GeoLineString getPolygonRoute = new GeoLineString&#40;getPolygonPoints&#41;;
19901992
*
19911993
* &#47;&#47; simple
1992-
* asyncClient.searchAlongRoute&#40;new SearchAlongRouteOptions&#40;&quot;burger&quot;, 1000, getPolygonRoute&#41;&#41;;
1994+
* SearchAddressResult result = asyncClient.searchAlongRoute&#40;
1995+
* new SearchAlongRouteOptions&#40;&quot;burger&quot;, 1000, getPolygonRoute&#41;&#41;.block&#40;&#41;;
19931996
*
19941997
* &#47;&#47; options
19951998
* asyncClient.searchAlongRoute&#40;
19961999
* new SearchAlongRouteOptions&#40;&quot;burger&quot;, 1000, getPolygonRoute&#41;
19972000
* .setCategoryFilter&#40;Arrays.asList&#40;7315&#41;&#41;
1998-
* .setTop&#40;5&#41;&#41;;
2001+
* .setTop&#40;5&#41;&#41;.block&#40;&#41;;
19992002
*
20002003
* &#47;&#47; complete
20012004
* asyncClient.searchAlongRouteWithResponse&#40;
20022005
* new SearchAlongRouteOptions&#40;&quot;burger&quot;, 1000, getPolygonRoute&#41;
2003-
* .setCategoryFilter&#40;Arrays.asList&#40;7315&#41;&#41;
2004-
* .setTop&#40;5&#41;&#41;.block&#40;&#41;.getStatusCode&#40;&#41;;
2006+
* .setCategoryFilter&#40;Arrays.asList&#40;7315&#41;&#41;.setOperatingHours&#40;OperatingHoursRange.NEXT_SEVEN_DAYS&#41;
2007+
* .setTop&#40;5&#41;&#41;.block&#40;&#41;.getStatusCode&#40;&#41;;
20052008
* </pre>
20062009
* <!-- end com.azure.maps.search.async.search_along_route -->
20072010
*
@@ -2024,26 +2027,27 @@ public Mono<Response<SearchAddressResult>> searchAlongRouteWithResponse(SearchAl
20242027
*
20252028
* &#47;&#47; create route points
20262029
* List&lt;GeoPosition&gt; getPolygonPoints = new ArrayList&lt;&gt;&#40;&#41;;
2027-
* points.add&#40;new GeoPosition&#40;-122.143035, 47.653536&#41;&#41;;
2028-
* points.add&#40;new GeoPosition&#40;-122.187164, 47.617556&#41;&#41;;
2029-
* points.add&#40;new GeoPosition&#40;-122.114981, 47.570599&#41;&#41;;
2030-
* points.add&#40;new GeoPosition&#40;-122.132756, 47.654009&#41;&#41;;
2030+
* getPolygonPoints.add&#40;new GeoPosition&#40;-122.143035, 47.653536&#41;&#41;;
2031+
* getPolygonPoints.add&#40;new GeoPosition&#40;-122.187164, 47.617556&#41;&#41;;
2032+
* getPolygonPoints.add&#40;new GeoPosition&#40;-122.114981, 47.570599&#41;&#41;;
2033+
* getPolygonPoints.add&#40;new GeoPosition&#40;-122.132756, 47.654009&#41;&#41;;
20312034
* GeoLineString getPolygonRoute = new GeoLineString&#40;getPolygonPoints&#41;;
20322035
*
20332036
* &#47;&#47; simple
2034-
* asyncClient.searchAlongRoute&#40;new SearchAlongRouteOptions&#40;&quot;burger&quot;, 1000, getPolygonRoute&#41;&#41;;
2037+
* SearchAddressResult result = asyncClient.searchAlongRoute&#40;
2038+
* new SearchAlongRouteOptions&#40;&quot;burger&quot;, 1000, getPolygonRoute&#41;&#41;.block&#40;&#41;;
20352039
*
20362040
* &#47;&#47; options
20372041
* asyncClient.searchAlongRoute&#40;
20382042
* new SearchAlongRouteOptions&#40;&quot;burger&quot;, 1000, getPolygonRoute&#41;
20392043
* .setCategoryFilter&#40;Arrays.asList&#40;7315&#41;&#41;
2040-
* .setTop&#40;5&#41;&#41;;
2044+
* .setTop&#40;5&#41;&#41;.block&#40;&#41;;
20412045
*
20422046
* &#47;&#47; complete
20432047
* asyncClient.searchAlongRouteWithResponse&#40;
20442048
* new SearchAlongRouteOptions&#40;&quot;burger&quot;, 1000, getPolygonRoute&#41;
2045-
* .setCategoryFilter&#40;Arrays.asList&#40;7315&#41;&#41;
2046-
* .setTop&#40;5&#41;&#41;.block&#40;&#41;.getStatusCode&#40;&#41;;
2049+
* .setCategoryFilter&#40;Arrays.asList&#40;7315&#41;&#41;.setOperatingHours&#40;OperatingHoursRange.NEXT_SEVEN_DAYS&#41;
2050+
* .setTop&#40;5&#41;&#41;.block&#40;&#41;.getStatusCode&#40;&#41;;
20472051
* </pre>
20482052
* <!-- end com.azure.maps.search.async.search_along_route -->
20492053
*
@@ -2093,7 +2097,7 @@ Mono<Response<SearchAddressResult>> searchAlongRouteWithResponse(SearchAlongRout
20932097
* asyncClient.beginFuzzySearchBatch&#40;fuzzyOptionsList&#41;.getSyncPoller&#40;&#41;.getFinalResult&#40;&#41;;
20942098
* </pre>
20952099
* <!-- end com.azure.maps.search.async.fuzzy_search_batch -->
2096-
*
2100+
*
20972101
* @param optionsList a list of {@link FuzzySearchOptions} to be searched.
20982102
* @throws IllegalArgumentException thrown if parameters fail the validation.
20992103
* @throws HttpResponseException thrown if the request is rejected by server.

sdk/maps/azure-maps-search/src/main/java/com/azure/maps/search/MapsSearchClient.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ public Response<SearchAddressResult> searchPointOfInterestWithResponse(SearchPoi
348348
* Search Nearby Points of Interest
349349
* <!-- src_embed com.azure.maps.search.sync.search_nearby -->
350350
* <pre>
351-
* System.out.println&#40;&quot;Search Nearby:&quot;&#41;;
351+
* System.out.println&#40;&quot;Search Nearby Points of Interest:&quot;&#41;;
352352
*
353353
* &#47;&#47; options
354354
* client.searchNearbyPointsOfInterest&#40;
@@ -380,7 +380,7 @@ public SearchAddressResult searchNearbyPointsOfInterest(SearchNearbyPointsOfInte
380380
* Search Nearby Points of Interest
381381
* <!-- src_embed com.azure.maps.search.sync.search_nearby -->
382382
* <pre>
383-
* System.out.println&#40;&quot;Search Nearby:&quot;&#41;;
383+
* System.out.println&#40;&quot;Search Nearby Points of Interest:&quot;&#41;;
384384
*
385385
* &#47;&#47; options
386386
* client.searchNearbyPointsOfInterest&#40;
@@ -412,7 +412,7 @@ public SearchAddressResult searchNearbyPointsOfInterest(GeoPosition query) {
412412
* Search Nearby Points of Interest
413413
* <!-- src_embed com.azure.maps.search.sync.search_nearby -->
414414
* <pre>
415-
* System.out.println&#40;&quot;Search Nearby:&quot;&#41;;
415+
* System.out.println&#40;&quot;Search Nearby Points of Interest:&quot;&#41;;
416416
*
417417
* &#47;&#47; options
418418
* client.searchNearbyPointsOfInterest&#40;

sdk/maps/azure-maps-search/src/main/java/com/azure/maps/search/implementation/SearchClientImplBuilder.java

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ public SearchClientImplBuilder httpLogOptions(HttpLogOptions httpLogOptions) {
9595
}
9696

9797
/*
98-
* The client options such as application ID and custom headers to set on a
99-
* request.
98+
* The client options such as application ID and custom headers to set on a request.
10099
*/
101100
@Generated private ClientOptions clientOptions;
102101

@@ -130,8 +129,7 @@ public SearchClientImplBuilder addPolicy(HttpPipelinePolicy customPolicy) {
130129
}
131130

132131
/*
133-
* The configuration store that is used during construction of the service
134-
* client.
132+
* The configuration store that is used during construction of the service client.
135133
*/
136134
@Generated private Configuration configuration;
137135

@@ -144,11 +142,9 @@ public SearchClientImplBuilder configuration(Configuration configuration) {
144142
}
145143

146144
/*
147-
* Specifies which account is intended for usage in conjunction with the
148-
* Azure AD security model. It represents a unique ID for the Azure Maps
149-
* account and can be retrieved from the Azure Maps management plane
150-
* Account API. To use Azure AD security in Azure Maps see the following
151-
* [articles](https://aka.ms/amauthdetails) for guidance.
145+
* Specifies which account is intended for usage in conjunction with the Azure AD security model. It represents a
146+
* unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To
147+
* use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
152148
*/
153149
@Generated private String clientId;
154150

@@ -218,8 +214,7 @@ public SearchClientImplBuilder serializerAdapter(SerializerAdapter serializerAda
218214
}
219215

220216
/*
221-
* The retry policy that will attempt to retry failed requests, if
222-
* applicable.
217+
* The retry policy that will attempt to retry failed requests, if applicable.
223218
*/
224219
@Generated private RetryPolicy retryPolicy;
225220

@@ -242,19 +237,13 @@ public SearchClientImplBuilder retryPolicy(RetryPolicy retryPolicy) {
242237
*/
243238
@Generated
244239
public SearchClientImpl buildClient() {
245-
if (pipeline == null) {
246-
this.pipeline = createHttpPipeline();
247-
}
248-
if (host == null) {
249-
this.host = "https://atlas.microsoft.com";
250-
}
251-
if (apiVersion == null) {
252-
this.apiVersion = "1.0";
253-
}
254-
if (serializerAdapter == null) {
255-
this.serializerAdapter = JacksonAdapter.createDefaultSerializerAdapter();
256-
}
257-
SearchClientImpl client = new SearchClientImpl(pipeline, serializerAdapter, clientId, host, apiVersion);
240+
HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline();
241+
String localHost = (host != null) ? host : "https://atlas.microsoft.com";
242+
String localApiVersion = (apiVersion != null) ? apiVersion : "1.0";
243+
SerializerAdapter localSerializerAdapter =
244+
(serializerAdapter != null) ? serializerAdapter : JacksonAdapter.createDefaultSerializerAdapter();
245+
SearchClientImpl client =
246+
new SearchClientImpl(localPipeline, localSerializerAdapter, clientId, localHost, localApiVersion);
258247
return client;
259248
}
260249

0 commit comments

Comments
 (0)