Skip to content

Commit b3adfab

Browse files
committed
revert unnecessary changes
1 parent 33be4d8 commit b3adfab

5 files changed

Lines changed: 45 additions & 61 deletions

File tree

sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexAsyncClient.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,13 +1399,11 @@ Mono<ListSynonymMapsResult> getSynonymMaps() {
13991399
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
14001400
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
14011401
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
1402-
* @return all synonym maps as paginated response with {@link PagedFlux}.
1402+
* @return response from a List SynonymMaps request on successful completion of {@link Mono}.
14031403
*/
1404-
@ServiceMethod(returns = ReturnType.COLLECTION)
1405-
public PagedFlux<SynonymMap> listSynonymMaps() {
1406-
return new PagedFlux<>(() -> listSynonymMapsWithResponse(new RequestOptions())
1407-
.map(response -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(),
1408-
response.getHeaders(), response.getValue().getSynonymMaps(), null, null)));
1404+
@ServiceMethod(returns = ReturnType.SINGLE)
1405+
public Mono<ListSynonymMapsResult> listSynonymMaps() {
1406+
return getSynonymMaps();
14091407
}
14101408

14111409
/**
@@ -1430,7 +1428,7 @@ public PagedFlux<SynonymMap> listSynonymMaps() {
14301428
* {@link Mono}.
14311429
*/
14321430
@ServiceMethod(returns = ReturnType.SINGLE)
1433-
Mono<Response<ListSynonymMapsResult>> listSynonymMapsWithResponse(RequestOptions requestOptions) {
1431+
public Mono<Response<ListSynonymMapsResult>> listSynonymMapsWithResponse(RequestOptions requestOptions) {
14341432
return mapResponse(getSynonymMapsWithResponse(requestOptions), ListSynonymMapsResult.class);
14351433
}
14361434

sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClient.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,15 +1438,11 @@ ListSynonymMapsResult getSynonymMaps() {
14381438
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
14391439
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
14401440
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
1441-
* @return all synonym maps as paginated response with {@link PagedIterable}.
1441+
* @return response from a List SynonymMaps request.
14421442
*/
1443-
@ServiceMethod(returns = ReturnType.COLLECTION)
1444-
public PagedIterable<SynonymMap> listSynonymMaps() {
1445-
return new PagedIterable<>(() -> {
1446-
Response<ListSynonymMapsResult> response = listSynonymMapsWithResponse(new RequestOptions());
1447-
return new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(),
1448-
response.getValue().getSynonymMaps(), null, null);
1449-
});
1443+
@ServiceMethod(returns = ReturnType.SINGLE)
1444+
public ListSynonymMapsResult listSynonymMaps() {
1445+
return getSynonymMaps();
14501446
}
14511447

14521448
/**
@@ -1470,7 +1466,7 @@ public PagedIterable<SynonymMap> listSynonymMaps() {
14701466
* @return response from a List SynonymMaps request along with {@link Response}.
14711467
*/
14721468
@ServiceMethod(returns = ReturnType.SINGLE)
1473-
Response<ListSynonymMapsResult> listSynonymMapsWithResponse(RequestOptions requestOptions) {
1469+
public Response<ListSynonymMapsResult> listSynonymMapsWithResponse(RequestOptions requestOptions) {
14741470
return convertResponse(getSynonymMapsWithResponse(requestOptions), ListSynonymMapsResult.class);
14751471
}
14761472

sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerAsyncClient.java

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,13 +1362,11 @@ public Mono<SearchIndexerDataSourceConnection> getDataSourceConnection(String na
13621362
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
13631363
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
13641364
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
1365-
* @return all datasources as paginated response with {@link PagedFlux}.
1365+
* @return response from a List Datasources request on successful completion of {@link Mono}.
13661366
*/
1367-
@ServiceMethod(returns = ReturnType.COLLECTION)
1368-
public PagedFlux<SearchIndexerDataSourceConnection> listDataSourceConnections() {
1369-
return new PagedFlux<>(() -> listDataSourceConnectionsWithResponse(new RequestOptions())
1370-
.map(response -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(),
1371-
response.getHeaders(), response.getValue().getDataSources(), null, null)));
1367+
@ServiceMethod(returns = ReturnType.SINGLE)
1368+
public Mono<ListDataSourcesResult> listDataSourceConnections() {
1369+
return getDataSourceConnections();
13721370
}
13731371

13741372
/**
@@ -1393,7 +1391,7 @@ public PagedFlux<SearchIndexerDataSourceConnection> listDataSourceConnections()
13931391
* {@link Mono}.
13941392
*/
13951393
@ServiceMethod(returns = ReturnType.SINGLE)
1396-
Mono<Response<ListDataSourcesResult>> listDataSourceConnectionsWithResponse(RequestOptions requestOptions) {
1394+
public Mono<Response<ListDataSourcesResult>> listDataSourceConnectionsWithResponse(RequestOptions requestOptions) {
13971395
return mapResponse(getDataSourceConnectionsWithResponse(requestOptions), ListDataSourcesResult.class);
13981396
}
13991397

@@ -1624,13 +1622,11 @@ public Mono<SearchIndexer> getIndexer(String name) {
16241622
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
16251623
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
16261624
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
1627-
* @return all indexers as paginated response with {@link PagedFlux}.
1625+
* @return response from a List Indexers request on successful completion of {@link Mono}.
16281626
*/
1629-
@ServiceMethod(returns = ReturnType.COLLECTION)
1630-
public PagedFlux<SearchIndexer> listIndexers() {
1631-
return new PagedFlux<>(() -> listIndexersWithResponse(new RequestOptions())
1632-
.map(response -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(),
1633-
response.getHeaders(), response.getValue().getIndexers(), null, null)));
1627+
@ServiceMethod(returns = ReturnType.SINGLE)
1628+
public Mono<ListIndexersResult> listIndexers() {
1629+
return getIndexers();
16341630
}
16351631

16361632
/**
@@ -1655,7 +1651,7 @@ public PagedFlux<SearchIndexer> listIndexers() {
16551651
* {@link Mono}.
16561652
*/
16571653
@ServiceMethod(returns = ReturnType.SINGLE)
1658-
Mono<Response<ListIndexersResult>> listIndexersWithResponse(RequestOptions requestOptions) {
1654+
public Mono<Response<ListIndexersResult>> listIndexersWithResponse(RequestOptions requestOptions) {
16591655
return mapResponse(getIndexersWithResponse(requestOptions), ListIndexersResult.class);
16601656
}
16611657

sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClient.java

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,15 +1334,11 @@ public SearchIndexerDataSourceConnection getDataSourceConnection(String name) {
13341334
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
13351335
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
13361336
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
1337-
* @return all datasources as paginated response with {@link PagedIterable}.
1337+
* @return response from a List Datasources request.
13381338
*/
1339-
@ServiceMethod(returns = ReturnType.COLLECTION)
1340-
public PagedIterable<SearchIndexerDataSourceConnection> listDataSourceConnections() {
1341-
return new PagedIterable<>(() -> {
1342-
Response<ListDataSourcesResult> response = listDataSourceConnectionsWithResponse(new RequestOptions());
1343-
return new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(),
1344-
response.getValue().getDataSources(), null, null);
1345-
});
1339+
@ServiceMethod(returns = ReturnType.SINGLE)
1340+
public ListDataSourcesResult listDataSourceConnections() {
1341+
return getDataSourceConnections();
13461342
}
13471343

13481344
/**
@@ -1367,7 +1363,7 @@ public PagedIterable<SearchIndexerDataSourceConnection> listDataSourceConnection
13671363
* @return response from a List Datasources request along with {@link Response}.
13681364
*/
13691365
@ServiceMethod(returns = ReturnType.SINGLE)
1370-
Response<ListDataSourcesResult> listDataSourceConnectionsWithResponse(RequestOptions requestOptions) {
1366+
public Response<ListDataSourcesResult> listDataSourceConnectionsWithResponse(RequestOptions requestOptions) {
13711367
return convertResponse(getDataSourceConnectionsWithResponse(requestOptions), ListDataSourcesResult.class);
13721368
}
13731369

@@ -1586,15 +1582,11 @@ public SearchIndexer getIndexer(String name) {
15861582
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
15871583
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
15881584
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
1589-
* @return all indexers as paginated response with {@link PagedIterable}.
1585+
* @return response from a List Indexers request.
15901586
*/
1591-
@ServiceMethod(returns = ReturnType.COLLECTION)
1592-
public PagedIterable<SearchIndexer> listIndexers() {
1593-
return new PagedIterable<>(() -> {
1594-
Response<ListIndexersResult> response = listIndexersWithResponse(new RequestOptions());
1595-
return new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(),
1596-
response.getValue().getIndexers(), null, null);
1597-
});
1587+
@ServiceMethod(returns = ReturnType.SINGLE)
1588+
public ListIndexersResult listIndexers() {
1589+
return getIndexers();
15981590
}
15991591

16001592
/**
@@ -1618,7 +1610,7 @@ public PagedIterable<SearchIndexer> listIndexers() {
16181610
* @return response from a List Indexers request along with {@link Response}.
16191611
*/
16201612
@ServiceMethod(returns = ReturnType.SINGLE)
1621-
Response<ListIndexersResult> listIndexersWithResponse(RequestOptions requestOptions) {
1613+
public Response<ListIndexersResult> listIndexersWithResponse(RequestOptions requestOptions) {
16221614
return convertResponse(getIndexersWithResponse(requestOptions), ListIndexersResult.class);
16231615
}
16241616

sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/SearchJavaDocCodeSnippets.java

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
import com.azure.search.documents.indexes.models.GetIndexStatisticsResult;
2424
import com.azure.search.documents.indexes.models.InputFieldMappingEntry;
2525
import com.azure.search.documents.indexes.models.LexicalTokenizerName;
26-
26+
import com.azure.search.documents.indexes.models.ListDataSourcesResult;
27+
import com.azure.search.documents.indexes.models.ListIndexersResult;
28+
import com.azure.search.documents.indexes.models.ListSynonymMapsResult;
2729
import com.azure.search.documents.indexes.models.OcrSkill;
2830
import com.azure.search.documents.indexes.models.OutputFieldMappingEntry;
2931
import com.azure.search.documents.indexes.models.SearchAlias;
@@ -985,8 +987,8 @@ public void getSynonymMapWithResponse() {
985987
*/
986988
public void listSynonymMaps() {
987989
// BEGIN: com.azure.search.documents.indexes.SearchIndexClient.listSynonymMaps
988-
PagedIterable<SynonymMap> synonymMaps = SEARCH_INDEX_CLIENT.listSynonymMaps();
989-
for (SynonymMap synonymMap: synonymMaps) {
990+
ListSynonymMapsResult synonymMaps = SEARCH_INDEX_CLIENT.listSynonymMaps();
991+
for (SynonymMap synonymMap: synonymMaps.getSynonymMaps()) {
990992
System.out.printf("The synonymMap name is %s. The ETag of synonymMap is %s.%n", synonymMap.getName(),
991993
synonymMap.getETag());
992994
}
@@ -1347,9 +1349,9 @@ public void getSynonymMapWithResponseAsync() {
13471349
public void listSynonymMapsAsync() {
13481350
// BEGIN: com.azure.search.documents.indexes.SearchIndexAsyncClient.listSynonymMaps
13491351
SEARCH_INDEX_ASYNC_CLIENT.listSynonymMaps()
1350-
.subscribe(synonymMap ->
1352+
.subscribe(result -> result.getSynonymMaps().forEach(synonymMap ->
13511353
System.out.printf("The synonymMap name is %s. The ETag of synonymMap is %s.%n",
1352-
synonymMap.getName(), synonymMap.getETag()));
1354+
synonymMap.getName(), synonymMap.getETag())));
13531355
// END: com.azure.search.documents.indexes.SearchIndexAsyncClient.listSynonymMaps
13541356
}
13551357

@@ -1517,8 +1519,8 @@ public void getSearchIndexerWithResponse() {
15171519
*/
15181520
public void listIndexers() {
15191521
// BEGIN: com.azure.search.documents.indexes.SearchIndexerClient.listIndexers
1520-
PagedIterable<SearchIndexer> indexers = SEARCH_INDEXER_CLIENT.listIndexers();
1521-
for (SearchIndexer indexer: indexers) {
1522+
ListIndexersResult indexers = SEARCH_INDEXER_CLIENT.listIndexers();
1523+
for (SearchIndexer indexer: indexers.getIndexers()) {
15221524
System.out.printf("The indexer name is %s. The ETag of indexer is %s.%n", indexer.getName(),
15231525
indexer.getETag());
15241526
}
@@ -1752,8 +1754,8 @@ public void getDataSourceWithResponse() {
17521754
*/
17531755
public void listDataSources() {
17541756
// BEGIN: com.azure.search.documents.indexes.SearchIndexerClient.listDataSourceConnections
1755-
PagedIterable<SearchIndexerDataSourceConnection> dataSources = SEARCH_INDEXER_CLIENT.listDataSourceConnections();
1756-
for (SearchIndexerDataSourceConnection dataSource: dataSources) {
1757+
ListDataSourcesResult dataSources = SEARCH_INDEXER_CLIENT.listDataSourceConnections();
1758+
for (SearchIndexerDataSourceConnection dataSource: dataSources.getDataSources()) {
17571759
System.out.printf("The dataSource name is %s. The ETag of dataSource is %s.%n", dataSource.getName(),
17581760
dataSource.getETag());
17591761
}
@@ -2103,9 +2105,9 @@ public void getSearchIndexerWithResponseAsync() {
21032105
public void listIndexersAsync() {
21042106
// BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.listIndexers
21052107
SEARCH_INDEXER_ASYNC_CLIENT.listIndexers()
2106-
.subscribe(indexer ->
2108+
.subscribe(result -> result.getIndexers().forEach(indexer ->
21072109
System.out.printf("The indexer name is %s. The ETag of indexer is %s.%n", indexer.getName(),
2108-
indexer.getETag()));
2110+
indexer.getETag())));
21092111
// END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.listIndexers
21102112
}
21112113

@@ -2307,9 +2309,9 @@ public void getDataSourceWithResponseAsync() {
23072309
public void listDataSourcesAsync() {
23082310
// BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.listDataSourceConnections
23092311
SEARCH_INDEXER_ASYNC_CLIENT.listDataSourceConnections()
2310-
.subscribe(dataSource ->
2312+
.subscribe(result -> result.getDataSources().forEach(dataSource ->
23112313
System.out.printf("The dataSource name is %s. The ETag of dataSource is %s.%n",
2312-
dataSource.getName(), dataSource.getETag()));
2314+
dataSource.getName(), dataSource.getETag())));
23132315
// END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.listDataSourceConnections
23142316
}
23152317

0 commit comments

Comments
 (0)