diff --git a/sdk/search/azure-search-documents/pom.xml b/sdk/search/azure-search-documents/pom.xml
index 6b2f7beeeda1..c78615854dba 100644
--- a/sdk/search/azure-search-documents/pom.xml
+++ b/sdk/search/azure-search-documents/pom.xml
@@ -107,4 +107,22 @@
test
+
+
+
+
+ org.revapi
+ revapi-maven-plugin
+
+
+ com.azure:azure-search-documents:11.7.10
+
+
+ com.azure:azure-search-documents:11.8.0-beta.9
+
+ true
+
+
+
+
diff --git a/sdk/search/azure-search-documents/search/src/main/java/com/azure/search/Aliases.java b/sdk/search/azure-search-documents/search/src/main/java/com/azure/search/Aliases.java
new file mode 100644
index 000000000000..65dfb0b12c73
--- /dev/null
+++ b/sdk/search/azure-search-documents/search/src/main/java/com/azure/search/Aliases.java
@@ -0,0 +1,491 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package com.azure.search;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.Delete;
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Post;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.search.models.ErrorResponseException;
+import com.azure.search.models.ListAliasesResult;
+import com.azure.search.models.RequestOptions;
+import com.azure.search.models.SearchAlias;
+import java.util.UUID;
+import reactor.core.publisher.Mono;
+
+/**
+ * An instance of this class provides access to all the operations defined in Aliases.
+ */
+public final class Aliases {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final AliasesService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final SearchClient client;
+
+ /**
+ * Initializes an instance of Aliases.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ Aliases(SearchClient client) {
+ this.service = RestProxy.create(AliasesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for SearchClientAliases to be used by the proxy service to perform REST
+ * calls.
+ */
+ @Host("{endpoint}")
+ @ServiceInterface(name = "SearchClientAliases")
+ public interface AliasesService {
+ @Post("/aliases")
+ @ExpectedResponses({ 201 })
+ @UnexpectedResponseExceptionType(ErrorResponseException.class)
+ Mono> create(@HostParam("endpoint") String endpoint,
+ @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId,
+ @QueryParam("api-version") String apiVersion, @BodyParam("application/json") SearchAlias alias,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Get("/aliases")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ErrorResponseException.class)
+ Mono> list(@HostParam("endpoint") String endpoint,
+ @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
+
+ @Put("/aliases('{aliasName}')")
+ @ExpectedResponses({ 200, 201 })
+ @UnexpectedResponseExceptionType(ErrorResponseException.class)
+ Mono> createOrUpdate(@HostParam("endpoint") String endpoint,
+ @PathParam("aliasName") String aliasName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("Prefer") String prefer, @QueryParam("api-version") String apiVersion,
+ @BodyParam("application/json") SearchAlias alias, @HeaderParam("Accept") String accept, Context context);
+
+ @Delete("/aliases('{aliasName}')")
+ @ExpectedResponses({ 204, 404 })
+ @UnexpectedResponseExceptionType(ErrorResponseException.class)
+ Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("aliasName") String aliasName,
+ @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("If-Match") String ifMatch,
+ @HeaderParam("If-None-Match") String ifNoneMatch, @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Get("/aliases('{aliasName}')")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ErrorResponseException.class)
+ Mono> get(@HostParam("endpoint") String endpoint,
+ @PathParam("aliasName") String aliasName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
+ }
+
+ /**
+ * Creates a new search alias.
+ *
+ * @param alias The definition of the alias to create.
+ * @param requestOptions Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents an index alias, which describes a mapping from the alias name to an index along with
+ * {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> createWithResponseAsync(SearchAlias alias, RequestOptions requestOptions) {
+ return FluxUtil.withContext(context -> createWithResponseAsync(alias, requestOptions, context));
+ }
+
+ /**
+ * Creates a new search alias.
+ *
+ * @param alias The definition of the alias to create.
+ * @param requestOptions Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents an index alias, which describes a mapping from the alias name to an index along with
+ * {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> createWithResponseAsync(SearchAlias alias, RequestOptions requestOptions,
+ Context context) {
+ final String accept = "application/json";
+ UUID xMsClientRequestIdInternal = null;
+ if (requestOptions != null) {
+ xMsClientRequestIdInternal = requestOptions.getXMsClientRequestId();
+ }
+ UUID xMsClientRequestId = xMsClientRequestIdInternal;
+ return service.create(this.client.getEndpoint(), xMsClientRequestId, this.client.getApiVersion(), alias, accept,
+ context);
+ }
+
+ /**
+ * Creates a new search alias.
+ *
+ * @param alias The definition of the alias to create.
+ * @param requestOptions Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents an index alias, which describes a mapping from the alias name to an index on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono createAsync(SearchAlias alias, RequestOptions requestOptions) {
+ return createWithResponseAsync(alias, requestOptions).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Creates a new search alias.
+ *
+ * @param alias The definition of the alias to create.
+ * @param requestOptions Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents an index alias, which describes a mapping from the alias name to an index on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono createAsync(SearchAlias alias, RequestOptions requestOptions, Context context) {
+ return createWithResponseAsync(alias, requestOptions, context).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Lists all aliases available for a search service.
+ *
+ * @param requestOptions Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response from a List Aliases request along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> listSinglePageAsync(RequestOptions requestOptions, Context context) {
+ final String accept = "application/json";
+ UUID xMsClientRequestIdInternal = null;
+ if (requestOptions != null) {
+ xMsClientRequestIdInternal = requestOptions.getXMsClientRequestId();
+ }
+ UUID xMsClientRequestId = xMsClientRequestIdInternal;
+ return service.list(this.client.getEndpoint(), xMsClientRequestId, this.client.getApiVersion(), accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().getAliases(), null, null));
+ }
+
+ /**
+ * Lists all aliases available for a search service.
+ *
+ * @param requestOptions Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response from a List Aliases request as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listAsync(RequestOptions requestOptions, Context context) {
+ return new PagedFlux<>(() -> listSinglePageAsync(requestOptions, context));
+ }
+
+ /**
+ * Creates a new search alias or updates an alias if it already exists.
+ *
+ * @param aliasName The definition of the alias to create or update.
+ * @param alias The definition of the alias to create or update.
+ * @param ifMatch Defines the If-Match condition. The operation will be performed only if the ETag on the server
+ * matches this value.
+ * @param ifNoneMatch Defines the If-None-Match condition. The operation will be performed only if the ETag on the
+ * server does not match this value.
+ * @param requestOptions Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents an index alias, which describes a mapping from the alias name to an index along with
+ * {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> createOrUpdateWithResponseAsync(String aliasName, SearchAlias alias,
+ String ifMatch, String ifNoneMatch, RequestOptions requestOptions) {
+ return FluxUtil.withContext(context -> createOrUpdateWithResponseAsync(aliasName, alias, ifMatch, ifNoneMatch,
+ requestOptions, context));
+ }
+
+ /**
+ * Creates a new search alias or updates an alias if it already exists.
+ *
+ * @param aliasName The definition of the alias to create or update.
+ * @param alias The definition of the alias to create or update.
+ * @param ifMatch Defines the If-Match condition. The operation will be performed only if the ETag on the server
+ * matches this value.
+ * @param ifNoneMatch Defines the If-None-Match condition. The operation will be performed only if the ETag on the
+ * server does not match this value.
+ * @param requestOptions Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents an index alias, which describes a mapping from the alias name to an index along with
+ * {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> createOrUpdateWithResponseAsync(String aliasName, SearchAlias alias,
+ String ifMatch, String ifNoneMatch, RequestOptions requestOptions, Context context) {
+ final String prefer = "return=representation";
+ final String accept = "application/json";
+ UUID xMsClientRequestIdInternal = null;
+ if (requestOptions != null) {
+ xMsClientRequestIdInternal = requestOptions.getXMsClientRequestId();
+ }
+ UUID xMsClientRequestId = xMsClientRequestIdInternal;
+ return service.createOrUpdate(this.client.getEndpoint(), aliasName, xMsClientRequestId, ifMatch, ifNoneMatch,
+ prefer, this.client.getApiVersion(), alias, accept, context);
+ }
+
+ /**
+ * Creates a new search alias or updates an alias if it already exists.
+ *
+ * @param aliasName The definition of the alias to create or update.
+ * @param alias The definition of the alias to create or update.
+ * @param ifMatch Defines the If-Match condition. The operation will be performed only if the ETag on the server
+ * matches this value.
+ * @param ifNoneMatch Defines the If-None-Match condition. The operation will be performed only if the ETag on the
+ * server does not match this value.
+ * @param requestOptions Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents an index alias, which describes a mapping from the alias name to an index on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono createOrUpdateAsync(String aliasName, SearchAlias alias, String ifMatch,
+ String ifNoneMatch, RequestOptions requestOptions) {
+ return createOrUpdateWithResponseAsync(aliasName, alias, ifMatch, ifNoneMatch, requestOptions)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Creates a new search alias or updates an alias if it already exists.
+ *
+ * @param aliasName The definition of the alias to create or update.
+ * @param alias The definition of the alias to create or update.
+ * @param ifMatch Defines the If-Match condition. The operation will be performed only if the ETag on the server
+ * matches this value.
+ * @param ifNoneMatch Defines the If-None-Match condition. The operation will be performed only if the ETag on the
+ * server does not match this value.
+ * @param requestOptions Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents an index alias, which describes a mapping from the alias name to an index on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono createOrUpdateAsync(String aliasName, SearchAlias alias, String ifMatch,
+ String ifNoneMatch, RequestOptions requestOptions, Context context) {
+ return createOrUpdateWithResponseAsync(aliasName, alias, ifMatch, ifNoneMatch, requestOptions, context)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Deletes a search alias and its associated mapping to an index. This operation is permanent, with no recovery
+ * option. The mapped index is untouched by this operation.
+ *
+ * @param aliasName The name of the alias to delete.
+ * @param ifMatch Defines the If-Match condition. The operation will be performed only if the ETag on the server
+ * matches this value.
+ * @param ifNoneMatch Defines the If-None-Match condition. The operation will be performed only if the ETag on the
+ * server does not match this value.
+ * @param requestOptions Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> deleteWithResponseAsync(String aliasName, String ifMatch, String ifNoneMatch,
+ RequestOptions requestOptions) {
+ return FluxUtil
+ .withContext(context -> deleteWithResponseAsync(aliasName, ifMatch, ifNoneMatch, requestOptions, context));
+ }
+
+ /**
+ * Deletes a search alias and its associated mapping to an index. This operation is permanent, with no recovery
+ * option. The mapped index is untouched by this operation.
+ *
+ * @param aliasName The name of the alias to delete.
+ * @param ifMatch Defines the If-Match condition. The operation will be performed only if the ETag on the server
+ * matches this value.
+ * @param ifNoneMatch Defines the If-None-Match condition. The operation will be performed only if the ETag on the
+ * server does not match this value.
+ * @param requestOptions Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> deleteWithResponseAsync(String aliasName, String ifMatch, String ifNoneMatch,
+ RequestOptions requestOptions, Context context) {
+ final String accept = "application/json";
+ UUID xMsClientRequestIdInternal = null;
+ if (requestOptions != null) {
+ xMsClientRequestIdInternal = requestOptions.getXMsClientRequestId();
+ }
+ UUID xMsClientRequestId = xMsClientRequestIdInternal;
+ return service.delete(this.client.getEndpoint(), aliasName, xMsClientRequestId, ifMatch, ifNoneMatch,
+ this.client.getApiVersion(), accept, context);
+ }
+
+ /**
+ * Deletes a search alias and its associated mapping to an index. This operation is permanent, with no recovery
+ * option. The mapped index is untouched by this operation.
+ *
+ * @param aliasName The name of the alias to delete.
+ * @param ifMatch Defines the If-Match condition. The operation will be performed only if the ETag on the server
+ * matches this value.
+ * @param ifNoneMatch Defines the If-None-Match condition. The operation will be performed only if the ETag on the
+ * server does not match this value.
+ * @param requestOptions Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono deleteAsync(String aliasName, String ifMatch, String ifNoneMatch, RequestOptions requestOptions) {
+ return deleteWithResponseAsync(aliasName, ifMatch, ifNoneMatch, requestOptions)
+ .flatMap(ignored -> Mono.empty());
+ }
+
+ /**
+ * Deletes a search alias and its associated mapping to an index. This operation is permanent, with no recovery
+ * option. The mapped index is untouched by this operation.
+ *
+ * @param aliasName The name of the alias to delete.
+ * @param ifMatch Defines the If-Match condition. The operation will be performed only if the ETag on the server
+ * matches this value.
+ * @param ifNoneMatch Defines the If-None-Match condition. The operation will be performed only if the ETag on the
+ * server does not match this value.
+ * @param requestOptions Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono deleteAsync(String aliasName, String ifMatch, String ifNoneMatch, RequestOptions requestOptions,
+ Context context) {
+ return deleteWithResponseAsync(aliasName, ifMatch, ifNoneMatch, requestOptions, context)
+ .flatMap(ignored -> Mono.empty());
+ }
+
+ /**
+ * Retrieves an alias definition.
+ *
+ * @param aliasName The name of the alias to retrieve.
+ * @param requestOptions Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents an index alias, which describes a mapping from the alias name to an index along with
+ * {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getWithResponseAsync(String aliasName, RequestOptions requestOptions) {
+ return FluxUtil.withContext(context -> getWithResponseAsync(aliasName, requestOptions, context));
+ }
+
+ /**
+ * Retrieves an alias definition.
+ *
+ * @param aliasName The name of the alias to retrieve.
+ * @param requestOptions Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents an index alias, which describes a mapping from the alias name to an index along with
+ * {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getWithResponseAsync(String aliasName, RequestOptions requestOptions,
+ Context context) {
+ final String accept = "application/json";
+ UUID xMsClientRequestIdInternal = null;
+ if (requestOptions != null) {
+ xMsClientRequestIdInternal = requestOptions.getXMsClientRequestId();
+ }
+ UUID xMsClientRequestId = xMsClientRequestIdInternal;
+ return service.get(this.client.getEndpoint(), aliasName, xMsClientRequestId, this.client.getApiVersion(),
+ accept, context);
+ }
+
+ /**
+ * Retrieves an alias definition.
+ *
+ * @param aliasName The name of the alias to retrieve.
+ * @param requestOptions Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents an index alias, which describes a mapping from the alias name to an index on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getAsync(String aliasName, RequestOptions requestOptions) {
+ return getWithResponseAsync(aliasName, requestOptions).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Retrieves an alias definition.
+ *
+ * @param aliasName The name of the alias to retrieve.
+ * @param requestOptions Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents an index alias, which describes a mapping from the alias name to an index on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getAsync(String aliasName, RequestOptions requestOptions, Context context) {
+ return getWithResponseAsync(aliasName, requestOptions, context)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+}
diff --git a/sdk/search/azure-search-documents/search/src/main/java/com/azure/search/DataSources.java b/sdk/search/azure-search-documents/search/src/main/java/com/azure/search/DataSources.java
new file mode 100644
index 000000000000..401f098f1822
--- /dev/null
+++ b/sdk/search/azure-search-documents/search/src/main/java/com/azure/search/DataSources.java
@@ -0,0 +1,545 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package com.azure.search;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.Delete;
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Post;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.search.models.ErrorResponseException;
+import com.azure.search.models.ListDataSourcesResult;
+import com.azure.search.models.RequestOptions;
+import com.azure.search.models.SearchIndexerDataSource;
+import java.util.UUID;
+import reactor.core.publisher.Mono;
+
+/**
+ * An instance of this class provides access to all the operations defined in DataSources.
+ */
+public final class DataSources {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final DataSourcesService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final SearchClient client;
+
+ /**
+ * Initializes an instance of DataSources.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ DataSources(SearchClient client) {
+ this.service
+ = RestProxy.create(DataSourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for SearchClientDataSources to be used by the proxy service to perform
+ * REST calls.
+ */
+ @Host("{endpoint}")
+ @ServiceInterface(name = "SearchClientDataSources")
+ public interface DataSourcesService {
+ @Put("/datasources('{dataSourceName}')")
+ @ExpectedResponses({ 200, 201 })
+ @UnexpectedResponseExceptionType(ErrorResponseException.class)
+ Mono> createOrUpdate(@HostParam("endpoint") String endpoint,
+ @PathParam("dataSourceName") String dataSourceName,
+ @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("If-Match") String ifMatch,
+ @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("Prefer") String prefer,
+ @QueryParam("api-version") String apiVersion,
+ @QueryParam("ignoreResetRequirements") Boolean skipIndexerResetRequirementForCache,
+ @BodyParam("application/json") SearchIndexerDataSource dataSource, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Delete("/datasources('{dataSourceName}')")
+ @ExpectedResponses({ 204, 404 })
+ @UnexpectedResponseExceptionType(ErrorResponseException.class)
+ Mono> delete(@HostParam("endpoint") String endpoint,
+ @PathParam("dataSourceName") String dataSourceName,
+ @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("If-Match") String ifMatch,
+ @HeaderParam("If-None-Match") String ifNoneMatch, @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Get("/datasources('{dataSourceName}')")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ErrorResponseException.class)
+ Mono> get(@HostParam("endpoint") String endpoint,
+ @PathParam("dataSourceName") String dataSourceName,
+ @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
+
+ @Get("/datasources")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ErrorResponseException.class)
+ Mono> list(@HostParam("endpoint") String endpoint,
+ @QueryParam("$select") String select, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
+
+ @Post("/datasources")
+ @ExpectedResponses({ 201 })
+ @UnexpectedResponseExceptionType(ErrorResponseException.class)
+ Mono> create(@HostParam("endpoint") String endpoint,
+ @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId,
+ @QueryParam("api-version") String apiVersion,
+ @BodyParam("application/json") SearchIndexerDataSource dataSource, @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Creates a new datasource or updates a datasource if it already exists.
+ *
+ * @param dataSourceName The name of the datasource to create or update.
+ * @param dataSource The definition of the datasource to create or update.
+ * @param ifMatch Defines the If-Match condition. The operation will be performed only if the ETag on the server
+ * matches this value.
+ * @param ifNoneMatch Defines the If-None-Match condition. The operation will be performed only if the ETag on the
+ * server does not match this value.
+ * @param skipIndexerResetRequirementForCache Ignores cache reset requirements.
+ * @param requestOptions Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents a datasource definition, which can be used to configure an indexer along with {@link Response}
+ * on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> createOrUpdateWithResponseAsync(String dataSourceName,
+ SearchIndexerDataSource dataSource, String ifMatch, String ifNoneMatch,
+ Boolean skipIndexerResetRequirementForCache, RequestOptions requestOptions) {
+ return FluxUtil.withContext(context -> createOrUpdateWithResponseAsync(dataSourceName, dataSource, ifMatch,
+ ifNoneMatch, skipIndexerResetRequirementForCache, requestOptions, context));
+ }
+
+ /**
+ * Creates a new datasource or updates a datasource if it already exists.
+ *
+ * @param dataSourceName The name of the datasource to create or update.
+ * @param dataSource The definition of the datasource to create or update.
+ * @param ifMatch Defines the If-Match condition. The operation will be performed only if the ETag on the server
+ * matches this value.
+ * @param ifNoneMatch Defines the If-None-Match condition. The operation will be performed only if the ETag on the
+ * server does not match this value.
+ * @param skipIndexerResetRequirementForCache Ignores cache reset requirements.
+ * @param requestOptions Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents a datasource definition, which can be used to configure an indexer along with {@link Response}
+ * on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> createOrUpdateWithResponseAsync(String dataSourceName,
+ SearchIndexerDataSource dataSource, String ifMatch, String ifNoneMatch,
+ Boolean skipIndexerResetRequirementForCache, RequestOptions requestOptions, Context context) {
+ final String prefer = "return=representation";
+ final String accept = "application/json";
+ UUID xMsClientRequestIdInternal = null;
+ if (requestOptions != null) {
+ xMsClientRequestIdInternal = requestOptions.getXMsClientRequestId();
+ }
+ UUID xMsClientRequestId = xMsClientRequestIdInternal;
+ return service.createOrUpdate(this.client.getEndpoint(), dataSourceName, xMsClientRequestId, ifMatch,
+ ifNoneMatch, prefer, this.client.getApiVersion(), skipIndexerResetRequirementForCache, dataSource, accept,
+ context);
+ }
+
+ /**
+ * Creates a new datasource or updates a datasource if it already exists.
+ *
+ * @param dataSourceName The name of the datasource to create or update.
+ * @param dataSource The definition of the datasource to create or update.
+ * @param ifMatch Defines the If-Match condition. The operation will be performed only if the ETag on the server
+ * matches this value.
+ * @param ifNoneMatch Defines the If-None-Match condition. The operation will be performed only if the ETag on the
+ * server does not match this value.
+ * @param skipIndexerResetRequirementForCache Ignores cache reset requirements.
+ * @param requestOptions Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents a datasource definition, which can be used to configure an indexer on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono createOrUpdateAsync(String dataSourceName, SearchIndexerDataSource dataSource,
+ String ifMatch, String ifNoneMatch, Boolean skipIndexerResetRequirementForCache,
+ RequestOptions requestOptions) {
+ return createOrUpdateWithResponseAsync(dataSourceName, dataSource, ifMatch, ifNoneMatch,
+ skipIndexerResetRequirementForCache, requestOptions).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Creates a new datasource or updates a datasource if it already exists.
+ *
+ * @param dataSourceName The name of the datasource to create or update.
+ * @param dataSource The definition of the datasource to create or update.
+ * @param ifMatch Defines the If-Match condition. The operation will be performed only if the ETag on the server
+ * matches this value.
+ * @param ifNoneMatch Defines the If-None-Match condition. The operation will be performed only if the ETag on the
+ * server does not match this value.
+ * @param skipIndexerResetRequirementForCache Ignores cache reset requirements.
+ * @param requestOptions Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents a datasource definition, which can be used to configure an indexer on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono createOrUpdateAsync(String dataSourceName, SearchIndexerDataSource dataSource,
+ String ifMatch, String ifNoneMatch, Boolean skipIndexerResetRequirementForCache, RequestOptions requestOptions,
+ Context context) {
+ return createOrUpdateWithResponseAsync(dataSourceName, dataSource, ifMatch, ifNoneMatch,
+ skipIndexerResetRequirementForCache, requestOptions, context)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Deletes a datasource.
+ *
+ * @param dataSourceName The name of the datasource to delete.
+ * @param ifMatch Defines the If-Match condition. The operation will be performed only if the ETag on the server
+ * matches this value.
+ * @param ifNoneMatch Defines the If-None-Match condition. The operation will be performed only if the ETag on the
+ * server does not match this value.
+ * @param requestOptions Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> deleteWithResponseAsync(String dataSourceName, String ifMatch, String ifNoneMatch,
+ RequestOptions requestOptions) {
+ return FluxUtil.withContext(
+ context -> deleteWithResponseAsync(dataSourceName, ifMatch, ifNoneMatch, requestOptions, context));
+ }
+
+ /**
+ * Deletes a datasource.
+ *
+ * @param dataSourceName The name of the datasource to delete.
+ * @param ifMatch Defines the If-Match condition. The operation will be performed only if the ETag on the server
+ * matches this value.
+ * @param ifNoneMatch Defines the If-None-Match condition. The operation will be performed only if the ETag on the
+ * server does not match this value.
+ * @param requestOptions Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> deleteWithResponseAsync(String dataSourceName, String ifMatch, String ifNoneMatch,
+ RequestOptions requestOptions, Context context) {
+ final String accept = "application/json";
+ UUID xMsClientRequestIdInternal = null;
+ if (requestOptions != null) {
+ xMsClientRequestIdInternal = requestOptions.getXMsClientRequestId();
+ }
+ UUID xMsClientRequestId = xMsClientRequestIdInternal;
+ return service.delete(this.client.getEndpoint(), dataSourceName, xMsClientRequestId, ifMatch, ifNoneMatch,
+ this.client.getApiVersion(), accept, context);
+ }
+
+ /**
+ * Deletes a datasource.
+ *
+ * @param dataSourceName The name of the datasource to delete.
+ * @param ifMatch Defines the If-Match condition. The operation will be performed only if the ETag on the server
+ * matches this value.
+ * @param ifNoneMatch Defines the If-None-Match condition. The operation will be performed only if the ETag on the
+ * server does not match this value.
+ * @param requestOptions Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono deleteAsync(String dataSourceName, String ifMatch, String ifNoneMatch,
+ RequestOptions requestOptions) {
+ return deleteWithResponseAsync(dataSourceName, ifMatch, ifNoneMatch, requestOptions)
+ .flatMap(ignored -> Mono.empty());
+ }
+
+ /**
+ * Deletes a datasource.
+ *
+ * @param dataSourceName The name of the datasource to delete.
+ * @param ifMatch Defines the If-Match condition. The operation will be performed only if the ETag on the server
+ * matches this value.
+ * @param ifNoneMatch Defines the If-None-Match condition. The operation will be performed only if the ETag on the
+ * server does not match this value.
+ * @param requestOptions Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono deleteAsync(String dataSourceName, String ifMatch, String ifNoneMatch,
+ RequestOptions requestOptions, Context context) {
+ return deleteWithResponseAsync(dataSourceName, ifMatch, ifNoneMatch, requestOptions, context)
+ .flatMap(ignored -> Mono.empty());
+ }
+
+ /**
+ * Retrieves a datasource definition.
+ *
+ * @param dataSourceName The name of the datasource to retrieve.
+ * @param requestOptions Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents a datasource definition, which can be used to configure an indexer along with {@link Response}
+ * on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getWithResponseAsync(String dataSourceName,
+ RequestOptions requestOptions) {
+ return FluxUtil.withContext(context -> getWithResponseAsync(dataSourceName, requestOptions, context));
+ }
+
+ /**
+ * Retrieves a datasource definition.
+ *
+ * @param dataSourceName The name of the datasource to retrieve.
+ * @param requestOptions Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents a datasource definition, which can be used to configure an indexer along with {@link Response}
+ * on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getWithResponseAsync(String dataSourceName,
+ RequestOptions requestOptions, Context context) {
+ final String accept = "application/json";
+ UUID xMsClientRequestIdInternal = null;
+ if (requestOptions != null) {
+ xMsClientRequestIdInternal = requestOptions.getXMsClientRequestId();
+ }
+ UUID xMsClientRequestId = xMsClientRequestIdInternal;
+ return service.get(this.client.getEndpoint(), dataSourceName, xMsClientRequestId, this.client.getApiVersion(),
+ accept, context);
+ }
+
+ /**
+ * Retrieves a datasource definition.
+ *
+ * @param dataSourceName The name of the datasource to retrieve.
+ * @param requestOptions Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents a datasource definition, which can be used to configure an indexer on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getAsync(String dataSourceName, RequestOptions requestOptions) {
+ return getWithResponseAsync(dataSourceName, requestOptions).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Retrieves a datasource definition.
+ *
+ * @param dataSourceName The name of the datasource to retrieve.
+ * @param requestOptions Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents a datasource definition, which can be used to configure an indexer on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getAsync(String dataSourceName, RequestOptions requestOptions,
+ Context context) {
+ return getWithResponseAsync(dataSourceName, requestOptions, context)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Lists all datasources available for a search service.
+ *
+ * @param select Selects which top-level properties of the data sources to retrieve. Specified as a comma-separated
+ * list of JSON property names, or '*' for all properties. The default is all properties.
+ * @param requestOptions Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response from a List Datasources request along with {@link Response} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> listWithResponseAsync(String select, RequestOptions requestOptions) {
+ return FluxUtil.withContext(context -> listWithResponseAsync(select, requestOptions, context));
+ }
+
+ /**
+ * Lists all datasources available for a search service.
+ *
+ * @param select Selects which top-level properties of the data sources to retrieve. Specified as a comma-separated
+ * list of JSON property names, or '*' for all properties. The default is all properties.
+ * @param requestOptions Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response from a List Datasources request along with {@link Response} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> listWithResponseAsync(String select, RequestOptions requestOptions,
+ Context context) {
+ final String accept = "application/json";
+ UUID xMsClientRequestIdInternal = null;
+ if (requestOptions != null) {
+ xMsClientRequestIdInternal = requestOptions.getXMsClientRequestId();
+ }
+ UUID xMsClientRequestId = xMsClientRequestIdInternal;
+ return service.list(this.client.getEndpoint(), select, xMsClientRequestId, this.client.getApiVersion(), accept,
+ context);
+ }
+
+ /**
+ * Lists all datasources available for a search service.
+ *
+ * @param select Selects which top-level properties of the data sources to retrieve. Specified as a comma-separated
+ * list of JSON property names, or '*' for all properties. The default is all properties.
+ * @param requestOptions Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response from a List Datasources request on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono listAsync(String select, RequestOptions requestOptions) {
+ return listWithResponseAsync(select, requestOptions).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Lists all datasources available for a search service.
+ *
+ * @param select Selects which top-level properties of the data sources to retrieve. Specified as a comma-separated
+ * list of JSON property names, or '*' for all properties. The default is all properties.
+ * @param requestOptions Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response from a List Datasources request on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono listAsync(String select, RequestOptions requestOptions, Context context) {
+ return listWithResponseAsync(select, requestOptions, context).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Creates a new datasource.
+ *
+ * @param dataSource The definition of the datasource to create.
+ * @param requestOptions Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents a datasource definition, which can be used to configure an indexer along with {@link Response}
+ * on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> createWithResponseAsync(SearchIndexerDataSource dataSource,
+ RequestOptions requestOptions) {
+ return FluxUtil.withContext(context -> createWithResponseAsync(dataSource, requestOptions, context));
+ }
+
+ /**
+ * Creates a new datasource.
+ *
+ * @param dataSource The definition of the datasource to create.
+ * @param requestOptions Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents a datasource definition, which can be used to configure an indexer along with {@link Response}
+ * on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> createWithResponseAsync(SearchIndexerDataSource dataSource,
+ RequestOptions requestOptions, Context context) {
+ final String accept = "application/json";
+ UUID xMsClientRequestIdInternal = null;
+ if (requestOptions != null) {
+ xMsClientRequestIdInternal = requestOptions.getXMsClientRequestId();
+ }
+ UUID xMsClientRequestId = xMsClientRequestIdInternal;
+ return service.create(this.client.getEndpoint(), xMsClientRequestId, this.client.getApiVersion(), dataSource,
+ accept, context);
+ }
+
+ /**
+ * Creates a new datasource.
+ *
+ * @param dataSource The definition of the datasource to create.
+ * @param requestOptions Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents a datasource definition, which can be used to configure an indexer on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono createAsync(SearchIndexerDataSource dataSource,
+ RequestOptions requestOptions) {
+ return createWithResponseAsync(dataSource, requestOptions).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Creates a new datasource.
+ *
+ * @param dataSource The definition of the datasource to create.
+ * @param requestOptions Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents a datasource definition, which can be used to configure an indexer on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono createAsync(SearchIndexerDataSource dataSource, RequestOptions requestOptions,
+ Context context) {
+ return createWithResponseAsync(dataSource, requestOptions, context)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+}
diff --git a/sdk/search/azure-search-documents/search/src/main/java/com/azure/search/Documents.java b/sdk/search/azure-search-documents/search/src/main/java/com/azure/search/Documents.java
new file mode 100644
index 000000000000..1755cfd4dc65
--- /dev/null
+++ b/sdk/search/azure-search-documents/search/src/main/java/com/azure/search/Documents.java
@@ -0,0 +1,1271 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package com.azure.search;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Post;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.search.models.AutocompleteMode;
+import com.azure.search.models.AutocompleteOptions;
+import com.azure.search.models.AutocompleteRequest;
+import com.azure.search.models.AutocompleteResult;
+import com.azure.search.models.ErrorResponseException;
+import com.azure.search.models.IndexBatchImpl;
+import com.azure.search.models.IndexDocumentsResult;
+import com.azure.search.models.QueryAnswerType;
+import com.azure.search.models.QueryCaptionType;
+import com.azure.search.models.QueryDebugMode;
+import com.azure.search.models.QueryLanguage;
+import com.azure.search.models.QueryRewritesType;
+import com.azure.search.models.QuerySpellerType;
+import com.azure.search.models.QueryType;
+import com.azure.search.models.RequestOptions;
+import com.azure.search.models.ScoringStatistics;
+import com.azure.search.models.SearchDocumentsResult;
+import com.azure.search.models.SearchMode;
+import com.azure.search.models.SearchOptions;
+import com.azure.search.models.SearchRequest;
+import com.azure.search.models.SemanticErrorMode;
+import com.azure.search.models.SuggestDocumentsResult;
+import com.azure.search.models.SuggestOptions;
+import com.azure.search.models.SuggestRequest;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.UUID;
+import java.util.stream.Collectors;
+import reactor.core.publisher.Mono;
+
+/**
+ * An instance of this class provides access to all the operations defined in Documents.
+ */
+public final class Documents {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final DocumentsService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final SearchClient client;
+
+ /**
+ * Initializes an instance of Documents.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ Documents(SearchClient client) {
+ this.service
+ = RestProxy.create(DocumentsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for SearchClientDocuments to be used by the proxy service to perform REST
+ * calls.
+ */
+ @Host("{endpoint}/indexes('{indexName}')")
+ @ServiceInterface(name = "SearchClientDocuments")
+ public interface DocumentsService {
+ @Get("/docs/$count")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ErrorResponseException.class)
+ Mono> count(@HostParam("endpoint") String endpoint, @HostParam("indexName") String indexName,
+ @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
+
+ @Get("/docs")
+ @ExpectedResponses({ 200, 206 })
+ @UnexpectedResponseExceptionType(ErrorResponseException.class)
+ Mono> searchGet(@HostParam("endpoint") String endpoint,
+ @HostParam("indexName") String indexName, @QueryParam("search") String searchText,
+ @QueryParam("$count") Boolean includeTotalResultCount,
+ @QueryParam(value = "facet", multipleQueryParams = true) List facets,
+ @QueryParam("$filter") String filter, @QueryParam("highlight") String highlightFields,
+ @QueryParam("highlightPostTag") String highlightPostTag,
+ @QueryParam("highlightPreTag") String highlightPreTag,
+ @QueryParam("minimumCoverage") Double minimumCoverage, @QueryParam("$orderby") String orderBy,
+ @QueryParam("queryType") QueryType queryType,
+ @QueryParam(value = "scoringParameter", multipleQueryParams = true) List scoringParameters,
+ @QueryParam("scoringProfile") String scoringProfile, @QueryParam("searchFields") String searchFields,
+ @QueryParam("searchMode") SearchMode searchMode,
+ @QueryParam("scoringStatistics") ScoringStatistics scoringStatistics,
+ @QueryParam("sessionId") String sessionId, @QueryParam("$select") String select,
+ @QueryParam("$skip") Integer skip, @QueryParam("$top") Integer top,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId,
+ @QueryParam("semanticConfiguration") String semanticConfiguration,
+ @QueryParam("semanticErrorHandling") SemanticErrorMode semanticErrorHandling,
+ @QueryParam("semanticMaxWaitInMilliseconds") Integer semanticMaxWaitInMilliseconds,
+ @QueryParam("answers") QueryAnswerType answers, @QueryParam("captions") QueryCaptionType captions,
+ @QueryParam("semanticQuery") String semanticQuery,
+ @QueryParam("queryRewrites") QueryRewritesType queryRewrites, @QueryParam("debug") QueryDebugMode debug,
+ @QueryParam("queryLanguage") QueryLanguage queryLanguage, @QueryParam("speller") QuerySpellerType speller,
+ @QueryParam("semanticFields") String semanticFields,
+ @HeaderParam("x-ms-query-source-authorization") String xMsQuerySourceAuthorization,
+ @HeaderParam("x-ms-enable-elevated-read") Boolean xMsEnableElevatedRead,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Post("/docs/search.post.search")
+ @ExpectedResponses({ 200, 206 })
+ @UnexpectedResponseExceptionType(ErrorResponseException.class)
+ Mono> searchPost(@HostParam("endpoint") String endpoint,
+ @HostParam("indexName") String indexName, @QueryParam("api-version") String apiVersion,
+ @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId,
+ @HeaderParam("x-ms-query-source-authorization") String xMsQuerySourceAuthorization,
+ @HeaderParam("x-ms-enable-elevated-read") Boolean xMsEnableElevatedRead,
+ @BodyParam("application/json") SearchRequest searchRequest, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Get("/docs('{key}')")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ErrorResponseException.class)
+ Mono>> get(@HostParam("endpoint") String endpoint,
+ @HostParam("indexName") String indexName, @PathParam("key") String key,
+ @QueryParam("$select") String selectedFields, @QueryParam("api-version") String apiVersion,
+ @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId,
+ @HeaderParam("x-ms-query-source-authorization") String xMsQuerySourceAuthorization,
+ @HeaderParam("x-ms-enable-elevated-read") Boolean xMsEnableElevatedRead,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Get("/docs/search.suggest")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ErrorResponseException.class)
+ Mono> suggestGet(@HostParam("endpoint") String endpoint,
+ @HostParam("indexName") String indexName, @QueryParam("search") String searchText,
+ @QueryParam("suggesterName") String suggesterName, @QueryParam("$filter") String filter,
+ @QueryParam("fuzzy") Boolean useFuzzyMatching, @QueryParam("highlightPostTag") String highlightPostTag,
+ @QueryParam("highlightPreTag") String highlightPreTag,
+ @QueryParam("minimumCoverage") Double minimumCoverage, @QueryParam("$orderby") String orderBy,
+ @QueryParam("searchFields") String searchFields, @QueryParam("$select") String select,
+ @QueryParam("$top") Integer top, @QueryParam("api-version") String apiVersion,
+ @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Post("/docs/search.post.suggest")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ErrorResponseException.class)
+ Mono> suggestPost(@HostParam("endpoint") String endpoint,
+ @HostParam("indexName") String indexName, @QueryParam("api-version") String apiVersion,
+ @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId,
+ @BodyParam("application/json") SuggestRequest suggestRequest, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Post("/docs/search.index")
+ @ExpectedResponses({ 200, 207 })
+ @UnexpectedResponseExceptionType(ErrorResponseException.class)
+ Mono> index(@HostParam("endpoint") String endpoint,
+ @HostParam("indexName") String indexName, @QueryParam("api-version") String apiVersion,
+ @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId,
+ @BodyParam("application/json") IndexBatchImpl batch, @HeaderParam("Accept") String accept, Context context);
+
+ @Get("/docs/search.autocomplete")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ErrorResponseException.class)
+ Mono> autocompleteGet(@HostParam("endpoint") String endpoint,
+ @HostParam("indexName") String indexName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId,
+ @QueryParam("api-version") String apiVersion, @QueryParam("search") String searchText,
+ @QueryParam("suggesterName") String suggesterName,
+ @QueryParam("autocompleteMode") AutocompleteMode autocompleteMode, @QueryParam("$filter") String filter,
+ @QueryParam("fuzzy") Boolean useFuzzyMatching, @QueryParam("highlightPostTag") String highlightPostTag,
+ @QueryParam("highlightPreTag") String highlightPreTag,
+ @QueryParam("minimumCoverage") Double minimumCoverage, @QueryParam("searchFields") String searchFields,
+ @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context);
+
+ @Post("/docs/search.post.autocomplete")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ErrorResponseException.class)
+ Mono> autocompletePost(@HostParam("endpoint") String endpoint,
+ @HostParam("indexName") String indexName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId,
+ @QueryParam("api-version") String apiVersion,
+ @BodyParam("application/json") AutocompleteRequest autocompleteRequest,
+ @HeaderParam("Accept") String accept, Context context);
+ }
+
+ /**
+ * Queries the number of documents in the index.
+ *
+ * @param requestOptions Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response body along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> countWithResponseAsync(RequestOptions requestOptions) {
+ return FluxUtil.withContext(context -> countWithResponseAsync(requestOptions, context));
+ }
+
+ /**
+ * Queries the number of documents in the index.
+ *
+ * @param requestOptions Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response body along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> countWithResponseAsync(RequestOptions requestOptions, Context context) {
+ final String accept = "application/json";
+ UUID xMsClientRequestIdInternal = null;
+ if (requestOptions != null) {
+ xMsClientRequestIdInternal = requestOptions.getXMsClientRequestId();
+ }
+ UUID xMsClientRequestId = xMsClientRequestIdInternal;
+ return service.count(this.client.getEndpoint(), this.client.getIndexName(), xMsClientRequestId,
+ this.client.getApiVersion(), accept, context);
+ }
+
+ /**
+ * Queries the number of documents in the index.
+ *
+ * @param requestOptions Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response body on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono countAsync(RequestOptions requestOptions) {
+ return countWithResponseAsync(requestOptions).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Queries the number of documents in the index.
+ *
+ * @param requestOptions Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response body on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono countAsync(RequestOptions requestOptions, Context context) {
+ return countWithResponseAsync(requestOptions, context).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Searches for documents in the index.
+ *
+ * @param searchText A full-text search query expression; Use "*" or omit this parameter to match all documents.
+ * @param xMsQuerySourceAuthorization Token identifying the user for which the query is being executed. This token
+ * is used to enforce security restrictions on documents.
+ * @param xMsEnableElevatedRead A value that enables elevated read that bypass document level permission checks for
+ * the query operation.
+ * @param searchOptions Parameter group.
+ * @param requestOptions Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response containing search results from an index along with {@link Response} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> searchGetWithResponseAsync(String searchText,
+ String xMsQuerySourceAuthorization, Boolean xMsEnableElevatedRead, SearchOptions searchOptions,
+ RequestOptions requestOptions) {
+ return FluxUtil.withContext(context -> searchGetWithResponseAsync(searchText, xMsQuerySourceAuthorization,
+ xMsEnableElevatedRead, searchOptions, requestOptions, context));
+ }
+
+ /**
+ * Searches for documents in the index.
+ *
+ * @param searchText A full-text search query expression; Use "*" or omit this parameter to match all documents.
+ * @param xMsQuerySourceAuthorization Token identifying the user for which the query is being executed. This token
+ * is used to enforce security restrictions on documents.
+ * @param xMsEnableElevatedRead A value that enables elevated read that bypass document level permission checks for
+ * the query operation.
+ * @param searchOptions Parameter group.
+ * @param requestOptions Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response containing search results from an index along with {@link Response} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> searchGetWithResponseAsync(String searchText,
+ String xMsQuerySourceAuthorization, Boolean xMsEnableElevatedRead, SearchOptions searchOptions,
+ RequestOptions requestOptions, Context context) {
+ final String accept = "application/json";
+ Boolean includeTotalResultCountInternal = null;
+ if (searchOptions != null) {
+ includeTotalResultCountInternal = searchOptions.isIncludeTotalResultCount();
+ }
+ Boolean includeTotalResultCount = includeTotalResultCountInternal;
+ List facetsInternal = null;
+ if (searchOptions != null) {
+ facetsInternal = searchOptions.getFacets();
+ }
+ List facets = facetsInternal;
+ String filterInternal = null;
+ if (searchOptions != null) {
+ filterInternal = searchOptions.getFilter();
+ }
+ String filter = filterInternal;
+ List highlightFieldsInternal = null;
+ if (searchOptions != null) {
+ highlightFieldsInternal = searchOptions.getHighlightFields();
+ }
+ List highlightFields = highlightFieldsInternal;
+ String highlightPostTagInternal = null;
+ if (searchOptions != null) {
+ highlightPostTagInternal = searchOptions.getHighlightPostTag();
+ }
+ String highlightPostTag = highlightPostTagInternal;
+ String highlightPreTagInternal = null;
+ if (searchOptions != null) {
+ highlightPreTagInternal = searchOptions.getHighlightPreTag();
+ }
+ String highlightPreTag = highlightPreTagInternal;
+ Double minimumCoverageInternal = null;
+ if (searchOptions != null) {
+ minimumCoverageInternal = searchOptions.getMinimumCoverage();
+ }
+ Double minimumCoverage = minimumCoverageInternal;
+ List orderByInternal = null;
+ if (searchOptions != null) {
+ orderByInternal = searchOptions.getOrderBy();
+ }
+ List orderBy = orderByInternal;
+ QueryType queryTypeInternal = null;
+ if (searchOptions != null) {
+ queryTypeInternal = searchOptions.getQueryType();
+ }
+ QueryType queryType = queryTypeInternal;
+ List scoringParametersInternal = null;
+ if (searchOptions != null) {
+ scoringParametersInternal = searchOptions.getScoringParameters();
+ }
+ List scoringParameters = scoringParametersInternal;
+ String scoringProfileInternal = null;
+ if (searchOptions != null) {
+ scoringProfileInternal = searchOptions.getScoringProfile();
+ }
+ String scoringProfile = scoringProfileInternal;
+ List searchFieldsInternal = null;
+ if (searchOptions != null) {
+ searchFieldsInternal = searchOptions.getSearchFields();
+ }
+ List searchFields = searchFieldsInternal;
+ SearchMode searchModeInternal = null;
+ if (searchOptions != null) {
+ searchModeInternal = searchOptions.getSearchMode();
+ }
+ SearchMode searchMode = searchModeInternal;
+ ScoringStatistics scoringStatisticsInternal = null;
+ if (searchOptions != null) {
+ scoringStatisticsInternal = searchOptions.getScoringStatistics();
+ }
+ ScoringStatistics scoringStatistics = scoringStatisticsInternal;
+ String sessionIdInternal = null;
+ if (searchOptions != null) {
+ sessionIdInternal = searchOptions.getSessionId();
+ }
+ String sessionId = sessionIdInternal;
+ List selectInternal = null;
+ if (searchOptions != null) {
+ selectInternal = searchOptions.getSelect();
+ }
+ List select = selectInternal;
+ Integer skipInternal = null;
+ if (searchOptions != null) {
+ skipInternal = searchOptions.getSkip();
+ }
+ Integer skip = skipInternal;
+ Integer topInternal = null;
+ if (searchOptions != null) {
+ topInternal = searchOptions.getTop();
+ }
+ Integer top = topInternal;
+ UUID xMsClientRequestIdInternal = null;
+ if (requestOptions != null) {
+ xMsClientRequestIdInternal = requestOptions.getXMsClientRequestId();
+ }
+ UUID xMsClientRequestId = xMsClientRequestIdInternal;
+ String semanticConfigurationInternal = null;
+ if (searchOptions != null) {
+ semanticConfigurationInternal = searchOptions.getSemanticConfiguration();
+ }
+ String semanticConfiguration = semanticConfigurationInternal;
+ SemanticErrorMode semanticErrorHandlingInternal = null;
+ if (searchOptions != null) {
+ semanticErrorHandlingInternal = searchOptions.getSemanticErrorHandling();
+ }
+ SemanticErrorMode semanticErrorHandling = semanticErrorHandlingInternal;
+ Integer semanticMaxWaitInMillisecondsInternal = null;
+ if (searchOptions != null) {
+ semanticMaxWaitInMillisecondsInternal = searchOptions.getSemanticMaxWaitInMilliseconds();
+ }
+ Integer semanticMaxWaitInMilliseconds = semanticMaxWaitInMillisecondsInternal;
+ QueryAnswerType answersInternal = null;
+ if (searchOptions != null) {
+ answersInternal = searchOptions.getAnswers();
+ }
+ QueryAnswerType answers = answersInternal;
+ QueryCaptionType captionsInternal = null;
+ if (searchOptions != null) {
+ captionsInternal = searchOptions.getCaptions();
+ }
+ QueryCaptionType captions = captionsInternal;
+ String semanticQueryInternal = null;
+ if (searchOptions != null) {
+ semanticQueryInternal = searchOptions.getSemanticQuery();
+ }
+ String semanticQuery = semanticQueryInternal;
+ QueryRewritesType queryRewritesInternal = null;
+ if (searchOptions != null) {
+ queryRewritesInternal = searchOptions.getQueryRewrites();
+ }
+ QueryRewritesType queryRewrites = queryRewritesInternal;
+ QueryDebugMode debugInternal = null;
+ if (searchOptions != null) {
+ debugInternal = searchOptions.getDebug();
+ }
+ QueryDebugMode debug = debugInternal;
+ QueryLanguage queryLanguageInternal = null;
+ if (searchOptions != null) {
+ queryLanguageInternal = searchOptions.getQueryLanguage();
+ }
+ QueryLanguage queryLanguage = queryLanguageInternal;
+ QuerySpellerType spellerInternal = null;
+ if (searchOptions != null) {
+ spellerInternal = searchOptions.getSpeller();
+ }
+ QuerySpellerType speller = spellerInternal;
+ List semanticFieldsInternal = null;
+ if (searchOptions != null) {
+ semanticFieldsInternal = searchOptions.getSemanticFields();
+ }
+ List semanticFields = semanticFieldsInternal;
+ List facetsConverted = (facets == null)
+ ? new ArrayList<>()
+ : facets.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList());
+ String highlightFieldsConverted = (highlightFields == null)
+ ? null
+ : highlightFields.stream()
+ .map(paramItemValue -> Objects.toString(paramItemValue, ""))
+ .collect(Collectors.joining(","));
+ String orderByConverted = (orderBy == null)
+ ? null
+ : orderBy.stream()
+ .map(paramItemValue -> Objects.toString(paramItemValue, ""))
+ .collect(Collectors.joining(","));
+ List scoringParametersConverted = (scoringParameters == null)
+ ? new ArrayList<>()
+ : scoringParameters.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList());
+ String searchFieldsConverted = (searchFields == null)
+ ? null
+ : searchFields.stream()
+ .map(paramItemValue -> Objects.toString(paramItemValue, ""))
+ .collect(Collectors.joining(","));
+ String selectConverted = (select == null)
+ ? null
+ : select.stream()
+ .map(paramItemValue -> Objects.toString(paramItemValue, ""))
+ .collect(Collectors.joining(","));
+ String semanticFieldsConverted = (semanticFields == null)
+ ? null
+ : semanticFields.stream()
+ .map(paramItemValue -> Objects.toString(paramItemValue, ""))
+ .collect(Collectors.joining(","));
+ return service.searchGet(this.client.getEndpoint(), this.client.getIndexName(), searchText,
+ includeTotalResultCount, facetsConverted, filter, highlightFieldsConverted, highlightPostTag,
+ highlightPreTag, minimumCoverage, orderByConverted, queryType, scoringParametersConverted, scoringProfile,
+ searchFieldsConverted, searchMode, scoringStatistics, sessionId, selectConverted, skip, top,
+ this.client.getApiVersion(), xMsClientRequestId, semanticConfiguration, semanticErrorHandling,
+ semanticMaxWaitInMilliseconds, answers, captions, semanticQuery, queryRewrites, debug, queryLanguage,
+ speller, semanticFieldsConverted, xMsQuerySourceAuthorization, xMsEnableElevatedRead, accept, context);
+ }
+
+ /**
+ * Searches for documents in the index.
+ *
+ * @param searchText A full-text search query expression; Use "*" or omit this parameter to match all documents.
+ * @param xMsQuerySourceAuthorization Token identifying the user for which the query is being executed. This token
+ * is used to enforce security restrictions on documents.
+ * @param xMsEnableElevatedRead A value that enables elevated read that bypass document level permission checks for
+ * the query operation.
+ * @param searchOptions Parameter group.
+ * @param requestOptions Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response containing search results from an index on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono searchGetAsync(String searchText, String xMsQuerySourceAuthorization,
+ Boolean xMsEnableElevatedRead, SearchOptions searchOptions, RequestOptions requestOptions) {
+ return searchGetWithResponseAsync(searchText, xMsQuerySourceAuthorization, xMsEnableElevatedRead, searchOptions,
+ requestOptions).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Searches for documents in the index.
+ *
+ * @param searchText A full-text search query expression; Use "*" or omit this parameter to match all documents.
+ * @param xMsQuerySourceAuthorization Token identifying the user for which the query is being executed. This token
+ * is used to enforce security restrictions on documents.
+ * @param xMsEnableElevatedRead A value that enables elevated read that bypass document level permission checks for
+ * the query operation.
+ * @param searchOptions Parameter group.
+ * @param requestOptions Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response containing search results from an index on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono searchGetAsync(String searchText, String xMsQuerySourceAuthorization,
+ Boolean xMsEnableElevatedRead, SearchOptions searchOptions, RequestOptions requestOptions, Context context) {
+ return searchGetWithResponseAsync(searchText, xMsQuerySourceAuthorization, xMsEnableElevatedRead, searchOptions,
+ requestOptions, context).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Searches for documents in the index.
+ *
+ * @param searchRequest The definition of the Search request.
+ * @param xMsQuerySourceAuthorization Token identifying the user for which the query is being executed. This token
+ * is used to enforce security restrictions on documents.
+ * @param xMsEnableElevatedRead A value that enables elevated read that bypass document level permission checks for
+ * the query operation.
+ * @param requestOptions Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response containing search results from an index along with {@link Response} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> searchPostWithResponseAsync(SearchRequest searchRequest,
+ String xMsQuerySourceAuthorization, Boolean xMsEnableElevatedRead, RequestOptions requestOptions) {
+ return FluxUtil.withContext(context -> searchPostWithResponseAsync(searchRequest, xMsQuerySourceAuthorization,
+ xMsEnableElevatedRead, requestOptions, context));
+ }
+
+ /**
+ * Searches for documents in the index.
+ *
+ * @param searchRequest The definition of the Search request.
+ * @param xMsQuerySourceAuthorization Token identifying the user for which the query is being executed. This token
+ * is used to enforce security restrictions on documents.
+ * @param xMsEnableElevatedRead A value that enables elevated read that bypass document level permission checks for
+ * the query operation.
+ * @param requestOptions Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response containing search results from an index along with {@link Response} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> searchPostWithResponseAsync(SearchRequest searchRequest,
+ String xMsQuerySourceAuthorization, Boolean xMsEnableElevatedRead, RequestOptions requestOptions,
+ Context context) {
+ final String accept = "application/json";
+ UUID xMsClientRequestIdInternal = null;
+ if (requestOptions != null) {
+ xMsClientRequestIdInternal = requestOptions.getXMsClientRequestId();
+ }
+ UUID xMsClientRequestId = xMsClientRequestIdInternal;
+ return service.searchPost(this.client.getEndpoint(), this.client.getIndexName(), this.client.getApiVersion(),
+ xMsClientRequestId, xMsQuerySourceAuthorization, xMsEnableElevatedRead, searchRequest, accept, context);
+ }
+
+ /**
+ * Searches for documents in the index.
+ *
+ * @param searchRequest The definition of the Search request.
+ * @param xMsQuerySourceAuthorization Token identifying the user for which the query is being executed. This token
+ * is used to enforce security restrictions on documents.
+ * @param xMsEnableElevatedRead A value that enables elevated read that bypass document level permission checks for
+ * the query operation.
+ * @param requestOptions Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response containing search results from an index on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono searchPostAsync(SearchRequest searchRequest, String xMsQuerySourceAuthorization,
+ Boolean xMsEnableElevatedRead, RequestOptions requestOptions) {
+ return searchPostWithResponseAsync(searchRequest, xMsQuerySourceAuthorization, xMsEnableElevatedRead,
+ requestOptions).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Searches for documents in the index.
+ *
+ * @param searchRequest The definition of the Search request.
+ * @param xMsQuerySourceAuthorization Token identifying the user for which the query is being executed. This token
+ * is used to enforce security restrictions on documents.
+ * @param xMsEnableElevatedRead A value that enables elevated read that bypass document level permission checks for
+ * the query operation.
+ * @param requestOptions Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response containing search results from an index on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono searchPostAsync(SearchRequest searchRequest, String xMsQuerySourceAuthorization,
+ Boolean xMsEnableElevatedRead, RequestOptions requestOptions, Context context) {
+ return searchPostWithResponseAsync(searchRequest, xMsQuerySourceAuthorization, xMsEnableElevatedRead,
+ requestOptions, context).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Retrieves a document from the index.
+ *
+ * @param key The key of the document to retrieve.
+ * @param selectedFields List of field names to retrieve for the document; Any field not retrieved will be missing
+ * from the returned document.
+ * @param xMsQuerySourceAuthorization Token identifying the user for which the query is being executed. This token
+ * is used to enforce security restrictions on documents.
+ * @param xMsEnableElevatedRead A value that enables elevated read that bypass document level permission checks for
+ * the query operation.
+ * @param requestOptions Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a document retrieved via a document lookup operation along with {@link Response} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono>> getWithResponseAsync(String key, List selectedFields,
+ String xMsQuerySourceAuthorization, Boolean xMsEnableElevatedRead, RequestOptions requestOptions) {
+ return FluxUtil.withContext(context -> getWithResponseAsync(key, selectedFields, xMsQuerySourceAuthorization,
+ xMsEnableElevatedRead, requestOptions, context));
+ }
+
+ /**
+ * Retrieves a document from the index.
+ *
+ * @param key The key of the document to retrieve.
+ * @param selectedFields List of field names to retrieve for the document; Any field not retrieved will be missing
+ * from the returned document.
+ * @param xMsQuerySourceAuthorization Token identifying the user for which the query is being executed. This token
+ * is used to enforce security restrictions on documents.
+ * @param xMsEnableElevatedRead A value that enables elevated read that bypass document level permission checks for
+ * the query operation.
+ * @param requestOptions Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a document retrieved via a document lookup operation along with {@link Response} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono>> getWithResponseAsync(String key, List selectedFields,
+ String xMsQuerySourceAuthorization, Boolean xMsEnableElevatedRead, RequestOptions requestOptions,
+ Context context) {
+ final String accept = "application/json";
+ UUID xMsClientRequestIdInternal = null;
+ if (requestOptions != null) {
+ xMsClientRequestIdInternal = requestOptions.getXMsClientRequestId();
+ }
+ UUID xMsClientRequestId = xMsClientRequestIdInternal;
+ String selectedFieldsConverted = (selectedFields == null)
+ ? null
+ : selectedFields.stream()
+ .map(paramItemValue -> Objects.toString(paramItemValue, ""))
+ .collect(Collectors.joining(","));
+ return service.get(this.client.getEndpoint(), this.client.getIndexName(), key, selectedFieldsConverted,
+ this.client.getApiVersion(), xMsClientRequestId, xMsQuerySourceAuthorization, xMsEnableElevatedRead, accept,
+ context);
+ }
+
+ /**
+ * Retrieves a document from the index.
+ *
+ * @param key The key of the document to retrieve.
+ * @param selectedFields List of field names to retrieve for the document; Any field not retrieved will be missing
+ * from the returned document.
+ * @param xMsQuerySourceAuthorization Token identifying the user for which the query is being executed. This token
+ * is used to enforce security restrictions on documents.
+ * @param xMsEnableElevatedRead A value that enables elevated read that bypass document level permission checks for
+ * the query operation.
+ * @param requestOptions Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ErrorResponseException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a document retrieved via a document lookup operation on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono