diff --git a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml
index 6daa15d8eed0..300b597773aa 100755
--- a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml
+++ b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml
@@ -362,9 +362,14 @@
+ files=".*[/\\]search[/\\]documents[/\\]implementation[/\\]models[/\\]"/>
+ files=".*[/\\]search[/\\]documents[/\\]implementation[/\\]converters[/\\]"/>
+
+
+
> getDocumentCountWithResponse(Context context) {
try {
return restClient.documents()
.countWithRestResponseAsync(context)
+ .onErrorMap(MappingUtils::exceptionMapper)
.map(Function.identity());
} catch (RuntimeException ex) {
return monoError(logger, ex);
@@ -410,7 +420,9 @@ private Mono search(SearchRequest request, RequestOptions r
SearchRequest requestToUse = (continuationToken == null) ? request
: SearchContinuationToken.deserializeToken(serviceVersion.getVersion(), continuationToken);
- return restClient.documents().searchPostWithRestResponseAsync(requestToUse, requestOptions, context)
+ return restClient.documents().searchPostWithRestResponseAsync(requestToUse,
+ RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
.map(searchDocumentResponse -> new SearchPagedResponse(searchDocumentResponse, serviceVersion));
}
/**
@@ -450,12 +462,12 @@ Mono> getDocumentWithResponse(String key, List
RequestOptions requestOptions, Context context) {
try {
return restClient.documents()
- .getWithRestResponseAsync(key, selectedFields, requestOptions, context)
+ .getWithRestResponseAsync(key, selectedFields, RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(DocumentResponseConversions::exceptionMapper)
.map(res -> {
SearchDocument doc = new SearchDocument(res.getValue());
return new SimpleResponse<>(res, doc);
})
- .onErrorMap(DocumentResponseConversions::exceptionMapper)
.map(Function.identity());
} catch (RuntimeException ex) {
return monoError(logger, ex);
@@ -507,7 +519,9 @@ SuggestPagedFlux suggest(String searchText, String suggesterName, SuggestOptions
private Mono suggest(RequestOptions requestOptions, SuggestRequest suggestRequest,
Context context) {
- return restClient.documents().suggestPostWithRestResponseAsync(suggestRequest, requestOptions, context)
+ return restClient.documents().suggestPostWithRestResponseAsync(suggestRequest,
+ RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
.map(SuggestPagedResponse::new);
}
@@ -548,10 +562,12 @@ public Mono> indexDocumentsWithResponse(IndexDocu
Mono> indexDocumentsWithResponse(IndexDocumentsBatch> batch, Context context) {
try {
return restClient.documents()
- .indexWithRestResponseAsync(batch, context)
+ .indexWithRestResponseAsync(IndexBatchBaseConverter.map(batch), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
.flatMap(response -> (response.getStatusCode() == MULTI_STATUS_CODE)
- ? Mono.error(new IndexBatchException(response.getValue()))
- : Mono.just(response));
+ ? Mono.error(new IndexBatchException(IndexDocumentsResultConverter.map(response.getValue())))
+ : Mono.just(response)
+ .map(MappingUtils::mappingIndexDocumentResultResponse));
} catch (RuntimeException ex) {
return monoError(logger, ex);
}
@@ -594,8 +610,10 @@ AutocompletePagedFlux autocomplete(String searchText, String suggesterName, Auto
private Mono autocomplete(RequestOptions requestOptions, AutocompleteRequest request,
Context context) {
- return restClient.documents().autocompletePostWithRestResponseAsync(request, requestOptions, context)
- .map(AutocompletePagedResponse::new);
+ return restClient.documents().autocompletePostWithRestResponseAsync(request,
+ RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
+ .map(MappingUtils::mappingAutocompleteResponse);
}
/**
@@ -609,15 +627,18 @@ private static SearchRequest createSearchRequest(String searchText, SearchOption
SearchRequest searchRequest = new SearchRequest().setSearchText(searchText);
if (searchOptions != null) {
- searchRequest.setSearchMode(searchOptions.getSearchMode())
+ List scoringParameters = searchOptions.getScoringParameters() == null ? null
+ : searchOptions.getScoringParameters().stream().map(ScoringParameter::toString)
+ .collect(Collectors.toList());
+ searchRequest.setSearchMode(SearchModeConverter.map(searchOptions.getSearchMode()))
.setFacets(searchOptions.getFacets())
.setFilter(searchOptions.getFilter())
.setHighlightPostTag(searchOptions.getHighlightPostTag())
.setHighlightPreTag(searchOptions.getHighlightPreTag())
.setIncludeTotalResultCount(searchOptions.isIncludeTotalResultCount())
.setMinimumCoverage(searchOptions.getMinimumCoverage())
- .setQueryType(searchOptions.getQueryType())
- .setScoringParameters(searchOptions.getScoringParameters())
+ .setQueryType(QueryTypeConverter.map(searchOptions.getQueryType()))
+ .setScoringParameters(scoringParameters)
.setScoringProfile(searchOptions.getScoringProfile())
.setSkip(searchOptions.getSkip())
.setTop(searchOptions.getTop());
@@ -704,7 +725,7 @@ private static AutocompleteRequest createAutoCompleteRequest(String searchText,
.setHighlightPreTag(autocompleteOptions.getHighlightPreTag())
.setMinimumCoverage(autocompleteOptions.getMinimumCoverage())
.setTop(autocompleteOptions.getTop())
- .setAutocompleteMode(autocompleteOptions.getAutocompleteMode());
+ .setAutocompleteMode(AutocompleteModeConverter.map(autocompleteOptions.getAutocompleteMode()));
List searchFields = autocompleteOptions.getSearchFields();
if (searchFields != null) {
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchServiceAsyncClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchServiceAsyncClient.java
index cb21634ea065..c8fe029f08ff 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchServiceAsyncClient.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchServiceAsyncClient.java
@@ -6,13 +6,20 @@
import com.azure.core.http.HttpPipeline;
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.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.core.util.logging.ClientLogger;
import com.azure.search.documents.implementation.SearchServiceRestClientBuilder;
import com.azure.search.documents.implementation.SearchServiceRestClientImpl;
+import com.azure.search.documents.implementation.converters.AnalyzeRequestConverter;
+import com.azure.search.documents.implementation.converters.RequestOptionsConverter;
+import com.azure.search.documents.implementation.converters.SearchIndexConverter;
+import com.azure.search.documents.implementation.converters.SearchIndexerConverter;
+import com.azure.search.documents.implementation.converters.SearchIndexerDataSourceConverter;
+import com.azure.search.documents.implementation.converters.SearchIndexerSkillsetConverter;
+import com.azure.search.documents.implementation.converters.SynonymMapConverter;
+import com.azure.search.documents.implementation.util.MappingUtils;
import com.azure.search.documents.models.AnalyzeRequest;
import com.azure.search.documents.models.AnalyzedTokenInfo;
import com.azure.search.documents.models.GetIndexStatisticsResult;
@@ -148,8 +155,10 @@ Mono> createOrUpdateDataSourceWithResponse(Sea
return restClient
.dataSources()
.createOrUpdateWithRestResponseAsync(dataSource.getName(),
- dataSource, ifMatch, null, requestOptions, context)
- .map(Function.identity());
+ SearchIndexerDataSourceConverter.map(dataSource), ifMatch, null,
+ RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
+ .map(MappingUtils::mappingExternalDataSource);
} catch (RuntimeException ex) {
return monoError(logger, ex);
}
@@ -182,8 +191,10 @@ Mono> createDataSourceWithResponse(SearchIndex
RequestOptions requestOptions, Context context) {
try {
return restClient.dataSources()
- .createWithRestResponseAsync(dataSource, requestOptions, context)
- .map(Function.identity());
+ .createWithRestResponseAsync(SearchIndexerDataSourceConverter.map(dataSource),
+ RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
+ .map(MappingUtils::mappingExternalDataSource);
} catch (RuntimeException ex) {
return monoError(logger, ex);
}
@@ -216,8 +227,9 @@ Mono> getDataSourceWithResponse(String dataSou
RequestOptions requestOptions, Context context) {
try {
return restClient.dataSources()
- .getWithRestResponseAsync(dataSourceName, requestOptions, context)
- .map(Function.identity());
+ .getWithRestResponseAsync(dataSourceName, RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
+ .map(MappingUtils::mappingExternalDataSource);
} catch (RuntimeException ex) {
return monoError(logger, ex);
}
@@ -261,14 +273,9 @@ PagedFlux listDataSources(String select, RequestOptions
private Mono> listDataSourcesWithResponse(String select,
RequestOptions requestOptions, Context context) {
return restClient.dataSources()
- .listWithRestResponseAsync(select, requestOptions, context)
- .map(response -> new PagedResponseBase<>(
- response.getRequest(),
- response.getStatusCode(),
- response.getHeaders(),
- response.getValue().getDataSources(),
- null,
- null));
+ .listWithRestResponseAsync(select, RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
+ .map(MappingUtils::mappingPagingDataSource);
}
/**
@@ -307,8 +314,10 @@ Mono> deleteDataSourceWithResponse(String dataSourceName, String
.deleteWithRestResponseAsync(
dataSourceName,
etag, null,
- requestOptions,
- context).map(Function.identity());
+ RequestOptionsConverter.map(requestOptions),
+ context)
+ .onErrorMap(MappingUtils::exceptionMapper)
+ .map(Function.identity());
} catch (RuntimeException ex) {
return monoError(logger, ex);
}
@@ -341,8 +350,10 @@ Mono> createIndexerWithResponse(SearchIndexer indexer, R
Context context) {
try {
return restClient.indexers()
- .createWithRestResponseAsync(indexer, requestOptions, context)
- .map(Function.identity());
+ .createWithRestResponseAsync(SearchIndexerConverter.map(indexer),
+ RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
+ .map(MappingUtils::mappingExternalSearchIndexer);
} catch (RuntimeException ex) {
return monoError(logger, ex);
}
@@ -380,9 +391,12 @@ Mono> createOrUpdateIndexerWithResponse(SearchIndexer in
String ifMatch = onlyIfUnchanged ? indexer.getETag() : null;
try {
return restClient.indexers()
- .createOrUpdateWithRestResponseAsync(indexer.getName(), indexer, ifMatch, null, requestOptions,
+ .createOrUpdateWithRestResponseAsync(indexer.getName(), SearchIndexerConverter.map(indexer), ifMatch,
+ null,
+ RequestOptionsConverter.map(requestOptions),
context)
- .map(Function.identity());
+ .onErrorMap(MappingUtils::exceptionMapper)
+ .map(MappingUtils::mappingExternalSearchIndexer);
} catch (RuntimeException ex) {
return monoError(logger, ex);
}
@@ -414,8 +428,9 @@ Mono> getIndexerWithResponse(String indexerName, Request
Context context) {
try {
return restClient.indexers()
- .getWithRestResponseAsync(indexerName, requestOptions, context)
- .map(Function.identity());
+ .getWithRestResponseAsync(indexerName, RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
+ .map(MappingUtils::mappingExternalSearchIndexer);
} catch (RuntimeException ex) {
return monoError(logger, ex);
}
@@ -456,14 +471,9 @@ PagedFlux listIndexers(String select, RequestOptions requestOptio
private Mono> listIndexersWithResponse(String select, RequestOptions requestOptions,
Context context) {
return restClient.indexers()
- .listWithRestResponseAsync(select, requestOptions, context)
- .map(response -> new PagedResponseBase<>(
- response.getRequest(),
- response.getStatusCode(),
- response.getHeaders(),
- response.getValue().getIndexers(),
- null,
- null));
+ .listWithRestResponseAsync(select, RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
+ .map(MappingUtils::mappingPagingSearchIndexer);
}
/**
@@ -508,7 +518,9 @@ Mono> deleteIndexerWithResponse(String indexerName, String etag,
Context context) {
try {
return restClient.indexers()
- .deleteWithRestResponseAsync(indexerName, etag, null, requestOptions, context)
+ .deleteWithRestResponseAsync(indexerName, etag, null,
+ RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
.map(Function.identity());
} catch (RuntimeException ex) {
return monoError(logger, ex);
@@ -540,7 +552,8 @@ public Mono> resetIndexerWithResponse(String indexerName, Request
Mono> resetIndexerWithResponse(String indexerName, RequestOptions requestOptions, Context context) {
try {
return restClient.indexers()
- .resetWithRestResponseAsync(indexerName, requestOptions, context)
+ .resetWithRestResponseAsync(indexerName, RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
.map(Function.identity());
} catch (RuntimeException ex) {
return monoError(logger, ex);
@@ -571,7 +584,9 @@ public Mono> runIndexerWithResponse(String indexerName, RequestOp
Mono> runIndexerWithResponse(String indexerName, RequestOptions requestOptions, Context context) {
try {
- return restClient.indexers().runWithRestResponseAsync(indexerName, requestOptions, context)
+ return restClient.indexers().runWithRestResponseAsync(indexerName,
+ RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
.map(Function.identity());
} catch (RuntimeException ex) {
return monoError(logger, ex);
@@ -605,8 +620,9 @@ Mono> getIndexerStatusWithResponse(String indexerN
Context context) {
try {
return restClient.indexers()
- .getStatusWithRestResponseAsync(indexerName, requestOptions, context)
- .map(Function.identity());
+ .getStatusWithRestResponseAsync(indexerName, RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
+ .map(MappingUtils::mappingIndexerStatus);
} catch (RuntimeException ex) {
return monoError(logger, ex);
}
@@ -639,8 +655,10 @@ Mono> createIndexWithResponse(SearchIndex index, RequestOp
Objects.requireNonNull(index, "'Index' cannot be null");
try {
return restClient.indexes()
- .createWithRestResponseAsync(index, requestOptions, context)
- .map(Function.identity());
+ .createWithRestResponseAsync(SearchIndexConverter.map(index),
+ RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
+ .map(MappingUtils::mappingExternalSearchIndex);
} catch (RuntimeException ex) {
return monoError(logger, ex);
}
@@ -671,8 +689,9 @@ public Mono> getIndexWithResponse(String indexName, Reques
Mono> getIndexWithResponse(String indexName, RequestOptions requestOptions, Context context) {
try {
return restClient.indexes()
- .getWithRestResponseAsync(indexName, requestOptions, context)
- .map(Function.identity());
+ .getWithRestResponseAsync(indexName, RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
+ .map(MappingUtils::mappingExternalSearchIndex);
} catch (RuntimeException ex) {
return monoError(logger, ex);
}
@@ -705,8 +724,9 @@ Mono> getIndexStatisticsWithResponse(String i
RequestOptions requestOptions, Context context) {
try {
return restClient.indexes()
- .getStatisticsWithRestResponseAsync(indexName, requestOptions, context)
- .map(Function.identity());
+ .getStatisticsWithRestResponseAsync(indexName, RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
+ .map(MappingUtils::mappingGetIndexStatistics);
} catch (RuntimeException ex) {
return monoError(logger, ex);
}
@@ -750,14 +770,9 @@ PagedFlux listIndexes(String select, RequestOptions requestOptions,
private Mono> listIndexesWithResponse(String select, RequestOptions requestOptions,
Context context) {
return restClient.indexes()
- .listWithRestResponseAsync(select, requestOptions, context)
- .map(response -> new PagedResponseBase<>(
- response.getRequest(),
- response.getStatusCode(),
- response.getHeaders(),
- response.getValue().getIndexes(),
- null,
- null));
+ .listWithRestResponseAsync(select, RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
+ .map(MappingUtils::mappingPagingSearchIndex);
}
/**
@@ -796,9 +811,11 @@ Mono> createOrUpdateIndexWithResponse(SearchIndex index, b
Objects.requireNonNull(index, "'Index' cannot null.");
String ifMatch = onlyIfUnchanged ? index.getETag() : null;
return restClient.indexes()
- .createOrUpdateWithRestResponseAsync(index.getName(), index, allowIndexDowntime, ifMatch, null,
- requestOptions, context)
- .map(Function.identity());
+ .createOrUpdateWithRestResponseAsync(index.getName(), SearchIndexConverter.map(index),
+ allowIndexDowntime, ifMatch, null,
+ RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
+ .map(MappingUtils::mappingExternalSearchIndex);
} catch (RuntimeException ex) {
return monoError(logger, ex);
}
@@ -835,7 +852,9 @@ Mono> deleteIndexWithResponse(String indexName, String etag, Requ
Context context) {
try {
return restClient.indexes()
- .deleteWithRestResponseAsync(indexName, etag, null, requestOptions, context)
+ .deleteWithRestResponseAsync(indexName, etag, null,
+ RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
.map(Function.identity());
} catch (RuntimeException ex) {
return monoError(logger, ex);
@@ -884,14 +903,10 @@ PagedFlux analyzeText(String indexName, AnalyzeRequest analyz
private Mono> analyzeTextWithResponse(String indexName,
AnalyzeRequest analyzeRequest, RequestOptions requestOptions, Context context) {
return restClient.indexes()
- .analyzeWithRestResponseAsync(indexName, analyzeRequest, requestOptions, context)
- .map(response -> new PagedResponseBase<>(
- response.getRequest(),
- response.getStatusCode(),
- response.getHeaders(),
- response.getValue().getTokens(),
- null,
- null));
+ .analyzeWithRestResponseAsync(indexName, AnalyzeRequestConverter.map(analyzeRequest),
+ RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
+ .map(MappingUtils::mappingTokenInfo);
}
/**
@@ -923,8 +938,10 @@ Mono> createSkillsetWithResponse(SearchIndexerSk
Objects.requireNonNull(skillset, "'Skillset' cannot be null.");
try {
return restClient.skillsets()
- .createWithRestResponseAsync(skillset, requestOptions, context)
- .map(Function.identity());
+ .createWithRestResponseAsync(SearchIndexerSkillsetConverter.map(skillset),
+ RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
+ .map(MappingUtils::mappingExternalSkillset);
} catch (RuntimeException ex) {
return monoError(logger, ex);
}
@@ -957,8 +974,9 @@ Mono> getSkillsetWithResponse(String skillsetNam
Context context) {
try {
return this.restClient.skillsets()
- .getWithRestResponseAsync(skillsetName, requestOptions, context)
- .map(result -> result);
+ .getWithRestResponseAsync(skillsetName, RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
+ .map(MappingUtils::mappingExternalSkillset);
} catch (RuntimeException ex) {
return monoError(logger, ex);
}
@@ -1003,14 +1021,9 @@ private Mono> listSkillsetsWithResponse(Str
RequestOptions requestOptions,
Context context) {
return this.restClient.skillsets()
- .listWithRestResponseAsync(select, requestOptions, context)
- .map(response -> new PagedResponseBase<>(
- response.getRequest(),
- response.getStatusCode(),
- response.getHeaders(),
- response.getValue().getSkillsets(),
- null,
- null));
+ .listWithRestResponseAsync(select, RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
+ .map(MappingUtils::mappingPagingSkillset);
}
/**
@@ -1045,9 +1058,12 @@ Mono> createOrUpdateSkillsetWithResponse(SearchI
String ifMatch = onlyIfUnchanged ? skillset.getETag() : null;
try {
return restClient.skillsets()
- .createOrUpdateWithRestResponseAsync(skillset.getName(), skillset, ifMatch, null, requestOptions,
+ .createOrUpdateWithRestResponseAsync(skillset.getName(), SearchIndexerSkillsetConverter.map(skillset),
+ ifMatch, null,
+ RequestOptionsConverter.map(requestOptions),
context)
- .map(Function.identity());
+ .onErrorMap(MappingUtils::exceptionMapper)
+ .map(MappingUtils::mappingExternalSkillset);
} catch (RuntimeException ex) {
return monoError(logger, ex);
}
@@ -1086,7 +1102,9 @@ Mono> deleteSkillsetWithResponse(String skillsetName, String etag
Context context) {
try {
return restClient.skillsets()
- .deleteWithRestResponseAsync(skillsetName, etag, null, requestOptions, context)
+ .deleteWithRestResponseAsync(skillsetName, etag, null,
+ RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
.map(Function.identity());
} catch (RuntimeException ex) {
return monoError(logger, ex);
@@ -1121,8 +1139,10 @@ Mono> createSynonymMapWithResponse(SynonymMap synonymMap, R
Objects.requireNonNull(synonymMap, "'SynonymMap' cannot be null.");
try {
return restClient.synonymMaps()
- .createWithRestResponseAsync(synonymMap, requestOptions, context)
- .map(Function.identity());
+ .createWithRestResponseAsync(SynonymMapConverter.map(synonymMap),
+ RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
+ .map(MappingUtils::mappingExternalSynonymMap);
} catch (RuntimeException ex) {
return monoError(logger, ex);
}
@@ -1154,8 +1174,9 @@ Mono> getSynonymMapWithResponse(String synonymMapName, Requ
Context context) {
try {
return restClient.synonymMaps()
- .getWithRestResponseAsync(synonymMapName, requestOptions, context)
- .map(Function.identity());
+ .getWithRestResponseAsync(synonymMapName, RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
+ .map(MappingUtils::mappingExternalSynonymMap);
} catch (RuntimeException ex) {
return monoError(logger, ex);
}
@@ -1199,14 +1220,9 @@ PagedFlux listSynonymMaps(String select, RequestOptions requestOptio
private Mono> listSynonymMapsWithResponse(String select, RequestOptions requestOptions,
Context context) {
return restClient.synonymMaps()
- .listWithRestResponseAsync(select, requestOptions, context)
- .map(response -> new PagedResponseBase<>(
- response.getRequest(),
- response.getStatusCode(),
- response.getHeaders(),
- response.getValue().getSynonymMaps(),
- null,
- null));
+ .listWithRestResponseAsync(select, RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
+ .map(MappingUtils::mappingPagingSynonymMap);
}
/**
@@ -1241,9 +1257,12 @@ Mono> createOrUpdateSynonymMapWithResponse(SynonymMap synon
String ifMatch = onlyIfUnchanged ? synonymMap.getETag() : null;
try {
return restClient.synonymMaps()
- .createOrUpdateWithRestResponseAsync(synonymMap.getName(), synonymMap, ifMatch, null, requestOptions,
+ .createOrUpdateWithRestResponseAsync(synonymMap.getName(), SynonymMapConverter.map(synonymMap),
+ ifMatch, null,
+ RequestOptionsConverter.map(requestOptions),
context)
- .map(Function.identity());
+ .onErrorMap(MappingUtils::exceptionMapper)
+ .map(MappingUtils::mappingExternalSynonymMap);
} catch (RuntimeException ex) {
return monoError(logger, ex);
}
@@ -1282,7 +1301,9 @@ Mono> deleteSynonymMapWithResponse(String synonymMapName, String
RequestOptions requestOptions, Context context) {
try {
return restClient.synonymMaps()
- .deleteWithRestResponseAsync(synonymMapName, etag, null, requestOptions, context)
+ .deleteWithRestResponseAsync(synonymMapName, etag, null,
+ RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
.map(Function.identity());
} catch (RuntimeException ex) {
return monoError(logger, ex);
@@ -1314,8 +1335,10 @@ public Mono> getServiceStatisticsWithResponse(Reques
Mono> getServiceStatisticsWithResponse(RequestOptions requestOptions, Context context) {
try {
- return restClient.getServiceStatisticsWithRestResponseAsync(requestOptions, context)
- .map(Function.identity());
+ return restClient.getServiceStatisticsWithRestResponseAsync(
+ RequestOptionsConverter.map(requestOptions), context)
+ .onErrorMap(MappingUtils::exceptionMapper)
+ .map(MappingUtils::mappingExternalServiceStatistics);
} catch (RuntimeException ex) {
return monoError(logger, ex);
}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/DataSourcesImpl.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/DataSourcesImpl.java
index 3382f1b13648..cd4afca8c63b 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/DataSourcesImpl.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/DataSourcesImpl.java
@@ -26,9 +26,9 @@
import com.azure.core.http.rest.SimpleResponse;
import com.azure.core.util.Context;
import com.azure.search.documents.implementation.models.ListDataSourcesResult;
-import com.azure.search.documents.models.RequestOptions;
-import com.azure.search.documents.models.SearchErrorException;
-import com.azure.search.documents.models.SearchIndexerDataSource;
+import com.azure.search.documents.implementation.models.RequestOptions;
+import com.azure.search.documents.implementation.models.SearchErrorException;
+import com.azure.search.documents.implementation.models.SearchIndexerDataSource;
import java.util.UUID;
import reactor.core.publisher.Mono;
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/DocumentsImpl.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/DocumentsImpl.java
index c11b1f6dfe7a..9526336aecb4 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/DocumentsImpl.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/DocumentsImpl.java
@@ -25,23 +25,22 @@
import com.azure.core.util.serializer.CollectionFormat;
import com.azure.core.util.serializer.JacksonAdapter;
import com.azure.core.util.serializer.SerializerAdapter;
+import com.azure.search.documents.implementation.models.AutocompleteMode;
+import com.azure.search.documents.implementation.models.AutocompleteOptions;
import com.azure.search.documents.implementation.models.AutocompleteRequest;
+import com.azure.search.documents.implementation.models.AutocompleteResult;
+import com.azure.search.documents.implementation.models.IndexBatch;
+import com.azure.search.documents.implementation.models.IndexDocumentsResult;
+import com.azure.search.documents.implementation.models.QueryType;
+import com.azure.search.documents.implementation.models.RequestOptions;
import com.azure.search.documents.implementation.models.SearchDocumentsResult;
+import com.azure.search.documents.implementation.models.SearchErrorException;
+import com.azure.search.documents.implementation.models.SearchMode;
+import com.azure.search.documents.implementation.models.SearchOptions;
import com.azure.search.documents.implementation.models.SearchRequest;
import com.azure.search.documents.implementation.models.SuggestDocumentsResult;
+import com.azure.search.documents.implementation.models.SuggestOptions;
import com.azure.search.documents.implementation.models.SuggestRequest;
-import com.azure.search.documents.models.AutocompleteMode;
-import com.azure.search.documents.models.AutocompleteOptions;
-import com.azure.search.documents.models.AutocompleteResult;
-import com.azure.search.documents.models.IndexBatchBase;
-import com.azure.search.documents.models.IndexDocumentsResult;
-import com.azure.search.documents.models.QueryType;
-import com.azure.search.documents.models.RequestOptions;
-import com.azure.search.documents.models.ScoringParameter;
-import com.azure.search.documents.models.SearchErrorException;
-import com.azure.search.documents.models.SearchMode;
-import com.azure.search.documents.models.SearchOptions;
-import com.azure.search.documents.models.SuggestOptions;
import java.util.List;
import java.util.Map;
import java.util.UUID;
@@ -114,7 +113,7 @@ private interface DocumentsService {
@Post("docs/search.index")
@ExpectedResponses({200, 207})
@UnexpectedResponseExceptionType(SearchErrorException.class)
- Mono> index(@HostParam("endpoint") String endpoint, @HostParam("indexName") String indexName, @HeaderParam("accept") String accept, @BodyParam("application/json; charset=utf-8") IndexBatchBase batch, @QueryParam("api-version") String apiVersion, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, Context context);
+ Mono> index(@HostParam("endpoint") String endpoint, @HostParam("indexName") String indexName, @HeaderParam("accept") String accept, @BodyParam("application/json; charset=utf-8") IndexBatch batch, @QueryParam("api-version") String apiVersion, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, Context context);
@Get("docs/search.autocomplete")
@ExpectedResponses({200})
@@ -243,7 +242,7 @@ public Mono> searchGetWithRestResponseAsyn
if (searchOptions != null) {
queryType = searchOptions.getQueryType();
}
- List scoringParameters = null;
+ List scoringParameters = null;
if (searchOptions != null) {
scoringParameters = searchOptions.getScoringParameters();
}
@@ -406,7 +405,7 @@ public Mono> suggestGetWithRestResponseAs
}
Boolean useFuzzyMatching = null;
if (suggestOptions != null) {
- useFuzzyMatching = suggestOptions.useFuzzyMatching();
+ useFuzzyMatching = suggestOptions.isUseFuzzyMatching();
}
String highlightPostTag = null;
if (suggestOptions != null) {
@@ -491,7 +490,7 @@ public Mono> suggestPostWithRestResponseA
* @return a Mono which performs the network request upon subscription.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono> indexWithRestResponseAsync(IndexBatchBase batch, Context context) {
+ public Mono> indexWithRestResponseAsync(IndexBatch batch, Context context) {
final String accept = "application/json;odata.metadata=none";
final UUID xMsClientRequestId = null;
@@ -508,7 +507,7 @@ public Mono> indexWithRestResponseAsync
* @return a Mono which performs the network request upon subscription.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono> indexWithRestResponseAsync(IndexBatchBase batch, RequestOptions requestOptions, Context context) {
+ public Mono> indexWithRestResponseAsync(IndexBatch batch, RequestOptions requestOptions, Context context) {
final String accept = "application/json;odata.metadata=none";
UUID xMsClientRequestId = null;
@@ -572,7 +571,7 @@ public Mono> autocompleteGetWithRestResponseA
}
Boolean useFuzzyMatching = null;
if (autocompleteOptions != null) {
- useFuzzyMatching = autocompleteOptions.useFuzzyMatching();
+ useFuzzyMatching = autocompleteOptions.isUseFuzzyMatching();
}
String highlightPostTag = null;
if (autocompleteOptions != null) {
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/IndexersImpl.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/IndexersImpl.java
index 7030277bf29e..159702655d64 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/IndexersImpl.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/IndexersImpl.java
@@ -26,10 +26,10 @@
import com.azure.core.http.rest.SimpleResponse;
import com.azure.core.util.Context;
import com.azure.search.documents.implementation.models.ListIndexersResult;
-import com.azure.search.documents.models.RequestOptions;
-import com.azure.search.documents.models.SearchErrorException;
-import com.azure.search.documents.models.SearchIndexer;
-import com.azure.search.documents.models.SearchIndexerStatus;
+import com.azure.search.documents.implementation.models.RequestOptions;
+import com.azure.search.documents.implementation.models.SearchErrorException;
+import com.azure.search.documents.implementation.models.SearchIndexer;
+import com.azure.search.documents.implementation.models.SearchIndexerStatus;
import java.util.UUID;
import reactor.core.publisher.Mono;
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/IndexesImpl.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/IndexesImpl.java
index 882ca42d28cf..95b7f7c43d81 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/IndexesImpl.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/IndexesImpl.java
@@ -25,13 +25,13 @@
import com.azure.core.http.rest.RestProxy;
import com.azure.core.http.rest.SimpleResponse;
import com.azure.core.util.Context;
+import com.azure.search.documents.implementation.models.AnalyzeRequest;
import com.azure.search.documents.implementation.models.AnalyzeResult;
+import com.azure.search.documents.implementation.models.GetIndexStatisticsResult;
import com.azure.search.documents.implementation.models.ListIndexesResult;
-import com.azure.search.documents.models.AnalyzeRequest;
-import com.azure.search.documents.models.GetIndexStatisticsResult;
-import com.azure.search.documents.models.RequestOptions;
-import com.azure.search.documents.models.SearchErrorException;
-import com.azure.search.documents.models.SearchIndex;
+import com.azure.search.documents.implementation.models.RequestOptions;
+import com.azure.search.documents.implementation.models.SearchErrorException;
+import com.azure.search.documents.implementation.models.SearchIndex;
import java.util.UUID;
import reactor.core.publisher.Mono;
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/Iso8601DateDeserializer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/Iso8601DateDeserializer.java
index 4a28ade45707..329591a6853f 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/Iso8601DateDeserializer.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/Iso8601DateDeserializer.java
@@ -1,5 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
+
package com.azure.search.documents.implementation;
import com.fasterxml.jackson.core.JsonParser;
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchServiceRestClientBuilder.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchServiceRestClientBuilder.java
index 512f7a8d05bc..c5c7fd1f26b4 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchServiceRestClientBuilder.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchServiceRestClientBuilder.java
@@ -16,8 +16,8 @@
import com.azure.core.http.policy.UserAgentPolicy;
import com.azure.core.http.rest.SimpleResponse;
import com.azure.core.util.Context;
-import com.azure.search.documents.models.RequestOptions;
-import com.azure.search.documents.models.ServiceStatistics;
+import com.azure.search.documents.implementation.models.RequestOptions;
+import com.azure.search.documents.implementation.models.ServiceStatistics;
import reactor.core.publisher.Mono;
/**
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchServiceRestClientImpl.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchServiceRestClientImpl.java
index 710583016488..4d9f5e9aff37 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchServiceRestClientImpl.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchServiceRestClientImpl.java
@@ -25,9 +25,9 @@
import com.azure.core.http.rest.RestProxy;
import com.azure.core.http.rest.SimpleResponse;
import com.azure.core.util.Context;
-import com.azure.search.documents.models.RequestOptions;
-import com.azure.search.documents.models.SearchErrorException;
-import com.azure.search.documents.models.ServiceStatistics;
+import com.azure.search.documents.implementation.models.RequestOptions;
+import com.azure.search.documents.implementation.models.SearchErrorException;
+import com.azure.search.documents.implementation.models.ServiceStatistics;
import java.util.UUID;
import reactor.core.publisher.Mono;
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SkillsetsImpl.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SkillsetsImpl.java
index a06b421d8c5a..d692ba4b547a 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SkillsetsImpl.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SkillsetsImpl.java
@@ -26,9 +26,9 @@
import com.azure.core.http.rest.SimpleResponse;
import com.azure.core.util.Context;
import com.azure.search.documents.implementation.models.ListSkillsetsResult;
-import com.azure.search.documents.models.RequestOptions;
-import com.azure.search.documents.models.SearchErrorException;
-import com.azure.search.documents.models.SearchIndexerSkillset;
+import com.azure.search.documents.implementation.models.RequestOptions;
+import com.azure.search.documents.implementation.models.SearchErrorException;
+import com.azure.search.documents.implementation.models.SearchIndexerSkillset;
import java.util.UUID;
import reactor.core.publisher.Mono;
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SynonymMapsImpl.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SynonymMapsImpl.java
index 95d9654906e9..a0754ff86625 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SynonymMapsImpl.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SynonymMapsImpl.java
@@ -26,9 +26,9 @@
import com.azure.core.http.rest.SimpleResponse;
import com.azure.core.util.Context;
import com.azure.search.documents.implementation.models.ListSynonymMapsResult;
-import com.azure.search.documents.models.RequestOptions;
-import com.azure.search.documents.models.SearchErrorException;
-import com.azure.search.documents.models.SynonymMap;
+import com.azure.search.documents.implementation.models.RequestOptions;
+import com.azure.search.documents.implementation.models.SearchErrorException;
+import com.azure.search.documents.implementation.models.SynonymMap;
import java.util.UUID;
import reactor.core.publisher.Mono;
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AnalyzeRequestConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AnalyzeRequestConverter.java
new file mode 100644
index 000000000000..a7eb0684b508
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AnalyzeRequestConverter.java
@@ -0,0 +1,97 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.AnalyzeRequest;
+import com.azure.search.documents.models.CharFilterName;
+import com.azure.search.documents.models.LexicalAnalyzerName;
+import com.azure.search.documents.models.LexicalTokenizerName;
+import com.azure.search.documents.models.TokenFilterName;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.AnalyzeRequest} and
+ * {@link AnalyzeRequest}.
+ */
+public final class AnalyzeRequestConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(AnalyzeRequestConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.AnalyzeRequest} to {@link AnalyzeRequest}.
+ */
+ public static AnalyzeRequest map(com.azure.search.documents.implementation.models.AnalyzeRequest obj) {
+ if (obj == null) {
+ return null;
+ }
+ AnalyzeRequest analyzeRequest = new AnalyzeRequest();
+
+ if (obj.getCharFilters() != null) {
+ List _charFilters =
+ obj.getCharFilters().stream().map(CharFilterNameConverter::map).collect(Collectors.toList());
+ analyzeRequest.setCharFilters(_charFilters);
+ }
+
+ if (obj.getAnalyzer() != null) {
+ LexicalAnalyzerName _analyzer = LexicalAnalyzerNameConverter.map(obj.getAnalyzer());
+ analyzeRequest.setAnalyzer(_analyzer);
+ }
+
+ if (obj.getTokenFilters() != null) {
+ List _tokenFilters =
+ obj.getTokenFilters().stream().map(TokenFilterNameConverter::map).collect(Collectors.toList());
+ analyzeRequest.setTokenFilters(_tokenFilters);
+ }
+
+ String _text = obj.getText();
+ analyzeRequest.setText(_text);
+
+ if (obj.getTokenizer() != null) {
+ LexicalTokenizerName _tokenizer = LexicalTokenizerNameConverter.map(obj.getTokenizer());
+ analyzeRequest.setTokenizer(_tokenizer);
+ }
+ return analyzeRequest;
+ }
+
+ /**
+ * Maps from {@link AnalyzeRequest} to {@link com.azure.search.documents.implementation.models.AnalyzeRequest}.
+ */
+ public static com.azure.search.documents.implementation.models.AnalyzeRequest map(AnalyzeRequest obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.AnalyzeRequest analyzeRequest =
+ new com.azure.search.documents.implementation.models.AnalyzeRequest();
+
+ if (obj.getCharFilters() != null) {
+ List _charFilters =
+ obj.getCharFilters().stream().map(CharFilterNameConverter::map).collect(Collectors.toList());
+ analyzeRequest.setCharFilters(_charFilters);
+ }
+
+ if (obj.getAnalyzer() != null) {
+ com.azure.search.documents.implementation.models.LexicalAnalyzerName _analyzer =
+ LexicalAnalyzerNameConverter.map(obj.getAnalyzer());
+ analyzeRequest.setAnalyzer(_analyzer);
+ }
+
+ if (obj.getTokenFilters() != null) {
+ List _tokenFilters =
+ obj.getTokenFilters().stream().map(TokenFilterNameConverter::map).collect(Collectors.toList());
+ analyzeRequest.setTokenFilters(_tokenFilters);
+ }
+
+ String _text = obj.getText();
+ analyzeRequest.setText(_text);
+
+ if (obj.getTokenizer() != null) {
+ com.azure.search.documents.implementation.models.LexicalTokenizerName _tokenizer =
+ LexicalTokenizerNameConverter.map(obj.getTokenizer());
+ analyzeRequest.setTokenizer(_tokenizer);
+ }
+ return analyzeRequest;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AnalyzedTokenInfoConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AnalyzedTokenInfoConverter.java
new file mode 100644
index 000000000000..6ba570ac41f2
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AnalyzedTokenInfoConverter.java
@@ -0,0 +1,62 @@
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.implementation.util.PrivateFieldAccessHelper;
+import com.azure.search.documents.models.AnalyzedTokenInfo;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.AnalyzedTokenInfo} and
+ * {@link AnalyzedTokenInfo}.
+ */
+public final class AnalyzedTokenInfoConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(AnalyzedTokenInfoConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.AnalyzedTokenInfo} to
+ * {@link AnalyzedTokenInfo}.
+ */
+ public static AnalyzedTokenInfo map(com.azure.search.documents.implementation.models.AnalyzedTokenInfo obj) {
+ if (obj == null) {
+ return null;
+ }
+ AnalyzedTokenInfo analyzedTokenInfo = new AnalyzedTokenInfo();
+
+ int _endOffset = obj.getEndOffset();
+ PrivateFieldAccessHelper.set(analyzedTokenInfo, "endOffset", _endOffset);
+
+ int _startOffset = obj.getStartOffset();
+ PrivateFieldAccessHelper.set(analyzedTokenInfo, "startOffset", _startOffset);
+
+ int _position = obj.getPosition();
+ PrivateFieldAccessHelper.set(analyzedTokenInfo, "position", _position);
+
+ String _token = obj.getToken();
+ PrivateFieldAccessHelper.set(analyzedTokenInfo, "token", _token);
+ return analyzedTokenInfo;
+ }
+
+ /**
+ * Maps from {@link AnalyzedTokenInfo} to
+ * {@link com.azure.search.documents.implementation.models.AnalyzedTokenInfo}.
+ */
+ public static com.azure.search.documents.implementation.models.AnalyzedTokenInfo map(AnalyzedTokenInfo obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.AnalyzedTokenInfo analyzedTokenInfo =
+ new com.azure.search.documents.implementation.models.AnalyzedTokenInfo();
+
+ int _endOffset = obj.getEndOffset();
+ PrivateFieldAccessHelper.set(analyzedTokenInfo, "endOffset", _endOffset);
+
+ int _startOffset = obj.getStartOffset();
+ PrivateFieldAccessHelper.set(analyzedTokenInfo, "startOffset", _startOffset);
+
+ int _position = obj.getPosition();
+ PrivateFieldAccessHelper.set(analyzedTokenInfo, "position", _position);
+
+ String _token = obj.getToken();
+ PrivateFieldAccessHelper.set(analyzedTokenInfo, "token", _token);
+ return analyzedTokenInfo;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AsciiFoldingTokenFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AsciiFoldingTokenFilterConverter.java
new file mode 100644
index 000000000000..9c4fc1f29fea
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AsciiFoldingTokenFilterConverter.java
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.AsciiFoldingTokenFilter;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.AsciiFoldingTokenFilter} and
+ * {@link AsciiFoldingTokenFilter}.
+ */
+public final class AsciiFoldingTokenFilterConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(AsciiFoldingTokenFilterConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.AsciiFoldingTokenFilter} to
+ * {@link AsciiFoldingTokenFilter}.
+ */
+ public static AsciiFoldingTokenFilter map(com.azure.search.documents.implementation.models.AsciiFoldingTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ AsciiFoldingTokenFilter asciiFoldingTokenFilter = new AsciiFoldingTokenFilter();
+
+ String _name = obj.getName();
+ asciiFoldingTokenFilter.setName(_name);
+
+ Boolean _preserveOriginal = obj.isPreserveOriginal();
+ asciiFoldingTokenFilter.setPreserveOriginal(_preserveOriginal);
+ return asciiFoldingTokenFilter;
+ }
+
+ /**
+ * Maps from {@link AsciiFoldingTokenFilter} to
+ * {@link com.azure.search.documents.implementation.models.AsciiFoldingTokenFilter}.
+ */
+ public static com.azure.search.documents.implementation.models.AsciiFoldingTokenFilter map(AsciiFoldingTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.AsciiFoldingTokenFilter asciiFoldingTokenFilter =
+ new com.azure.search.documents.implementation.models.AsciiFoldingTokenFilter();
+
+ String _name = obj.getName();
+ asciiFoldingTokenFilter.setName(_name);
+
+ Boolean _preserveOriginal = obj.isPreserveOriginal();
+ asciiFoldingTokenFilter.setPreserveOriginal(_preserveOriginal);
+ return asciiFoldingTokenFilter;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AutocompleteItemConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AutocompleteItemConverter.java
new file mode 100644
index 000000000000..61aca3f4c2ff
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AutocompleteItemConverter.java
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.implementation.util.PrivateFieldAccessHelper;
+import com.azure.search.documents.models.AutocompleteItem;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.AutocompleteItem} and
+ * {@link AutocompleteItem}.
+ */
+public final class AutocompleteItemConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(AutocompleteItemConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.AutocompleteItem} to {@link AutocompleteItem}.
+ */
+ public static AutocompleteItem map(com.azure.search.documents.implementation.models.AutocompleteItem obj) {
+ if (obj == null) {
+ return null;
+ }
+ AutocompleteItem autocompleteItem = new AutocompleteItem();
+
+ String _text = obj.getText();
+ PrivateFieldAccessHelper.set(autocompleteItem, "text", _text);
+
+ String _queryPlusText = obj.getQueryPlusText();
+ PrivateFieldAccessHelper.set(autocompleteItem, "queryPlusText", _queryPlusText);
+ return autocompleteItem;
+ }
+
+ /**
+ * Maps from {@link AutocompleteItem} to {@link com.azure.search.documents.implementation.models.AutocompleteItem}.
+ */
+ public static com.azure.search.documents.implementation.models.AutocompleteItem map(AutocompleteItem obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.AutocompleteItem autocompleteItem =
+ new com.azure.search.documents.implementation.models.AutocompleteItem();
+
+ String _text = obj.getText();
+ PrivateFieldAccessHelper.set(autocompleteItem, "text", _text);
+
+ String _queryPlusText = obj.getQueryPlusText();
+ PrivateFieldAccessHelper.set(autocompleteItem, "queryPlusText", _queryPlusText);
+ return autocompleteItem;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AutocompleteModeConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AutocompleteModeConverter.java
new file mode 100644
index 000000000000..a9f5a14b629e
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AutocompleteModeConverter.java
@@ -0,0 +1,58 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.AutocompleteMode;
+
+import static com.azure.search.documents.implementation.util.Constants.ENUM_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ENUM_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.AutocompleteMode} and
+ * {@link AutocompleteMode}.
+ */
+public final class AutocompleteModeConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(AutocompleteModeConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.AutocompleteMode} to enum
+ * {@link AutocompleteMode}.
+ */
+ public static AutocompleteMode map(com.azure.search.documents.implementation.models.AutocompleteMode obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case ONE_TERM:
+ return AutocompleteMode.ONE_TERM;
+ case TWO_TERMS:
+ return AutocompleteMode.TWO_TERMS;
+ case ONE_TERM_WITH_CONTEXT:
+ return AutocompleteMode.ONE_TERM_WITH_CONTEXT;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_EXTERNAL_ERROR_MSG, obj)));
+ }
+ }
+
+ /**
+ * Maps from enum {@link AutocompleteMode} to enum
+ * {@link com.azure.search.documents.implementation.models.AutocompleteMode}.
+ */
+ public static com.azure.search.documents.implementation.models.AutocompleteMode map(AutocompleteMode obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case ONE_TERM:
+ return com.azure.search.documents.implementation.models.AutocompleteMode.ONE_TERM;
+ case TWO_TERMS:
+ return com.azure.search.documents.implementation.models.AutocompleteMode.TWO_TERMS;
+ case ONE_TERM_WITH_CONTEXT:
+ return com.azure.search.documents.implementation.models.AutocompleteMode.ONE_TERM_WITH_CONTEXT;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj)));
+ }
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AutocompleteOptionsConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AutocompleteOptionsConverter.java
new file mode 100644
index 000000000000..3534cdf097e5
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AutocompleteOptionsConverter.java
@@ -0,0 +1,103 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.implementation.util.PrivateFieldAccessHelper;
+import com.azure.search.documents.models.AutocompleteMode;
+import com.azure.search.documents.models.AutocompleteOptions;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.AutocompleteOptions} and
+ * {@link AutocompleteOptions}.
+ */
+public final class AutocompleteOptionsConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(AutocompleteOptionsConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.AutocompleteOptions} to
+ * {@link AutocompleteOptions}.
+ */
+ public static AutocompleteOptions map(com.azure.search.documents.implementation.models.AutocompleteOptions obj) {
+ if (obj == null) {
+ return null;
+ }
+ AutocompleteOptions autocompleteOptions = new AutocompleteOptions();
+
+ String _filter = obj.getFilter();
+ autocompleteOptions.setFilter(_filter);
+
+ Boolean _useFuzzyMatching = obj.isUseFuzzyMatching();
+ autocompleteOptions.setUseFuzzyMatching(_useFuzzyMatching);
+
+ Double _minimumCoverage = obj.getMinimumCoverage();
+ autocompleteOptions.setMinimumCoverage(_minimumCoverage);
+
+ if (obj.getAutocompleteMode() != null) {
+ AutocompleteMode _autocompleteMode = AutocompleteModeConverter.map(obj.getAutocompleteMode());
+ autocompleteOptions.setAutocompleteMode(_autocompleteMode);
+ }
+
+ Integer _top = obj.getTop();
+ autocompleteOptions.setTop(_top);
+
+ String _highlightPostTag = obj.getHighlightPostTag();
+ autocompleteOptions.setHighlightPostTag(_highlightPostTag);
+
+ if (obj.getSearchFields() != null) {
+ List _searchFields = new ArrayList<>(obj.getSearchFields());
+ PrivateFieldAccessHelper.set(autocompleteOptions, "searchFields", _searchFields);
+ }
+
+ String _highlightPreTag = obj.getHighlightPreTag();
+ autocompleteOptions.setHighlightPreTag(_highlightPreTag);
+ return autocompleteOptions;
+ }
+
+ /**
+ * Maps from {@link AutocompleteOptions} to
+ * {@link com.azure.search.documents.implementation.models.AutocompleteOptions}.
+ */
+ public static com.azure.search.documents.implementation.models.AutocompleteOptions map(AutocompleteOptions obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.AutocompleteOptions autocompleteOptions =
+ new com.azure.search.documents.implementation.models.AutocompleteOptions();
+
+ String _filter = obj.getFilter();
+ autocompleteOptions.setFilter(_filter);
+
+ Boolean _useFuzzyMatching = obj.useFuzzyMatching();
+ autocompleteOptions.setUseFuzzyMatching(_useFuzzyMatching);
+
+ Double _minimumCoverage = obj.getMinimumCoverage();
+ autocompleteOptions.setMinimumCoverage(_minimumCoverage);
+
+ if (obj.getAutocompleteMode() != null) {
+ com.azure.search.documents.implementation.models.AutocompleteMode _autocompleteMode =
+ AutocompleteModeConverter.map(obj.getAutocompleteMode());
+ autocompleteOptions.setAutocompleteMode(_autocompleteMode);
+ }
+
+ Integer _top = obj.getTop();
+ autocompleteOptions.setTop(_top);
+
+ String _highlightPostTag = obj.getHighlightPostTag();
+ autocompleteOptions.setHighlightPostTag(_highlightPostTag);
+
+ if (obj.getSearchFields() != null) {
+ List _searchFields = new ArrayList<>(obj.getSearchFields());
+ PrivateFieldAccessHelper.set(autocompleteOptions, "searchFields", _searchFields);
+ }
+
+ String _highlightPreTag = obj.getHighlightPreTag();
+ autocompleteOptions.setHighlightPreTag(_highlightPreTag);
+ return autocompleteOptions;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AutocompleteResultConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AutocompleteResultConverter.java
new file mode 100644
index 000000000000..f1ac3e181a29
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AutocompleteResultConverter.java
@@ -0,0 +1,63 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.implementation.util.PrivateFieldAccessHelper;
+import com.azure.search.documents.models.AutocompleteItem;
+import com.azure.search.documents.models.AutocompleteResult;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.AutocompleteResult} and
+ * {@link AutocompleteResult}.
+ */
+public final class AutocompleteResultConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(AutocompleteResultConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.AutocompleteResult} to
+ * {@link AutocompleteResult}.
+ */
+ public static AutocompleteResult map(com.azure.search.documents.implementation.models.AutocompleteResult obj) {
+ if (obj == null) {
+ return null;
+ }
+ AutocompleteResult autocompleteResult = new AutocompleteResult();
+
+ Double _coverage = obj.getCoverage();
+ PrivateFieldAccessHelper.set(autocompleteResult, "coverage", _coverage);
+
+ if (obj.getResults() != null) {
+ List _results =
+ obj.getResults().stream().map(AutocompleteItemConverter::map).collect(Collectors.toList());
+ PrivateFieldAccessHelper.set(autocompleteResult, "results", _results);
+ }
+ return autocompleteResult;
+ }
+
+ /**
+ * Maps from {@link AutocompleteResult} to
+ * {@link com.azure.search.documents.implementation.models.AutocompleteResult}.
+ */
+ public static com.azure.search.documents.implementation.models.AutocompleteResult map(AutocompleteResult obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.AutocompleteResult autocompleteResult =
+ new com.azure.search.documents.implementation.models.AutocompleteResult();
+
+ Double _coverage = obj.getCoverage();
+ PrivateFieldAccessHelper.set(autocompleteResult, "coverage", _coverage);
+
+ if (obj.getResults() != null) {
+ List _results =
+ obj.getResults().stream().map(AutocompleteItemConverter::map).collect(Collectors.toList());
+ PrivateFieldAccessHelper.set(autocompleteResult, "results", _results);
+ }
+ return autocompleteResult;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AzureActiveDirectoryApplicationCredentialsConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AzureActiveDirectoryApplicationCredentialsConverter.java
new file mode 100644
index 000000000000..2fb6d19c2d54
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AzureActiveDirectoryApplicationCredentialsConverter.java
@@ -0,0 +1,54 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.AzureActiveDirectoryApplicationCredentials;
+
+/**
+ * A converter between
+ * {@link com.azure.search.documents.implementation.models.AzureActiveDirectoryApplicationCredentials} and
+ * {@link AzureActiveDirectoryApplicationCredentials}.
+ */
+public final class AzureActiveDirectoryApplicationCredentialsConverter {
+ private static final ClientLogger LOGGER =
+ new ClientLogger(AzureActiveDirectoryApplicationCredentialsConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.AzureActiveDirectoryApplicationCredentials} to
+ * {@link AzureActiveDirectoryApplicationCredentials}.
+ */
+ public static AzureActiveDirectoryApplicationCredentials map(com.azure.search.documents.implementation.models.AzureActiveDirectoryApplicationCredentials obj) {
+ if (obj == null) {
+ return null;
+ }
+ AzureActiveDirectoryApplicationCredentials azureActiveDirectoryApplicationCredentials =
+ new AzureActiveDirectoryApplicationCredentials();
+
+ String _applicationId = obj.getApplicationId();
+ azureActiveDirectoryApplicationCredentials.setApplicationId(_applicationId);
+
+ String _applicationSecret = obj.getApplicationSecret();
+ azureActiveDirectoryApplicationCredentials.setApplicationSecret(_applicationSecret);
+ return azureActiveDirectoryApplicationCredentials;
+ }
+
+ /**
+ * Maps from {@link AzureActiveDirectoryApplicationCredentials} to
+ * {@link com.azure.search.documents.implementation.models.AzureActiveDirectoryApplicationCredentials}.
+ */
+ public static com.azure.search.documents.implementation.models.AzureActiveDirectoryApplicationCredentials map(AzureActiveDirectoryApplicationCredentials obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.AzureActiveDirectoryApplicationCredentials azureActiveDirectoryApplicationCredentials = new com.azure.search.documents.implementation.models.AzureActiveDirectoryApplicationCredentials();
+
+ String _applicationId = obj.getApplicationId();
+ azureActiveDirectoryApplicationCredentials.setApplicationId(_applicationId);
+
+ String _applicationSecret = obj.getApplicationSecret();
+ azureActiveDirectoryApplicationCredentials.setApplicationSecret(_applicationSecret);
+ return azureActiveDirectoryApplicationCredentials;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/BM25SimilarityConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/BM25SimilarityConverter.java
new file mode 100644
index 000000000000..ab7d43a83d6d
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/BM25SimilarityConverter.java
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.BM25Similarity;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.BM25Similarity} and
+ * {@link BM25Similarity}.
+ */
+public final class BM25SimilarityConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(BM25SimilarityConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.BM25Similarity} to {@link BM25Similarity}.
+ */
+ public static BM25Similarity map(com.azure.search.documents.implementation.models.BM25Similarity obj) {
+ if (obj == null) {
+ return null;
+ }
+ BM25Similarity bM25Similarity = new BM25Similarity();
+
+ Double _b = obj.getB();
+ bM25Similarity.setB(_b);
+
+ Double _k1 = obj.getK1();
+ bM25Similarity.setK1(_k1);
+ return bM25Similarity;
+ }
+
+ /**
+ * Maps from {@link BM25Similarity} to {@link com.azure.search.documents.implementation.models.BM25Similarity}.
+ */
+ public static com.azure.search.documents.implementation.models.BM25Similarity map(BM25Similarity obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.BM25Similarity bM25Similarity =
+ new com.azure.search.documents.implementation.models.BM25Similarity();
+
+ Double _b = obj.getB();
+ bM25Similarity.setB(_b);
+
+ Double _k1 = obj.getK1();
+ bM25Similarity.setK1(_k1);
+ return bM25Similarity;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CharFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CharFilterConverter.java
new file mode 100644
index 000000000000..e70cd7aa58b0
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CharFilterConverter.java
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.implementation.models.MappingCharFilter;
+import com.azure.search.documents.implementation.models.PatternReplaceCharFilter;
+import com.azure.search.documents.models.CharFilter;
+
+import static com.azure.search.documents.implementation.util.Constants.ABSTRACT_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ABSTRACT_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.CharFilter} and {@link CharFilter}.
+ */
+public final class CharFilterConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(CharFilterConverter.class);
+
+ /**
+ * Maps abstract class from {@link com.azure.search.documents.implementation.models.CharFilter} to
+ * {@link CharFilter}. Dedicate works to sub class converter.
+ */
+ public static CharFilter map(com.azure.search.documents.implementation.models.CharFilter obj) {
+ if (obj instanceof PatternReplaceCharFilter) {
+ return PatternReplaceCharFilterConverter.map((PatternReplaceCharFilter) obj);
+ }
+ if (obj instanceof MappingCharFilter) {
+ return MappingCharFilterConverter.map((MappingCharFilter) obj);
+ }
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_EXTERNAL_ERROR_MSG,
+ obj.getClass().getSimpleName())));
+ }
+
+ /**
+ * Maps abstract class from {@link CharFilter} to
+ * {@link com.azure.search.documents.implementation.models.CharFilter}. Dedicate works to sub class converter.
+ */
+ public static com.azure.search.documents.implementation.models.CharFilter map(CharFilter obj) {
+ if (obj instanceof com.azure.search.documents.models.PatternReplaceCharFilter) {
+ return PatternReplaceCharFilterConverter.map((com.azure.search.documents.models.PatternReplaceCharFilter) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.MappingCharFilter) {
+ return MappingCharFilterConverter.map((com.azure.search.documents.models.MappingCharFilter) obj);
+ }
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_INTERNAL_ERROR_MSG, obj.getClass().getSimpleName())));
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CharFilterNameConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CharFilterNameConverter.java
new file mode 100644
index 000000000000..b645a39163f3
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CharFilterNameConverter.java
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.CharFilterName;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.CharFilterName} and
+ * {@link CharFilterName}.
+ */
+public final class CharFilterNameConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(CharFilterNameConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.CharFilterName} to enum
+ * {@link CharFilterName}.
+ */
+ public static CharFilterName map(com.azure.search.documents.implementation.models.CharFilterName obj) {
+ if (obj == null) {
+ return null;
+ }
+ return CharFilterName.fromString(obj.toString());
+ }
+
+ /**
+ * Maps from enum {@link CharFilterName} to enum
+ * {@link com.azure.search.documents.implementation.models.CharFilterName}.
+ */
+ public static com.azure.search.documents.implementation.models.CharFilterName map(CharFilterName obj) {
+ if (obj == null) {
+ return null;
+ }
+ return com.azure.search.documents.implementation.models.CharFilterName.fromString(obj.toString());
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CjkBigramTokenFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CjkBigramTokenFilterConverter.java
new file mode 100644
index 000000000000..c35daa826b15
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CjkBigramTokenFilterConverter.java
@@ -0,0 +1,68 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.CjkBigramTokenFilter;
+import com.azure.search.documents.models.CjkBigramTokenFilterScripts;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.CjkBigramTokenFilter} and
+ * {@link CjkBigramTokenFilter}.
+ */
+public final class CjkBigramTokenFilterConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(CjkBigramTokenFilterConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.CjkBigramTokenFilter} to
+ * {@link CjkBigramTokenFilter}.
+ */
+ public static CjkBigramTokenFilter map(com.azure.search.documents.implementation.models.CjkBigramTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ CjkBigramTokenFilter cjkBigramTokenFilter = new CjkBigramTokenFilter();
+
+ String _name = obj.getName();
+ cjkBigramTokenFilter.setName(_name);
+
+ Boolean _outputUnigrams = obj.isOutputUnigrams();
+ cjkBigramTokenFilter.setOutputUnigrams(_outputUnigrams);
+
+ if (obj.getIgnoreScripts() != null) {
+ List _ignoreScripts =
+ obj.getIgnoreScripts().stream().map(CjkBigramTokenFilterScriptsConverter::map).collect(Collectors.toList());
+ cjkBigramTokenFilter.setIgnoreScripts(_ignoreScripts);
+ }
+ return cjkBigramTokenFilter;
+ }
+
+ /**
+ * Maps from {@link CjkBigramTokenFilter} to
+ * {@link com.azure.search.documents.implementation.models.CjkBigramTokenFilter}.
+ */
+ public static com.azure.search.documents.implementation.models.CjkBigramTokenFilter map(CjkBigramTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.CjkBigramTokenFilter cjkBigramTokenFilter =
+ new com.azure.search.documents.implementation.models.CjkBigramTokenFilter();
+
+ String _name = obj.getName();
+ cjkBigramTokenFilter.setName(_name);
+
+ Boolean _outputUnigrams = obj.isOutputUnigrams();
+ cjkBigramTokenFilter.setOutputUnigrams(_outputUnigrams);
+
+ if (obj.getIgnoreScripts() != null) {
+ List _ignoreScripts =
+ obj.getIgnoreScripts().stream().map(CjkBigramTokenFilterScriptsConverter::map).collect(Collectors.toList());
+ cjkBigramTokenFilter.setIgnoreScripts(_ignoreScripts);
+ }
+ return cjkBigramTokenFilter;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CjkBigramTokenFilterScriptsConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CjkBigramTokenFilterScriptsConverter.java
new file mode 100644
index 000000000000..536ad9d2f6f4
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CjkBigramTokenFilterScriptsConverter.java
@@ -0,0 +1,62 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.CjkBigramTokenFilterScripts;
+
+import static com.azure.search.documents.implementation.util.Constants.ENUM_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ENUM_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.CjkBigramTokenFilterScripts} and
+ * {@link CjkBigramTokenFilterScripts}.
+ */
+public final class CjkBigramTokenFilterScriptsConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(CjkBigramTokenFilterScriptsConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.CjkBigramTokenFilterScripts} to enum
+ * {@link CjkBigramTokenFilterScripts}.
+ */
+ public static CjkBigramTokenFilterScripts map(com.azure.search.documents.implementation.models.CjkBigramTokenFilterScripts obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case HAN:
+ return CjkBigramTokenFilterScripts.HAN;
+ case HIRAGANA:
+ return CjkBigramTokenFilterScripts.HIRAGANA;
+ case KATAKANA:
+ return CjkBigramTokenFilterScripts.KATAKANA;
+ case HANGUL:
+ return CjkBigramTokenFilterScripts.HANGUL;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_EXTERNAL_ERROR_MSG, obj)));
+ }
+ }
+
+ /**
+ * Maps from enum {@link CjkBigramTokenFilterScripts} to enum
+ * {@link com.azure.search.documents.implementation.models.CjkBigramTokenFilterScripts}.
+ */
+ public static com.azure.search.documents.implementation.models.CjkBigramTokenFilterScripts map(CjkBigramTokenFilterScripts obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case HAN:
+ return com.azure.search.documents.implementation.models.CjkBigramTokenFilterScripts.HAN;
+ case HIRAGANA:
+ return com.azure.search.documents.implementation.models.CjkBigramTokenFilterScripts.HIRAGANA;
+ case KATAKANA:
+ return com.azure.search.documents.implementation.models.CjkBigramTokenFilterScripts.KATAKANA;
+ case HANGUL:
+ return com.azure.search.documents.implementation.models.CjkBigramTokenFilterScripts.HANGUL;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj)));
+ }
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ClassicSimilarityConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ClassicSimilarityConverter.java
new file mode 100644
index 000000000000..67fbc60bd6b0
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ClassicSimilarityConverter.java
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.ClassicSimilarity;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.ClassicSimilarity} and
+ * {@link ClassicSimilarity}.
+ */
+public final class ClassicSimilarityConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(ClassicSimilarityConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.ClassicSimilarity} to
+ * {@link ClassicSimilarity}.
+ */
+ public static ClassicSimilarity map(com.azure.search.documents.implementation.models.ClassicSimilarity obj) {
+ if (obj == null) {
+ return null;
+ }
+ ClassicSimilarity classicSimilarity = new ClassicSimilarity();
+ return classicSimilarity;
+ }
+
+ /**
+ * Maps from {@link ClassicSimilarity} to
+ * {@link com.azure.search.documents.implementation.models.ClassicSimilarity}.
+ */
+ public static com.azure.search.documents.implementation.models.ClassicSimilarity map(ClassicSimilarity obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.ClassicSimilarity classicSimilarity =
+ new com.azure.search.documents.implementation.models.ClassicSimilarity();
+ return classicSimilarity;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ClassicTokenizerConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ClassicTokenizerConverter.java
new file mode 100644
index 000000000000..6ca49b83f07a
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ClassicTokenizerConverter.java
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.ClassicTokenizer;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.ClassicTokenizer} and
+ * {@link ClassicTokenizer}.
+ */
+public final class ClassicTokenizerConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(ClassicTokenizerConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.ClassicTokenizer} to {@link ClassicTokenizer}.
+ */
+ public static ClassicTokenizer map(com.azure.search.documents.implementation.models.ClassicTokenizer obj) {
+ if (obj == null) {
+ return null;
+ }
+ ClassicTokenizer classicTokenizer = new ClassicTokenizer();
+
+ String _name = obj.getName();
+ classicTokenizer.setName(_name);
+
+ Integer _maxTokenLength = obj.getMaxTokenLength();
+ classicTokenizer.setMaxTokenLength(_maxTokenLength);
+ return classicTokenizer;
+ }
+
+ /**
+ * Maps from {@link ClassicTokenizer} to {@link com.azure.search.documents.implementation.models.ClassicTokenizer}.
+ */
+ public static com.azure.search.documents.implementation.models.ClassicTokenizer map(ClassicTokenizer obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.ClassicTokenizer classicTokenizer =
+ new com.azure.search.documents.implementation.models.ClassicTokenizer();
+
+ String _name = obj.getName();
+ classicTokenizer.setName(_name);
+
+ Integer _maxTokenLength = obj.getMaxTokenLength();
+ classicTokenizer.setMaxTokenLength(_maxTokenLength);
+ return classicTokenizer;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CognitiveServicesAccountConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CognitiveServicesAccountConverter.java
new file mode 100644
index 000000000000..ab9c7238b28f
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CognitiveServicesAccountConverter.java
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.implementation.models.CognitiveServicesAccountKey;
+import com.azure.search.documents.implementation.models.DefaultCognitiveServicesAccount;
+import com.azure.search.documents.models.CognitiveServicesAccount;
+
+import static com.azure.search.documents.implementation.util.Constants.ABSTRACT_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ABSTRACT_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.CognitiveServicesAccount} and
+ * {@link CognitiveServicesAccount}.
+ */
+public final class CognitiveServicesAccountConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(CognitiveServicesAccountConverter.class);
+
+ /**
+ * Maps abstract class from {@link com.azure.search.documents.implementation.models.CognitiveServicesAccount} to
+ * {@link CognitiveServicesAccount}. Dedicate works to sub class converter.
+ */
+ public static CognitiveServicesAccount map(com.azure.search.documents.implementation.models.CognitiveServicesAccount obj) {
+ if (obj instanceof CognitiveServicesAccountKey) {
+ return CognitiveServicesAccountKeyConverter.map((CognitiveServicesAccountKey) obj);
+ }
+ if (obj instanceof DefaultCognitiveServicesAccount) {
+ return DefaultCognitiveServicesAccountConverter.map((DefaultCognitiveServicesAccount) obj);
+ }
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_EXTERNAL_ERROR_MSG,
+ obj.getClass().getSimpleName())));
+ }
+
+ /**
+ * Maps abstract class from {@link CognitiveServicesAccount} to
+ * {@link com.azure.search.documents.implementation.models.CognitiveServicesAccount}. Dedicate works to sub class
+ * converter.
+ */
+ public static com.azure.search.documents.implementation.models.CognitiveServicesAccount map(CognitiveServicesAccount obj) {
+ if (obj instanceof com.azure.search.documents.models.CognitiveServicesAccountKey) {
+ return CognitiveServicesAccountKeyConverter.map((com.azure.search.documents.models.CognitiveServicesAccountKey) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.DefaultCognitiveServicesAccount) {
+ return DefaultCognitiveServicesAccountConverter.map((com.azure.search.documents.models.DefaultCognitiveServicesAccount) obj);
+ }
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_INTERNAL_ERROR_MSG, obj.getClass().getSimpleName())));
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CognitiveServicesAccountKeyConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CognitiveServicesAccountKeyConverter.java
new file mode 100644
index 000000000000..e621fa142ae7
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CognitiveServicesAccountKeyConverter.java
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.CognitiveServicesAccountKey;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.CognitiveServicesAccountKey} and
+ * {@link CognitiveServicesAccountKey}.
+ */
+public final class CognitiveServicesAccountKeyConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(CognitiveServicesAccountKeyConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.CognitiveServicesAccountKey} to
+ * {@link CognitiveServicesAccountKey}.
+ */
+ public static CognitiveServicesAccountKey map(com.azure.search.documents.implementation.models.CognitiveServicesAccountKey obj) {
+ if (obj == null) {
+ return null;
+ }
+ CognitiveServicesAccountKey cognitiveServicesAccountKey = new CognitiveServicesAccountKey();
+
+ String _description = obj.getDescription();
+ cognitiveServicesAccountKey.setDescription(_description);
+
+ String _key = obj.getKey();
+ cognitiveServicesAccountKey.setKey(_key);
+ return cognitiveServicesAccountKey;
+ }
+
+ /**
+ * Maps from {@link CognitiveServicesAccountKey} to
+ * {@link com.azure.search.documents.implementation.models.CognitiveServicesAccountKey}.
+ */
+ public static com.azure.search.documents.implementation.models.CognitiveServicesAccountKey map(CognitiveServicesAccountKey obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.CognitiveServicesAccountKey cognitiveServicesAccountKey =
+ new com.azure.search.documents.implementation.models.CognitiveServicesAccountKey();
+
+ String _description = obj.getDescription();
+ cognitiveServicesAccountKey.setDescription(_description);
+
+ String _key = obj.getKey();
+ cognitiveServicesAccountKey.setKey(_key);
+ return cognitiveServicesAccountKey;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CommonGramTokenFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CommonGramTokenFilterConverter.java
new file mode 100644
index 000000000000..7d5787bdab34
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CommonGramTokenFilterConverter.java
@@ -0,0 +1,72 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.CommonGramTokenFilter;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.CommonGramTokenFilter} and
+ * {@link CommonGramTokenFilter}.
+ */
+public final class CommonGramTokenFilterConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(CommonGramTokenFilterConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.CommonGramTokenFilter} to
+ * {@link CommonGramTokenFilter}.
+ */
+ public static CommonGramTokenFilter map(com.azure.search.documents.implementation.models.CommonGramTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ CommonGramTokenFilter commonGramTokenFilter = new CommonGramTokenFilter();
+
+ String _name = obj.getName();
+ commonGramTokenFilter.setName(_name);
+
+ Boolean _ignoreCase = obj.isIgnoreCase();
+ commonGramTokenFilter.setIgnoreCase(_ignoreCase);
+
+ Boolean _useQueryMode = obj.isUseQueryMode();
+ commonGramTokenFilter.setUseQueryMode(_useQueryMode);
+
+ if (obj.getCommonWords() != null) {
+ List _commonWords = new ArrayList<>(obj.getCommonWords());
+ commonGramTokenFilter.setCommonWords(_commonWords);
+ }
+ return commonGramTokenFilter;
+ }
+
+ /**
+ * Maps from {@link CommonGramTokenFilter} to
+ * {@link com.azure.search.documents.implementation.models.CommonGramTokenFilter}.
+ */
+ public static com.azure.search.documents.implementation.models.CommonGramTokenFilter map(CommonGramTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.CommonGramTokenFilter commonGramTokenFilter =
+ new com.azure.search.documents.implementation.models.CommonGramTokenFilter();
+
+ String _name = obj.getName();
+ commonGramTokenFilter.setName(_name);
+
+ Boolean _ignoreCase = obj.isIgnoreCase();
+ commonGramTokenFilter.setIgnoreCase(_ignoreCase);
+
+ Boolean _useQueryMode = obj.isUseQueryMode();
+ commonGramTokenFilter.setUseQueryMode(_useQueryMode);
+
+ if (obj.getCommonWords() != null) {
+ List _commonWords = new ArrayList<>(obj.getCommonWords());
+ commonGramTokenFilter.setCommonWords(_commonWords);
+ }
+ return commonGramTokenFilter;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ConditionalSkillConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ConditionalSkillConverter.java
new file mode 100644
index 000000000000..dc3ea8a2b2f4
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ConditionalSkillConverter.java
@@ -0,0 +1,85 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.ConditionalSkill;
+import com.azure.search.documents.models.InputFieldMappingEntry;
+import com.azure.search.documents.models.OutputFieldMappingEntry;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.ConditionalSkill} and
+ * {@link ConditionalSkill}.
+ */
+public final class ConditionalSkillConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(ConditionalSkillConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.ConditionalSkill} to {@link ConditionalSkill}.
+ */
+ public static ConditionalSkill map(com.azure.search.documents.implementation.models.ConditionalSkill obj) {
+ if (obj == null) {
+ return null;
+ }
+ ConditionalSkill conditionalSkill = new ConditionalSkill();
+
+ if (obj.getOutputs() != null) {
+ List _outputs =
+ obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ conditionalSkill.setOutputs(_outputs);
+ }
+
+ if (obj.getInputs() != null) {
+ List _inputs =
+ obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ conditionalSkill.setInputs(_inputs);
+ }
+
+ String _name = obj.getName();
+ conditionalSkill.setName(_name);
+
+ String _context = obj.getContext();
+ conditionalSkill.setContext(_context);
+
+ String _description = obj.getDescription();
+ conditionalSkill.setDescription(_description);
+ return conditionalSkill;
+ }
+
+ /**
+ * Maps from {@link ConditionalSkill} to {@link com.azure.search.documents.implementation.models.ConditionalSkill}.
+ */
+ public static com.azure.search.documents.implementation.models.ConditionalSkill map(ConditionalSkill obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.ConditionalSkill conditionalSkill =
+ new com.azure.search.documents.implementation.models.ConditionalSkill();
+
+ if (obj.getOutputs() != null) {
+ List _outputs =
+ obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ conditionalSkill.setOutputs(_outputs);
+ }
+
+ if (obj.getInputs() != null) {
+ List _inputs =
+ obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ conditionalSkill.setInputs(_inputs);
+ }
+
+ String _name = obj.getName();
+ conditionalSkill.setName(_name);
+
+ String _context = obj.getContext();
+ conditionalSkill.setContext(_context);
+
+ String _description = obj.getDescription();
+ conditionalSkill.setDescription(_description);
+ return conditionalSkill;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/Constants.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/Constants.java
new file mode 100644
index 000000000000..989784f790e7
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/Constants.java
@@ -0,0 +1,12 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+public class Constants {
+ public static final String CLASS_JAVA_DOC_FORMAT = "";
+ public static final String INTERNAL_EXTERNAL_MAP_JAVA_DOC_FORMAT = "";
+ public static final String EXTERNAL_INTERNAL_MAP_JAVA_DOC_FORMAT = "";
+ public static final String ENUM_ERROR_MSG = "";
+ public static final String ABSTRACT_ERROR_MSG = "";
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CorsOptionsConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CorsOptionsConverter.java
new file mode 100644
index 000000000000..fec428b613bb
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CorsOptionsConverter.java
@@ -0,0 +1,58 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.implementation.util.PrivateFieldAccessHelper;
+import com.azure.search.documents.models.CorsOptions;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.CorsOptions} and {@link CorsOptions}.
+ */
+public final class CorsOptionsConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(CorsOptionsConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.CorsOptions} to {@link CorsOptions}.
+ */
+ public static CorsOptions map(com.azure.search.documents.implementation.models.CorsOptions obj) {
+ if (obj == null) {
+ return null;
+ }
+ CorsOptions corsOptions = new CorsOptions();
+
+ if (obj.getAllowedOrigins() != null) {
+ List _allowedOrigins = new ArrayList<>(obj.getAllowedOrigins());
+ PrivateFieldAccessHelper.set(corsOptions, "allowedOrigins", _allowedOrigins);
+ }
+
+ Long _maxAgeInSeconds = obj.getMaxAgeInSeconds();
+ corsOptions.setMaxAgeInSeconds(_maxAgeInSeconds);
+ return corsOptions;
+ }
+
+ /**
+ * Maps from {@link CorsOptions} to {@link com.azure.search.documents.implementation.models.CorsOptions}.
+ */
+ public static com.azure.search.documents.implementation.models.CorsOptions map(CorsOptions obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.CorsOptions corsOptions =
+ new com.azure.search.documents.implementation.models.CorsOptions();
+
+ if (obj.getAllowedOrigins() != null) {
+ List _allowedOrigins = new ArrayList<>(obj.getAllowedOrigins());
+ PrivateFieldAccessHelper.set(corsOptions, "allowedOrigins", _allowedOrigins);
+ }
+
+ Long _maxAgeInSeconds = obj.getMaxAgeInSeconds();
+ corsOptions.setMaxAgeInSeconds(_maxAgeInSeconds);
+ return corsOptions;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CustomAnalyzerConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CustomAnalyzerConverter.java
new file mode 100644
index 000000000000..e6ca219cd55b
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CustomAnalyzerConverter.java
@@ -0,0 +1,85 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.CharFilterName;
+import com.azure.search.documents.models.CustomAnalyzer;
+import com.azure.search.documents.models.LexicalTokenizerName;
+import com.azure.search.documents.models.TokenFilterName;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.CustomAnalyzer} and
+ * {@link CustomAnalyzer}.
+ */
+public final class CustomAnalyzerConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(CustomAnalyzerConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.CustomAnalyzer} to {@link CustomAnalyzer}.
+ */
+ public static CustomAnalyzer map(com.azure.search.documents.implementation.models.CustomAnalyzer obj) {
+ if (obj == null) {
+ return null;
+ }
+ CustomAnalyzer customAnalyzer = new CustomAnalyzer();
+
+ String _name = obj.getName();
+ customAnalyzer.setName(_name);
+
+ if (obj.getCharFilters() != null) {
+ List _charFilters =
+ obj.getCharFilters().stream().map(CharFilterNameConverter::map).collect(Collectors.toList());
+ customAnalyzer.setCharFilters(_charFilters);
+ }
+
+ if (obj.getTokenFilters() != null) {
+ List _tokenFilters =
+ obj.getTokenFilters().stream().map(TokenFilterNameConverter::map).collect(Collectors.toList());
+ customAnalyzer.setTokenFilters(_tokenFilters);
+ }
+
+ if (obj.getTokenizer() != null) {
+ LexicalTokenizerName _tokenizer = LexicalTokenizerNameConverter.map(obj.getTokenizer());
+ customAnalyzer.setTokenizer(_tokenizer);
+ }
+ return customAnalyzer;
+ }
+
+ /**
+ * Maps from {@link CustomAnalyzer} to {@link com.azure.search.documents.implementation.models.CustomAnalyzer}.
+ */
+ public static com.azure.search.documents.implementation.models.CustomAnalyzer map(CustomAnalyzer obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.CustomAnalyzer customAnalyzer =
+ new com.azure.search.documents.implementation.models.CustomAnalyzer();
+
+ String _name = obj.getName();
+ customAnalyzer.setName(_name);
+
+ if (obj.getCharFilters() != null) {
+ List _charFilters =
+ obj.getCharFilters().stream().map(CharFilterNameConverter::map).collect(Collectors.toList());
+ customAnalyzer.setCharFilters(_charFilters);
+ }
+
+ if (obj.getTokenFilters() != null) {
+ List _tokenFilters =
+ obj.getTokenFilters().stream().map(TokenFilterNameConverter::map).collect(Collectors.toList());
+ customAnalyzer.setTokenFilters(_tokenFilters);
+ }
+
+ if (obj.getTokenizer() != null) {
+ com.azure.search.documents.implementation.models.LexicalTokenizerName _tokenizer =
+ LexicalTokenizerNameConverter.map(obj.getTokenizer());
+ customAnalyzer.setTokenizer(_tokenizer);
+ }
+ return customAnalyzer;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DataChangeDetectionPolicyConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DataChangeDetectionPolicyConverter.java
new file mode 100644
index 000000000000..dfc6dde79860
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DataChangeDetectionPolicyConverter.java
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.implementation.models.HighWaterMarkChangeDetectionPolicy;
+import com.azure.search.documents.implementation.models.SqlIntegratedChangeTrackingPolicy;
+import com.azure.search.documents.models.DataChangeDetectionPolicy;
+
+import static com.azure.search.documents.implementation.util.Constants.ABSTRACT_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ABSTRACT_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.DataChangeDetectionPolicy} and
+ * {@link DataChangeDetectionPolicy}.
+ */
+public final class DataChangeDetectionPolicyConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(DataChangeDetectionPolicyConverter.class);
+
+ /**
+ * Maps abstract class from {@link com.azure.search.documents.implementation.models.DataChangeDetectionPolicy} to
+ * {@link DataChangeDetectionPolicy}. Dedicate works to sub class converter.
+ */
+ public static DataChangeDetectionPolicy map(com.azure.search.documents.implementation.models.DataChangeDetectionPolicy obj) {
+ if (obj instanceof HighWaterMarkChangeDetectionPolicy) {
+ return HighWaterMarkChangeDetectionPolicyConverter.map((HighWaterMarkChangeDetectionPolicy) obj);
+ }
+ if (obj instanceof SqlIntegratedChangeTrackingPolicy) {
+ return SqlIntegratedChangeTrackingPolicyConverter.map((SqlIntegratedChangeTrackingPolicy) obj);
+ }
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_EXTERNAL_ERROR_MSG,
+ obj.getClass().getSimpleName())));
+ }
+
+ /**
+ * Maps abstract class from {@link DataChangeDetectionPolicy} to
+ * {@link com.azure.search.documents.implementation.models.DataChangeDetectionPolicy}. Dedicate works to sub class
+ * converter.
+ */
+ public static com.azure.search.documents.implementation.models.DataChangeDetectionPolicy map(DataChangeDetectionPolicy obj) {
+ if (obj instanceof com.azure.search.documents.models.SqlIntegratedChangeTrackingPolicy) {
+ return SqlIntegratedChangeTrackingPolicyConverter.map((com.azure.search.documents.models.SqlIntegratedChangeTrackingPolicy) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.HighWaterMarkChangeDetectionPolicy) {
+ return HighWaterMarkChangeDetectionPolicyConverter.map((com.azure.search.documents.models.HighWaterMarkChangeDetectionPolicy) obj);
+ }
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_INTERNAL_ERROR_MSG, obj.getClass().getSimpleName())));
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DataDeletionDetectionPolicyConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DataDeletionDetectionPolicyConverter.java
new file mode 100644
index 000000000000..4fec8829cb71
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DataDeletionDetectionPolicyConverter.java
@@ -0,0 +1,43 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.implementation.models.SoftDeleteColumnDeletionDetectionPolicy;
+import com.azure.search.documents.models.DataDeletionDetectionPolicy;
+
+import static com.azure.search.documents.implementation.util.Constants.ABSTRACT_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ABSTRACT_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.DataDeletionDetectionPolicy} and
+ * {@link DataDeletionDetectionPolicy}.
+ */
+public final class DataDeletionDetectionPolicyConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(DataDeletionDetectionPolicyConverter.class);
+
+ /**
+ * Maps abstract class from {@link com.azure.search.documents.implementation.models.DataDeletionDetectionPolicy} to
+ * {@link DataDeletionDetectionPolicy}. Dedicate works to sub class converter.
+ */
+ public static DataDeletionDetectionPolicy map(com.azure.search.documents.implementation.models.DataDeletionDetectionPolicy obj) {
+ if (obj instanceof SoftDeleteColumnDeletionDetectionPolicy) {
+ return SoftDeleteColumnDeletionDetectionPolicyConverter.map((SoftDeleteColumnDeletionDetectionPolicy) obj);
+ }
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_EXTERNAL_ERROR_MSG,
+ obj.getClass().getSimpleName())));
+ }
+
+ /**
+ * Maps abstract class from {@link DataDeletionDetectionPolicy} to
+ * {@link com.azure.search.documents.implementation.models.DataDeletionDetectionPolicy}. Dedicate works to sub
+ * class converter.
+ */
+ public static com.azure.search.documents.implementation.models.DataDeletionDetectionPolicy map(DataDeletionDetectionPolicy obj) {
+ if (obj instanceof com.azure.search.documents.models.SoftDeleteColumnDeletionDetectionPolicy) {
+ return SoftDeleteColumnDeletionDetectionPolicyConverter.map((com.azure.search.documents.models.SoftDeleteColumnDeletionDetectionPolicy) obj);
+ }
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_INTERNAL_ERROR_MSG, obj.getClass().getSimpleName())));
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DataSourceCredentialsConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DataSourceCredentialsConverter.java
new file mode 100644
index 000000000000..18a984393d43
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DataSourceCredentialsConverter.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.DataSourceCredentials;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.DataSourceCredentials} and
+ * {@link DataSourceCredentials}.
+ */
+public final class DataSourceCredentialsConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(DataSourceCredentialsConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.DataSourceCredentials} to
+ * {@link DataSourceCredentials}.
+ */
+ public static DataSourceCredentials map(com.azure.search.documents.implementation.models.DataSourceCredentials obj) {
+ if (obj == null) {
+ return null;
+ }
+ DataSourceCredentials dataSourceCredentials = new DataSourceCredentials();
+
+ String _connectionString = obj.getConnectionString();
+ dataSourceCredentials.setConnectionString(_connectionString);
+ return dataSourceCredentials;
+ }
+
+ /**
+ * Maps from {@link DataSourceCredentials} to
+ * {@link com.azure.search.documents.implementation.models.DataSourceCredentials}.
+ */
+ public static com.azure.search.documents.implementation.models.DataSourceCredentials map(DataSourceCredentials obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.DataSourceCredentials dataSourceCredentials =
+ new com.azure.search.documents.implementation.models.DataSourceCredentials();
+
+ String _connectionString = obj.getConnectionString();
+ dataSourceCredentials.setConnectionString(_connectionString);
+ return dataSourceCredentials;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DefaultCognitiveServicesAccountConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DefaultCognitiveServicesAccountConverter.java
new file mode 100644
index 000000000000..a20ce974edda
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DefaultCognitiveServicesAccountConverter.java
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.DefaultCognitiveServicesAccount;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.DefaultCognitiveServicesAccount} and
+ * {@link DefaultCognitiveServicesAccount}.
+ */
+public final class DefaultCognitiveServicesAccountConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(DefaultCognitiveServicesAccountConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.DefaultCognitiveServicesAccount} to
+ * {@link DefaultCognitiveServicesAccount}.
+ */
+ public static DefaultCognitiveServicesAccount map(com.azure.search.documents.implementation.models.DefaultCognitiveServicesAccount obj) {
+ if (obj == null) {
+ return null;
+ }
+ DefaultCognitiveServicesAccount defaultCognitiveServicesAccount = new DefaultCognitiveServicesAccount();
+
+ String _description = obj.getDescription();
+ defaultCognitiveServicesAccount.setDescription(_description);
+ return defaultCognitiveServicesAccount;
+ }
+
+ /**
+ * Maps from {@link DefaultCognitiveServicesAccount} to
+ * {@link com.azure.search.documents.implementation.models.DefaultCognitiveServicesAccount}.
+ */
+ public static com.azure.search.documents.implementation.models.DefaultCognitiveServicesAccount map(DefaultCognitiveServicesAccount obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.DefaultCognitiveServicesAccount defaultCognitiveServicesAccount = new com.azure.search.documents.implementation.models.DefaultCognitiveServicesAccount();
+
+ String _description = obj.getDescription();
+ defaultCognitiveServicesAccount.setDescription(_description);
+ return defaultCognitiveServicesAccount;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DictionaryDecompounderTokenFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DictionaryDecompounderTokenFilterConverter.java
new file mode 100644
index 000000000000..0de398e7cc6d
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DictionaryDecompounderTokenFilterConverter.java
@@ -0,0 +1,83 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.DictionaryDecompounderTokenFilter;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.DictionaryDecompounderTokenFilter} and
+ * {@link DictionaryDecompounderTokenFilter}.
+ */
+public final class DictionaryDecompounderTokenFilterConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(DictionaryDecompounderTokenFilterConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.DictionaryDecompounderTokenFilter} to
+ * {@link DictionaryDecompounderTokenFilter}.
+ */
+ public static DictionaryDecompounderTokenFilter map(com.azure.search.documents.implementation.models.DictionaryDecompounderTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ DictionaryDecompounderTokenFilter dictionaryDecompounderTokenFilter = new DictionaryDecompounderTokenFilter();
+
+ String _name = obj.getName();
+ dictionaryDecompounderTokenFilter.setName(_name);
+
+ Integer _minSubwordSize = obj.getMinSubwordSize();
+ dictionaryDecompounderTokenFilter.setMinSubwordSize(_minSubwordSize);
+
+ Boolean _onlyLongestMatch = obj.isOnlyLongestMatch();
+ dictionaryDecompounderTokenFilter.setOnlyLongestMatch(_onlyLongestMatch);
+
+ Integer _maxSubwordSize = obj.getMaxSubwordSize();
+ dictionaryDecompounderTokenFilter.setMaxSubwordSize(_maxSubwordSize);
+
+ if (obj.getWordList() != null) {
+ List _wordList = new ArrayList<>(obj.getWordList());
+ dictionaryDecompounderTokenFilter.setWordList(_wordList);
+ }
+
+ Integer _minWordSize = obj.getMinWordSize();
+ dictionaryDecompounderTokenFilter.setMinWordSize(_minWordSize);
+ return dictionaryDecompounderTokenFilter;
+ }
+
+ /**
+ * Maps from {@link DictionaryDecompounderTokenFilter} to
+ * {@link com.azure.search.documents.implementation.models.DictionaryDecompounderTokenFilter}.
+ */
+ public static com.azure.search.documents.implementation.models.DictionaryDecompounderTokenFilter map(DictionaryDecompounderTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.DictionaryDecompounderTokenFilter dictionaryDecompounderTokenFilter = new com.azure.search.documents.implementation.models.DictionaryDecompounderTokenFilter();
+
+ String _name = obj.getName();
+ dictionaryDecompounderTokenFilter.setName(_name);
+
+ Integer _minSubwordSize = obj.getMinSubwordSize();
+ dictionaryDecompounderTokenFilter.setMinSubwordSize(_minSubwordSize);
+
+ Boolean _onlyLongestMatch = obj.isOnlyLongestMatch();
+ dictionaryDecompounderTokenFilter.setOnlyLongestMatch(_onlyLongestMatch);
+
+ Integer _maxSubwordSize = obj.getMaxSubwordSize();
+ dictionaryDecompounderTokenFilter.setMaxSubwordSize(_maxSubwordSize);
+
+ if (obj.getWordList() != null) {
+ List _wordList = new ArrayList<>(obj.getWordList());
+ dictionaryDecompounderTokenFilter.setWordList(_wordList);
+ }
+
+ Integer _minWordSize = obj.getMinWordSize();
+ dictionaryDecompounderTokenFilter.setMinWordSize(_minWordSize);
+ return dictionaryDecompounderTokenFilter;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DistanceScoringFunctionConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DistanceScoringFunctionConverter.java
new file mode 100644
index 000000000000..09fec805f2ec
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DistanceScoringFunctionConverter.java
@@ -0,0 +1,77 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.DistanceScoringFunction;
+import com.azure.search.documents.models.DistanceScoringParameters;
+import com.azure.search.documents.models.ScoringFunctionInterpolation;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.DistanceScoringFunction} and
+ * {@link DistanceScoringFunction}.
+ */
+public final class DistanceScoringFunctionConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(DistanceScoringFunctionConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.DistanceScoringFunction} to
+ * {@link DistanceScoringFunction}.
+ */
+ public static DistanceScoringFunction map(com.azure.search.documents.implementation.models.DistanceScoringFunction obj) {
+ if (obj == null) {
+ return null;
+ }
+ DistanceScoringFunction distanceScoringFunction = new DistanceScoringFunction();
+
+ if (obj.getInterpolation() != null) {
+ ScoringFunctionInterpolation _interpolation =
+ ScoringFunctionInterpolationConverter.map(obj.getInterpolation());
+ distanceScoringFunction.setInterpolation(_interpolation);
+ }
+
+ String _fieldName = obj.getFieldName();
+ distanceScoringFunction.setFieldName(_fieldName);
+
+ double _boost = obj.getBoost();
+ distanceScoringFunction.setBoost(_boost);
+
+ if (obj.getParameters() != null) {
+ DistanceScoringParameters _parameters = DistanceScoringParametersConverter.map(obj.getParameters());
+ distanceScoringFunction.setParameters(_parameters);
+ }
+ return distanceScoringFunction;
+ }
+
+ /**
+ * Maps from {@link DistanceScoringFunction} to
+ * {@link com.azure.search.documents.implementation.models.DistanceScoringFunction}.
+ */
+ public static com.azure.search.documents.implementation.models.DistanceScoringFunction map(DistanceScoringFunction obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.DistanceScoringFunction distanceScoringFunction =
+ new com.azure.search.documents.implementation.models.DistanceScoringFunction();
+
+ if (obj.getInterpolation() != null) {
+ com.azure.search.documents.implementation.models.ScoringFunctionInterpolation _interpolation =
+ ScoringFunctionInterpolationConverter.map(obj.getInterpolation());
+ distanceScoringFunction.setInterpolation(_interpolation);
+ }
+
+ String _fieldName = obj.getFieldName();
+ distanceScoringFunction.setFieldName(_fieldName);
+
+ double _boost = obj.getBoost();
+ distanceScoringFunction.setBoost(_boost);
+
+ if (obj.getParameters() != null) {
+ com.azure.search.documents.implementation.models.DistanceScoringParameters _parameters =
+ DistanceScoringParametersConverter.map(obj.getParameters());
+ distanceScoringFunction.setParameters(_parameters);
+ }
+ return distanceScoringFunction;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DistanceScoringParametersConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DistanceScoringParametersConverter.java
new file mode 100644
index 000000000000..b75a32961656
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/DistanceScoringParametersConverter.java
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.DistanceScoringParameters;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.DistanceScoringParameters} and
+ * {@link DistanceScoringParameters}.
+ */
+public final class DistanceScoringParametersConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(DistanceScoringParametersConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.DistanceScoringParameters} to
+ * {@link DistanceScoringParameters}.
+ */
+ public static DistanceScoringParameters map(com.azure.search.documents.implementation.models.DistanceScoringParameters obj) {
+ if (obj == null) {
+ return null;
+ }
+ DistanceScoringParameters distanceScoringParameters = new DistanceScoringParameters();
+
+ String _referencePointParameter = obj.getReferencePointParameter();
+ distanceScoringParameters.setReferencePointParameter(_referencePointParameter);
+
+ double _boostingDistance = obj.getBoostingDistance();
+ distanceScoringParameters.setBoostingDistance(_boostingDistance);
+ return distanceScoringParameters;
+ }
+
+ /**
+ * Maps from {@link DistanceScoringParameters} to
+ * {@link com.azure.search.documents.implementation.models.DistanceScoringParameters}.
+ */
+ public static com.azure.search.documents.implementation.models.DistanceScoringParameters map(DistanceScoringParameters obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.DistanceScoringParameters distanceScoringParameters =
+ new com.azure.search.documents.implementation.models.DistanceScoringParameters();
+
+ String _referencePointParameter = obj.getReferencePointParameter();
+ distanceScoringParameters.setReferencePointParameter(_referencePointParameter);
+
+ double _boostingDistance = obj.getBoostingDistance();
+ distanceScoringParameters.setBoostingDistance(_boostingDistance);
+ return distanceScoringParameters;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EdgeNGramTokenFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EdgeNGramTokenFilterConverter.java
new file mode 100644
index 000000000000..dccce1b42158
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EdgeNGramTokenFilterConverter.java
@@ -0,0 +1,70 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.EdgeNGramTokenFilter;
+import com.azure.search.documents.models.EdgeNGramTokenFilterSide;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.EdgeNGramTokenFilter} and
+ * {@link EdgeNGramTokenFilter}.
+ */
+public final class EdgeNGramTokenFilterConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(EdgeNGramTokenFilterConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.EdgeNGramTokenFilter} to
+ * {@link EdgeNGramTokenFilter}.
+ */
+ public static EdgeNGramTokenFilter map(com.azure.search.documents.implementation.models.EdgeNGramTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ EdgeNGramTokenFilter edgeNGramTokenFilter = new EdgeNGramTokenFilter();
+
+ String _name = obj.getName();
+ edgeNGramTokenFilter.setName(_name);
+
+ Integer _maxGram = obj.getMaxGram();
+ edgeNGramTokenFilter.setMaxGram(_maxGram);
+
+ if (obj.getSide() != null) {
+ EdgeNGramTokenFilterSide _side = EdgeNGramTokenFilterSideConverter.map(obj.getSide());
+ edgeNGramTokenFilter.setSide(_side);
+ }
+
+ Integer _minGram = obj.getMinGram();
+ edgeNGramTokenFilter.setMinGram(_minGram);
+ return edgeNGramTokenFilter;
+ }
+
+ /**
+ * Maps from {@link EdgeNGramTokenFilter} to
+ * {@link com.azure.search.documents.implementation.models.EdgeNGramTokenFilter}.
+ */
+ public static com.azure.search.documents.implementation.models.EdgeNGramTokenFilter map(EdgeNGramTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.EdgeNGramTokenFilter edgeNGramTokenFilter =
+ new com.azure.search.documents.implementation.models.EdgeNGramTokenFilter();
+
+ String _name = obj.getName();
+ edgeNGramTokenFilter.setName(_name);
+
+ Integer _maxGram = obj.getMaxGram();
+ edgeNGramTokenFilter.setMaxGram(_maxGram);
+
+ if (obj.getSide() != null) {
+ com.azure.search.documents.implementation.models.EdgeNGramTokenFilterSide _side =
+ EdgeNGramTokenFilterSideConverter.map(obj.getSide());
+ edgeNGramTokenFilter.setSide(_side);
+ }
+
+ Integer _minGram = obj.getMinGram();
+ edgeNGramTokenFilter.setMinGram(_minGram);
+ return edgeNGramTokenFilter;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EdgeNGramTokenFilterSideConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EdgeNGramTokenFilterSideConverter.java
new file mode 100644
index 000000000000..a20c13cda181
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EdgeNGramTokenFilterSideConverter.java
@@ -0,0 +1,54 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.EdgeNGramTokenFilterSide;
+
+import static com.azure.search.documents.implementation.util.Constants.ENUM_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ENUM_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.EdgeNGramTokenFilterSide} and
+ * {@link EdgeNGramTokenFilterSide}.
+ */
+public final class EdgeNGramTokenFilterSideConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(EdgeNGramTokenFilterSideConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.EdgeNGramTokenFilterSide} to enum
+ * {@link EdgeNGramTokenFilterSide}.
+ */
+ public static EdgeNGramTokenFilterSide map(com.azure.search.documents.implementation.models.EdgeNGramTokenFilterSide obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case FRONT:
+ return EdgeNGramTokenFilterSide.FRONT;
+ case BACK:
+ return EdgeNGramTokenFilterSide.BACK;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_EXTERNAL_ERROR_MSG, obj)));
+ }
+ }
+
+ /**
+ * Maps from enum {@link EdgeNGramTokenFilterSide} to enum
+ * {@link com.azure.search.documents.implementation.models.EdgeNGramTokenFilterSide}.
+ */
+ public static com.azure.search.documents.implementation.models.EdgeNGramTokenFilterSide map(EdgeNGramTokenFilterSide obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case FRONT:
+ return com.azure.search.documents.implementation.models.EdgeNGramTokenFilterSide.FRONT;
+ case BACK:
+ return com.azure.search.documents.implementation.models.EdgeNGramTokenFilterSide.BACK;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj)));
+ }
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EdgeNGramTokenFilterV2Converter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EdgeNGramTokenFilterV2Converter.java
new file mode 100644
index 000000000000..8c31e8107532
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EdgeNGramTokenFilterV2Converter.java
@@ -0,0 +1,70 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.EdgeNGramTokenFilterSide;
+import com.azure.search.documents.models.EdgeNGramTokenFilterV2;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.EdgeNGramTokenFilterV2} and
+ * {@link EdgeNGramTokenFilterV2}.
+ */
+public final class EdgeNGramTokenFilterV2Converter {
+ private static final ClientLogger LOGGER = new ClientLogger(EdgeNGramTokenFilterV2Converter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.EdgeNGramTokenFilterV2} to
+ * {@link EdgeNGramTokenFilterV2}.
+ */
+ public static EdgeNGramTokenFilterV2 map(com.azure.search.documents.implementation.models.EdgeNGramTokenFilterV2 obj) {
+ if (obj == null) {
+ return null;
+ }
+ EdgeNGramTokenFilterV2 edgeNGramTokenFilterV2 = new EdgeNGramTokenFilterV2();
+
+ String _name = obj.getName();
+ edgeNGramTokenFilterV2.setName(_name);
+
+ Integer _maxGram = obj.getMaxGram();
+ edgeNGramTokenFilterV2.setMaxGram(_maxGram);
+
+ if (obj.getSide() != null) {
+ EdgeNGramTokenFilterSide _side = EdgeNGramTokenFilterSideConverter.map(obj.getSide());
+ edgeNGramTokenFilterV2.setSide(_side);
+ }
+
+ Integer _minGram = obj.getMinGram();
+ edgeNGramTokenFilterV2.setMinGram(_minGram);
+ return edgeNGramTokenFilterV2;
+ }
+
+ /**
+ * Maps from {@link EdgeNGramTokenFilterV2} to
+ * {@link com.azure.search.documents.implementation.models.EdgeNGramTokenFilterV2}.
+ */
+ public static com.azure.search.documents.implementation.models.EdgeNGramTokenFilterV2 map(EdgeNGramTokenFilterV2 obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.EdgeNGramTokenFilterV2 edgeNGramTokenFilterV2 =
+ new com.azure.search.documents.implementation.models.EdgeNGramTokenFilterV2();
+
+ String _name = obj.getName();
+ edgeNGramTokenFilterV2.setName(_name);
+
+ Integer _maxGram = obj.getMaxGram();
+ edgeNGramTokenFilterV2.setMaxGram(_maxGram);
+
+ if (obj.getSide() != null) {
+ com.azure.search.documents.implementation.models.EdgeNGramTokenFilterSide _side =
+ EdgeNGramTokenFilterSideConverter.map(obj.getSide());
+ edgeNGramTokenFilterV2.setSide(_side);
+ }
+
+ Integer _minGram = obj.getMinGram();
+ edgeNGramTokenFilterV2.setMinGram(_minGram);
+ return edgeNGramTokenFilterV2;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EdgeNGramTokenizerConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EdgeNGramTokenizerConverter.java
new file mode 100644
index 000000000000..2fd9b715cdc8
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EdgeNGramTokenizerConverter.java
@@ -0,0 +1,74 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.EdgeNGramTokenizer;
+import com.azure.search.documents.models.TokenCharacterKind;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.EdgeNGramTokenizer} and
+ * {@link EdgeNGramTokenizer}.
+ */
+public final class EdgeNGramTokenizerConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(EdgeNGramTokenizerConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.EdgeNGramTokenizer} to
+ * {@link EdgeNGramTokenizer}.
+ */
+ public static EdgeNGramTokenizer map(com.azure.search.documents.implementation.models.EdgeNGramTokenizer obj) {
+ if (obj == null) {
+ return null;
+ }
+ EdgeNGramTokenizer edgeNGramTokenizer = new EdgeNGramTokenizer();
+
+ String _name = obj.getName();
+ edgeNGramTokenizer.setName(_name);
+
+ Integer _maxGram = obj.getMaxGram();
+ edgeNGramTokenizer.setMaxGram(_maxGram);
+
+ if (obj.getTokenChars() != null) {
+ List _tokenChars =
+ obj.getTokenChars().stream().map(TokenCharacterKindConverter::map).collect(Collectors.toList());
+ edgeNGramTokenizer.setTokenChars(_tokenChars);
+ }
+
+ Integer _minGram = obj.getMinGram();
+ edgeNGramTokenizer.setMinGram(_minGram);
+ return edgeNGramTokenizer;
+ }
+
+ /**
+ * Maps from {@link EdgeNGramTokenizer} to
+ * {@link com.azure.search.documents.implementation.models.EdgeNGramTokenizer}.
+ */
+ public static com.azure.search.documents.implementation.models.EdgeNGramTokenizer map(EdgeNGramTokenizer obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.EdgeNGramTokenizer edgeNGramTokenizer =
+ new com.azure.search.documents.implementation.models.EdgeNGramTokenizer();
+
+ String _name = obj.getName();
+ edgeNGramTokenizer.setName(_name);
+
+ Integer _maxGram = obj.getMaxGram();
+ edgeNGramTokenizer.setMaxGram(_maxGram);
+
+ if (obj.getTokenChars() != null) {
+ List _tokenChars =
+ obj.getTokenChars().stream().map(TokenCharacterKindConverter::map).collect(Collectors.toList());
+ edgeNGramTokenizer.setTokenChars(_tokenChars);
+ }
+
+ Integer _minGram = obj.getMinGram();
+ edgeNGramTokenizer.setMinGram(_minGram);
+ return edgeNGramTokenizer;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ElisionTokenFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ElisionTokenFilterConverter.java
new file mode 100644
index 000000000000..3ca5954b0328
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ElisionTokenFilterConverter.java
@@ -0,0 +1,60 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.ElisionTokenFilter;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.ElisionTokenFilter} and
+ * {@link ElisionTokenFilter}.
+ */
+public final class ElisionTokenFilterConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(ElisionTokenFilterConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.ElisionTokenFilter} to
+ * {@link ElisionTokenFilter}.
+ */
+ public static ElisionTokenFilter map(com.azure.search.documents.implementation.models.ElisionTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ ElisionTokenFilter elisionTokenFilter = new ElisionTokenFilter();
+
+ String _name = obj.getName();
+ elisionTokenFilter.setName(_name);
+
+ if (obj.getArticles() != null) {
+ List _articles = new ArrayList<>(obj.getArticles());
+ elisionTokenFilter.setArticles(_articles);
+ }
+ return elisionTokenFilter;
+ }
+
+ /**
+ * Maps from {@link ElisionTokenFilter} to
+ * {@link com.azure.search.documents.implementation.models.ElisionTokenFilter}.
+ */
+ public static com.azure.search.documents.implementation.models.ElisionTokenFilter map(ElisionTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.ElisionTokenFilter elisionTokenFilter =
+ new com.azure.search.documents.implementation.models.ElisionTokenFilter();
+
+ String _name = obj.getName();
+ elisionTokenFilter.setName(_name);
+
+ if (obj.getArticles() != null) {
+ List _articles = new ArrayList<>(obj.getArticles());
+ elisionTokenFilter.setArticles(_articles);
+ }
+ return elisionTokenFilter;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EntityCategoryConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EntityCategoryConverter.java
new file mode 100644
index 000000000000..f07380552907
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EntityCategoryConverter.java
@@ -0,0 +1,74 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.EntityCategory;
+
+import static com.azure.search.documents.implementation.util.Constants.ENUM_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ENUM_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.EntityCategory} and
+ * {@link EntityCategory}.
+ */
+public final class EntityCategoryConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(EntityCategoryConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.EntityCategory} to enum
+ * {@link EntityCategory}.
+ */
+ public static EntityCategory map(com.azure.search.documents.implementation.models.EntityCategory obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case LOCATION:
+ return EntityCategory.LOCATION;
+ case ORGANIZATION:
+ return EntityCategory.ORGANIZATION;
+ case PERSON:
+ return EntityCategory.PERSON;
+ case QUANTITY:
+ return EntityCategory.QUANTITY;
+ case DATETIME:
+ return EntityCategory.DATETIME;
+ case URL:
+ return EntityCategory.URL;
+ case EMAIL:
+ return EntityCategory.EMAIL;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_EXTERNAL_ERROR_MSG, obj)));
+ }
+ }
+
+ /**
+ * Maps from enum {@link EntityCategory} to enum
+ * {@link com.azure.search.documents.implementation.models.EntityCategory}.
+ */
+ public static com.azure.search.documents.implementation.models.EntityCategory map(EntityCategory obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case LOCATION:
+ return com.azure.search.documents.implementation.models.EntityCategory.LOCATION;
+ case ORGANIZATION:
+ return com.azure.search.documents.implementation.models.EntityCategory.ORGANIZATION;
+ case PERSON:
+ return com.azure.search.documents.implementation.models.EntityCategory.PERSON;
+ case QUANTITY:
+ return com.azure.search.documents.implementation.models.EntityCategory.QUANTITY;
+ case DATETIME:
+ return com.azure.search.documents.implementation.models.EntityCategory.DATETIME;
+ case URL:
+ return com.azure.search.documents.implementation.models.EntityCategory.URL;
+ case EMAIL:
+ return com.azure.search.documents.implementation.models.EntityCategory.EMAIL;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj)));
+ }
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EntityRecognitionSkillConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EntityRecognitionSkillConverter.java
new file mode 100644
index 000000000000..944f8bf33091
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EntityRecognitionSkillConverter.java
@@ -0,0 +1,125 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.EntityCategory;
+import com.azure.search.documents.models.EntityRecognitionSkill;
+import com.azure.search.documents.models.EntityRecognitionSkillLanguage;
+import com.azure.search.documents.models.InputFieldMappingEntry;
+import com.azure.search.documents.models.OutputFieldMappingEntry;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.EntityRecognitionSkill} and
+ * {@link EntityRecognitionSkill}.
+ */
+public final class EntityRecognitionSkillConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(EntityRecognitionSkillConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.EntityRecognitionSkill} to
+ * {@link EntityRecognitionSkill}.
+ */
+ public static EntityRecognitionSkill map(com.azure.search.documents.implementation.models.EntityRecognitionSkill obj) {
+ if (obj == null) {
+ return null;
+ }
+ EntityRecognitionSkill entityRecognitionSkill = new EntityRecognitionSkill();
+
+ if (obj.getOutputs() != null) {
+ List _outputs =
+ obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ entityRecognitionSkill.setOutputs(_outputs);
+ }
+
+ if (obj.getInputs() != null) {
+ List _inputs =
+ obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ entityRecognitionSkill.setInputs(_inputs);
+ }
+
+ String _name = obj.getName();
+ entityRecognitionSkill.setName(_name);
+
+ String _context = obj.getContext();
+ entityRecognitionSkill.setContext(_context);
+
+ String _description = obj.getDescription();
+ entityRecognitionSkill.setDescription(_description);
+
+ Boolean _includeTypelessEntities = obj.isIncludeTypelessEntities();
+ entityRecognitionSkill.setIncludeTypelessEntities(_includeTypelessEntities);
+
+ if (obj.getDefaultLanguageCode() != null) {
+ EntityRecognitionSkillLanguage _defaultLanguageCode =
+ EntityRecognitionSkillLanguageConverter.map(obj.getDefaultLanguageCode());
+ entityRecognitionSkill.setDefaultLanguageCode(_defaultLanguageCode);
+ }
+
+ if (obj.getCategories() != null) {
+ List _categories =
+ obj.getCategories().stream().map(EntityCategoryConverter::map).collect(Collectors.toList());
+ entityRecognitionSkill.setCategories(_categories);
+ }
+
+ Double _minimumPrecision = obj.getMinimumPrecision();
+ entityRecognitionSkill.setMinimumPrecision(_minimumPrecision);
+ return entityRecognitionSkill;
+ }
+
+ /**
+ * Maps from {@link EntityRecognitionSkill} to
+ * {@link com.azure.search.documents.implementation.models.EntityRecognitionSkill}.
+ */
+ public static com.azure.search.documents.implementation.models.EntityRecognitionSkill map(EntityRecognitionSkill obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.EntityRecognitionSkill entityRecognitionSkill =
+ new com.azure.search.documents.implementation.models.EntityRecognitionSkill();
+
+ if (obj.getOutputs() != null) {
+ List _outputs =
+ obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ entityRecognitionSkill.setOutputs(_outputs);
+ }
+
+ if (obj.getInputs() != null) {
+ List _inputs =
+ obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ entityRecognitionSkill.setInputs(_inputs);
+ }
+
+ String _name = obj.getName();
+ entityRecognitionSkill.setName(_name);
+
+ String _context = obj.getContext();
+ entityRecognitionSkill.setContext(_context);
+
+ String _description = obj.getDescription();
+ entityRecognitionSkill.setDescription(_description);
+
+ Boolean _includeTypelessEntities = obj.isIncludeTypelessEntities();
+ entityRecognitionSkill.setIncludeTypelessEntities(_includeTypelessEntities);
+
+ if (obj.getDefaultLanguageCode() != null) {
+ com.azure.search.documents.implementation.models.EntityRecognitionSkillLanguage _defaultLanguageCode =
+ EntityRecognitionSkillLanguageConverter.map(obj.getDefaultLanguageCode());
+ entityRecognitionSkill.setDefaultLanguageCode(_defaultLanguageCode);
+ }
+
+ if (obj.getCategories() != null) {
+ List _categories =
+ obj.getCategories().stream().map(EntityCategoryConverter::map).collect(Collectors.toList());
+ entityRecognitionSkill.setCategories(_categories);
+ }
+
+ Double _minimumPrecision = obj.getMinimumPrecision();
+ entityRecognitionSkill.setMinimumPrecision(_minimumPrecision);
+ return entityRecognitionSkill;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EntityRecognitionSkillLanguageConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EntityRecognitionSkillLanguageConverter.java
new file mode 100644
index 000000000000..86ed5c43f13d
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EntityRecognitionSkillLanguageConverter.java
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.EntityRecognitionSkillLanguage;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.EntityRecognitionSkillLanguage} and
+ * {@link EntityRecognitionSkillLanguage}.
+ */
+public final class EntityRecognitionSkillLanguageConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(EntityRecognitionSkillLanguageConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.EntityRecognitionSkillLanguage} to enum
+ * {@link EntityRecognitionSkillLanguage}.
+ */
+ public static EntityRecognitionSkillLanguage map(com.azure.search.documents.implementation.models.EntityRecognitionSkillLanguage obj) {
+ if (obj == null) {
+ return null;
+ }
+ return EntityRecognitionSkillLanguage.fromString(obj.toString());
+ }
+
+ /**
+ * Maps from enum {@link EntityRecognitionSkillLanguage} to enum
+ * {@link com.azure.search.documents.implementation.models.EntityRecognitionSkillLanguage}.
+ */
+ public static com.azure.search.documents.implementation.models.EntityRecognitionSkillLanguage map(EntityRecognitionSkillLanguage obj) {
+ if (obj == null) {
+ return null;
+ }
+ return com.azure.search.documents.implementation.models.EntityRecognitionSkillLanguage.fromString(obj.toString());
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/FacetResultConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/FacetResultConverter.java
new file mode 100644
index 000000000000..df8b200df3dd
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/FacetResultConverter.java
@@ -0,0 +1,61 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.implementation.util.PrivateFieldAccessHelper;
+import com.azure.search.documents.models.FacetResult;
+
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.FacetResult} and {@link FacetResult}.
+ */
+public final class FacetResultConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(FacetResultConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.FacetResult} to {@link FacetResult}.
+ */
+ public static FacetResult map(com.azure.search.documents.implementation.models.FacetResult obj) {
+ if (obj == null) {
+ return null;
+ }
+ FacetResult facetResult = new FacetResult();
+
+ Long _count = obj.getCount();
+ PrivateFieldAccessHelper.set(facetResult, "count", _count);
+
+ if (obj.getAdditionalProperties() != null) {
+ Map _additionalProperties =
+ obj.getAdditionalProperties().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey,
+ Map.Entry::getValue));
+ PrivateFieldAccessHelper.set(facetResult, "additionalProperties", _additionalProperties);
+ }
+ return facetResult;
+ }
+
+ /**
+ * Maps from {@link FacetResult} to {@link com.azure.search.documents.implementation.models.FacetResult}.
+ */
+ public static com.azure.search.documents.implementation.models.FacetResult map(FacetResult obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.FacetResult facetResult =
+ new com.azure.search.documents.implementation.models.FacetResult();
+
+ Long _count = obj.getCount();
+ PrivateFieldAccessHelper.set(facetResult, "count", _count);
+
+ if (obj.getAdditionalProperties() != null) {
+ Map _additionalProperties =
+ obj.getAdditionalProperties().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey,
+ Map.Entry::getValue));
+ PrivateFieldAccessHelper.set(facetResult, "additionalProperties", _additionalProperties);
+ }
+ return facetResult;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/FieldMappingConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/FieldMappingConverter.java
new file mode 100644
index 000000000000..ab2b71b328a1
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/FieldMappingConverter.java
@@ -0,0 +1,61 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.FieldMapping;
+import com.azure.search.documents.models.FieldMappingFunction;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.FieldMapping} and {@link FieldMapping}.
+ */
+public final class FieldMappingConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(FieldMappingConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.FieldMapping} to {@link FieldMapping}.
+ */
+ public static FieldMapping map(com.azure.search.documents.implementation.models.FieldMapping obj) {
+ if (obj == null) {
+ return null;
+ }
+ FieldMapping fieldMapping = new FieldMapping();
+
+ String _sourceFieldName = obj.getSourceFieldName();
+ fieldMapping.setSourceFieldName(_sourceFieldName);
+
+ String _targetFieldName = obj.getTargetFieldName();
+ fieldMapping.setTargetFieldName(_targetFieldName);
+
+ if (obj.getMappingFunction() != null) {
+ FieldMappingFunction _mappingFunction = FieldMappingFunctionConverter.map(obj.getMappingFunction());
+ fieldMapping.setMappingFunction(_mappingFunction);
+ }
+ return fieldMapping;
+ }
+
+ /**
+ * Maps from {@link FieldMapping} to {@link com.azure.search.documents.implementation.models.FieldMapping}.
+ */
+ public static com.azure.search.documents.implementation.models.FieldMapping map(FieldMapping obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.FieldMapping fieldMapping =
+ new com.azure.search.documents.implementation.models.FieldMapping();
+
+ String _sourceFieldName = obj.getSourceFieldName();
+ fieldMapping.setSourceFieldName(_sourceFieldName);
+
+ String _targetFieldName = obj.getTargetFieldName();
+ fieldMapping.setTargetFieldName(_targetFieldName);
+
+ if (obj.getMappingFunction() != null) {
+ com.azure.search.documents.implementation.models.FieldMappingFunction _mappingFunction =
+ FieldMappingFunctionConverter.map(obj.getMappingFunction());
+ fieldMapping.setMappingFunction(_mappingFunction);
+ }
+ return fieldMapping;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/FieldMappingFunctionConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/FieldMappingFunctionConverter.java
new file mode 100644
index 000000000000..0aeb3f0477fa
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/FieldMappingFunctionConverter.java
@@ -0,0 +1,63 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.FieldMappingFunction;
+
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.FieldMappingFunction} and
+ * {@link FieldMappingFunction}.
+ */
+public final class FieldMappingFunctionConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(FieldMappingFunctionConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.FieldMappingFunction} to
+ * {@link FieldMappingFunction}.
+ */
+ public static FieldMappingFunction map(com.azure.search.documents.implementation.models.FieldMappingFunction obj) {
+ if (obj == null) {
+ return null;
+ }
+ FieldMappingFunction fieldMappingFunction = new FieldMappingFunction();
+
+ String _name = obj.getName();
+ fieldMappingFunction.setName(_name);
+
+ if (obj.getParameters() != null) {
+ Map _parameters =
+ obj.getParameters().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey,
+ Map.Entry::getValue));
+ fieldMappingFunction.setParameters(_parameters);
+ }
+ return fieldMappingFunction;
+ }
+
+ /**
+ * Maps from {@link FieldMappingFunction} to
+ * {@link com.azure.search.documents.implementation.models.FieldMappingFunction}.
+ */
+ public static com.azure.search.documents.implementation.models.FieldMappingFunction map(FieldMappingFunction obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.FieldMappingFunction fieldMappingFunction =
+ new com.azure.search.documents.implementation.models.FieldMappingFunction();
+
+ String _name = obj.getName();
+ fieldMappingFunction.setName(_name);
+
+ if (obj.getParameters() != null) {
+ Map _parameters =
+ obj.getParameters().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey,
+ Map.Entry::getValue));
+ fieldMappingFunction.setParameters(_parameters);
+ }
+ return fieldMappingFunction;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/FreshnessScoringFunctionConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/FreshnessScoringFunctionConverter.java
new file mode 100644
index 000000000000..14d51ad24165
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/FreshnessScoringFunctionConverter.java
@@ -0,0 +1,77 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.FreshnessScoringFunction;
+import com.azure.search.documents.models.FreshnessScoringParameters;
+import com.azure.search.documents.models.ScoringFunctionInterpolation;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.FreshnessScoringFunction} and
+ * {@link FreshnessScoringFunction}.
+ */
+public final class FreshnessScoringFunctionConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(FreshnessScoringFunctionConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.FreshnessScoringFunction} to
+ * {@link FreshnessScoringFunction}.
+ */
+ public static FreshnessScoringFunction map(com.azure.search.documents.implementation.models.FreshnessScoringFunction obj) {
+ if (obj == null) {
+ return null;
+ }
+ FreshnessScoringFunction freshnessScoringFunction = new FreshnessScoringFunction();
+
+ if (obj.getInterpolation() != null) {
+ ScoringFunctionInterpolation _interpolation =
+ ScoringFunctionInterpolationConverter.map(obj.getInterpolation());
+ freshnessScoringFunction.setInterpolation(_interpolation);
+ }
+
+ String _fieldName = obj.getFieldName();
+ freshnessScoringFunction.setFieldName(_fieldName);
+
+ double _boost = obj.getBoost();
+ freshnessScoringFunction.setBoost(_boost);
+
+ if (obj.getParameters() != null) {
+ FreshnessScoringParameters _parameters = FreshnessScoringParametersConverter.map(obj.getParameters());
+ freshnessScoringFunction.setParameters(_parameters);
+ }
+ return freshnessScoringFunction;
+ }
+
+ /**
+ * Maps from {@link FreshnessScoringFunction} to
+ * {@link com.azure.search.documents.implementation.models.FreshnessScoringFunction}.
+ */
+ public static com.azure.search.documents.implementation.models.FreshnessScoringFunction map(FreshnessScoringFunction obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.FreshnessScoringFunction freshnessScoringFunction =
+ new com.azure.search.documents.implementation.models.FreshnessScoringFunction();
+
+ if (obj.getInterpolation() != null) {
+ com.azure.search.documents.implementation.models.ScoringFunctionInterpolation _interpolation =
+ ScoringFunctionInterpolationConverter.map(obj.getInterpolation());
+ freshnessScoringFunction.setInterpolation(_interpolation);
+ }
+
+ String _fieldName = obj.getFieldName();
+ freshnessScoringFunction.setFieldName(_fieldName);
+
+ double _boost = obj.getBoost();
+ freshnessScoringFunction.setBoost(_boost);
+
+ if (obj.getParameters() != null) {
+ com.azure.search.documents.implementation.models.FreshnessScoringParameters _parameters =
+ FreshnessScoringParametersConverter.map(obj.getParameters());
+ freshnessScoringFunction.setParameters(_parameters);
+ }
+ return freshnessScoringFunction;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/FreshnessScoringParametersConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/FreshnessScoringParametersConverter.java
new file mode 100644
index 000000000000..de977c59e259
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/FreshnessScoringParametersConverter.java
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.FreshnessScoringParameters;
+
+import java.time.Duration;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.FreshnessScoringParameters} and
+ * {@link FreshnessScoringParameters}.
+ */
+public final class FreshnessScoringParametersConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(FreshnessScoringParametersConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.FreshnessScoringParameters} to
+ * {@link FreshnessScoringParameters}.
+ */
+ public static FreshnessScoringParameters map(com.azure.search.documents.implementation.models.FreshnessScoringParameters obj) {
+ if (obj == null) {
+ return null;
+ }
+ FreshnessScoringParameters freshnessScoringParameters = new FreshnessScoringParameters();
+
+ Duration _boostingDuration = obj.getBoostingDuration();
+ freshnessScoringParameters.setBoostingDuration(_boostingDuration);
+ return freshnessScoringParameters;
+ }
+
+ /**
+ * Maps from {@link FreshnessScoringParameters} to
+ * {@link com.azure.search.documents.implementation.models.FreshnessScoringParameters}.
+ */
+ public static com.azure.search.documents.implementation.models.FreshnessScoringParameters map(FreshnessScoringParameters obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.FreshnessScoringParameters freshnessScoringParameters =
+ new com.azure.search.documents.implementation.models.FreshnessScoringParameters();
+
+ Duration _boostingDuration = obj.getBoostingDuration();
+ freshnessScoringParameters.setBoostingDuration(_boostingDuration);
+ return freshnessScoringParameters;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/GetIndexStatisticsResultConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/GetIndexStatisticsResultConverter.java
new file mode 100644
index 000000000000..41651e64819c
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/GetIndexStatisticsResultConverter.java
@@ -0,0 +1,53 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.implementation.util.PrivateFieldAccessHelper;
+import com.azure.search.documents.models.GetIndexStatisticsResult;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.GetIndexStatisticsResult} and
+ * {@link GetIndexStatisticsResult}.
+ */
+public final class GetIndexStatisticsResultConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(GetIndexStatisticsResultConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.GetIndexStatisticsResult} to
+ * {@link GetIndexStatisticsResult}.
+ */
+ public static GetIndexStatisticsResult map(com.azure.search.documents.implementation.models.GetIndexStatisticsResult obj) {
+ if (obj == null) {
+ return null;
+ }
+ GetIndexStatisticsResult getIndexStatisticsResult = new GetIndexStatisticsResult();
+
+ long _documentCount = obj.getDocumentCount();
+ PrivateFieldAccessHelper.set(getIndexStatisticsResult, "documentCount", _documentCount);
+
+ long _storageSize = obj.getStorageSize();
+ PrivateFieldAccessHelper.set(getIndexStatisticsResult, "storageSize", _storageSize);
+ return getIndexStatisticsResult;
+ }
+
+ /**
+ * Maps from {@link GetIndexStatisticsResult} to
+ * {@link com.azure.search.documents.implementation.models.GetIndexStatisticsResult}.
+ */
+ public static com.azure.search.documents.implementation.models.GetIndexStatisticsResult map(GetIndexStatisticsResult obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.GetIndexStatisticsResult getIndexStatisticsResult =
+ new com.azure.search.documents.implementation.models.GetIndexStatisticsResult();
+
+ long _documentCount = obj.getDocumentCount();
+ PrivateFieldAccessHelper.set(getIndexStatisticsResult, "documentCount", _documentCount);
+
+ long _storageSize = obj.getStorageSize();
+ PrivateFieldAccessHelper.set(getIndexStatisticsResult, "storageSize", _storageSize);
+ return getIndexStatisticsResult;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/HighWaterMarkChangeDetectionPolicyConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/HighWaterMarkChangeDetectionPolicyConverter.java
new file mode 100644
index 000000000000..86fbf2418ef9
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/HighWaterMarkChangeDetectionPolicyConverter.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.HighWaterMarkChangeDetectionPolicy;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.HighWaterMarkChangeDetectionPolicy}
+ * and {@link HighWaterMarkChangeDetectionPolicy}.
+ */
+public final class HighWaterMarkChangeDetectionPolicyConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(HighWaterMarkChangeDetectionPolicyConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.HighWaterMarkChangeDetectionPolicy} to
+ * {@link HighWaterMarkChangeDetectionPolicy}.
+ */
+ public static HighWaterMarkChangeDetectionPolicy map(com.azure.search.documents.implementation.models.HighWaterMarkChangeDetectionPolicy obj) {
+ if (obj == null) {
+ return null;
+ }
+ HighWaterMarkChangeDetectionPolicy highWaterMarkChangeDetectionPolicy =
+ new HighWaterMarkChangeDetectionPolicy();
+
+ String _highWaterMarkColumnName = obj.getHighWaterMarkColumnName();
+ highWaterMarkChangeDetectionPolicy.setHighWaterMarkColumnName(_highWaterMarkColumnName);
+ return highWaterMarkChangeDetectionPolicy;
+ }
+
+ /**
+ * Maps from {@link HighWaterMarkChangeDetectionPolicy} to
+ * {@link com.azure.search.documents.implementation.models.HighWaterMarkChangeDetectionPolicy}.
+ */
+ public static com.azure.search.documents.implementation.models.HighWaterMarkChangeDetectionPolicy map(HighWaterMarkChangeDetectionPolicy obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.HighWaterMarkChangeDetectionPolicy highWaterMarkChangeDetectionPolicy = new com.azure.search.documents.implementation.models.HighWaterMarkChangeDetectionPolicy();
+
+ String _highWaterMarkColumnName = obj.getHighWaterMarkColumnName();
+ highWaterMarkChangeDetectionPolicy.setHighWaterMarkColumnName(_highWaterMarkColumnName);
+ return highWaterMarkChangeDetectionPolicy;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ImageAnalysisSkillConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ImageAnalysisSkillConverter.java
new file mode 100644
index 000000000000..6858949f8b96
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ImageAnalysisSkillConverter.java
@@ -0,0 +1,126 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.ImageAnalysisSkill;
+import com.azure.search.documents.models.ImageAnalysisSkillLanguage;
+import com.azure.search.documents.models.ImageDetail;
+import com.azure.search.documents.models.InputFieldMappingEntry;
+import com.azure.search.documents.models.OutputFieldMappingEntry;
+import com.azure.search.documents.models.VisualFeature;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.ImageAnalysisSkill} and
+ * {@link ImageAnalysisSkill}.
+ */
+public final class ImageAnalysisSkillConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(ImageAnalysisSkillConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.ImageAnalysisSkill} to
+ * {@link ImageAnalysisSkill}.
+ */
+ public static ImageAnalysisSkill map(com.azure.search.documents.implementation.models.ImageAnalysisSkill obj) {
+ if (obj == null) {
+ return null;
+ }
+ ImageAnalysisSkill imageAnalysisSkill = new ImageAnalysisSkill();
+
+ if (obj.getOutputs() != null) {
+ List _outputs =
+ obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ imageAnalysisSkill.setOutputs(_outputs);
+ }
+
+ if (obj.getInputs() != null) {
+ List _inputs =
+ obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ imageAnalysisSkill.setInputs(_inputs);
+ }
+
+ String _name = obj.getName();
+ imageAnalysisSkill.setName(_name);
+
+ String _context = obj.getContext();
+ imageAnalysisSkill.setContext(_context);
+
+ String _description = obj.getDescription();
+ imageAnalysisSkill.setDescription(_description);
+
+ if (obj.getVisualFeatures() != null) {
+ List _visualFeatures =
+ obj.getVisualFeatures().stream().map(VisualFeatureConverter::map).collect(Collectors.toList());
+ imageAnalysisSkill.setVisualFeatures(_visualFeatures);
+ }
+
+ if (obj.getDefaultLanguageCode() != null) {
+ ImageAnalysisSkillLanguage _defaultLanguageCode =
+ ImageAnalysisSkillLanguageConverter.map(obj.getDefaultLanguageCode());
+ imageAnalysisSkill.setDefaultLanguageCode(_defaultLanguageCode);
+ }
+
+ if (obj.getDetails() != null) {
+ List _details =
+ obj.getDetails().stream().map(ImageDetailConverter::map).collect(Collectors.toList());
+ imageAnalysisSkill.setDetails(_details);
+ }
+ return imageAnalysisSkill;
+ }
+
+ /**
+ * Maps from {@link ImageAnalysisSkill} to
+ * {@link com.azure.search.documents.implementation.models.ImageAnalysisSkill}.
+ */
+ public static com.azure.search.documents.implementation.models.ImageAnalysisSkill map(ImageAnalysisSkill obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.ImageAnalysisSkill imageAnalysisSkill =
+ new com.azure.search.documents.implementation.models.ImageAnalysisSkill();
+
+ if (obj.getOutputs() != null) {
+ List _outputs =
+ obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ imageAnalysisSkill.setOutputs(_outputs);
+ }
+
+ if (obj.getInputs() != null) {
+ List _inputs =
+ obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ imageAnalysisSkill.setInputs(_inputs);
+ }
+
+ String _name = obj.getName();
+ imageAnalysisSkill.setName(_name);
+
+ String _context = obj.getContext();
+ imageAnalysisSkill.setContext(_context);
+
+ String _description = obj.getDescription();
+ imageAnalysisSkill.setDescription(_description);
+
+ if (obj.getVisualFeatures() != null) {
+ List _visualFeatures =
+ obj.getVisualFeatures().stream().map(VisualFeatureConverter::map).collect(Collectors.toList());
+ imageAnalysisSkill.setVisualFeatures(_visualFeatures);
+ }
+
+ if (obj.getDefaultLanguageCode() != null) {
+ com.azure.search.documents.implementation.models.ImageAnalysisSkillLanguage _defaultLanguageCode =
+ ImageAnalysisSkillLanguageConverter.map(obj.getDefaultLanguageCode());
+ imageAnalysisSkill.setDefaultLanguageCode(_defaultLanguageCode);
+ }
+
+ if (obj.getDetails() != null) {
+ List _details =
+ obj.getDetails().stream().map(ImageDetailConverter::map).collect(Collectors.toList());
+ imageAnalysisSkill.setDetails(_details);
+ }
+ return imageAnalysisSkill;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ImageAnalysisSkillLanguageConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ImageAnalysisSkillLanguageConverter.java
new file mode 100644
index 000000000000..d9268282aad5
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ImageAnalysisSkillLanguageConverter.java
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.ImageAnalysisSkillLanguage;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.ImageAnalysisSkillLanguage} and
+ * {@link ImageAnalysisSkillLanguage}.
+ */
+public final class ImageAnalysisSkillLanguageConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(ImageAnalysisSkillLanguageConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.ImageAnalysisSkillLanguage} to enum
+ * {@link ImageAnalysisSkillLanguage}.
+ */
+ public static ImageAnalysisSkillLanguage map(com.azure.search.documents.implementation.models.ImageAnalysisSkillLanguage obj) {
+ if (obj == null) {
+ return null;
+ }
+ return ImageAnalysisSkillLanguage.fromString(obj.toString());
+ }
+
+ /**
+ * Maps from enum {@link ImageAnalysisSkillLanguage} to enum
+ * {@link com.azure.search.documents.implementation.models.ImageAnalysisSkillLanguage}.
+ */
+ public static com.azure.search.documents.implementation.models.ImageAnalysisSkillLanguage map(ImageAnalysisSkillLanguage obj) {
+ if (obj == null) {
+ return null;
+ }
+ return com.azure.search.documents.implementation.models.ImageAnalysisSkillLanguage.fromString(obj.toString());
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ImageDetailConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ImageDetailConverter.java
new file mode 100644
index 000000000000..4dd1c004d7ce
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ImageDetailConverter.java
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.ImageDetail;
+
+import static com.azure.search.documents.implementation.util.Constants.ENUM_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ENUM_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.ImageDetail} and {@link ImageDetail}.
+ */
+public final class ImageDetailConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(ImageDetailConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.ImageDetail} to enum {@link ImageDetail}.
+ */
+ public static ImageDetail map(com.azure.search.documents.implementation.models.ImageDetail obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case CELEBRITIES:
+ return ImageDetail.CELEBRITIES;
+ case LANDMARKS:
+ return ImageDetail.LANDMARKS;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_EXTERNAL_ERROR_MSG, obj)));
+ }
+ }
+
+ /**
+ * Maps from enum {@link ImageDetail} to enum {@link com.azure.search.documents.implementation.models.ImageDetail}.
+ */
+ public static com.azure.search.documents.implementation.models.ImageDetail map(ImageDetail obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case CELEBRITIES:
+ return com.azure.search.documents.implementation.models.ImageDetail.CELEBRITIES;
+ case LANDMARKS:
+ return com.azure.search.documents.implementation.models.ImageDetail.LANDMARKS;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj)));
+ }
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexActionConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexActionConverter.java
new file mode 100644
index 000000000000..173616d2288d
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexActionConverter.java
@@ -0,0 +1,74 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.serializer.JacksonAdapter;
+import com.azure.search.documents.implementation.SerializationUtil;
+import com.azure.search.documents.implementation.util.PrivateFieldAccessHelper;
+import com.azure.search.documents.models.IndexAction;
+import com.azure.search.documents.models.IndexActionType;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import java.util.Map;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.IndexAction} and {@link IndexAction}.
+ */
+public final class IndexActionConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(IndexActionConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.IndexAction} to {@link IndexAction}.
+ */
+ public static IndexAction map(com.azure.search.documents.implementation.models.IndexAction obj) {
+ if (obj == null) {
+ return null;
+ }
+ IndexAction indexAction = new IndexAction();
+
+ if (obj.getActionType() != null) {
+ IndexActionType _actionType = IndexActionTypeConverter.map(obj.getActionType());
+ indexAction.setActionType(_actionType);
+ }
+
+ if (obj.getAdditionalProperties() != null) {
+ Map _properties = obj.getAdditionalProperties();
+ PrivateFieldAccessHelper.set(indexAction, "properties", _properties);
+ }
+ return indexAction;
+ }
+
+ /**
+ * Maps from {@link IndexAction} to {@link com.azure.search.documents.implementation.models.IndexAction}.
+ */
+ @SuppressWarnings("unchecked")
+ public static com.azure.search.documents.implementation.models.IndexAction map(IndexAction obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.IndexAction indexAction =
+ new com.azure.search.documents.implementation.models.IndexAction();
+
+ if (obj.getActionType() != null) {
+ com.azure.search.documents.implementation.models.IndexActionType _actionType =
+ IndexActionTypeConverter.map(obj.getActionType());
+ indexAction.setActionType(_actionType);
+ }
+
+ T _document = obj.getDocument();
+
+ ObjectMapper mapper = new JacksonAdapter().serializer();
+ SerializationUtil.configureMapper(mapper);
+ Map additionalProperties = mapper.convertValue(_document, Map.class);
+
+ indexAction.setAdditionalProperties(additionalProperties);
+
+ if (obj.getParamMap() != null) {
+ Map _properties = obj.getParamMap();
+ PrivateFieldAccessHelper.set(indexAction, "additionalProperties", _properties);
+ }
+ return indexAction;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexActionTypeConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexActionTypeConverter.java
new file mode 100644
index 000000000000..bdb419e385bb
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexActionTypeConverter.java
@@ -0,0 +1,62 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.IndexActionType;
+
+import static com.azure.search.documents.implementation.util.Constants.ENUM_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ENUM_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.IndexActionType} and
+ * {@link IndexActionType}.
+ */
+public final class IndexActionTypeConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(IndexActionTypeConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.IndexActionType} to enum
+ * {@link IndexActionType}.
+ */
+ public static IndexActionType map(com.azure.search.documents.implementation.models.IndexActionType obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case UPLOAD:
+ return IndexActionType.UPLOAD;
+ case MERGE:
+ return IndexActionType.MERGE;
+ case MERGE_OR_UPLOAD:
+ return IndexActionType.MERGE_OR_UPLOAD;
+ case DELETE:
+ return IndexActionType.DELETE;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_EXTERNAL_ERROR_MSG, obj)));
+ }
+ }
+
+ /**
+ * Maps from enum {@link IndexActionType} to enum
+ * {@link com.azure.search.documents.implementation.models.IndexActionType}.
+ */
+ public static com.azure.search.documents.implementation.models.IndexActionType map(IndexActionType obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case UPLOAD:
+ return com.azure.search.documents.implementation.models.IndexActionType.UPLOAD;
+ case MERGE:
+ return com.azure.search.documents.implementation.models.IndexActionType.MERGE;
+ case MERGE_OR_UPLOAD:
+ return com.azure.search.documents.implementation.models.IndexActionType.MERGE_OR_UPLOAD;
+ case DELETE:
+ return com.azure.search.documents.implementation.models.IndexActionType.DELETE;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj)));
+ }
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexBatchBaseConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexBatchBaseConverter.java
new file mode 100644
index 000000000000..abeb187c9452
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexBatchBaseConverter.java
@@ -0,0 +1,55 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.implementation.util.PrivateFieldAccessHelper;
+import com.azure.search.documents.models.IndexAction;
+import com.azure.search.documents.models.IndexBatchBase;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.IndexBatch} and
+ * {@link IndexBatchBase}.
+ */
+public final class IndexBatchBaseConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(IndexBatchBaseConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.IndexBatch} to {@link IndexBatchBase}.
+ */
+ public static IndexBatchBase map(com.azure.search.documents.implementation.models.IndexBatch obj) {
+ if (obj == null) {
+ return null;
+ }
+ IndexBatchBase indexBatchBase = new IndexBatchBase();
+
+ if (obj.getActions() != null) {
+ List> _actions =
+ obj.getActions().stream().map(IndexActionConverter::map).collect(Collectors.toList());
+ PrivateFieldAccessHelper.set(indexBatchBase, "actions", _actions);
+ }
+ return indexBatchBase;
+ }
+
+ /**
+ * Maps from {@link IndexBatchBase} to {@link com.azure.search.documents.implementation.models.IndexBatch}.
+ */
+ public static com.azure.search.documents.implementation.models.IndexBatch map(IndexBatchBase obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.IndexBatch indexBatch =
+ new com.azure.search.documents.implementation.models.IndexBatch();
+
+ if (obj.getActions() != null) {
+ List _actions =
+ obj.getActions().stream().map(IndexActionConverter::map).collect(Collectors.toList());
+ PrivateFieldAccessHelper.set(indexBatch, "actions", _actions);
+ }
+ return indexBatch;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexDocumentsResultConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexDocumentsResultConverter.java
new file mode 100644
index 000000000000..8e61f568bd49
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexDocumentsResultConverter.java
@@ -0,0 +1,57 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.implementation.util.PrivateFieldAccessHelper;
+import com.azure.search.documents.models.IndexDocumentsResult;
+import com.azure.search.documents.models.IndexingResult;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.IndexDocumentsResult} and
+ * {@link IndexDocumentsResult}.
+ */
+public final class IndexDocumentsResultConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(IndexDocumentsResultConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.IndexDocumentsResult} to
+ * {@link IndexDocumentsResult}.
+ */
+ public static IndexDocumentsResult map(com.azure.search.documents.implementation.models.IndexDocumentsResult obj) {
+ if (obj == null) {
+ return null;
+ }
+ IndexDocumentsResult indexDocumentsResult = new IndexDocumentsResult();
+
+ if (obj.getResults() != null) {
+ List _results =
+ obj.getResults().stream().map(IndexingResultConverter::map).collect(Collectors.toList());
+ PrivateFieldAccessHelper.set(indexDocumentsResult, "results", _results);
+ }
+ return indexDocumentsResult;
+ }
+
+ /**
+ * Maps from {@link IndexDocumentsResult} to
+ * {@link com.azure.search.documents.implementation.models.IndexDocumentsResult}.
+ */
+ public static com.azure.search.documents.implementation.models.IndexDocumentsResult map(IndexDocumentsResult obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.IndexDocumentsResult indexDocumentsResult =
+ new com.azure.search.documents.implementation.models.IndexDocumentsResult();
+
+ if (obj.getResults() != null) {
+ List _results =
+ obj.getResults().stream().map(IndexingResultConverter::map).collect(Collectors.toList());
+ PrivateFieldAccessHelper.set(indexDocumentsResult, "results", _results);
+ }
+ return indexDocumentsResult;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexerExecutionResultConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexerExecutionResultConverter.java
new file mode 100644
index 000000000000..0dd658785f20
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexerExecutionResultConverter.java
@@ -0,0 +1,125 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.implementation.util.PrivateFieldAccessHelper;
+import com.azure.search.documents.models.IndexerExecutionResult;
+import com.azure.search.documents.models.IndexerExecutionStatus;
+import com.azure.search.documents.models.SearchIndexerError;
+import com.azure.search.documents.models.SearchIndexerWarning;
+
+import java.time.OffsetDateTime;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.IndexerExecutionResult} and
+ * {@link IndexerExecutionResult}.
+ */
+public final class IndexerExecutionResultConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(IndexerExecutionResultConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.IndexerExecutionResult} to
+ * {@link IndexerExecutionResult}.
+ */
+ public static IndexerExecutionResult map(com.azure.search.documents.implementation.models.IndexerExecutionResult obj) {
+ if (obj == null) {
+ return null;
+ }
+ IndexerExecutionResult indexerExecutionResult = new IndexerExecutionResult();
+
+ String _finalTrackingState = obj.getFinalTrackingState();
+ PrivateFieldAccessHelper.set(indexerExecutionResult, "finalTrackingState", _finalTrackingState);
+
+ String _initialTrackingState = obj.getInitialTrackingState();
+ PrivateFieldAccessHelper.set(indexerExecutionResult, "initialTrackingState", _initialTrackingState);
+
+ if (obj.getWarnings() != null) {
+ List _warnings =
+ obj.getWarnings().stream().map(SearchIndexerWarningConverter::map).collect(Collectors.toList());
+ PrivateFieldAccessHelper.set(indexerExecutionResult, "warnings", _warnings);
+ }
+
+ String _errorMessage = obj.getErrorMessage();
+ PrivateFieldAccessHelper.set(indexerExecutionResult, "errorMessage", _errorMessage);
+
+ OffsetDateTime _startTime = obj.getStartTime();
+ PrivateFieldAccessHelper.set(indexerExecutionResult, "startTime", _startTime);
+
+ int _failedItemCount = obj.getFailedItemCount();
+ PrivateFieldAccessHelper.set(indexerExecutionResult, "failedItemCount", _failedItemCount);
+
+ OffsetDateTime _endTime = obj.getEndTime();
+ PrivateFieldAccessHelper.set(indexerExecutionResult, "endTime", _endTime);
+
+ if (obj.getErrors() != null) {
+ List _errors =
+ obj.getErrors().stream().map(SearchIndexerErrorConverter::map).collect(Collectors.toList());
+ PrivateFieldAccessHelper.set(indexerExecutionResult, "errors", _errors);
+ }
+
+ if (obj.getStatus() != null) {
+ IndexerExecutionStatus _status = IndexerExecutionStatusConverter.map(obj.getStatus());
+ PrivateFieldAccessHelper.set(indexerExecutionResult, "status", _status);
+ }
+
+ int _itemCount = obj.getItemCount();
+ PrivateFieldAccessHelper.set(indexerExecutionResult, "itemCount", _itemCount);
+ return indexerExecutionResult;
+ }
+
+ /**
+ * Maps from {@link IndexerExecutionResult} to
+ * {@link com.azure.search.documents.implementation.models.IndexerExecutionResult}.
+ */
+ public static com.azure.search.documents.implementation.models.IndexerExecutionResult map(IndexerExecutionResult obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.IndexerExecutionResult indexerExecutionResult =
+ new com.azure.search.documents.implementation.models.IndexerExecutionResult();
+
+ String _finalTrackingState = obj.getFinalTrackingState();
+ PrivateFieldAccessHelper.set(indexerExecutionResult, "finalTrackingState", _finalTrackingState);
+
+ String _initialTrackingState = obj.getInitialTrackingState();
+ PrivateFieldAccessHelper.set(indexerExecutionResult, "initialTrackingState", _initialTrackingState);
+
+ if (obj.getWarnings() != null) {
+ List _warnings =
+ obj.getWarnings().stream().map(SearchIndexerWarningConverter::map).collect(Collectors.toList());
+ PrivateFieldAccessHelper.set(indexerExecutionResult, "warnings", _warnings);
+ }
+
+ String _errorMessage = obj.getErrorMessage();
+ PrivateFieldAccessHelper.set(indexerExecutionResult, "errorMessage", _errorMessage);
+
+ OffsetDateTime _startTime = obj.getStartTime();
+ PrivateFieldAccessHelper.set(indexerExecutionResult, "startTime", _startTime);
+
+ int _failedItemCount = obj.getFailedItemCount();
+ PrivateFieldAccessHelper.set(indexerExecutionResult, "failedItemCount", _failedItemCount);
+
+ OffsetDateTime _endTime = obj.getEndTime();
+ PrivateFieldAccessHelper.set(indexerExecutionResult, "endTime", _endTime);
+
+ if (obj.getErrors() != null) {
+ List _errors =
+ obj.getErrors().stream().map(SearchIndexerErrorConverter::map).collect(Collectors.toList());
+ PrivateFieldAccessHelper.set(indexerExecutionResult, "errors", _errors);
+ }
+
+ if (obj.getStatus() != null) {
+ com.azure.search.documents.implementation.models.IndexerExecutionStatus _status =
+ IndexerExecutionStatusConverter.map(obj.getStatus());
+ PrivateFieldAccessHelper.set(indexerExecutionResult, "status", _status);
+ }
+
+ int _itemCount = obj.getItemCount();
+ PrivateFieldAccessHelper.set(indexerExecutionResult, "itemCount", _itemCount);
+ return indexerExecutionResult;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexerExecutionStatusConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexerExecutionStatusConverter.java
new file mode 100644
index 000000000000..93c29a799cb6
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexerExecutionStatusConverter.java
@@ -0,0 +1,62 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.IndexerExecutionStatus;
+
+import static com.azure.search.documents.implementation.util.Constants.ENUM_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ENUM_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.IndexerExecutionStatus} and
+ * {@link IndexerExecutionStatus}.
+ */
+public final class IndexerExecutionStatusConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(IndexerExecutionStatusConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.IndexerExecutionStatus} to enum
+ * {@link IndexerExecutionStatus}.
+ */
+ public static IndexerExecutionStatus map(com.azure.search.documents.implementation.models.IndexerExecutionStatus obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case TRANSIENT_FAILURE:
+ return IndexerExecutionStatus.TRANSIENT_FAILURE;
+ case SUCCESS:
+ return IndexerExecutionStatus.SUCCESS;
+ case IN_PROGRESS:
+ return IndexerExecutionStatus.IN_PROGRESS;
+ case RESET:
+ return IndexerExecutionStatus.RESET;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_EXTERNAL_ERROR_MSG, obj)));
+ }
+ }
+
+ /**
+ * Maps from enum {@link IndexerExecutionStatus} to enum
+ * {@link com.azure.search.documents.implementation.models.IndexerExecutionStatus}.
+ */
+ public static com.azure.search.documents.implementation.models.IndexerExecutionStatus map(IndexerExecutionStatus obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case TRANSIENT_FAILURE:
+ return com.azure.search.documents.implementation.models.IndexerExecutionStatus.TRANSIENT_FAILURE;
+ case SUCCESS:
+ return com.azure.search.documents.implementation.models.IndexerExecutionStatus.SUCCESS;
+ case IN_PROGRESS:
+ return com.azure.search.documents.implementation.models.IndexerExecutionStatus.IN_PROGRESS;
+ case RESET:
+ return com.azure.search.documents.implementation.models.IndexerExecutionStatus.RESET;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj)));
+ }
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexerStatusConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexerStatusConverter.java
new file mode 100644
index 000000000000..4755de82e8ff
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexerStatusConverter.java
@@ -0,0 +1,57 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.IndexerStatus;
+
+import static com.azure.search.documents.implementation.util.Constants.ENUM_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ENUM_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.IndexerStatus} and {@link IndexerStatus}.
+ */
+public final class IndexerStatusConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(IndexerStatusConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.IndexerStatus} to enum
+ * {@link IndexerStatus}.
+ */
+ public static IndexerStatus map(com.azure.search.documents.implementation.models.IndexerStatus obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case UNKNOWN:
+ return IndexerStatus.UNKNOWN;
+ case ERROR:
+ return IndexerStatus.ERROR;
+ case RUNNING:
+ return IndexerStatus.RUNNING;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_EXTERNAL_ERROR_MSG, obj)));
+ }
+ }
+
+ /**
+ * Maps from enum {@link IndexerStatus} to enum
+ * {@link com.azure.search.documents.implementation.models.IndexerStatus}.
+ */
+ public static com.azure.search.documents.implementation.models.IndexerStatus map(IndexerStatus obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case UNKNOWN:
+ return com.azure.search.documents.implementation.models.IndexerStatus.UNKNOWN;
+ case ERROR:
+ return com.azure.search.documents.implementation.models.IndexerStatus.ERROR;
+ case RUNNING:
+ return com.azure.search.documents.implementation.models.IndexerStatus.RUNNING;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj)));
+ }
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexingParametersConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexingParametersConverter.java
new file mode 100644
index 000000000000..74acefed82eb
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexingParametersConverter.java
@@ -0,0 +1,75 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.IndexingParameters;
+
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.IndexingParameters} and
+ * {@link IndexingParameters}.
+ */
+public final class IndexingParametersConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(IndexingParametersConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.IndexingParameters} to
+ * {@link IndexingParameters}.
+ */
+ public static IndexingParameters map(com.azure.search.documents.implementation.models.IndexingParameters obj) {
+ if (obj == null) {
+ return null;
+ }
+ IndexingParameters indexingParameters = new IndexingParameters();
+
+ Integer _maxFailedItemsPerBatch = obj.getMaxFailedItemsPerBatch();
+ indexingParameters.setMaxFailedItemsPerBatch(_maxFailedItemsPerBatch);
+
+ Integer _maxFailedItems = obj.getMaxFailedItems();
+ indexingParameters.setMaxFailedItems(_maxFailedItems);
+
+ if (obj.getConfiguration() != null) {
+ Map _configuration =
+ obj.getConfiguration().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey,
+ Map.Entry::getValue));
+ indexingParameters.setConfiguration(_configuration);
+ }
+
+ Integer _batchSize = obj.getBatchSize();
+ indexingParameters.setBatchSize(_batchSize);
+ return indexingParameters;
+ }
+
+ /**
+ * Maps from {@link IndexingParameters} to
+ * {@link com.azure.search.documents.implementation.models.IndexingParameters}.
+ */
+ public static com.azure.search.documents.implementation.models.IndexingParameters map(IndexingParameters obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.IndexingParameters indexingParameters =
+ new com.azure.search.documents.implementation.models.IndexingParameters();
+
+ Integer _maxFailedItemsPerBatch = obj.getMaxFailedItemsPerBatch();
+ indexingParameters.setMaxFailedItemsPerBatch(_maxFailedItemsPerBatch);
+
+ Integer _maxFailedItems = obj.getMaxFailedItems();
+ indexingParameters.setMaxFailedItems(_maxFailedItems);
+
+ if (obj.getConfiguration() != null) {
+ Map _configuration =
+ obj.getConfiguration().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey,
+ Map.Entry::getValue));
+ indexingParameters.setConfiguration(_configuration);
+ }
+
+ Integer _batchSize = obj.getBatchSize();
+ indexingParameters.setBatchSize(_batchSize);
+ return indexingParameters;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexingResultConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexingResultConverter.java
new file mode 100644
index 000000000000..ba215af1d717
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexingResultConverter.java
@@ -0,0 +1,63 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.implementation.util.PrivateFieldAccessHelper;
+import com.azure.search.documents.models.IndexingResult;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.IndexingResult} and
+ * {@link IndexingResult}.
+ */
+public final class IndexingResultConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(IndexingResultConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.IndexingResult} to {@link IndexingResult}.
+ */
+ public static IndexingResult map(com.azure.search.documents.implementation.models.IndexingResult obj) {
+ if (obj == null) {
+ return null;
+ }
+ IndexingResult indexingResult = new IndexingResult();
+
+ String _errorMessage = obj.getErrorMessage();
+ PrivateFieldAccessHelper.set(indexingResult, "errorMessage", _errorMessage);
+
+ String _key = obj.getKey();
+ PrivateFieldAccessHelper.set(indexingResult, "key", _key);
+
+ boolean _succeeded = obj.isSucceeded();
+ PrivateFieldAccessHelper.set(indexingResult, "succeeded", _succeeded);
+
+ int _statusCode = obj.getStatusCode();
+ PrivateFieldAccessHelper.set(indexingResult, "statusCode", _statusCode);
+ return indexingResult;
+ }
+
+ /**
+ * Maps from {@link IndexingResult} to {@link com.azure.search.documents.implementation.models.IndexingResult}.
+ */
+ public static com.azure.search.documents.implementation.models.IndexingResult map(IndexingResult obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.IndexingResult indexingResult =
+ new com.azure.search.documents.implementation.models.IndexingResult();
+
+ String _errorMessage = obj.getErrorMessage();
+ PrivateFieldAccessHelper.set(indexingResult, "errorMessage", _errorMessage);
+
+ String _key = obj.getKey();
+ PrivateFieldAccessHelper.set(indexingResult, "key", _key);
+
+ boolean _succeeded = obj.isSucceeded();
+ PrivateFieldAccessHelper.set(indexingResult, "succeeded", _succeeded);
+
+ int _statusCode = obj.getStatusCode();
+ PrivateFieldAccessHelper.set(indexingResult, "statusCode", _statusCode);
+ return indexingResult;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexingScheduleConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexingScheduleConverter.java
new file mode 100644
index 000000000000..de411619f653
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/IndexingScheduleConverter.java
@@ -0,0 +1,53 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.IndexingSchedule;
+
+import java.time.Duration;
+import java.time.OffsetDateTime;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.IndexingSchedule} and
+ * {@link IndexingSchedule}.
+ */
+public final class IndexingScheduleConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(IndexingScheduleConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.IndexingSchedule} to {@link IndexingSchedule}.
+ */
+ public static IndexingSchedule map(com.azure.search.documents.implementation.models.IndexingSchedule obj) {
+ if (obj == null) {
+ return null;
+ }
+ IndexingSchedule indexingSchedule = new IndexingSchedule();
+
+ Duration _interval = obj.getInterval();
+ indexingSchedule.setInterval(_interval);
+
+ OffsetDateTime _startTime = obj.getStartTime();
+ indexingSchedule.setStartTime(_startTime);
+ return indexingSchedule;
+ }
+
+ /**
+ * Maps from {@link IndexingSchedule} to {@link com.azure.search.documents.implementation.models.IndexingSchedule}.
+ */
+ public static com.azure.search.documents.implementation.models.IndexingSchedule map(IndexingSchedule obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.IndexingSchedule indexingSchedule =
+ new com.azure.search.documents.implementation.models.IndexingSchedule();
+
+ Duration _interval = obj.getInterval();
+ indexingSchedule.setInterval(_interval);
+
+ OffsetDateTime _startTime = obj.getStartTime();
+ indexingSchedule.setStartTime(_startTime);
+ return indexingSchedule;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/InputFieldMappingEntryConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/InputFieldMappingEntryConverter.java
new file mode 100644
index 000000000000..ac96783cadfa
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/InputFieldMappingEntryConverter.java
@@ -0,0 +1,73 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.InputFieldMappingEntry;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.InputFieldMappingEntry} and
+ * {@link InputFieldMappingEntry}.
+ */
+public final class InputFieldMappingEntryConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(InputFieldMappingEntryConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.InputFieldMappingEntry} to
+ * {@link InputFieldMappingEntry}.
+ */
+ public static InputFieldMappingEntry map(com.azure.search.documents.implementation.models.InputFieldMappingEntry obj) {
+ if (obj == null) {
+ return null;
+ }
+ InputFieldMappingEntry inputFieldMappingEntry = new InputFieldMappingEntry();
+
+ if (obj.getInputs() != null) {
+ List _inputs =
+ obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ inputFieldMappingEntry.setInputs(_inputs);
+ }
+
+ String _name = obj.getName();
+ inputFieldMappingEntry.setName(_name);
+
+ String _source = obj.getSource();
+ inputFieldMappingEntry.setSource(_source);
+
+ String _sourceContext = obj.getSourceContext();
+ inputFieldMappingEntry.setSourceContext(_sourceContext);
+ return inputFieldMappingEntry;
+ }
+
+ /**
+ * Maps from {@link InputFieldMappingEntry} to
+ * {@link com.azure.search.documents.implementation.models.InputFieldMappingEntry}.
+ */
+ public static com.azure.search.documents.implementation.models.InputFieldMappingEntry map(InputFieldMappingEntry obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.InputFieldMappingEntry inputFieldMappingEntry =
+ new com.azure.search.documents.implementation.models.InputFieldMappingEntry();
+
+ if (obj.getInputs() != null) {
+ List _inputs =
+ obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ inputFieldMappingEntry.setInputs(_inputs);
+ }
+
+ String _name = obj.getName();
+ inputFieldMappingEntry.setName(_name);
+
+ String _source = obj.getSource();
+ inputFieldMappingEntry.setSource(_source);
+
+ String _sourceContext = obj.getSourceContext();
+ inputFieldMappingEntry.setSourceContext(_sourceContext);
+ return inputFieldMappingEntry;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/KeepTokenFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/KeepTokenFilterConverter.java
new file mode 100644
index 000000000000..f5da8b2e36ce
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/KeepTokenFilterConverter.java
@@ -0,0 +1,64 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.KeepTokenFilter;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.KeepTokenFilter} and
+ * {@link KeepTokenFilter}.
+ */
+public final class KeepTokenFilterConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(KeepTokenFilterConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.KeepTokenFilter} to {@link KeepTokenFilter}.
+ */
+ public static KeepTokenFilter map(com.azure.search.documents.implementation.models.KeepTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ KeepTokenFilter keepTokenFilter = new KeepTokenFilter();
+
+ String _name = obj.getName();
+ keepTokenFilter.setName(_name);
+
+ if (obj.getKeepWords() != null) {
+ List _keepWords = new ArrayList<>(obj.getKeepWords());
+ keepTokenFilter.setKeepWords(_keepWords);
+ }
+
+ Boolean _lowerCaseKeepWords = obj.isLowerCaseKeepWords();
+ keepTokenFilter.setLowerCaseKeepWords(_lowerCaseKeepWords);
+ return keepTokenFilter;
+ }
+
+ /**
+ * Maps from {@link KeepTokenFilter} to {@link com.azure.search.documents.implementation.models.KeepTokenFilter}.
+ */
+ public static com.azure.search.documents.implementation.models.KeepTokenFilter map(KeepTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.KeepTokenFilter keepTokenFilter =
+ new com.azure.search.documents.implementation.models.KeepTokenFilter();
+
+ String _name = obj.getName();
+ keepTokenFilter.setName(_name);
+
+ if (obj.getKeepWords() != null) {
+ List _keepWords = new ArrayList<>(obj.getKeepWords());
+ keepTokenFilter.setKeepWords(_keepWords);
+ }
+
+ Boolean _lowerCaseKeepWords = obj.isLowerCaseKeepWords();
+ keepTokenFilter.setLowerCaseKeepWords(_lowerCaseKeepWords);
+ return keepTokenFilter;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/KeyPhraseExtractionSkillConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/KeyPhraseExtractionSkillConverter.java
new file mode 100644
index 000000000000..15f9a8f6913d
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/KeyPhraseExtractionSkillConverter.java
@@ -0,0 +1,106 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.InputFieldMappingEntry;
+import com.azure.search.documents.models.KeyPhraseExtractionSkill;
+import com.azure.search.documents.models.KeyPhraseExtractionSkillLanguage;
+import com.azure.search.documents.models.OutputFieldMappingEntry;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.KeyPhraseExtractionSkill} and
+ * {@link KeyPhraseExtractionSkill}.
+ */
+public final class KeyPhraseExtractionSkillConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(KeyPhraseExtractionSkillConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.KeyPhraseExtractionSkill} to
+ * {@link KeyPhraseExtractionSkill}.
+ */
+ public static KeyPhraseExtractionSkill map(com.azure.search.documents.implementation.models.KeyPhraseExtractionSkill obj) {
+ if (obj == null) {
+ return null;
+ }
+ KeyPhraseExtractionSkill keyPhraseExtractionSkill = new KeyPhraseExtractionSkill();
+
+ if (obj.getOutputs() != null) {
+ List _outputs =
+ obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ keyPhraseExtractionSkill.setOutputs(_outputs);
+ }
+
+ if (obj.getInputs() != null) {
+ List _inputs =
+ obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ keyPhraseExtractionSkill.setInputs(_inputs);
+ }
+
+ String _name = obj.getName();
+ keyPhraseExtractionSkill.setName(_name);
+
+ String _context = obj.getContext();
+ keyPhraseExtractionSkill.setContext(_context);
+
+ String _description = obj.getDescription();
+ keyPhraseExtractionSkill.setDescription(_description);
+
+ Integer _maxKeyPhraseCount = obj.getMaxKeyPhraseCount();
+ keyPhraseExtractionSkill.setMaxKeyPhraseCount(_maxKeyPhraseCount);
+
+ if (obj.getDefaultLanguageCode() != null) {
+ KeyPhraseExtractionSkillLanguage _defaultLanguageCode =
+ KeyPhraseExtractionSkillLanguageConverter.map(obj.getDefaultLanguageCode());
+ keyPhraseExtractionSkill.setDefaultLanguageCode(_defaultLanguageCode);
+ }
+ return keyPhraseExtractionSkill;
+ }
+
+ /**
+ * Maps from {@link KeyPhraseExtractionSkill} to
+ * {@link com.azure.search.documents.implementation.models.KeyPhraseExtractionSkill}.
+ */
+ public static com.azure.search.documents.implementation.models.KeyPhraseExtractionSkill map(KeyPhraseExtractionSkill obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.KeyPhraseExtractionSkill keyPhraseExtractionSkill =
+ new com.azure.search.documents.implementation.models.KeyPhraseExtractionSkill();
+
+ if (obj.getOutputs() != null) {
+ List _outputs =
+ obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ keyPhraseExtractionSkill.setOutputs(_outputs);
+ }
+
+ if (obj.getInputs() != null) {
+ List _inputs =
+ obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ keyPhraseExtractionSkill.setInputs(_inputs);
+ }
+
+ String _name = obj.getName();
+ keyPhraseExtractionSkill.setName(_name);
+
+ String _context = obj.getContext();
+ keyPhraseExtractionSkill.setContext(_context);
+
+ String _description = obj.getDescription();
+ keyPhraseExtractionSkill.setDescription(_description);
+
+ Integer _maxKeyPhraseCount = obj.getMaxKeyPhraseCount();
+ keyPhraseExtractionSkill.setMaxKeyPhraseCount(_maxKeyPhraseCount);
+
+ if (obj.getDefaultLanguageCode() != null) {
+ com.azure.search.documents.implementation.models.KeyPhraseExtractionSkillLanguage _defaultLanguageCode =
+ KeyPhraseExtractionSkillLanguageConverter.map(obj.getDefaultLanguageCode());
+ keyPhraseExtractionSkill.setDefaultLanguageCode(_defaultLanguageCode);
+ }
+ return keyPhraseExtractionSkill;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/KeyPhraseExtractionSkillLanguageConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/KeyPhraseExtractionSkillLanguageConverter.java
new file mode 100644
index 000000000000..0cb4dcf6a04f
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/KeyPhraseExtractionSkillLanguageConverter.java
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.KeyPhraseExtractionSkillLanguage;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.KeyPhraseExtractionSkillLanguage} and
+ * {@link KeyPhraseExtractionSkillLanguage}.
+ */
+public final class KeyPhraseExtractionSkillLanguageConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(KeyPhraseExtractionSkillLanguageConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.KeyPhraseExtractionSkillLanguage} to enum
+ * {@link KeyPhraseExtractionSkillLanguage}.
+ */
+ public static KeyPhraseExtractionSkillLanguage map(com.azure.search.documents.implementation.models.KeyPhraseExtractionSkillLanguage obj) {
+ if (obj == null) {
+ return null;
+ }
+ return KeyPhraseExtractionSkillLanguage.fromString(obj.toString());
+ }
+
+ /**
+ * Maps from enum {@link KeyPhraseExtractionSkillLanguage} to enum
+ * {@link com.azure.search.documents.implementation.models.KeyPhraseExtractionSkillLanguage}.
+ */
+ public static com.azure.search.documents.implementation.models.KeyPhraseExtractionSkillLanguage map(KeyPhraseExtractionSkillLanguage obj) {
+ if (obj == null) {
+ return null;
+ }
+ return com.azure.search.documents.implementation.models.KeyPhraseExtractionSkillLanguage.fromString(obj.toString());
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/KeywordMarkerTokenFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/KeywordMarkerTokenFilterConverter.java
new file mode 100644
index 000000000000..3ecaf240e6d4
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/KeywordMarkerTokenFilterConverter.java
@@ -0,0 +1,66 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.KeywordMarkerTokenFilter;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.KeywordMarkerTokenFilter} and
+ * {@link KeywordMarkerTokenFilter}.
+ */
+public final class KeywordMarkerTokenFilterConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(KeywordMarkerTokenFilterConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.KeywordMarkerTokenFilter} to
+ * {@link KeywordMarkerTokenFilter}.
+ */
+ public static KeywordMarkerTokenFilter map(com.azure.search.documents.implementation.models.KeywordMarkerTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ KeywordMarkerTokenFilter keywordMarkerTokenFilter = new KeywordMarkerTokenFilter();
+
+ String _name = obj.getName();
+ keywordMarkerTokenFilter.setName(_name);
+
+ if (obj.getKeywords() != null) {
+ List _keywords = new ArrayList<>(obj.getKeywords());
+ keywordMarkerTokenFilter.setKeywords(_keywords);
+ }
+
+ Boolean _ignoreCase = obj.isIgnoreCase();
+ keywordMarkerTokenFilter.setIgnoreCase(_ignoreCase);
+ return keywordMarkerTokenFilter;
+ }
+
+ /**
+ * Maps from {@link KeywordMarkerTokenFilter} to
+ * {@link com.azure.search.documents.implementation.models.KeywordMarkerTokenFilter}.
+ */
+ public static com.azure.search.documents.implementation.models.KeywordMarkerTokenFilter map(KeywordMarkerTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.KeywordMarkerTokenFilter keywordMarkerTokenFilter =
+ new com.azure.search.documents.implementation.models.KeywordMarkerTokenFilter();
+
+ String _name = obj.getName();
+ keywordMarkerTokenFilter.setName(_name);
+
+ if (obj.getKeywords() != null) {
+ List _keywords = new ArrayList<>(obj.getKeywords());
+ keywordMarkerTokenFilter.setKeywords(_keywords);
+ }
+
+ Boolean _ignoreCase = obj.isIgnoreCase();
+ keywordMarkerTokenFilter.setIgnoreCase(_ignoreCase);
+ return keywordMarkerTokenFilter;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/KeywordTokenizerConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/KeywordTokenizerConverter.java
new file mode 100644
index 000000000000..ec74e484936d
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/KeywordTokenizerConverter.java
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.KeywordTokenizer;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.KeywordTokenizer} and
+ * {@link KeywordTokenizer}.
+ */
+public final class KeywordTokenizerConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(KeywordTokenizerConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.KeywordTokenizer} to {@link KeywordTokenizer}.
+ */
+ public static KeywordTokenizer map(com.azure.search.documents.implementation.models.KeywordTokenizer obj) {
+ if (obj == null) {
+ return null;
+ }
+ KeywordTokenizer keywordTokenizer = new KeywordTokenizer();
+
+ String _name = obj.getName();
+ keywordTokenizer.setName(_name);
+
+ Integer _bufferSize = obj.getBufferSize();
+ keywordTokenizer.setBufferSize(_bufferSize);
+ return keywordTokenizer;
+ }
+
+ /**
+ * Maps from {@link KeywordTokenizer} to {@link com.azure.search.documents.implementation.models.KeywordTokenizer}.
+ */
+ public static com.azure.search.documents.implementation.models.KeywordTokenizer map(KeywordTokenizer obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.KeywordTokenizer keywordTokenizer =
+ new com.azure.search.documents.implementation.models.KeywordTokenizer();
+
+ String _name = obj.getName();
+ keywordTokenizer.setName(_name);
+
+ Integer _bufferSize = obj.getBufferSize();
+ keywordTokenizer.setBufferSize(_bufferSize);
+ return keywordTokenizer;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/KeywordTokenizerV2Converter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/KeywordTokenizerV2Converter.java
new file mode 100644
index 000000000000..47e06c048a11
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/KeywordTokenizerV2Converter.java
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.KeywordTokenizerV2;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.KeywordTokenizerV2} and
+ * {@link KeywordTokenizerV2}.
+ */
+public final class KeywordTokenizerV2Converter {
+ private static final ClientLogger LOGGER = new ClientLogger(KeywordTokenizerV2Converter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.KeywordTokenizerV2} to
+ * {@link KeywordTokenizerV2}.
+ */
+ public static KeywordTokenizerV2 map(com.azure.search.documents.implementation.models.KeywordTokenizerV2 obj) {
+ if (obj == null) {
+ return null;
+ }
+ KeywordTokenizerV2 keywordTokenizerV2 = new KeywordTokenizerV2();
+
+ String _name = obj.getName();
+ keywordTokenizerV2.setName(_name);
+
+ Integer _maxTokenLength = obj.getMaxTokenLength();
+ keywordTokenizerV2.setMaxTokenLength(_maxTokenLength);
+ return keywordTokenizerV2;
+ }
+
+ /**
+ * Maps from {@link KeywordTokenizerV2} to
+ * {@link com.azure.search.documents.implementation.models.KeywordTokenizerV2}.
+ */
+ public static com.azure.search.documents.implementation.models.KeywordTokenizerV2 map(KeywordTokenizerV2 obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.KeywordTokenizerV2 keywordTokenizerV2 =
+ new com.azure.search.documents.implementation.models.KeywordTokenizerV2();
+
+ String _name = obj.getName();
+ keywordTokenizerV2.setName(_name);
+
+ Integer _maxTokenLength = obj.getMaxTokenLength();
+ keywordTokenizerV2.setMaxTokenLength(_maxTokenLength);
+ return keywordTokenizerV2;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LanguageDetectionSkillConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LanguageDetectionSkillConverter.java
new file mode 100644
index 000000000000..d8e6a7fd91f5
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LanguageDetectionSkillConverter.java
@@ -0,0 +1,87 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.InputFieldMappingEntry;
+import com.azure.search.documents.models.LanguageDetectionSkill;
+import com.azure.search.documents.models.OutputFieldMappingEntry;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.LanguageDetectionSkill} and
+ * {@link LanguageDetectionSkill}.
+ */
+public final class LanguageDetectionSkillConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(LanguageDetectionSkillConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.LanguageDetectionSkill} to
+ * {@link LanguageDetectionSkill}.
+ */
+ public static LanguageDetectionSkill map(com.azure.search.documents.implementation.models.LanguageDetectionSkill obj) {
+ if (obj == null) {
+ return null;
+ }
+ LanguageDetectionSkill languageDetectionSkill = new LanguageDetectionSkill();
+
+ if (obj.getOutputs() != null) {
+ List _outputs =
+ obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ languageDetectionSkill.setOutputs(_outputs);
+ }
+
+ if (obj.getInputs() != null) {
+ List _inputs =
+ obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ languageDetectionSkill.setInputs(_inputs);
+ }
+
+ String _name = obj.getName();
+ languageDetectionSkill.setName(_name);
+
+ String _context = obj.getContext();
+ languageDetectionSkill.setContext(_context);
+
+ String _description = obj.getDescription();
+ languageDetectionSkill.setDescription(_description);
+ return languageDetectionSkill;
+ }
+
+ /**
+ * Maps from {@link LanguageDetectionSkill} to
+ * {@link com.azure.search.documents.implementation.models.LanguageDetectionSkill}.
+ */
+ public static com.azure.search.documents.implementation.models.LanguageDetectionSkill map(LanguageDetectionSkill obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.LanguageDetectionSkill languageDetectionSkill =
+ new com.azure.search.documents.implementation.models.LanguageDetectionSkill();
+
+ if (obj.getOutputs() != null) {
+ List _outputs =
+ obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ languageDetectionSkill.setOutputs(_outputs);
+ }
+
+ if (obj.getInputs() != null) {
+ List _inputs =
+ obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ languageDetectionSkill.setInputs(_inputs);
+ }
+
+ String _name = obj.getName();
+ languageDetectionSkill.setName(_name);
+
+ String _context = obj.getContext();
+ languageDetectionSkill.setContext(_context);
+
+ String _description = obj.getDescription();
+ languageDetectionSkill.setDescription(_description);
+ return languageDetectionSkill;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LengthTokenFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LengthTokenFilterConverter.java
new file mode 100644
index 000000000000..67455e0ceee8
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LengthTokenFilterConverter.java
@@ -0,0 +1,58 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.LengthTokenFilter;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.LengthTokenFilter} and
+ * {@link LengthTokenFilter}.
+ */
+public final class LengthTokenFilterConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(LengthTokenFilterConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.LengthTokenFilter} to
+ * {@link LengthTokenFilter}.
+ */
+ public static LengthTokenFilter map(com.azure.search.documents.implementation.models.LengthTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ LengthTokenFilter lengthTokenFilter = new LengthTokenFilter();
+
+ String _name = obj.getName();
+ lengthTokenFilter.setName(_name);
+
+ Integer _minLength = obj.getMinLength();
+ lengthTokenFilter.setMinLength(_minLength);
+
+ Integer _maxLength = obj.getMaxLength();
+ lengthTokenFilter.setMaxLength(_maxLength);
+ return lengthTokenFilter;
+ }
+
+ /**
+ * Maps from {@link LengthTokenFilter} to
+ * {@link com.azure.search.documents.implementation.models.LengthTokenFilter}.
+ */
+ public static com.azure.search.documents.implementation.models.LengthTokenFilter map(LengthTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.LengthTokenFilter lengthTokenFilter =
+ new com.azure.search.documents.implementation.models.LengthTokenFilter();
+
+ String _name = obj.getName();
+ lengthTokenFilter.setName(_name);
+
+ Integer _minLength = obj.getMinLength();
+ lengthTokenFilter.setMinLength(_minLength);
+
+ Integer _maxLength = obj.getMaxLength();
+ lengthTokenFilter.setMaxLength(_maxLength);
+ return lengthTokenFilter;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LexicalAnalyzerConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LexicalAnalyzerConverter.java
new file mode 100644
index 000000000000..51755d794f4b
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LexicalAnalyzerConverter.java
@@ -0,0 +1,63 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.implementation.models.CustomAnalyzer;
+import com.azure.search.documents.implementation.models.LuceneStandardAnalyzer;
+import com.azure.search.documents.implementation.models.PatternAnalyzer;
+import com.azure.search.documents.implementation.models.StopAnalyzer;
+import com.azure.search.documents.models.LexicalAnalyzer;
+
+import static com.azure.search.documents.implementation.util.Constants.ABSTRACT_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ABSTRACT_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.LexicalAnalyzer} and
+ * {@link LexicalAnalyzer}.
+ */
+public final class LexicalAnalyzerConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(LexicalAnalyzerConverter.class);
+
+ /**
+ * Maps abstract class from {@link com.azure.search.documents.implementation.models.LexicalAnalyzer} to
+ * {@link LexicalAnalyzer}. Dedicate works to sub class converter.
+ */
+ public static LexicalAnalyzer map(com.azure.search.documents.implementation.models.LexicalAnalyzer obj) {
+ if (obj instanceof LuceneStandardAnalyzer) {
+ return LuceneStandardAnalyzerConverter.map((LuceneStandardAnalyzer) obj);
+ }
+ if (obj instanceof PatternAnalyzer) {
+ return PatternAnalyzerConverter.map((PatternAnalyzer) obj);
+ }
+ if (obj instanceof CustomAnalyzer) {
+ return CustomAnalyzerConverter.map((CustomAnalyzer) obj);
+ }
+ if (obj instanceof StopAnalyzer) {
+ return StopAnalyzerConverter.map((StopAnalyzer) obj);
+ }
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_EXTERNAL_ERROR_MSG,
+ obj.getClass().getSimpleName())));
+ }
+
+ /**
+ * Maps abstract class from {@link LexicalAnalyzer} to
+ * {@link com.azure.search.documents.implementation.models.LexicalAnalyzer}. Dedicate works to sub class converter.
+ */
+ public static com.azure.search.documents.implementation.models.LexicalAnalyzer map(LexicalAnalyzer obj) {
+ if (obj instanceof com.azure.search.documents.models.CustomAnalyzer) {
+ return CustomAnalyzerConverter.map((com.azure.search.documents.models.CustomAnalyzer) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.LuceneStandardAnalyzer) {
+ return LuceneStandardAnalyzerConverter.map((com.azure.search.documents.models.LuceneStandardAnalyzer) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.PatternAnalyzer) {
+ return PatternAnalyzerConverter.map((com.azure.search.documents.models.PatternAnalyzer) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.StopAnalyzer) {
+ return StopAnalyzerConverter.map((com.azure.search.documents.models.StopAnalyzer) obj);
+ }
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_INTERNAL_ERROR_MSG, obj.getClass().getSimpleName())));
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LexicalAnalyzerNameConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LexicalAnalyzerNameConverter.java
new file mode 100644
index 000000000000..d664d0bf5d17
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LexicalAnalyzerNameConverter.java
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.LexicalAnalyzerName;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.LexicalAnalyzerName} and
+ * {@link LexicalAnalyzerName}.
+ */
+public final class LexicalAnalyzerNameConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(LexicalAnalyzerNameConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.LexicalAnalyzerName} to enum
+ * {@link LexicalAnalyzerName}.
+ */
+ public static LexicalAnalyzerName map(com.azure.search.documents.implementation.models.LexicalAnalyzerName obj) {
+ if (obj == null) {
+ return null;
+ }
+ return LexicalAnalyzerName.fromString(obj.toString());
+ }
+
+ /**
+ * Maps from enum {@link LexicalAnalyzerName} to enum
+ * {@link com.azure.search.documents.implementation.models.LexicalAnalyzerName}.
+ */
+ public static com.azure.search.documents.implementation.models.LexicalAnalyzerName map(LexicalAnalyzerName obj) {
+ if (obj == null) {
+ return null;
+ }
+ return com.azure.search.documents.implementation.models.LexicalAnalyzerName.fromString(obj.toString());
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LexicalTokenizerConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LexicalTokenizerConverter.java
new file mode 100644
index 000000000000..e7ba8cc47e7c
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LexicalTokenizerConverter.java
@@ -0,0 +1,119 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.implementation.models.ClassicTokenizer;
+import com.azure.search.documents.implementation.models.EdgeNGramTokenizer;
+import com.azure.search.documents.implementation.models.KeywordTokenizer;
+import com.azure.search.documents.implementation.models.KeywordTokenizerV2;
+import com.azure.search.documents.implementation.models.LuceneStandardTokenizer;
+import com.azure.search.documents.implementation.models.LuceneStandardTokenizerV2;
+import com.azure.search.documents.implementation.models.MicrosoftLanguageStemmingTokenizer;
+import com.azure.search.documents.implementation.models.MicrosoftLanguageTokenizer;
+import com.azure.search.documents.implementation.models.NGramTokenizer;
+import com.azure.search.documents.implementation.models.PathHierarchyTokenizerV2;
+import com.azure.search.documents.implementation.models.PatternTokenizer;
+import com.azure.search.documents.implementation.models.UaxUrlEmailTokenizer;
+import com.azure.search.documents.models.LexicalTokenizer;
+
+import static com.azure.search.documents.implementation.util.Constants.ABSTRACT_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ABSTRACT_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.LexicalTokenizer} and
+ * {@link LexicalTokenizer}.
+ */
+public final class LexicalTokenizerConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(LexicalTokenizerConverter.class);
+
+ /**
+ * Maps abstract class from {@link com.azure.search.documents.implementation.models.LexicalTokenizer} to
+ * {@link LexicalTokenizer}. Dedicate works to sub class converter.
+ */
+ public static LexicalTokenizer map(com.azure.search.documents.implementation.models.LexicalTokenizer obj) {
+ if (obj instanceof PatternTokenizer) {
+ return PatternTokenizerConverter.map((PatternTokenizer) obj);
+ }
+ if (obj instanceof NGramTokenizer) {
+ return NGramTokenizerConverter.map((NGramTokenizer) obj);
+ }
+ if (obj instanceof LuceneStandardTokenizer) {
+ return LuceneStandardTokenizerConverter.map((LuceneStandardTokenizer) obj);
+ }
+ if (obj instanceof PathHierarchyTokenizerV2) {
+ return PathHierarchyTokenizerV2Converter.map((PathHierarchyTokenizerV2) obj);
+ }
+ if (obj instanceof ClassicTokenizer) {
+ return ClassicTokenizerConverter.map((ClassicTokenizer) obj);
+ }
+ if (obj instanceof KeywordTokenizer) {
+ return KeywordTokenizerConverter.map((KeywordTokenizer) obj);
+ }
+ if (obj instanceof LuceneStandardTokenizerV2) {
+ return LuceneStandardTokenizerV2Converter.map((LuceneStandardTokenizerV2) obj);
+ }
+ if (obj instanceof UaxUrlEmailTokenizer) {
+ return UaxUrlEmailTokenizerConverter.map((UaxUrlEmailTokenizer) obj);
+ }
+ if (obj instanceof KeywordTokenizerV2) {
+ return KeywordTokenizerV2Converter.map((KeywordTokenizerV2) obj);
+ }
+ if (obj instanceof MicrosoftLanguageTokenizer) {
+ return MicrosoftLanguageTokenizerConverter.map((MicrosoftLanguageTokenizer) obj);
+ }
+ if (obj instanceof EdgeNGramTokenizer) {
+ return EdgeNGramTokenizerConverter.map((EdgeNGramTokenizer) obj);
+ }
+ if (obj instanceof MicrosoftLanguageStemmingTokenizer) {
+ return MicrosoftLanguageStemmingTokenizerConverter.map((MicrosoftLanguageStemmingTokenizer) obj);
+ }
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_EXTERNAL_ERROR_MSG,
+ obj.getClass().getSimpleName())));
+ }
+
+ /**
+ * Maps abstract class from {@link LexicalTokenizer} to
+ * {@link com.azure.search.documents.implementation.models.LexicalTokenizer}. Dedicate works to sub class converter.
+ */
+ public static com.azure.search.documents.implementation.models.LexicalTokenizer map(LexicalTokenizer obj) {
+ if (obj instanceof com.azure.search.documents.models.PatternTokenizer) {
+ return PatternTokenizerConverter.map((com.azure.search.documents.models.PatternTokenizer) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.EdgeNGramTokenizer) {
+ return EdgeNGramTokenizerConverter.map((com.azure.search.documents.models.EdgeNGramTokenizer) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.MicrosoftLanguageStemmingTokenizer) {
+ return MicrosoftLanguageStemmingTokenizerConverter.map((com.azure.search.documents.models.MicrosoftLanguageStemmingTokenizer) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.KeywordTokenizerV2) {
+ return KeywordTokenizerV2Converter.map((com.azure.search.documents.models.KeywordTokenizerV2) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.KeywordTokenizer) {
+ return KeywordTokenizerConverter.map((com.azure.search.documents.models.KeywordTokenizer) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.MicrosoftLanguageTokenizer) {
+ return MicrosoftLanguageTokenizerConverter.map((com.azure.search.documents.models.MicrosoftLanguageTokenizer) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.LuceneStandardTokenizerV2) {
+ return LuceneStandardTokenizerV2Converter.map((com.azure.search.documents.models.LuceneStandardTokenizerV2) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.LuceneStandardTokenizer) {
+ return LuceneStandardTokenizerConverter.map((com.azure.search.documents.models.LuceneStandardTokenizer) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.UaxUrlEmailTokenizer) {
+ return UaxUrlEmailTokenizerConverter.map((com.azure.search.documents.models.UaxUrlEmailTokenizer) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.PathHierarchyTokenizerV2) {
+ return PathHierarchyTokenizerV2Converter.map((com.azure.search.documents.models.PathHierarchyTokenizerV2) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.ClassicTokenizer) {
+ return ClassicTokenizerConverter.map((com.azure.search.documents.models.ClassicTokenizer) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.NGramTokenizer) {
+ return NGramTokenizerConverter.map((com.azure.search.documents.models.NGramTokenizer) obj);
+ }
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_INTERNAL_ERROR_MSG, obj.getClass().getSimpleName())));
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LexicalTokenizerNameConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LexicalTokenizerNameConverter.java
new file mode 100644
index 000000000000..5e98bd313568
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LexicalTokenizerNameConverter.java
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.LexicalTokenizerName;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.LexicalTokenizerName} and
+ * {@link LexicalTokenizerName}.
+ */
+public final class LexicalTokenizerNameConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(LexicalTokenizerNameConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.LexicalTokenizerName} to enum
+ * {@link LexicalTokenizerName}.
+ */
+ public static LexicalTokenizerName map(com.azure.search.documents.implementation.models.LexicalTokenizerName obj) {
+ if (obj == null) {
+ return null;
+ }
+ return LexicalTokenizerName.fromString(obj.toString());
+ }
+
+ /**
+ * Maps from enum {@link LexicalTokenizerName} to enum
+ * {@link com.azure.search.documents.implementation.models.LexicalTokenizerName}.
+ */
+ public static com.azure.search.documents.implementation.models.LexicalTokenizerName map(LexicalTokenizerName obj) {
+ if (obj == null) {
+ return null;
+ }
+ return com.azure.search.documents.implementation.models.LexicalTokenizerName.fromString(obj.toString());
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LimitTokenFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LimitTokenFilterConverter.java
new file mode 100644
index 000000000000..18a86232da36
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LimitTokenFilterConverter.java
@@ -0,0 +1,56 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.LimitTokenFilter;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.LimitTokenFilter} and
+ * {@link LimitTokenFilter}.
+ */
+public final class LimitTokenFilterConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(LimitTokenFilterConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.LimitTokenFilter} to {@link LimitTokenFilter}.
+ */
+ public static LimitTokenFilter map(com.azure.search.documents.implementation.models.LimitTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ LimitTokenFilter limitTokenFilter = new LimitTokenFilter();
+
+ String _name = obj.getName();
+ limitTokenFilter.setName(_name);
+
+ Integer _maxTokenCount = obj.getMaxTokenCount();
+ limitTokenFilter.setMaxTokenCount(_maxTokenCount);
+
+ Boolean _consumeAllTokens = obj.isConsumeAllTokens();
+ limitTokenFilter.setConsumeAllTokens(_consumeAllTokens);
+ return limitTokenFilter;
+ }
+
+ /**
+ * Maps from {@link LimitTokenFilter} to {@link com.azure.search.documents.implementation.models.LimitTokenFilter}.
+ */
+ public static com.azure.search.documents.implementation.models.LimitTokenFilter map(LimitTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.LimitTokenFilter limitTokenFilter =
+ new com.azure.search.documents.implementation.models.LimitTokenFilter();
+
+ String _name = obj.getName();
+ limitTokenFilter.setName(_name);
+
+ Integer _maxTokenCount = obj.getMaxTokenCount();
+ limitTokenFilter.setMaxTokenCount(_maxTokenCount);
+
+ Boolean _consumeAllTokens = obj.isConsumeAllTokens();
+ limitTokenFilter.setConsumeAllTokens(_consumeAllTokens);
+ return limitTokenFilter;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LuceneStandardAnalyzerConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LuceneStandardAnalyzerConverter.java
new file mode 100644
index 000000000000..35b75cafb7e3
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LuceneStandardAnalyzerConverter.java
@@ -0,0 +1,66 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.LuceneStandardAnalyzer;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.LuceneStandardAnalyzer} and
+ * {@link LuceneStandardAnalyzer}.
+ */
+public final class LuceneStandardAnalyzerConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(LuceneStandardAnalyzerConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.LuceneStandardAnalyzer} to
+ * {@link LuceneStandardAnalyzer}.
+ */
+ public static LuceneStandardAnalyzer map(com.azure.search.documents.implementation.models.LuceneStandardAnalyzer obj) {
+ if (obj == null) {
+ return null;
+ }
+ LuceneStandardAnalyzer luceneStandardAnalyzer = new LuceneStandardAnalyzer();
+
+ String _name = obj.getName();
+ luceneStandardAnalyzer.setName(_name);
+
+ Integer _maxTokenLength = obj.getMaxTokenLength();
+ luceneStandardAnalyzer.setMaxTokenLength(_maxTokenLength);
+
+ if (obj.getStopwords() != null) {
+ List _stopwords = new ArrayList<>(obj.getStopwords());
+ luceneStandardAnalyzer.setStopwords(_stopwords);
+ }
+ return luceneStandardAnalyzer;
+ }
+
+ /**
+ * Maps from {@link LuceneStandardAnalyzer} to
+ * {@link com.azure.search.documents.implementation.models.LuceneStandardAnalyzer}.
+ */
+ public static com.azure.search.documents.implementation.models.LuceneStandardAnalyzer map(LuceneStandardAnalyzer obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.LuceneStandardAnalyzer luceneStandardAnalyzer =
+ new com.azure.search.documents.implementation.models.LuceneStandardAnalyzer();
+
+ String _name = obj.getName();
+ luceneStandardAnalyzer.setName(_name);
+
+ Integer _maxTokenLength = obj.getMaxTokenLength();
+ luceneStandardAnalyzer.setMaxTokenLength(_maxTokenLength);
+
+ if (obj.getStopwords() != null) {
+ List _stopwords = new ArrayList<>(obj.getStopwords());
+ luceneStandardAnalyzer.setStopwords(_stopwords);
+ }
+ return luceneStandardAnalyzer;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LuceneStandardTokenizerConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LuceneStandardTokenizerConverter.java
new file mode 100644
index 000000000000..ba0838831014
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LuceneStandardTokenizerConverter.java
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.LuceneStandardTokenizer;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.LuceneStandardTokenizer} and
+ * {@link LuceneStandardTokenizer}.
+ */
+public final class LuceneStandardTokenizerConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(LuceneStandardTokenizerConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.LuceneStandardTokenizer} to
+ * {@link LuceneStandardTokenizer}.
+ */
+ public static LuceneStandardTokenizer map(com.azure.search.documents.implementation.models.LuceneStandardTokenizer obj) {
+ if (obj == null) {
+ return null;
+ }
+ LuceneStandardTokenizer luceneStandardTokenizer = new LuceneStandardTokenizer();
+
+ String _name = obj.getName();
+ luceneStandardTokenizer.setName(_name);
+
+ Integer _maxTokenLength = obj.getMaxTokenLength();
+ luceneStandardTokenizer.setMaxTokenLength(_maxTokenLength);
+ return luceneStandardTokenizer;
+ }
+
+ /**
+ * Maps from {@link LuceneStandardTokenizer} to
+ * {@link com.azure.search.documents.implementation.models.LuceneStandardTokenizer}.
+ */
+ public static com.azure.search.documents.implementation.models.LuceneStandardTokenizer map(LuceneStandardTokenizer obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.LuceneStandardTokenizer luceneStandardTokenizer =
+ new com.azure.search.documents.implementation.models.LuceneStandardTokenizer();
+
+ String _name = obj.getName();
+ luceneStandardTokenizer.setName(_name);
+
+ Integer _maxTokenLength = obj.getMaxTokenLength();
+ luceneStandardTokenizer.setMaxTokenLength(_maxTokenLength);
+ return luceneStandardTokenizer;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LuceneStandardTokenizerV2Converter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LuceneStandardTokenizerV2Converter.java
new file mode 100644
index 000000000000..1ff0923217e5
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LuceneStandardTokenizerV2Converter.java
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.LuceneStandardTokenizerV2;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.LuceneStandardTokenizerV2} and
+ * {@link LuceneStandardTokenizerV2}.
+ */
+public final class LuceneStandardTokenizerV2Converter {
+ private static final ClientLogger LOGGER = new ClientLogger(LuceneStandardTokenizerV2Converter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.LuceneStandardTokenizerV2} to
+ * {@link LuceneStandardTokenizerV2}.
+ */
+ public static LuceneStandardTokenizerV2 map(com.azure.search.documents.implementation.models.LuceneStandardTokenizerV2 obj) {
+ if (obj == null) {
+ return null;
+ }
+ LuceneStandardTokenizerV2 luceneStandardTokenizerV2 = new LuceneStandardTokenizerV2();
+
+ String _name = obj.getName();
+ luceneStandardTokenizerV2.setName(_name);
+
+ Integer _maxTokenLength = obj.getMaxTokenLength();
+ luceneStandardTokenizerV2.setMaxTokenLength(_maxTokenLength);
+ return luceneStandardTokenizerV2;
+ }
+
+ /**
+ * Maps from {@link LuceneStandardTokenizerV2} to
+ * {@link com.azure.search.documents.implementation.models.LuceneStandardTokenizerV2}.
+ */
+ public static com.azure.search.documents.implementation.models.LuceneStandardTokenizerV2 map(LuceneStandardTokenizerV2 obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.LuceneStandardTokenizerV2 luceneStandardTokenizerV2 =
+ new com.azure.search.documents.implementation.models.LuceneStandardTokenizerV2();
+
+ String _name = obj.getName();
+ luceneStandardTokenizerV2.setName(_name);
+
+ Integer _maxTokenLength = obj.getMaxTokenLength();
+ luceneStandardTokenizerV2.setMaxTokenLength(_maxTokenLength);
+ return luceneStandardTokenizerV2;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MagnitudeScoringFunctionConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MagnitudeScoringFunctionConverter.java
new file mode 100644
index 000000000000..abd4150025c4
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MagnitudeScoringFunctionConverter.java
@@ -0,0 +1,77 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.MagnitudeScoringFunction;
+import com.azure.search.documents.models.MagnitudeScoringParameters;
+import com.azure.search.documents.models.ScoringFunctionInterpolation;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.MagnitudeScoringFunction} and
+ * {@link MagnitudeScoringFunction}.
+ */
+public final class MagnitudeScoringFunctionConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(MagnitudeScoringFunctionConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.MagnitudeScoringFunction} to
+ * {@link MagnitudeScoringFunction}.
+ */
+ public static MagnitudeScoringFunction map(com.azure.search.documents.implementation.models.MagnitudeScoringFunction obj) {
+ if (obj == null) {
+ return null;
+ }
+ MagnitudeScoringFunction magnitudeScoringFunction = new MagnitudeScoringFunction();
+
+ if (obj.getInterpolation() != null) {
+ ScoringFunctionInterpolation _interpolation =
+ ScoringFunctionInterpolationConverter.map(obj.getInterpolation());
+ magnitudeScoringFunction.setInterpolation(_interpolation);
+ }
+
+ String _fieldName = obj.getFieldName();
+ magnitudeScoringFunction.setFieldName(_fieldName);
+
+ double _boost = obj.getBoost();
+ magnitudeScoringFunction.setBoost(_boost);
+
+ if (obj.getParameters() != null) {
+ MagnitudeScoringParameters _parameters = MagnitudeScoringParametersConverter.map(obj.getParameters());
+ magnitudeScoringFunction.setParameters(_parameters);
+ }
+ return magnitudeScoringFunction;
+ }
+
+ /**
+ * Maps from {@link MagnitudeScoringFunction} to
+ * {@link com.azure.search.documents.implementation.models.MagnitudeScoringFunction}.
+ */
+ public static com.azure.search.documents.implementation.models.MagnitudeScoringFunction map(MagnitudeScoringFunction obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.MagnitudeScoringFunction magnitudeScoringFunction =
+ new com.azure.search.documents.implementation.models.MagnitudeScoringFunction();
+
+ if (obj.getInterpolation() != null) {
+ com.azure.search.documents.implementation.models.ScoringFunctionInterpolation _interpolation =
+ ScoringFunctionInterpolationConverter.map(obj.getInterpolation());
+ magnitudeScoringFunction.setInterpolation(_interpolation);
+ }
+
+ String _fieldName = obj.getFieldName();
+ magnitudeScoringFunction.setFieldName(_fieldName);
+
+ double _boost = obj.getBoost();
+ magnitudeScoringFunction.setBoost(_boost);
+
+ if (obj.getParameters() != null) {
+ com.azure.search.documents.implementation.models.MagnitudeScoringParameters _parameters =
+ MagnitudeScoringParametersConverter.map(obj.getParameters());
+ magnitudeScoringFunction.setParameters(_parameters);
+ }
+ return magnitudeScoringFunction;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MagnitudeScoringParametersConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MagnitudeScoringParametersConverter.java
new file mode 100644
index 000000000000..e3a9246b3c4b
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MagnitudeScoringParametersConverter.java
@@ -0,0 +1,58 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.MagnitudeScoringParameters;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.MagnitudeScoringParameters} and
+ * {@link MagnitudeScoringParameters}.
+ */
+public final class MagnitudeScoringParametersConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(MagnitudeScoringParametersConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.MagnitudeScoringParameters} to
+ * {@link MagnitudeScoringParameters}.
+ */
+ public static MagnitudeScoringParameters map(com.azure.search.documents.implementation.models.MagnitudeScoringParameters obj) {
+ if (obj == null) {
+ return null;
+ }
+ MagnitudeScoringParameters magnitudeScoringParameters = new MagnitudeScoringParameters();
+
+ double _boostingRangeStart = obj.getBoostingRangeStart();
+ magnitudeScoringParameters.setBoostingRangeStart(_boostingRangeStart);
+
+ double _boostingRangeEnd = obj.getBoostingRangeEnd();
+ magnitudeScoringParameters.setBoostingRangeEnd(_boostingRangeEnd);
+
+ Boolean _shouldBoostBeyondRangeByConstant = obj.isShouldBoostBeyondRangeByConstant();
+ magnitudeScoringParameters.setShouldBoostBeyondRangeByConstant(_shouldBoostBeyondRangeByConstant);
+ return magnitudeScoringParameters;
+ }
+
+ /**
+ * Maps from {@link MagnitudeScoringParameters} to
+ * {@link com.azure.search.documents.implementation.models.MagnitudeScoringParameters}.
+ */
+ public static com.azure.search.documents.implementation.models.MagnitudeScoringParameters map(MagnitudeScoringParameters obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.MagnitudeScoringParameters magnitudeScoringParameters =
+ new com.azure.search.documents.implementation.models.MagnitudeScoringParameters();
+
+ double _boostingRangeStart = obj.getBoostingRangeStart();
+ magnitudeScoringParameters.setBoostingRangeStart(_boostingRangeStart);
+
+ double _boostingRangeEnd = obj.getBoostingRangeEnd();
+ magnitudeScoringParameters.setBoostingRangeEnd(_boostingRangeEnd);
+
+ Boolean _shouldBoostBeyondRangeByConstant = obj.shouldBoostBeyondRangeByConstant();
+ magnitudeScoringParameters.setShouldBoostBeyondRangeByConstant(_shouldBoostBeyondRangeByConstant);
+ return magnitudeScoringParameters;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MappingCharFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MappingCharFilterConverter.java
new file mode 100644
index 000000000000..e8c1d45b48bf
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MappingCharFilterConverter.java
@@ -0,0 +1,60 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.MappingCharFilter;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.MappingCharFilter} and
+ * {@link MappingCharFilter}.
+ */
+public final class MappingCharFilterConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(MappingCharFilterConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.MappingCharFilter} to
+ * {@link MappingCharFilter}.
+ */
+ public static MappingCharFilter map(com.azure.search.documents.implementation.models.MappingCharFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ MappingCharFilter mappingCharFilter = new MappingCharFilter();
+
+ String _name = obj.getName();
+ mappingCharFilter.setName(_name);
+
+ if (obj.getMappings() != null) {
+ List _mappings = new ArrayList<>(obj.getMappings());
+ mappingCharFilter.setMappings(_mappings);
+ }
+ return mappingCharFilter;
+ }
+
+ /**
+ * Maps from {@link MappingCharFilter} to
+ * {@link com.azure.search.documents.implementation.models.MappingCharFilter}.
+ */
+ public static com.azure.search.documents.implementation.models.MappingCharFilter map(MappingCharFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.MappingCharFilter mappingCharFilter =
+ new com.azure.search.documents.implementation.models.MappingCharFilter();
+
+ String _name = obj.getName();
+ mappingCharFilter.setName(_name);
+
+ if (obj.getMappings() != null) {
+ List _mappings = new ArrayList<>(obj.getMappings());
+ mappingCharFilter.setMappings(_mappings);
+ }
+ return mappingCharFilter;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MergeSkillConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MergeSkillConverter.java
new file mode 100644
index 000000000000..fa365d1dd254
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MergeSkillConverter.java
@@ -0,0 +1,96 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.InputFieldMappingEntry;
+import com.azure.search.documents.models.MergeSkill;
+import com.azure.search.documents.models.OutputFieldMappingEntry;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.MergeSkill} and {@link MergeSkill}.
+ */
+public final class MergeSkillConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(MergeSkillConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.MergeSkill} to {@link MergeSkill}.
+ */
+ public static MergeSkill map(com.azure.search.documents.implementation.models.MergeSkill obj) {
+ if (obj == null) {
+ return null;
+ }
+ MergeSkill mergeSkill = new MergeSkill();
+
+ if (obj.getOutputs() != null) {
+ List _outputs =
+ obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ mergeSkill.setOutputs(_outputs);
+ }
+
+ if (obj.getInputs() != null) {
+ List _inputs =
+ obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ mergeSkill.setInputs(_inputs);
+ }
+
+ String _name = obj.getName();
+ mergeSkill.setName(_name);
+
+ String _context = obj.getContext();
+ mergeSkill.setContext(_context);
+
+ String _description = obj.getDescription();
+ mergeSkill.setDescription(_description);
+
+ String _insertPostTag = obj.getInsertPostTag();
+ mergeSkill.setInsertPostTag(_insertPostTag);
+
+ String _insertPreTag = obj.getInsertPreTag();
+ mergeSkill.setInsertPreTag(_insertPreTag);
+ return mergeSkill;
+ }
+
+ /**
+ * Maps from {@link MergeSkill} to {@link com.azure.search.documents.implementation.models.MergeSkill}.
+ */
+ public static com.azure.search.documents.implementation.models.MergeSkill map(MergeSkill obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.MergeSkill mergeSkill =
+ new com.azure.search.documents.implementation.models.MergeSkill();
+
+ if (obj.getOutputs() != null) {
+ List _outputs =
+ obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ mergeSkill.setOutputs(_outputs);
+ }
+
+ if (obj.getInputs() != null) {
+ List _inputs =
+ obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ mergeSkill.setInputs(_inputs);
+ }
+
+ String _name = obj.getName();
+ mergeSkill.setName(_name);
+
+ String _context = obj.getContext();
+ mergeSkill.setContext(_context);
+
+ String _description = obj.getDescription();
+ mergeSkill.setDescription(_description);
+
+ String _insertPostTag = obj.getInsertPostTag();
+ mergeSkill.setInsertPostTag(_insertPostTag);
+
+ String _insertPreTag = obj.getInsertPreTag();
+ mergeSkill.setInsertPreTag(_insertPreTag);
+ return mergeSkill;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MicrosoftLanguageStemmingTokenizerConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MicrosoftLanguageStemmingTokenizerConverter.java
new file mode 100644
index 000000000000..b6f198d9ee3e
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MicrosoftLanguageStemmingTokenizerConverter.java
@@ -0,0 +1,71 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.MicrosoftLanguageStemmingTokenizer;
+import com.azure.search.documents.models.MicrosoftStemmingTokenizerLanguage;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.MicrosoftLanguageStemmingTokenizer}
+ * and {@link MicrosoftLanguageStemmingTokenizer}.
+ */
+public final class MicrosoftLanguageStemmingTokenizerConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(MicrosoftLanguageStemmingTokenizerConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.MicrosoftLanguageStemmingTokenizer} to
+ * {@link MicrosoftLanguageStemmingTokenizer}.
+ */
+ public static MicrosoftLanguageStemmingTokenizer map(com.azure.search.documents.implementation.models.MicrosoftLanguageStemmingTokenizer obj) {
+ if (obj == null) {
+ return null;
+ }
+ MicrosoftLanguageStemmingTokenizer microsoftLanguageStemmingTokenizer =
+ new MicrosoftLanguageStemmingTokenizer();
+
+ String _name = obj.getName();
+ microsoftLanguageStemmingTokenizer.setName(_name);
+
+ Integer _maxTokenLength = obj.getMaxTokenLength();
+ microsoftLanguageStemmingTokenizer.setMaxTokenLength(_maxTokenLength);
+
+ if (obj.getLanguage() != null) {
+ MicrosoftStemmingTokenizerLanguage _language =
+ MicrosoftStemmingTokenizerLanguageConverter.map(obj.getLanguage());
+ microsoftLanguageStemmingTokenizer.setLanguage(_language);
+ }
+
+ Boolean _isSearchTokenizer = obj.isSearchTokenizer();
+ microsoftLanguageStemmingTokenizer.setIsSearchTokenizer(_isSearchTokenizer);
+ return microsoftLanguageStemmingTokenizer;
+ }
+
+ /**
+ * Maps from {@link MicrosoftLanguageStemmingTokenizer} to
+ * {@link com.azure.search.documents.implementation.models.MicrosoftLanguageStemmingTokenizer}.
+ */
+ public static com.azure.search.documents.implementation.models.MicrosoftLanguageStemmingTokenizer map(MicrosoftLanguageStemmingTokenizer obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.MicrosoftLanguageStemmingTokenizer microsoftLanguageStemmingTokenizer = new com.azure.search.documents.implementation.models.MicrosoftLanguageStemmingTokenizer();
+
+ String _name = obj.getName();
+ microsoftLanguageStemmingTokenizer.setName(_name);
+
+ Integer _maxTokenLength = obj.getMaxTokenLength();
+ microsoftLanguageStemmingTokenizer.setMaxTokenLength(_maxTokenLength);
+
+ if (obj.getLanguage() != null) {
+ com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage _language =
+ MicrosoftStemmingTokenizerLanguageConverter.map(obj.getLanguage());
+ microsoftLanguageStemmingTokenizer.setLanguage(_language);
+ }
+
+ Boolean _isSearchTokenizer = obj.isSearchTokenizer();
+ microsoftLanguageStemmingTokenizer.setIsSearchTokenizer(_isSearchTokenizer);
+ return microsoftLanguageStemmingTokenizer;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MicrosoftLanguageTokenizerConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MicrosoftLanguageTokenizerConverter.java
new file mode 100644
index 000000000000..3fea9015f293
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MicrosoftLanguageTokenizerConverter.java
@@ -0,0 +1,70 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.MicrosoftLanguageTokenizer;
+import com.azure.search.documents.models.MicrosoftTokenizerLanguage;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.MicrosoftLanguageTokenizer} and
+ * {@link MicrosoftLanguageTokenizer}.
+ */
+public final class MicrosoftLanguageTokenizerConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(MicrosoftLanguageTokenizerConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.MicrosoftLanguageTokenizer} to
+ * {@link MicrosoftLanguageTokenizer}.
+ */
+ public static MicrosoftLanguageTokenizer map(com.azure.search.documents.implementation.models.MicrosoftLanguageTokenizer obj) {
+ if (obj == null) {
+ return null;
+ }
+ MicrosoftLanguageTokenizer microsoftLanguageTokenizer = new MicrosoftLanguageTokenizer();
+
+ String _name = obj.getName();
+ microsoftLanguageTokenizer.setName(_name);
+
+ Integer _maxTokenLength = obj.getMaxTokenLength();
+ microsoftLanguageTokenizer.setMaxTokenLength(_maxTokenLength);
+
+ if (obj.getLanguage() != null) {
+ MicrosoftTokenizerLanguage _language = MicrosoftTokenizerLanguageConverter.map(obj.getLanguage());
+ microsoftLanguageTokenizer.setLanguage(_language);
+ }
+
+ Boolean _isSearchTokenizer = obj.isSearchTokenizer();
+ microsoftLanguageTokenizer.setIsSearchTokenizer(_isSearchTokenizer);
+ return microsoftLanguageTokenizer;
+ }
+
+ /**
+ * Maps from {@link MicrosoftLanguageTokenizer} to
+ * {@link com.azure.search.documents.implementation.models.MicrosoftLanguageTokenizer}.
+ */
+ public static com.azure.search.documents.implementation.models.MicrosoftLanguageTokenizer map(MicrosoftLanguageTokenizer obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.MicrosoftLanguageTokenizer microsoftLanguageTokenizer =
+ new com.azure.search.documents.implementation.models.MicrosoftLanguageTokenizer();
+
+ String _name = obj.getName();
+ microsoftLanguageTokenizer.setName(_name);
+
+ Integer _maxTokenLength = obj.getMaxTokenLength();
+ microsoftLanguageTokenizer.setMaxTokenLength(_maxTokenLength);
+
+ if (obj.getLanguage() != null) {
+ com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage _language =
+ MicrosoftTokenizerLanguageConverter.map(obj.getLanguage());
+ microsoftLanguageTokenizer.setLanguage(_language);
+ }
+
+ Boolean _isSearchTokenizer = obj.isSearchTokenizer();
+ microsoftLanguageTokenizer.setIsSearchTokenizer(_isSearchTokenizer);
+ return microsoftLanguageTokenizer;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MicrosoftStemmingTokenizerLanguageConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MicrosoftStemmingTokenizerLanguageConverter.java
new file mode 100644
index 000000000000..b716a7c83679
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MicrosoftStemmingTokenizerLanguageConverter.java
@@ -0,0 +1,226 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.MicrosoftStemmingTokenizerLanguage;
+
+import static com.azure.search.documents.implementation.util.Constants.ENUM_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ENUM_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage}
+ * and {@link MicrosoftStemmingTokenizerLanguage}.
+ */
+public final class MicrosoftStemmingTokenizerLanguageConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(MicrosoftStemmingTokenizerLanguageConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage} to
+ * enum {@link MicrosoftStemmingTokenizerLanguage}.
+ */
+ public static MicrosoftStemmingTokenizerLanguage map(com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case ARABIC:
+ return MicrosoftStemmingTokenizerLanguage.ARABIC;
+ case BANGLA:
+ return MicrosoftStemmingTokenizerLanguage.BANGLA;
+ case BULGARIAN:
+ return MicrosoftStemmingTokenizerLanguage.BULGARIAN;
+ case CATALAN:
+ return MicrosoftStemmingTokenizerLanguage.CATALAN;
+ case CROATIAN:
+ return MicrosoftStemmingTokenizerLanguage.CROATIAN;
+ case CZECH:
+ return MicrosoftStemmingTokenizerLanguage.CZECH;
+ case DANISH:
+ return MicrosoftStemmingTokenizerLanguage.DANISH;
+ case DUTCH:
+ return MicrosoftStemmingTokenizerLanguage.DUTCH;
+ case ENGLISH:
+ return MicrosoftStemmingTokenizerLanguage.ENGLISH;
+ case ESTONIAN:
+ return MicrosoftStemmingTokenizerLanguage.ESTONIAN;
+ case FINNISH:
+ return MicrosoftStemmingTokenizerLanguage.FINNISH;
+ case FRENCH:
+ return MicrosoftStemmingTokenizerLanguage.FRENCH;
+ case GERMAN:
+ return MicrosoftStemmingTokenizerLanguage.GERMAN;
+ case GREEK:
+ return MicrosoftStemmingTokenizerLanguage.GREEK;
+ case GUJARATI:
+ return MicrosoftStemmingTokenizerLanguage.GUJARATI;
+ case HEBREW:
+ return MicrosoftStemmingTokenizerLanguage.HEBREW;
+ case HINDI:
+ return MicrosoftStemmingTokenizerLanguage.HINDI;
+ case HUNGARIAN:
+ return MicrosoftStemmingTokenizerLanguage.HUNGARIAN;
+ case ICELANDIC:
+ return MicrosoftStemmingTokenizerLanguage.ICELANDIC;
+ case INDONESIAN:
+ return MicrosoftStemmingTokenizerLanguage.INDONESIAN;
+ case ITALIAN:
+ return MicrosoftStemmingTokenizerLanguage.ITALIAN;
+ case KANNADA:
+ return MicrosoftStemmingTokenizerLanguage.KANNADA;
+ case LATVIAN:
+ return MicrosoftStemmingTokenizerLanguage.LATVIAN;
+ case LITHUANIAN:
+ return MicrosoftStemmingTokenizerLanguage.LITHUANIAN;
+ case MALAY:
+ return MicrosoftStemmingTokenizerLanguage.MALAY;
+ case MALAYALAM:
+ return MicrosoftStemmingTokenizerLanguage.MALAYALAM;
+ case MARATHI:
+ return MicrosoftStemmingTokenizerLanguage.MARATHI;
+ case NORWEGIAN_BOKMAAL:
+ return MicrosoftStemmingTokenizerLanguage.NORWEGIAN_BOKMAAL;
+ case POLISH:
+ return MicrosoftStemmingTokenizerLanguage.POLISH;
+ case PORTUGUESE:
+ return MicrosoftStemmingTokenizerLanguage.PORTUGUESE;
+ case PORTUGUESE_BRAZILIAN:
+ return MicrosoftStemmingTokenizerLanguage.PORTUGUESE_BRAZILIAN;
+ case PUNJABI:
+ return MicrosoftStemmingTokenizerLanguage.PUNJABI;
+ case ROMANIAN:
+ return MicrosoftStemmingTokenizerLanguage.ROMANIAN;
+ case RUSSIAN:
+ return MicrosoftStemmingTokenizerLanguage.RUSSIAN;
+ case SERBIAN_CYRILLIC:
+ return MicrosoftStemmingTokenizerLanguage.SERBIAN_CYRILLIC;
+ case SERBIAN_LATIN:
+ return MicrosoftStemmingTokenizerLanguage.SERBIAN_LATIN;
+ case SLOVAK:
+ return MicrosoftStemmingTokenizerLanguage.SLOVAK;
+ case SLOVENIAN:
+ return MicrosoftStemmingTokenizerLanguage.SLOVENIAN;
+ case SPANISH:
+ return MicrosoftStemmingTokenizerLanguage.SPANISH;
+ case SWEDISH:
+ return MicrosoftStemmingTokenizerLanguage.SWEDISH;
+ case TAMIL:
+ return MicrosoftStemmingTokenizerLanguage.TAMIL;
+ case TELUGU:
+ return MicrosoftStemmingTokenizerLanguage.TELUGU;
+ case TURKISH:
+ return MicrosoftStemmingTokenizerLanguage.TURKISH;
+ case UKRAINIAN:
+ return MicrosoftStemmingTokenizerLanguage.UKRAINIAN;
+ case URDU:
+ return MicrosoftStemmingTokenizerLanguage.URDU;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_EXTERNAL_ERROR_MSG, obj)));
+ }
+ }
+
+ /**
+ * Maps from enum {@link MicrosoftStemmingTokenizerLanguage} to enum
+ * {@link com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage}.
+ */
+ public static com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage map(MicrosoftStemmingTokenizerLanguage obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case ARABIC:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.ARABIC;
+ case BANGLA:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.BANGLA;
+ case BULGARIAN:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.BULGARIAN;
+ case CATALAN:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.CATALAN;
+ case CROATIAN:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.CROATIAN;
+ case CZECH:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.CZECH;
+ case DANISH:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.DANISH;
+ case DUTCH:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.DUTCH;
+ case ENGLISH:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.ENGLISH;
+ case ESTONIAN:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.ESTONIAN;
+ case FINNISH:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.FINNISH;
+ case FRENCH:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.FRENCH;
+ case GERMAN:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.GERMAN;
+ case GREEK:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.GREEK;
+ case GUJARATI:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.GUJARATI;
+ case HEBREW:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.HEBREW;
+ case HINDI:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.HINDI;
+ case HUNGARIAN:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.HUNGARIAN;
+ case ICELANDIC:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.ICELANDIC;
+ case INDONESIAN:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.INDONESIAN;
+ case ITALIAN:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.ITALIAN;
+ case KANNADA:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.KANNADA;
+ case LATVIAN:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.LATVIAN;
+ case LITHUANIAN:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.LITHUANIAN;
+ case MALAY:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.MALAY;
+ case MALAYALAM:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.MALAYALAM;
+ case MARATHI:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.MARATHI;
+ case NORWEGIAN_BOKMAAL:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.NORWEGIAN_BOKMAAL;
+ case POLISH:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.POLISH;
+ case PORTUGUESE:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.PORTUGUESE;
+ case PORTUGUESE_BRAZILIAN:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.PORTUGUESE_BRAZILIAN;
+ case PUNJABI:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.PUNJABI;
+ case ROMANIAN:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.ROMANIAN;
+ case RUSSIAN:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.RUSSIAN;
+ case SERBIAN_CYRILLIC:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.SERBIAN_CYRILLIC;
+ case SERBIAN_LATIN:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.SERBIAN_LATIN;
+ case SLOVAK:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.SLOVAK;
+ case SLOVENIAN:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.SLOVENIAN;
+ case SPANISH:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.SPANISH;
+ case SWEDISH:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.SWEDISH;
+ case TAMIL:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.TAMIL;
+ case TELUGU:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.TELUGU;
+ case TURKISH:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.TURKISH;
+ case UKRAINIAN:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.UKRAINIAN;
+ case URDU:
+ return com.azure.search.documents.implementation.models.MicrosoftStemmingTokenizerLanguage.URDU;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj)));
+ }
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MicrosoftTokenizerLanguageConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MicrosoftTokenizerLanguageConverter.java
new file mode 100644
index 000000000000..4924ae396f1d
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/MicrosoftTokenizerLanguageConverter.java
@@ -0,0 +1,214 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.MicrosoftTokenizerLanguage;
+
+import static com.azure.search.documents.implementation.util.Constants.ENUM_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ENUM_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage} and
+ * {@link MicrosoftTokenizerLanguage}.
+ */
+public final class MicrosoftTokenizerLanguageConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(MicrosoftTokenizerLanguageConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage} to enum
+ * {@link MicrosoftTokenizerLanguage}.
+ */
+ public static MicrosoftTokenizerLanguage map(com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case BANGLA:
+ return MicrosoftTokenizerLanguage.BANGLA;
+ case BULGARIAN:
+ return MicrosoftTokenizerLanguage.BULGARIAN;
+ case CATALAN:
+ return MicrosoftTokenizerLanguage.CATALAN;
+ case CHINESE_SIMPLIFIED:
+ return MicrosoftTokenizerLanguage.CHINESE_SIMPLIFIED;
+ case CHINESE_TRADITIONAL:
+ return MicrosoftTokenizerLanguage.CHINESE_TRADITIONAL;
+ case CROATIAN:
+ return MicrosoftTokenizerLanguage.CROATIAN;
+ case CZECH:
+ return MicrosoftTokenizerLanguage.CZECH;
+ case DANISH:
+ return MicrosoftTokenizerLanguage.DANISH;
+ case DUTCH:
+ return MicrosoftTokenizerLanguage.DUTCH;
+ case ENGLISH:
+ return MicrosoftTokenizerLanguage.ENGLISH;
+ case FRENCH:
+ return MicrosoftTokenizerLanguage.FRENCH;
+ case GERMAN:
+ return MicrosoftTokenizerLanguage.GERMAN;
+ case GREEK:
+ return MicrosoftTokenizerLanguage.GREEK;
+ case GUJARATI:
+ return MicrosoftTokenizerLanguage.GUJARATI;
+ case HINDI:
+ return MicrosoftTokenizerLanguage.HINDI;
+ case ICELANDIC:
+ return MicrosoftTokenizerLanguage.ICELANDIC;
+ case INDONESIAN:
+ return MicrosoftTokenizerLanguage.INDONESIAN;
+ case ITALIAN:
+ return MicrosoftTokenizerLanguage.ITALIAN;
+ case JAPANESE:
+ return MicrosoftTokenizerLanguage.JAPANESE;
+ case KANNADA:
+ return MicrosoftTokenizerLanguage.KANNADA;
+ case KOREAN:
+ return MicrosoftTokenizerLanguage.KOREAN;
+ case MALAY:
+ return MicrosoftTokenizerLanguage.MALAY;
+ case MALAYALAM:
+ return MicrosoftTokenizerLanguage.MALAYALAM;
+ case MARATHI:
+ return MicrosoftTokenizerLanguage.MARATHI;
+ case NORWEGIAN_BOKMAAL:
+ return MicrosoftTokenizerLanguage.NORWEGIAN_BOKMAAL;
+ case POLISH:
+ return MicrosoftTokenizerLanguage.POLISH;
+ case PORTUGUESE:
+ return MicrosoftTokenizerLanguage.PORTUGUESE;
+ case PORTUGUESE_BRAZILIAN:
+ return MicrosoftTokenizerLanguage.PORTUGUESE_BRAZILIAN;
+ case PUNJABI:
+ return MicrosoftTokenizerLanguage.PUNJABI;
+ case ROMANIAN:
+ return MicrosoftTokenizerLanguage.ROMANIAN;
+ case RUSSIAN:
+ return MicrosoftTokenizerLanguage.RUSSIAN;
+ case SERBIAN_CYRILLIC:
+ return MicrosoftTokenizerLanguage.SERBIAN_CYRILLIC;
+ case SERBIAN_LATIN:
+ return MicrosoftTokenizerLanguage.SERBIAN_LATIN;
+ case SLOVENIAN:
+ return MicrosoftTokenizerLanguage.SLOVENIAN;
+ case SPANISH:
+ return MicrosoftTokenizerLanguage.SPANISH;
+ case SWEDISH:
+ return MicrosoftTokenizerLanguage.SWEDISH;
+ case TAMIL:
+ return MicrosoftTokenizerLanguage.TAMIL;
+ case TELUGU:
+ return MicrosoftTokenizerLanguage.TELUGU;
+ case THAI:
+ return MicrosoftTokenizerLanguage.THAI;
+ case UKRAINIAN:
+ return MicrosoftTokenizerLanguage.UKRAINIAN;
+ case URDU:
+ return MicrosoftTokenizerLanguage.URDU;
+ case VIETNAMESE:
+ return MicrosoftTokenizerLanguage.VIETNAMESE;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_EXTERNAL_ERROR_MSG, obj)));
+ }
+ }
+
+ /**
+ * Maps from enum {@link MicrosoftTokenizerLanguage} to enum
+ * {@link com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage}.
+ */
+ public static com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage map(MicrosoftTokenizerLanguage obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case BANGLA:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.BANGLA;
+ case BULGARIAN:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.BULGARIAN;
+ case CATALAN:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.CATALAN;
+ case CHINESE_SIMPLIFIED:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.CHINESE_SIMPLIFIED;
+ case CHINESE_TRADITIONAL:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.CHINESE_TRADITIONAL;
+ case CROATIAN:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.CROATIAN;
+ case CZECH:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.CZECH;
+ case DANISH:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.DANISH;
+ case DUTCH:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.DUTCH;
+ case ENGLISH:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.ENGLISH;
+ case FRENCH:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.FRENCH;
+ case GERMAN:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.GERMAN;
+ case GREEK:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.GREEK;
+ case GUJARATI:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.GUJARATI;
+ case HINDI:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.HINDI;
+ case ICELANDIC:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.ICELANDIC;
+ case INDONESIAN:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.INDONESIAN;
+ case ITALIAN:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.ITALIAN;
+ case JAPANESE:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.JAPANESE;
+ case KANNADA:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.KANNADA;
+ case KOREAN:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.KOREAN;
+ case MALAY:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.MALAY;
+ case MALAYALAM:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.MALAYALAM;
+ case MARATHI:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.MARATHI;
+ case NORWEGIAN_BOKMAAL:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.NORWEGIAN_BOKMAAL;
+ case POLISH:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.POLISH;
+ case PORTUGUESE:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.PORTUGUESE;
+ case PORTUGUESE_BRAZILIAN:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.PORTUGUESE_BRAZILIAN;
+ case PUNJABI:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.PUNJABI;
+ case ROMANIAN:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.ROMANIAN;
+ case RUSSIAN:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.RUSSIAN;
+ case SERBIAN_CYRILLIC:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.SERBIAN_CYRILLIC;
+ case SERBIAN_LATIN:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.SERBIAN_LATIN;
+ case SLOVENIAN:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.SLOVENIAN;
+ case SPANISH:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.SPANISH;
+ case SWEDISH:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.SWEDISH;
+ case TAMIL:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.TAMIL;
+ case TELUGU:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.TELUGU;
+ case THAI:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.THAI;
+ case UKRAINIAN:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.UKRAINIAN;
+ case URDU:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.URDU;
+ case VIETNAMESE:
+ return com.azure.search.documents.implementation.models.MicrosoftTokenizerLanguage.VIETNAMESE;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj)));
+ }
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/NGramTokenFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/NGramTokenFilterConverter.java
new file mode 100644
index 000000000000..bfb4a0954095
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/NGramTokenFilterConverter.java
@@ -0,0 +1,56 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.NGramTokenFilter;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.NGramTokenFilter} and
+ * {@link NGramTokenFilter}.
+ */
+public final class NGramTokenFilterConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(NGramTokenFilterConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.NGramTokenFilter} to {@link NGramTokenFilter}.
+ */
+ public static NGramTokenFilter map(com.azure.search.documents.implementation.models.NGramTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ NGramTokenFilter nGramTokenFilter = new NGramTokenFilter();
+
+ String _name = obj.getName();
+ nGramTokenFilter.setName(_name);
+
+ Integer _maxGram = obj.getMaxGram();
+ nGramTokenFilter.setMaxGram(_maxGram);
+
+ Integer _minGram = obj.getMinGram();
+ nGramTokenFilter.setMinGram(_minGram);
+ return nGramTokenFilter;
+ }
+
+ /**
+ * Maps from {@link NGramTokenFilter} to {@link com.azure.search.documents.implementation.models.NGramTokenFilter}.
+ */
+ public static com.azure.search.documents.implementation.models.NGramTokenFilter map(NGramTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.NGramTokenFilter nGramTokenFilter =
+ new com.azure.search.documents.implementation.models.NGramTokenFilter();
+
+ String _name = obj.getName();
+ nGramTokenFilter.setName(_name);
+
+ Integer _maxGram = obj.getMaxGram();
+ nGramTokenFilter.setMaxGram(_maxGram);
+
+ Integer _minGram = obj.getMinGram();
+ nGramTokenFilter.setMinGram(_minGram);
+ return nGramTokenFilter;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/NGramTokenFilterV2Converter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/NGramTokenFilterV2Converter.java
new file mode 100644
index 000000000000..19c6df051ec8
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/NGramTokenFilterV2Converter.java
@@ -0,0 +1,58 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.NGramTokenFilterV2;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.NGramTokenFilterV2} and
+ * {@link NGramTokenFilterV2}.
+ */
+public final class NGramTokenFilterV2Converter {
+ private static final ClientLogger LOGGER = new ClientLogger(NGramTokenFilterV2Converter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.NGramTokenFilterV2} to
+ * {@link NGramTokenFilterV2}.
+ */
+ public static NGramTokenFilterV2 map(com.azure.search.documents.implementation.models.NGramTokenFilterV2 obj) {
+ if (obj == null) {
+ return null;
+ }
+ NGramTokenFilterV2 nGramTokenFilterV2 = new NGramTokenFilterV2();
+
+ String _name = obj.getName();
+ nGramTokenFilterV2.setName(_name);
+
+ Integer _maxGram = obj.getMaxGram();
+ nGramTokenFilterV2.setMaxGram(_maxGram);
+
+ Integer _minGram = obj.getMinGram();
+ nGramTokenFilterV2.setMinGram(_minGram);
+ return nGramTokenFilterV2;
+ }
+
+ /**
+ * Maps from {@link NGramTokenFilterV2} to
+ * {@link com.azure.search.documents.implementation.models.NGramTokenFilterV2}.
+ */
+ public static com.azure.search.documents.implementation.models.NGramTokenFilterV2 map(NGramTokenFilterV2 obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.NGramTokenFilterV2 nGramTokenFilterV2 =
+ new com.azure.search.documents.implementation.models.NGramTokenFilterV2();
+
+ String _name = obj.getName();
+ nGramTokenFilterV2.setName(_name);
+
+ Integer _maxGram = obj.getMaxGram();
+ nGramTokenFilterV2.setMaxGram(_maxGram);
+
+ Integer _minGram = obj.getMinGram();
+ nGramTokenFilterV2.setMinGram(_minGram);
+ return nGramTokenFilterV2;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/NGramTokenizerConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/NGramTokenizerConverter.java
new file mode 100644
index 000000000000..e3ca25f257a9
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/NGramTokenizerConverter.java
@@ -0,0 +1,72 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.NGramTokenizer;
+import com.azure.search.documents.models.TokenCharacterKind;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.NGramTokenizer} and
+ * {@link NGramTokenizer}.
+ */
+public final class NGramTokenizerConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(NGramTokenizerConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.NGramTokenizer} to {@link NGramTokenizer}.
+ */
+ public static NGramTokenizer map(com.azure.search.documents.implementation.models.NGramTokenizer obj) {
+ if (obj == null) {
+ return null;
+ }
+ NGramTokenizer nGramTokenizer = new NGramTokenizer();
+
+ String _name = obj.getName();
+ nGramTokenizer.setName(_name);
+
+ Integer _maxGram = obj.getMaxGram();
+ nGramTokenizer.setMaxGram(_maxGram);
+
+ if (obj.getTokenChars() != null) {
+ List _tokenChars =
+ obj.getTokenChars().stream().map(TokenCharacterKindConverter::map).collect(Collectors.toList());
+ nGramTokenizer.setTokenChars(_tokenChars);
+ }
+
+ Integer _minGram = obj.getMinGram();
+ nGramTokenizer.setMinGram(_minGram);
+ return nGramTokenizer;
+ }
+
+ /**
+ * Maps from {@link NGramTokenizer} to {@link com.azure.search.documents.implementation.models.NGramTokenizer}.
+ */
+ public static com.azure.search.documents.implementation.models.NGramTokenizer map(NGramTokenizer obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.NGramTokenizer nGramTokenizer =
+ new com.azure.search.documents.implementation.models.NGramTokenizer();
+
+ String _name = obj.getName();
+ nGramTokenizer.setName(_name);
+
+ Integer _maxGram = obj.getMaxGram();
+ nGramTokenizer.setMaxGram(_maxGram);
+
+ if (obj.getTokenChars() != null) {
+ List _tokenChars =
+ obj.getTokenChars().stream().map(TokenCharacterKindConverter::map).collect(Collectors.toList());
+ nGramTokenizer.setTokenChars(_tokenChars);
+ }
+
+ Integer _minGram = obj.getMinGram();
+ nGramTokenizer.setMinGram(_minGram);
+ return nGramTokenizer;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/OcrSkillConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/OcrSkillConverter.java
new file mode 100644
index 000000000000..60c04e6c6de2
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/OcrSkillConverter.java
@@ -0,0 +1,115 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.InputFieldMappingEntry;
+import com.azure.search.documents.models.OcrSkill;
+import com.azure.search.documents.models.OcrSkillLanguage;
+import com.azure.search.documents.models.OutputFieldMappingEntry;
+import com.azure.search.documents.models.TextExtractionAlgorithm;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.OcrSkill} and {@link OcrSkill}.
+ */
+public final class OcrSkillConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(OcrSkillConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.OcrSkill} to {@link OcrSkill}.
+ */
+ public static OcrSkill map(com.azure.search.documents.implementation.models.OcrSkill obj) {
+ if (obj == null) {
+ return null;
+ }
+ OcrSkill ocrSkill = new OcrSkill();
+
+ if (obj.getOutputs() != null) {
+ List _outputs =
+ obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ ocrSkill.setOutputs(_outputs);
+ }
+
+ if (obj.getInputs() != null) {
+ List _inputs =
+ obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ ocrSkill.setInputs(_inputs);
+ }
+
+ String _name = obj.getName();
+ ocrSkill.setName(_name);
+
+ String _context = obj.getContext();
+ ocrSkill.setContext(_context);
+
+ String _description = obj.getDescription();
+ ocrSkill.setDescription(_description);
+
+ if (obj.getTextExtractionAlgorithm() != null) {
+ TextExtractionAlgorithm _textExtractionAlgorithm =
+ TextExtractionAlgorithmConverter.map(obj.getTextExtractionAlgorithm());
+ ocrSkill.setTextExtractionAlgorithm(_textExtractionAlgorithm);
+ }
+
+ if (obj.getDefaultLanguageCode() != null) {
+ OcrSkillLanguage _defaultLanguageCode = OcrSkillLanguageConverter.map(obj.getDefaultLanguageCode());
+ ocrSkill.setDefaultLanguageCode(_defaultLanguageCode);
+ }
+
+ Boolean _shouldDetectOrientation = obj.isShouldDetectOrientation();
+ ocrSkill.setShouldDetectOrientation(_shouldDetectOrientation);
+ return ocrSkill;
+ }
+
+ /**
+ * Maps from {@link OcrSkill} to {@link com.azure.search.documents.implementation.models.OcrSkill}.
+ */
+ public static com.azure.search.documents.implementation.models.OcrSkill map(OcrSkill obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.OcrSkill ocrSkill =
+ new com.azure.search.documents.implementation.models.OcrSkill();
+
+ if (obj.getOutputs() != null) {
+ List _outputs =
+ obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ ocrSkill.setOutputs(_outputs);
+ }
+
+ if (obj.getInputs() != null) {
+ List _inputs =
+ obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ ocrSkill.setInputs(_inputs);
+ }
+
+ String _name = obj.getName();
+ ocrSkill.setName(_name);
+
+ String _context = obj.getContext();
+ ocrSkill.setContext(_context);
+
+ String _description = obj.getDescription();
+ ocrSkill.setDescription(_description);
+
+ if (obj.getTextExtractionAlgorithm() != null) {
+ com.azure.search.documents.implementation.models.TextExtractionAlgorithm _textExtractionAlgorithm =
+ TextExtractionAlgorithmConverter.map(obj.getTextExtractionAlgorithm());
+ ocrSkill.setTextExtractionAlgorithm(_textExtractionAlgorithm);
+ }
+
+ if (obj.getDefaultLanguageCode() != null) {
+ com.azure.search.documents.implementation.models.OcrSkillLanguage _defaultLanguageCode =
+ OcrSkillLanguageConverter.map(obj.getDefaultLanguageCode());
+ ocrSkill.setDefaultLanguageCode(_defaultLanguageCode);
+ }
+
+ Boolean _shouldDetectOrientation = obj.shouldDetectOrientation();
+ ocrSkill.setShouldDetectOrientation(_shouldDetectOrientation);
+ return ocrSkill;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/OcrSkillLanguageConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/OcrSkillLanguageConverter.java
new file mode 100644
index 000000000000..ec5e61a1ec13
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/OcrSkillLanguageConverter.java
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.OcrSkillLanguage;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.OcrSkillLanguage} and
+ * {@link OcrSkillLanguage}.
+ */
+public final class OcrSkillLanguageConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(OcrSkillLanguageConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.OcrSkillLanguage} to enum
+ * {@link OcrSkillLanguage}.
+ */
+ public static OcrSkillLanguage map(com.azure.search.documents.implementation.models.OcrSkillLanguage obj) {
+ if (obj == null) {
+ return null;
+ }
+ return OcrSkillLanguage.fromString(obj.toString());
+ }
+
+ /**
+ * Maps from enum {@link OcrSkillLanguage} to enum
+ * {@link com.azure.search.documents.implementation.models.OcrSkillLanguage}.
+ */
+ public static com.azure.search.documents.implementation.models.OcrSkillLanguage map(OcrSkillLanguage obj) {
+ if (obj == null) {
+ return null;
+ }
+ return com.azure.search.documents.implementation.models.OcrSkillLanguage.fromString(obj.toString());
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/OutputFieldMappingEntryConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/OutputFieldMappingEntryConverter.java
new file mode 100644
index 000000000000..1322b385c402
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/OutputFieldMappingEntryConverter.java
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.OutputFieldMappingEntry;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.OutputFieldMappingEntry} and
+ * {@link OutputFieldMappingEntry}.
+ */
+public final class OutputFieldMappingEntryConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(OutputFieldMappingEntryConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.OutputFieldMappingEntry} to
+ * {@link OutputFieldMappingEntry}.
+ */
+ public static OutputFieldMappingEntry map(com.azure.search.documents.implementation.models.OutputFieldMappingEntry obj) {
+ if (obj == null) {
+ return null;
+ }
+ OutputFieldMappingEntry outputFieldMappingEntry = new OutputFieldMappingEntry();
+
+ String _targetName = obj.getTargetName();
+ outputFieldMappingEntry.setTargetName(_targetName);
+
+ String _name = obj.getName();
+ outputFieldMappingEntry.setName(_name);
+ return outputFieldMappingEntry;
+ }
+
+ /**
+ * Maps from {@link OutputFieldMappingEntry} to
+ * {@link com.azure.search.documents.implementation.models.OutputFieldMappingEntry}.
+ */
+ public static com.azure.search.documents.implementation.models.OutputFieldMappingEntry map(OutputFieldMappingEntry obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.OutputFieldMappingEntry outputFieldMappingEntry =
+ new com.azure.search.documents.implementation.models.OutputFieldMappingEntry();
+
+ String _targetName = obj.getTargetName();
+ outputFieldMappingEntry.setTargetName(_targetName);
+
+ String _name = obj.getName();
+ outputFieldMappingEntry.setName(_name);
+ return outputFieldMappingEntry;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PathHierarchyTokenizerV2Converter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PathHierarchyTokenizerV2Converter.java
new file mode 100644
index 000000000000..6e4b0bc9ddcd
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PathHierarchyTokenizerV2Converter.java
@@ -0,0 +1,76 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.PathHierarchyTokenizerV2;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.PathHierarchyTokenizerV2} and
+ * {@link PathHierarchyTokenizerV2}.
+ */
+public final class PathHierarchyTokenizerV2Converter {
+ private static final ClientLogger LOGGER = new ClientLogger(PathHierarchyTokenizerV2Converter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.PathHierarchyTokenizerV2} to
+ * {@link PathHierarchyTokenizerV2}.
+ */
+ public static PathHierarchyTokenizerV2 map(com.azure.search.documents.implementation.models.PathHierarchyTokenizerV2 obj) {
+ if (obj == null) {
+ return null;
+ }
+ PathHierarchyTokenizerV2 pathHierarchyTokenizerV2 = new PathHierarchyTokenizerV2();
+
+ String _name = obj.getName();
+ pathHierarchyTokenizerV2.setName(_name);
+
+ Integer _maxTokenLength = obj.getMaxTokenLength();
+ pathHierarchyTokenizerV2.setMaxTokenLength(_maxTokenLength);
+
+ String _delimiter = obj.getDelimiter();
+ pathHierarchyTokenizerV2.setDelimiter(_delimiter);
+
+ Boolean _reverseTokenOrder = obj.isReverseTokenOrder();
+ pathHierarchyTokenizerV2.setReverseTokenOrder(_reverseTokenOrder);
+
+ Integer _numberOfTokensToSkip = obj.getNumberOfTokensToSkip();
+ pathHierarchyTokenizerV2.setNumberOfTokensToSkip(_numberOfTokensToSkip);
+
+ String _replacement = obj.getReplacement();
+ pathHierarchyTokenizerV2.setReplacement(_replacement);
+ return pathHierarchyTokenizerV2;
+ }
+
+ /**
+ * Maps from {@link PathHierarchyTokenizerV2} to
+ * {@link com.azure.search.documents.implementation.models.PathHierarchyTokenizerV2}.
+ */
+ public static com.azure.search.documents.implementation.models.PathHierarchyTokenizerV2 map(PathHierarchyTokenizerV2 obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.PathHierarchyTokenizerV2 pathHierarchyTokenizerV2 =
+ new com.azure.search.documents.implementation.models.PathHierarchyTokenizerV2();
+
+ String _name = obj.getName();
+ pathHierarchyTokenizerV2.setName(_name);
+
+ Integer _maxTokenLength = obj.getMaxTokenLength();
+ pathHierarchyTokenizerV2.setMaxTokenLength(_maxTokenLength);
+
+ String _delimiter = obj.getDelimiter();
+ pathHierarchyTokenizerV2.setDelimiter(_delimiter);
+
+ Boolean _reverseTokenOrder = obj.isReverseTokenOrder();
+ pathHierarchyTokenizerV2.setReverseTokenOrder(_reverseTokenOrder);
+
+ Integer _numberOfTokensToSkip = obj.getNumberOfTokensToSkip();
+ pathHierarchyTokenizerV2.setNumberOfTokensToSkip(_numberOfTokensToSkip);
+
+ String _replacement = obj.getReplacement();
+ pathHierarchyTokenizerV2.setReplacement(_replacement);
+ return pathHierarchyTokenizerV2;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternAnalyzerConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternAnalyzerConverter.java
new file mode 100644
index 000000000000..e0cf8141e798
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternAnalyzerConverter.java
@@ -0,0 +1,84 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.PatternAnalyzer;
+import com.azure.search.documents.models.RegexFlags;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.PatternAnalyzer} and
+ * {@link PatternAnalyzer}.
+ */
+public final class PatternAnalyzerConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(PatternAnalyzerConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.PatternAnalyzer} to {@link PatternAnalyzer}.
+ */
+ public static PatternAnalyzer map(com.azure.search.documents.implementation.models.PatternAnalyzer obj) {
+ if (obj == null) {
+ return null;
+ }
+ PatternAnalyzer patternAnalyzer = new PatternAnalyzer();
+
+ String _name = obj.getName();
+ patternAnalyzer.setName(_name);
+
+ Boolean _lowerCaseTerms = obj.isLowerCaseTerms();
+ patternAnalyzer.setLowerCaseTerms(_lowerCaseTerms);
+
+ String _pattern = obj.getPattern();
+ patternAnalyzer.setPattern(_pattern);
+
+ if (obj.getFlags() != null) {
+ List regexFlags =
+ Arrays.stream(obj.getFlags().toString().split("\\|")).map(RegexFlags::fromString).collect(Collectors.toList());
+ patternAnalyzer.setFlags(regexFlags);
+ }
+
+ if (obj.getStopwords() != null) {
+ List _stopwords = new ArrayList<>(obj.getStopwords());
+ patternAnalyzer.setStopwords(_stopwords);
+ }
+ return patternAnalyzer;
+ }
+
+ /**
+ * Maps from {@link PatternAnalyzer} to {@link com.azure.search.documents.implementation.models.PatternAnalyzer}.
+ */
+ public static com.azure.search.documents.implementation.models.PatternAnalyzer map(PatternAnalyzer obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.PatternAnalyzer patternAnalyzer =
+ new com.azure.search.documents.implementation.models.PatternAnalyzer();
+
+ String _name = obj.getName();
+ patternAnalyzer.setName(_name);
+
+ Boolean _lowerCaseTerms = obj.isLowerCaseTerms();
+ patternAnalyzer.setLowerCaseTerms(_lowerCaseTerms);
+
+ String _pattern = obj.getPattern();
+ patternAnalyzer.setPattern(_pattern);
+
+ if (obj.getFlags() != null) {
+ String flattenFlags =
+ obj.getFlags().stream().map(RegexFlags::toString).collect(Collectors.joining("|"));
+ patternAnalyzer.setFlags(com.azure.search.documents.implementation.models.RegexFlags.fromString(flattenFlags));
+ }
+
+ if (obj.getStopwords() != null) {
+ List _stopwords = new ArrayList<>(obj.getStopwords());
+ patternAnalyzer.setStopwords(_stopwords);
+ }
+ return patternAnalyzer;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternCaptureTokenFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternCaptureTokenFilterConverter.java
new file mode 100644
index 000000000000..db666473664c
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternCaptureTokenFilterConverter.java
@@ -0,0 +1,66 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.PatternCaptureTokenFilter;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.PatternCaptureTokenFilter} and
+ * {@link PatternCaptureTokenFilter}.
+ */
+public final class PatternCaptureTokenFilterConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(PatternCaptureTokenFilterConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.PatternCaptureTokenFilter} to
+ * {@link PatternCaptureTokenFilter}.
+ */
+ public static PatternCaptureTokenFilter map(com.azure.search.documents.implementation.models.PatternCaptureTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ PatternCaptureTokenFilter patternCaptureTokenFilter = new PatternCaptureTokenFilter();
+
+ String _name = obj.getName();
+ patternCaptureTokenFilter.setName(_name);
+
+ if (obj.getPatterns() != null) {
+ List _patterns = new ArrayList<>(obj.getPatterns());
+ patternCaptureTokenFilter.setPatterns(_patterns);
+ }
+
+ Boolean _preserveOriginal = obj.isPreserveOriginal();
+ patternCaptureTokenFilter.setPreserveOriginal(_preserveOriginal);
+ return patternCaptureTokenFilter;
+ }
+
+ /**
+ * Maps from {@link PatternCaptureTokenFilter} to
+ * {@link com.azure.search.documents.implementation.models.PatternCaptureTokenFilter}.
+ */
+ public static com.azure.search.documents.implementation.models.PatternCaptureTokenFilter map(PatternCaptureTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.PatternCaptureTokenFilter patternCaptureTokenFilter =
+ new com.azure.search.documents.implementation.models.PatternCaptureTokenFilter();
+
+ String _name = obj.getName();
+ patternCaptureTokenFilter.setName(_name);
+
+ if (obj.getPatterns() != null) {
+ List _patterns = new ArrayList<>(obj.getPatterns());
+ patternCaptureTokenFilter.setPatterns(_patterns);
+ }
+
+ Boolean _preserveOriginal = obj.isPreserveOriginal();
+ patternCaptureTokenFilter.setPreserveOriginal(_preserveOriginal);
+ return patternCaptureTokenFilter;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternReplaceCharFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternReplaceCharFilterConverter.java
new file mode 100644
index 000000000000..6a2bf957c402
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternReplaceCharFilterConverter.java
@@ -0,0 +1,58 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.PatternReplaceCharFilter;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.PatternReplaceCharFilter} and
+ * {@link PatternReplaceCharFilter}.
+ */
+public final class PatternReplaceCharFilterConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(PatternReplaceCharFilterConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.PatternReplaceCharFilter} to
+ * {@link PatternReplaceCharFilter}.
+ */
+ public static PatternReplaceCharFilter map(com.azure.search.documents.implementation.models.PatternReplaceCharFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ PatternReplaceCharFilter patternReplaceCharFilter = new PatternReplaceCharFilter();
+
+ String _name = obj.getName();
+ patternReplaceCharFilter.setName(_name);
+
+ String _pattern = obj.getPattern();
+ patternReplaceCharFilter.setPattern(_pattern);
+
+ String _replacement = obj.getReplacement();
+ patternReplaceCharFilter.setReplacement(_replacement);
+ return patternReplaceCharFilter;
+ }
+
+ /**
+ * Maps from {@link PatternReplaceCharFilter} to
+ * {@link com.azure.search.documents.implementation.models.PatternReplaceCharFilter}.
+ */
+ public static com.azure.search.documents.implementation.models.PatternReplaceCharFilter map(PatternReplaceCharFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.PatternReplaceCharFilter patternReplaceCharFilter =
+ new com.azure.search.documents.implementation.models.PatternReplaceCharFilter();
+
+ String _name = obj.getName();
+ patternReplaceCharFilter.setName(_name);
+
+ String _pattern = obj.getPattern();
+ patternReplaceCharFilter.setPattern(_pattern);
+
+ String _replacement = obj.getReplacement();
+ patternReplaceCharFilter.setReplacement(_replacement);
+ return patternReplaceCharFilter;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternReplaceTokenFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternReplaceTokenFilterConverter.java
new file mode 100644
index 000000000000..43d21498b07e
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternReplaceTokenFilterConverter.java
@@ -0,0 +1,58 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.PatternReplaceTokenFilter;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.PatternReplaceTokenFilter} and
+ * {@link PatternReplaceTokenFilter}.
+ */
+public final class PatternReplaceTokenFilterConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(PatternReplaceTokenFilterConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.PatternReplaceTokenFilter} to
+ * {@link PatternReplaceTokenFilter}.
+ */
+ public static PatternReplaceTokenFilter map(com.azure.search.documents.implementation.models.PatternReplaceTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ PatternReplaceTokenFilter patternReplaceTokenFilter = new PatternReplaceTokenFilter();
+
+ String _name = obj.getName();
+ patternReplaceTokenFilter.setName(_name);
+
+ String _pattern = obj.getPattern();
+ patternReplaceTokenFilter.setPattern(_pattern);
+
+ String _replacement = obj.getReplacement();
+ patternReplaceTokenFilter.setReplacement(_replacement);
+ return patternReplaceTokenFilter;
+ }
+
+ /**
+ * Maps from {@link PatternReplaceTokenFilter} to
+ * {@link com.azure.search.documents.implementation.models.PatternReplaceTokenFilter}.
+ */
+ public static com.azure.search.documents.implementation.models.PatternReplaceTokenFilter map(PatternReplaceTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.PatternReplaceTokenFilter patternReplaceTokenFilter =
+ new com.azure.search.documents.implementation.models.PatternReplaceTokenFilter();
+
+ String _name = obj.getName();
+ patternReplaceTokenFilter.setName(_name);
+
+ String _pattern = obj.getPattern();
+ patternReplaceTokenFilter.setPattern(_pattern);
+
+ String _replacement = obj.getReplacement();
+ patternReplaceTokenFilter.setReplacement(_replacement);
+ return patternReplaceTokenFilter;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternTokenizerConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternTokenizerConverter.java
new file mode 100644
index 000000000000..6c1805cb9323
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternTokenizerConverter.java
@@ -0,0 +1,73 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.PatternTokenizer;
+import com.azure.search.documents.models.RegexFlags;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.PatternTokenizer} and
+ * {@link PatternTokenizer}.
+ */
+public final class PatternTokenizerConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(PatternTokenizerConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.PatternTokenizer} to {@link PatternTokenizer}.
+ */
+ public static PatternTokenizer map(com.azure.search.documents.implementation.models.PatternTokenizer obj) {
+ if (obj == null) {
+ return null;
+ }
+ PatternTokenizer patternTokenizer = new PatternTokenizer();
+
+ String _name = obj.getName();
+ patternTokenizer.setName(_name);
+
+ String _pattern = obj.getPattern();
+ patternTokenizer.setPattern(_pattern);
+
+ if (obj.getFlags() != null) {
+ List regexFlags =
+ Arrays.stream(obj.getFlags().toString().split("\\|")).map(RegexFlags::fromString).collect(Collectors.toList());
+ patternTokenizer.setFlags(regexFlags);
+ }
+
+ Integer _group = obj.getGroup();
+ patternTokenizer.setGroup(_group);
+ return patternTokenizer;
+ }
+
+ /**
+ * Maps from {@link PatternTokenizer} to {@link com.azure.search.documents.implementation.models.PatternTokenizer}.
+ */
+ public static com.azure.search.documents.implementation.models.PatternTokenizer map(PatternTokenizer obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.PatternTokenizer patternTokenizer =
+ new com.azure.search.documents.implementation.models.PatternTokenizer();
+
+ String _name = obj.getName();
+ patternTokenizer.setName(_name);
+
+ String _pattern = obj.getPattern();
+ patternTokenizer.setPattern(_pattern);
+
+ if (obj.getFlags() != null) {
+ String flattenFlags =
+ obj.getFlags().stream().map(RegexFlags::toString).collect(Collectors.joining("|"));
+ patternTokenizer.setFlags(com.azure.search.documents.implementation.models.RegexFlags.fromString(flattenFlags));
+ }
+
+ Integer _group = obj.getGroup();
+ patternTokenizer.setGroup(_group);
+ return patternTokenizer;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PhoneticEncoderConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PhoneticEncoderConverter.java
new file mode 100644
index 000000000000..004cfae9283e
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PhoneticEncoderConverter.java
@@ -0,0 +1,90 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.PhoneticEncoder;
+
+import static com.azure.search.documents.implementation.util.Constants.ENUM_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ENUM_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.PhoneticEncoder} and
+ * {@link PhoneticEncoder}.
+ */
+public final class PhoneticEncoderConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(PhoneticEncoderConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.PhoneticEncoder} to enum
+ * {@link PhoneticEncoder}.
+ */
+ public static PhoneticEncoder map(com.azure.search.documents.implementation.models.PhoneticEncoder obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case METAPHONE:
+ return PhoneticEncoder.METAPHONE;
+ case DOUBLE_METAPHONE:
+ return PhoneticEncoder.DOUBLE_METAPHONE;
+ case SOUNDEX:
+ return PhoneticEncoder.SOUNDEX;
+ case REFINED_SOUNDEX:
+ return PhoneticEncoder.REFINED_SOUNDEX;
+ case CAVERPHONE1:
+ return PhoneticEncoder.CAVERPHONE1;
+ case CAVERPHONE2:
+ return PhoneticEncoder.CAVERPHONE2;
+ case COLOGNE:
+ return PhoneticEncoder.COLOGNE;
+ case NYSIIS:
+ return PhoneticEncoder.NYSIIS;
+ case KOELNER_PHONETIK:
+ return PhoneticEncoder.KOELNER_PHONETIK;
+ case HAASE_PHONETIK:
+ return PhoneticEncoder.HAASE_PHONETIK;
+ case BEIDER_MORSE:
+ return PhoneticEncoder.BEIDER_MORSE;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_EXTERNAL_ERROR_MSG, obj)));
+ }
+ }
+
+ /**
+ * Maps from enum {@link PhoneticEncoder} to enum
+ * {@link com.azure.search.documents.implementation.models.PhoneticEncoder}.
+ */
+ public static com.azure.search.documents.implementation.models.PhoneticEncoder map(PhoneticEncoder obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case METAPHONE:
+ return com.azure.search.documents.implementation.models.PhoneticEncoder.METAPHONE;
+ case DOUBLE_METAPHONE:
+ return com.azure.search.documents.implementation.models.PhoneticEncoder.DOUBLE_METAPHONE;
+ case SOUNDEX:
+ return com.azure.search.documents.implementation.models.PhoneticEncoder.SOUNDEX;
+ case REFINED_SOUNDEX:
+ return com.azure.search.documents.implementation.models.PhoneticEncoder.REFINED_SOUNDEX;
+ case CAVERPHONE1:
+ return com.azure.search.documents.implementation.models.PhoneticEncoder.CAVERPHONE1;
+ case CAVERPHONE2:
+ return com.azure.search.documents.implementation.models.PhoneticEncoder.CAVERPHONE2;
+ case COLOGNE:
+ return com.azure.search.documents.implementation.models.PhoneticEncoder.COLOGNE;
+ case NYSIIS:
+ return com.azure.search.documents.implementation.models.PhoneticEncoder.NYSIIS;
+ case KOELNER_PHONETIK:
+ return com.azure.search.documents.implementation.models.PhoneticEncoder.KOELNER_PHONETIK;
+ case HAASE_PHONETIK:
+ return com.azure.search.documents.implementation.models.PhoneticEncoder.HAASE_PHONETIK;
+ case BEIDER_MORSE:
+ return com.azure.search.documents.implementation.models.PhoneticEncoder.BEIDER_MORSE;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj)));
+ }
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PhoneticTokenFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PhoneticTokenFilterConverter.java
new file mode 100644
index 000000000000..19e2b53a48c0
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PhoneticTokenFilterConverter.java
@@ -0,0 +1,64 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.PhoneticEncoder;
+import com.azure.search.documents.models.PhoneticTokenFilter;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.PhoneticTokenFilter} and
+ * {@link PhoneticTokenFilter}.
+ */
+public final class PhoneticTokenFilterConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(PhoneticTokenFilterConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.PhoneticTokenFilter} to
+ * {@link PhoneticTokenFilter}.
+ */
+ public static PhoneticTokenFilter map(com.azure.search.documents.implementation.models.PhoneticTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ PhoneticTokenFilter phoneticTokenFilter = new PhoneticTokenFilter();
+
+ String _name = obj.getName();
+ phoneticTokenFilter.setName(_name);
+
+ Boolean _replaceOriginalTokens = obj.isReplaceOriginalTokens();
+ phoneticTokenFilter.setReplaceOriginalTokens(_replaceOriginalTokens);
+
+ if (obj.getEncoder() != null) {
+ PhoneticEncoder _encoder = PhoneticEncoderConverter.map(obj.getEncoder());
+ phoneticTokenFilter.setEncoder(_encoder);
+ }
+ return phoneticTokenFilter;
+ }
+
+ /**
+ * Maps from {@link PhoneticTokenFilter} to
+ * {@link com.azure.search.documents.implementation.models.PhoneticTokenFilter}.
+ */
+ public static com.azure.search.documents.implementation.models.PhoneticTokenFilter map(PhoneticTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.PhoneticTokenFilter phoneticTokenFilter =
+ new com.azure.search.documents.implementation.models.PhoneticTokenFilter();
+
+ String _name = obj.getName();
+ phoneticTokenFilter.setName(_name);
+
+ Boolean _replaceOriginalTokens = obj.isReplaceOriginalTokens();
+ phoneticTokenFilter.setReplaceOriginalTokens(_replaceOriginalTokens);
+
+ if (obj.getEncoder() != null) {
+ com.azure.search.documents.implementation.models.PhoneticEncoder _encoder =
+ PhoneticEncoderConverter.map(obj.getEncoder());
+ phoneticTokenFilter.setEncoder(_encoder);
+ }
+ return phoneticTokenFilter;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/QueryTypeConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/QueryTypeConverter.java
new file mode 100644
index 000000000000..ac6a2bb515c9
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/QueryTypeConverter.java
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.QueryType;
+
+import static com.azure.search.documents.implementation.util.Constants.ENUM_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ENUM_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.QueryType} and {@link QueryType}.
+ */
+public final class QueryTypeConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(QueryTypeConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.QueryType} to enum {@link QueryType}.
+ */
+ public static QueryType map(com.azure.search.documents.implementation.models.QueryType obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case SIMPLE:
+ return QueryType.SIMPLE;
+ case FULL:
+ return QueryType.FULL;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_EXTERNAL_ERROR_MSG, obj)));
+ }
+ }
+
+ /**
+ * Maps from enum {@link QueryType} to enum {@link com.azure.search.documents.implementation.models.QueryType}.
+ */
+ public static com.azure.search.documents.implementation.models.QueryType map(QueryType obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case SIMPLE:
+ return com.azure.search.documents.implementation.models.QueryType.SIMPLE;
+ case FULL:
+ return com.azure.search.documents.implementation.models.QueryType.FULL;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj)));
+ }
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/RegexFlagsConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/RegexFlagsConverter.java
new file mode 100644
index 000000000000..0b625128d51b
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/RegexFlagsConverter.java
@@ -0,0 +1,34 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.RegexFlags;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.RegexFlags} and {@link RegexFlags}.
+ */
+public final class RegexFlagsConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(RegexFlagsConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.RegexFlags} to enum {@link RegexFlags}.
+ */
+ public static RegexFlags map(com.azure.search.documents.implementation.models.RegexFlags obj) {
+ if (obj == null) {
+ return null;
+ }
+ return RegexFlags.fromString(obj.toString());
+ }
+
+ /**
+ * Maps from enum {@link RegexFlags} to enum {@link com.azure.search.documents.implementation.models.RegexFlags}.
+ */
+ public static com.azure.search.documents.implementation.models.RegexFlags map(RegexFlags obj) {
+ if (obj == null) {
+ return null;
+ }
+ return com.azure.search.documents.implementation.models.RegexFlags.fromString(obj.toString());
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/RequestOptionsConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/RequestOptionsConverter.java
new file mode 100644
index 000000000000..d77b9fbacfb1
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/RequestOptionsConverter.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.RequestOptions;
+
+import java.util.UUID;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.RequestOptions} and
+ * {@link RequestOptions}.
+ */
+public final class RequestOptionsConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(RequestOptionsConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.RequestOptions} to {@link RequestOptions}.
+ */
+ public static RequestOptions map(com.azure.search.documents.implementation.models.RequestOptions obj) {
+ if (obj == null) {
+ return null;
+ }
+ RequestOptions requestOptions = new RequestOptions();
+
+ UUID _xMsClientRequestId = obj.getXMsClientRequestId();
+ requestOptions.setXMsClientRequestId(_xMsClientRequestId);
+ return requestOptions;
+ }
+
+ /**
+ * Maps from {@link RequestOptions} to {@link com.azure.search.documents.implementation.models.RequestOptions}.
+ */
+ public static com.azure.search.documents.implementation.models.RequestOptions map(RequestOptions obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.RequestOptions requestOptions =
+ new com.azure.search.documents.implementation.models.RequestOptions();
+
+ UUID _xMsClientRequestId = obj.getXMsClientRequestId();
+ requestOptions.setXMsClientRequestId(_xMsClientRequestId);
+ return requestOptions;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ResourceCounterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ResourceCounterConverter.java
new file mode 100644
index 000000000000..cf239f5f83ff
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ResourceCounterConverter.java
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.ResourceCounter;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.ResourceCounter} and
+ * {@link ResourceCounter}.
+ */
+public final class ResourceCounterConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(ResourceCounterConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.ResourceCounter} to {@link ResourceCounter}.
+ */
+ public static ResourceCounter map(com.azure.search.documents.implementation.models.ResourceCounter obj) {
+ if (obj == null) {
+ return null;
+ }
+ ResourceCounter resourceCounter = new ResourceCounter();
+
+ long _usage = obj.getUsage();
+ resourceCounter.setUsage(_usage);
+
+ Long _quota = obj.getQuota();
+ resourceCounter.setQuota(_quota);
+ return resourceCounter;
+ }
+
+ /**
+ * Maps from {@link ResourceCounter} to {@link com.azure.search.documents.implementation.models.ResourceCounter}.
+ */
+ public static com.azure.search.documents.implementation.models.ResourceCounter map(ResourceCounter obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.ResourceCounter resourceCounter =
+ new com.azure.search.documents.implementation.models.ResourceCounter();
+
+ long _usage = obj.getUsage();
+ resourceCounter.setUsage(_usage);
+
+ Long _quota = obj.getQuota();
+ resourceCounter.setQuota(_quota);
+ return resourceCounter;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ScoringFunctionAggregationConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ScoringFunctionAggregationConverter.java
new file mode 100644
index 000000000000..27e90f8427d0
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ScoringFunctionAggregationConverter.java
@@ -0,0 +1,66 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.ScoringFunctionAggregation;
+
+import static com.azure.search.documents.implementation.util.Constants.ENUM_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ENUM_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.ScoringFunctionAggregation} and
+ * {@link ScoringFunctionAggregation}.
+ */
+public final class ScoringFunctionAggregationConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(ScoringFunctionAggregationConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.ScoringFunctionAggregation} to enum
+ * {@link ScoringFunctionAggregation}.
+ */
+ public static ScoringFunctionAggregation map(com.azure.search.documents.implementation.models.ScoringFunctionAggregation obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case SUM:
+ return ScoringFunctionAggregation.SUM;
+ case AVERAGE:
+ return ScoringFunctionAggregation.AVERAGE;
+ case MINIMUM:
+ return ScoringFunctionAggregation.MINIMUM;
+ case MAXIMUM:
+ return ScoringFunctionAggregation.MAXIMUM;
+ case FIRST_MATCHING:
+ return ScoringFunctionAggregation.FIRST_MATCHING;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_EXTERNAL_ERROR_MSG, obj)));
+ }
+ }
+
+ /**
+ * Maps from enum {@link ScoringFunctionAggregation} to enum
+ * {@link com.azure.search.documents.implementation.models.ScoringFunctionAggregation}.
+ */
+ public static com.azure.search.documents.implementation.models.ScoringFunctionAggregation map(ScoringFunctionAggregation obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case SUM:
+ return com.azure.search.documents.implementation.models.ScoringFunctionAggregation.SUM;
+ case AVERAGE:
+ return com.azure.search.documents.implementation.models.ScoringFunctionAggregation.AVERAGE;
+ case MINIMUM:
+ return com.azure.search.documents.implementation.models.ScoringFunctionAggregation.MINIMUM;
+ case MAXIMUM:
+ return com.azure.search.documents.implementation.models.ScoringFunctionAggregation.MAXIMUM;
+ case FIRST_MATCHING:
+ return com.azure.search.documents.implementation.models.ScoringFunctionAggregation.FIRST_MATCHING;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj)));
+ }
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ScoringFunctionConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ScoringFunctionConverter.java
new file mode 100644
index 000000000000..d2f75f81caba
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ScoringFunctionConverter.java
@@ -0,0 +1,63 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.implementation.models.DistanceScoringFunction;
+import com.azure.search.documents.implementation.models.FreshnessScoringFunction;
+import com.azure.search.documents.implementation.models.MagnitudeScoringFunction;
+import com.azure.search.documents.implementation.models.TagScoringFunction;
+import com.azure.search.documents.models.ScoringFunction;
+
+import static com.azure.search.documents.implementation.util.Constants.ABSTRACT_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ABSTRACT_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.ScoringFunction} and
+ * {@link ScoringFunction}.
+ */
+public final class ScoringFunctionConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(ScoringFunctionConverter.class);
+
+ /**
+ * Maps abstract class from {@link com.azure.search.documents.implementation.models.ScoringFunction} to
+ * {@link ScoringFunction}. Dedicate works to sub class converter.
+ */
+ public static ScoringFunction map(com.azure.search.documents.implementation.models.ScoringFunction obj) {
+ if (obj instanceof DistanceScoringFunction) {
+ return DistanceScoringFunctionConverter.map((DistanceScoringFunction) obj);
+ }
+ if (obj instanceof MagnitudeScoringFunction) {
+ return MagnitudeScoringFunctionConverter.map((MagnitudeScoringFunction) obj);
+ }
+ if (obj instanceof TagScoringFunction) {
+ return TagScoringFunctionConverter.map((TagScoringFunction) obj);
+ }
+ if (obj instanceof FreshnessScoringFunction) {
+ return FreshnessScoringFunctionConverter.map((FreshnessScoringFunction) obj);
+ }
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_EXTERNAL_ERROR_MSG,
+ obj.getClass().getSimpleName())));
+ }
+
+ /**
+ * Maps abstract class from {@link ScoringFunction} to
+ * {@link com.azure.search.documents.implementation.models.ScoringFunction}. Dedicate works to sub class converter.
+ */
+ public static com.azure.search.documents.implementation.models.ScoringFunction map(ScoringFunction obj) {
+ if (obj instanceof com.azure.search.documents.models.MagnitudeScoringFunction) {
+ return MagnitudeScoringFunctionConverter.map((com.azure.search.documents.models.MagnitudeScoringFunction) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.TagScoringFunction) {
+ return TagScoringFunctionConverter.map((com.azure.search.documents.models.TagScoringFunction) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.FreshnessScoringFunction) {
+ return FreshnessScoringFunctionConverter.map((com.azure.search.documents.models.FreshnessScoringFunction) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.DistanceScoringFunction) {
+ return DistanceScoringFunctionConverter.map((com.azure.search.documents.models.DistanceScoringFunction) obj);
+ }
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_INTERNAL_ERROR_MSG, obj.getClass().getSimpleName())));
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ScoringFunctionInterpolationConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ScoringFunctionInterpolationConverter.java
new file mode 100644
index 000000000000..ebed46cc87f8
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ScoringFunctionInterpolationConverter.java
@@ -0,0 +1,62 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.ScoringFunctionInterpolation;
+
+import static com.azure.search.documents.implementation.util.Constants.ENUM_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ENUM_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.ScoringFunctionInterpolation} and
+ * {@link ScoringFunctionInterpolation}.
+ */
+public final class ScoringFunctionInterpolationConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(ScoringFunctionInterpolationConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.ScoringFunctionInterpolation} to enum
+ * {@link ScoringFunctionInterpolation}.
+ */
+ public static ScoringFunctionInterpolation map(com.azure.search.documents.implementation.models.ScoringFunctionInterpolation obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case LINEAR:
+ return ScoringFunctionInterpolation.LINEAR;
+ case CONSTANT:
+ return ScoringFunctionInterpolation.CONSTANT;
+ case QUADRATIC:
+ return ScoringFunctionInterpolation.QUADRATIC;
+ case LOGARITHMIC:
+ return ScoringFunctionInterpolation.LOGARITHMIC;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_EXTERNAL_ERROR_MSG, obj)));
+ }
+ }
+
+ /**
+ * Maps from enum {@link ScoringFunctionInterpolation} to enum
+ * {@link com.azure.search.documents.implementation.models.ScoringFunctionInterpolation}.
+ */
+ public static com.azure.search.documents.implementation.models.ScoringFunctionInterpolation map(ScoringFunctionInterpolation obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case LINEAR:
+ return com.azure.search.documents.implementation.models.ScoringFunctionInterpolation.LINEAR;
+ case CONSTANT:
+ return com.azure.search.documents.implementation.models.ScoringFunctionInterpolation.CONSTANT;
+ case QUADRATIC:
+ return com.azure.search.documents.implementation.models.ScoringFunctionInterpolation.QUADRATIC;
+ case LOGARITHMIC:
+ return com.azure.search.documents.implementation.models.ScoringFunctionInterpolation.LOGARITHMIC;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj)));
+ }
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ScoringProfileConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ScoringProfileConverter.java
new file mode 100644
index 000000000000..303dbc7d6d6f
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ScoringProfileConverter.java
@@ -0,0 +1,85 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.ScoringFunction;
+import com.azure.search.documents.models.ScoringFunctionAggregation;
+import com.azure.search.documents.models.ScoringProfile;
+import com.azure.search.documents.models.TextWeights;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.ScoringProfile} and
+ * {@link ScoringProfile}.
+ */
+public final class ScoringProfileConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(ScoringProfileConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.ScoringProfile} to {@link ScoringProfile}.
+ */
+ public static ScoringProfile map(com.azure.search.documents.implementation.models.ScoringProfile obj) {
+ if (obj == null) {
+ return null;
+ }
+ ScoringProfile scoringProfile = new ScoringProfile();
+
+ if (obj.getFunctions() != null) {
+ List _functions =
+ obj.getFunctions().stream().map(ScoringFunctionConverter::map).collect(Collectors.toList());
+ scoringProfile.setFunctions(_functions);
+ }
+
+ String _name = obj.getName();
+ scoringProfile.setName(_name);
+
+ if (obj.getTextWeights() != null) {
+ TextWeights _textWeights = TextWeightsConverter.map(obj.getTextWeights());
+ scoringProfile.setTextWeights(_textWeights);
+ }
+
+ if (obj.getFunctionAggregation() != null) {
+ ScoringFunctionAggregation _functionAggregation =
+ ScoringFunctionAggregationConverter.map(obj.getFunctionAggregation());
+ scoringProfile.setFunctionAggregation(_functionAggregation);
+ }
+ return scoringProfile;
+ }
+
+ /**
+ * Maps from {@link ScoringProfile} to {@link com.azure.search.documents.implementation.models.ScoringProfile}.
+ */
+ public static com.azure.search.documents.implementation.models.ScoringProfile map(ScoringProfile obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.ScoringProfile scoringProfile =
+ new com.azure.search.documents.implementation.models.ScoringProfile();
+
+ if (obj.getFunctions() != null) {
+ List _functions =
+ obj.getFunctions().stream().map(ScoringFunctionConverter::map).collect(Collectors.toList());
+ scoringProfile.setFunctions(_functions);
+ }
+
+ String _name = obj.getName();
+ scoringProfile.setName(_name);
+
+ if (obj.getTextWeights() != null) {
+ com.azure.search.documents.implementation.models.TextWeights _textWeights =
+ TextWeightsConverter.map(obj.getTextWeights());
+ scoringProfile.setTextWeights(_textWeights);
+ }
+
+ if (obj.getFunctionAggregation() != null) {
+ com.azure.search.documents.implementation.models.ScoringFunctionAggregation _functionAggregation =
+ ScoringFunctionAggregationConverter.map(obj.getFunctionAggregation());
+ scoringProfile.setFunctionAggregation(_functionAggregation);
+ }
+ return scoringProfile;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchFieldConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchFieldConverter.java
new file mode 100644
index 000000000000..7e5208acffcf
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchFieldConverter.java
@@ -0,0 +1,152 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.LexicalAnalyzerName;
+import com.azure.search.documents.models.SearchField;
+import com.azure.search.documents.models.SearchFieldDataType;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.SearchField} and {@link SearchField}.
+ */
+public final class SearchFieldConverter {
+ private static final ClientLogger LOGGER =
+ new ClientLogger(com.azure.search.documents.implementation.converters.SearchFieldConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.SearchField} to {@link SearchField}.
+ */
+ public static SearchField map(com.azure.search.documents.implementation.models.SearchField obj) {
+ if (obj == null) {
+ return null;
+ }
+ SearchField searchField = new SearchField();
+
+ Boolean _filterable = obj.isFilterable();
+ searchField.setFilterable(_filterable);
+
+ Boolean _hidden = obj.isRetrievable() == null ? null : !obj.isRetrievable();
+ searchField.setHidden(_hidden);
+
+ Boolean _sortable = obj.isSortable();
+ searchField.setSortable(_sortable);
+
+ if (obj.getType() != null) {
+ SearchFieldDataType _type = SearchFieldDataTypeConverter.map(obj.getType());
+ searchField.setType(_type);
+ }
+
+ Boolean _searchable = obj.isSearchable();
+ searchField.setSearchable(_searchable);
+
+ if (obj.getAnalyzer() != null) {
+ LexicalAnalyzerName _analyzer = LexicalAnalyzerNameConverter.map(obj.getAnalyzer());
+ searchField.setAnalyzer(_analyzer);
+ }
+
+ if (obj.getSearchAnalyzer() != null) {
+ LexicalAnalyzerName _searchAnalyzer = LexicalAnalyzerNameConverter.map(obj.getSearchAnalyzer());
+ searchField.setSearchAnalyzer(_searchAnalyzer);
+ }
+
+ String _name = obj.getName();
+ searchField.setName(_name);
+
+ if (obj.getIndexAnalyzer() != null) {
+ LexicalAnalyzerName _indexAnalyzer = LexicalAnalyzerNameConverter.map(obj.getIndexAnalyzer());
+ searchField.setIndexAnalyzer(_indexAnalyzer);
+ }
+
+ Boolean _facetable = obj.isFacetable();
+ searchField.setFacetable(_facetable);
+
+ if (obj.getSynonymMaps() != null) {
+ List _synonymMaps = new ArrayList<>(obj.getSynonymMaps());
+ searchField.setSynonymMaps(_synonymMaps);
+ }
+
+ if (obj.getFields() != null) {
+ List _fields =
+ obj.getFields().stream().map(com.azure.search.documents.implementation.converters.SearchFieldConverter::map).collect(Collectors.toList());
+ searchField.setFields(_fields);
+ }
+
+ Boolean _key = obj.isKey();
+ searchField.setKey(_key);
+ return searchField;
+ }
+
+ /**
+ * Maps from {@link SearchField} to {@link com.azure.search.documents.implementation.models.SearchField}.
+ */
+ public static com.azure.search.documents.implementation.models.SearchField map(SearchField obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.SearchField searchField =
+ new com.azure.search.documents.implementation.models.SearchField();
+
+ Boolean _filterable = obj.isFilterable();
+ searchField.setFilterable(_filterable);
+
+ Boolean _hidden = obj.isHidden() == null ? null : !obj.isHidden();
+ searchField.setRetrievable(_hidden);
+
+ Boolean _sortable = obj.isSortable();
+ searchField.setSortable(_sortable);
+
+ if (obj.getType() != null) {
+ com.azure.search.documents.implementation.models.SearchFieldDataType _type =
+ SearchFieldDataTypeConverter.map(obj.getType());
+ searchField.setType(_type);
+ }
+
+ Boolean _searchable = obj.isSearchable();
+ searchField.setSearchable(_searchable);
+
+ if (obj.getAnalyzer() != null) {
+ com.azure.search.documents.implementation.models.LexicalAnalyzerName _analyzer =
+ LexicalAnalyzerNameConverter.map(obj.getAnalyzer());
+ searchField.setAnalyzer(_analyzer);
+ }
+
+ if (obj.getSearchAnalyzer() != null) {
+ com.azure.search.documents.implementation.models.LexicalAnalyzerName _searchAnalyzer =
+ LexicalAnalyzerNameConverter.map(obj.getSearchAnalyzer());
+ searchField.setSearchAnalyzer(_searchAnalyzer);
+ }
+
+ String _name = obj.getName();
+ searchField.setName(_name);
+
+ if (obj.getIndexAnalyzer() != null) {
+ com.azure.search.documents.implementation.models.LexicalAnalyzerName _indexAnalyzer =
+ LexicalAnalyzerNameConverter.map(obj.getIndexAnalyzer());
+ searchField.setIndexAnalyzer(_indexAnalyzer);
+ }
+
+ Boolean _facetable = obj.isFacetable();
+ searchField.setFacetable(_facetable);
+
+ if (obj.getSynonymMaps() != null) {
+ List _synonymMaps = new ArrayList<>(obj.getSynonymMaps());
+ searchField.setSynonymMaps(_synonymMaps);
+ }
+
+ if (obj.getFields() != null) {
+ List _fields =
+ obj.getFields().stream().map(com.azure.search.documents.implementation.converters.SearchFieldConverter::map).collect(Collectors.toList());
+ searchField.setFields(_fields);
+ }
+
+ Boolean _key = obj.isKey();
+ searchField.setKey(_key);
+ return searchField;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchFieldDataTypeConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchFieldDataTypeConverter.java
new file mode 100644
index 000000000000..a0c470912450
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchFieldDataTypeConverter.java
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.SearchFieldDataType;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.SearchFieldDataType} and
+ * {@link SearchFieldDataType}.
+ */
+public final class SearchFieldDataTypeConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(SearchFieldDataTypeConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.SearchFieldDataType} to enum
+ * {@link SearchFieldDataType}.
+ */
+ public static SearchFieldDataType map(com.azure.search.documents.implementation.models.SearchFieldDataType obj) {
+ if (obj == null) {
+ return null;
+ }
+ return SearchFieldDataType.fromString(obj.toString());
+ }
+
+ /**
+ * Maps from enum {@link SearchFieldDataType} to enum
+ * {@link com.azure.search.documents.implementation.models.SearchFieldDataType}.
+ */
+ public static com.azure.search.documents.implementation.models.SearchFieldDataType map(SearchFieldDataType obj) {
+ if (obj == null) {
+ return null;
+ }
+ return com.azure.search.documents.implementation.models.SearchFieldDataType.fromString(obj.toString());
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexConverter.java
new file mode 100644
index 000000000000..ff72541a0bfa
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexConverter.java
@@ -0,0 +1,186 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.CharFilter;
+import com.azure.search.documents.models.CorsOptions;
+import com.azure.search.documents.models.LexicalAnalyzer;
+import com.azure.search.documents.models.LexicalTokenizer;
+import com.azure.search.documents.models.ScoringProfile;
+import com.azure.search.documents.models.SearchField;
+import com.azure.search.documents.models.SearchIndex;
+import com.azure.search.documents.models.SearchResourceEncryptionKey;
+import com.azure.search.documents.models.Similarity;
+import com.azure.search.documents.models.Suggester;
+import com.azure.search.documents.models.TokenFilter;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.SearchIndex} and {@link SearchIndex}.
+ */
+public final class SearchIndexConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(SearchIndexConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.SearchIndex} to {@link SearchIndex}.
+ */
+ public static SearchIndex map(com.azure.search.documents.implementation.models.SearchIndex obj) {
+ if (obj == null) {
+ return null;
+ }
+ SearchIndex searchIndex = new SearchIndex();
+
+ if (obj.getTokenizers() != null) {
+ List _tokenizers =
+ obj.getTokenizers().stream().map(LexicalTokenizerConverter::map).collect(Collectors.toList());
+ searchIndex.setTokenizers(_tokenizers);
+ }
+
+ if (obj.getSuggesters() != null) {
+ List _suggesters =
+ obj.getSuggesters().stream().map(SuggesterConverter::map).collect(Collectors.toList());
+ searchIndex.setSuggesters(_suggesters);
+ }
+
+ if (obj.getCharFilters() != null) {
+ List _charFilters =
+ obj.getCharFilters().stream().map(CharFilterConverter::map).collect(Collectors.toList());
+ searchIndex.setCharFilters(_charFilters);
+ }
+
+ if (obj.getTokenFilters() != null) {
+ List _tokenFilters =
+ obj.getTokenFilters().stream().map(TokenFilterConverter::map).collect(Collectors.toList());
+ searchIndex.setTokenFilters(_tokenFilters);
+ }
+
+ if (obj.getEncryptionKey() != null) {
+ SearchResourceEncryptionKey _encryptionKey =
+ SearchResourceEncryptionKeyConverter.map(obj.getEncryptionKey());
+ searchIndex.setEncryptionKey(_encryptionKey);
+ }
+
+ String _defaultScoringProfile = obj.getDefaultScoringProfile();
+ searchIndex.setDefaultScoringProfile(_defaultScoringProfile);
+
+ if (obj.getAnalyzers() != null) {
+ List _analyzers =
+ obj.getAnalyzers().stream().map(LexicalAnalyzerConverter::map).collect(Collectors.toList());
+ searchIndex.setAnalyzers(_analyzers);
+ }
+
+ if (obj.getSimilarity() != null) {
+ Similarity _similarity = SimilarityConverter.map(obj.getSimilarity());
+ searchIndex.setSimilarity(_similarity);
+ }
+
+ String _name = obj.getName();
+ searchIndex.setName(_name);
+
+ if (obj.getCorsOptions() != null) {
+ CorsOptions _corsOptions = CorsOptionsConverter.map(obj.getCorsOptions());
+ searchIndex.setCorsOptions(_corsOptions);
+ }
+
+ String _eTag = obj.getETag();
+ searchIndex.setETag(_eTag);
+
+ if (obj.getScoringProfiles() != null) {
+ List _scoringProfiles =
+ obj.getScoringProfiles().stream().map(ScoringProfileConverter::map).collect(Collectors.toList());
+ searchIndex.setScoringProfiles(_scoringProfiles);
+ }
+
+ if (obj.getFields() != null) {
+ List _fields =
+ obj.getFields().stream().map(SearchFieldConverter::map).collect(Collectors.toList());
+ searchIndex.setFields(_fields);
+ }
+ return searchIndex;
+ }
+
+ /**
+ * Maps from {@link SearchIndex} to {@link com.azure.search.documents.implementation.models.SearchIndex}.
+ */
+ public static com.azure.search.documents.implementation.models.SearchIndex map(SearchIndex obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.SearchIndex searchIndex =
+ new com.azure.search.documents.implementation.models.SearchIndex();
+
+ if (obj.getTokenizers() != null) {
+ List _tokenizers =
+ obj.getTokenizers().stream().map(LexicalTokenizerConverter::map).collect(Collectors.toList());
+ searchIndex.setTokenizers(_tokenizers);
+ }
+
+ if (obj.getSuggesters() != null) {
+ List _suggesters =
+ obj.getSuggesters().stream().map(SuggesterConverter::map).collect(Collectors.toList());
+ searchIndex.setSuggesters(_suggesters);
+ }
+
+ if (obj.getCharFilters() != null) {
+ List _charFilters =
+ obj.getCharFilters().stream().map(CharFilterConverter::map).collect(Collectors.toList());
+ searchIndex.setCharFilters(_charFilters);
+ }
+
+ if (obj.getTokenFilters() != null) {
+ List _tokenFilters =
+ obj.getTokenFilters().stream().map(TokenFilterConverter::map).collect(Collectors.toList());
+ searchIndex.setTokenFilters(_tokenFilters);
+ }
+
+ if (obj.getEncryptionKey() != null) {
+ com.azure.search.documents.implementation.models.SearchResourceEncryptionKey _encryptionKey =
+ SearchResourceEncryptionKeyConverter.map(obj.getEncryptionKey());
+ searchIndex.setEncryptionKey(_encryptionKey);
+ }
+
+ String _defaultScoringProfile = obj.getDefaultScoringProfile();
+ searchIndex.setDefaultScoringProfile(_defaultScoringProfile);
+
+ if (obj.getAnalyzers() != null) {
+ List _analyzers =
+ obj.getAnalyzers().stream().map(LexicalAnalyzerConverter::map).collect(Collectors.toList());
+ searchIndex.setAnalyzers(_analyzers);
+ }
+
+ if (obj.getSimilarity() != null) {
+ com.azure.search.documents.implementation.models.Similarity _similarity =
+ SimilarityConverter.map(obj.getSimilarity());
+ searchIndex.setSimilarity(_similarity);
+ }
+
+ String _name = obj.getName();
+ searchIndex.setName(_name);
+
+ if (obj.getCorsOptions() != null) {
+ com.azure.search.documents.implementation.models.CorsOptions _corsOptions =
+ CorsOptionsConverter.map(obj.getCorsOptions());
+ searchIndex.setCorsOptions(_corsOptions);
+ }
+
+ String _eTag = obj.getETag();
+ searchIndex.setETag(_eTag);
+
+ if (obj.getScoringProfiles() != null) {
+ List _scoringProfiles =
+ obj.getScoringProfiles().stream().map(ScoringProfileConverter::map).collect(Collectors.toList());
+ searchIndex.setScoringProfiles(_scoringProfiles);
+ }
+
+ if (obj.getFields() != null) {
+ List _fields =
+ obj.getFields().stream().map(SearchFieldConverter::map).collect(Collectors.toList());
+ searchIndex.setFields(_fields);
+ }
+ return searchIndex;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerConverter.java
new file mode 100644
index 000000000000..c16f94ad2837
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerConverter.java
@@ -0,0 +1,131 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.FieldMapping;
+import com.azure.search.documents.models.IndexingParameters;
+import com.azure.search.documents.models.IndexingSchedule;
+import com.azure.search.documents.models.SearchIndexer;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.SearchIndexer} and {@link SearchIndexer}.
+ */
+public final class SearchIndexerConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(SearchIndexerConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.SearchIndexer} to {@link SearchIndexer}.
+ */
+ public static SearchIndexer map(com.azure.search.documents.implementation.models.SearchIndexer obj) {
+ if (obj == null) {
+ return null;
+ }
+ SearchIndexer searchIndexer = new SearchIndexer();
+
+ if (obj.getSchedule() != null) {
+ IndexingSchedule _schedule = IndexingScheduleConverter.map(obj.getSchedule());
+ searchIndexer.setSchedule(_schedule);
+ }
+
+ String _skillsetName = obj.getSkillsetName();
+ searchIndexer.setSkillsetName(_skillsetName);
+
+ String _name = obj.getName();
+ searchIndexer.setName(_name);
+
+ String _description = obj.getDescription();
+ searchIndexer.setDescription(_description);
+
+ String _eTag = obj.getETag();
+ searchIndexer.setETag(_eTag);
+
+ String _targetIndexName = obj.getTargetIndexName();
+ searchIndexer.setTargetIndexName(_targetIndexName);
+
+ if (obj.getFieldMappings() != null) {
+ List _fieldMappings =
+ obj.getFieldMappings().stream().map(FieldMappingConverter::map).collect(Collectors.toList());
+ searchIndexer.setFieldMappings(_fieldMappings);
+ }
+
+ Boolean _isDisabled = obj.isDisabled();
+ searchIndexer.setIsDisabled(_isDisabled);
+
+ if (obj.getParameters() != null) {
+ IndexingParameters _parameters = IndexingParametersConverter.map(obj.getParameters());
+ searchIndexer.setParameters(_parameters);
+ }
+
+ String _dataSourceName = obj.getDataSourceName();
+ searchIndexer.setDataSourceName(_dataSourceName);
+
+ if (obj.getOutputFieldMappings() != null) {
+ List _outputFieldMappings =
+ obj.getOutputFieldMappings().stream().map(FieldMappingConverter::map).collect(Collectors.toList());
+ searchIndexer.setOutputFieldMappings(_outputFieldMappings);
+ }
+ return searchIndexer;
+ }
+
+ /**
+ * Maps from {@link SearchIndexer} to {@link com.azure.search.documents.implementation.models.SearchIndexer}.
+ */
+ public static com.azure.search.documents.implementation.models.SearchIndexer map(SearchIndexer obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.SearchIndexer searchIndexer =
+ new com.azure.search.documents.implementation.models.SearchIndexer();
+
+ if (obj.getSchedule() != null) {
+ com.azure.search.documents.implementation.models.IndexingSchedule _schedule =
+ IndexingScheduleConverter.map(obj.getSchedule());
+ searchIndexer.setSchedule(_schedule);
+ }
+
+ String _skillsetName = obj.getSkillsetName();
+ searchIndexer.setSkillsetName(_skillsetName);
+
+ String _name = obj.getName();
+ searchIndexer.setName(_name);
+
+ String _description = obj.getDescription();
+ searchIndexer.setDescription(_description);
+
+ String _eTag = obj.getETag();
+ searchIndexer.setETag(_eTag);
+
+ String _targetIndexName = obj.getTargetIndexName();
+ searchIndexer.setTargetIndexName(_targetIndexName);
+
+ if (obj.getFieldMappings() != null) {
+ List _fieldMappings =
+ obj.getFieldMappings().stream().map(FieldMappingConverter::map).collect(Collectors.toList());
+ searchIndexer.setFieldMappings(_fieldMappings);
+ }
+
+ Boolean _isDisabled = obj.isDisabled();
+ searchIndexer.setIsDisabled(_isDisabled);
+
+ if (obj.getParameters() != null) {
+ com.azure.search.documents.implementation.models.IndexingParameters _parameters =
+ IndexingParametersConverter.map(obj.getParameters());
+ searchIndexer.setParameters(_parameters);
+ }
+
+ String _dataSourceName = obj.getDataSourceName();
+ searchIndexer.setDataSourceName(_dataSourceName);
+
+ if (obj.getOutputFieldMappings() != null) {
+ List _outputFieldMappings =
+ obj.getOutputFieldMappings().stream().map(FieldMappingConverter::map).collect(Collectors.toList());
+ searchIndexer.setOutputFieldMappings(_outputFieldMappings);
+ }
+ return searchIndexer;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerDataContainerConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerDataContainerConverter.java
new file mode 100644
index 000000000000..acf947c0d605
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerDataContainerConverter.java
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.SearchIndexerDataContainer;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.SearchIndexerDataContainer} and
+ * {@link SearchIndexerDataContainer}.
+ */
+public final class SearchIndexerDataContainerConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(SearchIndexerDataContainerConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.SearchIndexerDataContainer} to
+ * {@link SearchIndexerDataContainer}.
+ */
+ public static SearchIndexerDataContainer map(com.azure.search.documents.implementation.models.SearchIndexerDataContainer obj) {
+ if (obj == null) {
+ return null;
+ }
+ SearchIndexerDataContainer searchIndexerDataContainer = new SearchIndexerDataContainer();
+
+ String _query = obj.getQuery();
+ searchIndexerDataContainer.setQuery(_query);
+
+ String _name = obj.getName();
+ searchIndexerDataContainer.setName(_name);
+ return searchIndexerDataContainer;
+ }
+
+ /**
+ * Maps from {@link SearchIndexerDataContainer} to
+ * {@link com.azure.search.documents.implementation.models.SearchIndexerDataContainer}.
+ */
+ public static com.azure.search.documents.implementation.models.SearchIndexerDataContainer map(SearchIndexerDataContainer obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.SearchIndexerDataContainer searchIndexerDataContainer =
+ new com.azure.search.documents.implementation.models.SearchIndexerDataContainer();
+
+ String _query = obj.getQuery();
+ searchIndexerDataContainer.setQuery(_query);
+
+ String _name = obj.getName();
+ searchIndexerDataContainer.setName(_name);
+ return searchIndexerDataContainer;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerDataSourceConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerDataSourceConverter.java
new file mode 100644
index 000000000000..0b9949ea71db
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerDataSourceConverter.java
@@ -0,0 +1,119 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.DataChangeDetectionPolicy;
+import com.azure.search.documents.models.DataDeletionDetectionPolicy;
+import com.azure.search.documents.models.DataSourceCredentials;
+import com.azure.search.documents.models.SearchIndexerDataContainer;
+import com.azure.search.documents.models.SearchIndexerDataSource;
+import com.azure.search.documents.models.SearchIndexerDataSourceType;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.SearchIndexerDataSource} and
+ * {@link SearchIndexerDataSource}.
+ */
+public final class SearchIndexerDataSourceConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(SearchIndexerDataSourceConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.SearchIndexerDataSource} to
+ * {@link SearchIndexerDataSource}.
+ */
+ public static SearchIndexerDataSource map(com.azure.search.documents.implementation.models.SearchIndexerDataSource obj) {
+ if (obj == null) {
+ return null;
+ }
+ SearchIndexerDataSource searchIndexerDataSource = new SearchIndexerDataSource();
+
+ if (obj.getContainer() != null) {
+ SearchIndexerDataContainer _container = SearchIndexerDataContainerConverter.map(obj.getContainer());
+ searchIndexerDataSource.setContainer(_container);
+ }
+
+ if (obj.getDataChangeDetectionPolicy() != null) {
+ DataChangeDetectionPolicy _dataChangeDetectionPolicy =
+ DataChangeDetectionPolicyConverter.map(obj.getDataChangeDetectionPolicy());
+ searchIndexerDataSource.setDataChangeDetectionPolicy(_dataChangeDetectionPolicy);
+ }
+
+ if (obj.getCredentials() != null) {
+ DataSourceCredentials _credentials = DataSourceCredentialsConverter.map(obj.getCredentials());
+ searchIndexerDataSource.setCredentials(_credentials);
+ }
+
+ String _name = obj.getName();
+ searchIndexerDataSource.setName(_name);
+
+ String _description = obj.getDescription();
+ searchIndexerDataSource.setDescription(_description);
+
+ if (obj.getDataDeletionDetectionPolicy() != null) {
+ DataDeletionDetectionPolicy _dataDeletionDetectionPolicy =
+ DataDeletionDetectionPolicyConverter.map(obj.getDataDeletionDetectionPolicy());
+ searchIndexerDataSource.setDataDeletionDetectionPolicy(_dataDeletionDetectionPolicy);
+ }
+
+ String _eTag = obj.getETag();
+ searchIndexerDataSource.setETag(_eTag);
+
+ if (obj.getType() != null) {
+ SearchIndexerDataSourceType _type = SearchIndexerDataSourceTypeConverter.map(obj.getType());
+ searchIndexerDataSource.setType(_type);
+ }
+ return searchIndexerDataSource;
+ }
+
+ /**
+ * Maps from {@link SearchIndexerDataSource} to
+ * {@link com.azure.search.documents.implementation.models.SearchIndexerDataSource}.
+ */
+ public static com.azure.search.documents.implementation.models.SearchIndexerDataSource map(SearchIndexerDataSource obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.SearchIndexerDataSource searchIndexerDataSource =
+ new com.azure.search.documents.implementation.models.SearchIndexerDataSource();
+
+ if (obj.getContainer() != null) {
+ com.azure.search.documents.implementation.models.SearchIndexerDataContainer _container =
+ SearchIndexerDataContainerConverter.map(obj.getContainer());
+ searchIndexerDataSource.setContainer(_container);
+ }
+
+ if (obj.getDataChangeDetectionPolicy() != null) {
+ com.azure.search.documents.implementation.models.DataChangeDetectionPolicy _dataChangeDetectionPolicy =
+ DataChangeDetectionPolicyConverter.map(obj.getDataChangeDetectionPolicy());
+ searchIndexerDataSource.setDataChangeDetectionPolicy(_dataChangeDetectionPolicy);
+ }
+
+ if (obj.getCredentials() != null) {
+ com.azure.search.documents.implementation.models.DataSourceCredentials _credentials =
+ DataSourceCredentialsConverter.map(obj.getCredentials());
+ searchIndexerDataSource.setCredentials(_credentials);
+ }
+
+ String _name = obj.getName();
+ searchIndexerDataSource.setName(_name);
+
+ String _description = obj.getDescription();
+ searchIndexerDataSource.setDescription(_description);
+
+ if (obj.getDataDeletionDetectionPolicy() != null) {
+ com.azure.search.documents.implementation.models.DataDeletionDetectionPolicy _dataDeletionDetectionPolicy = DataDeletionDetectionPolicyConverter.map(obj.getDataDeletionDetectionPolicy());
+ searchIndexerDataSource.setDataDeletionDetectionPolicy(_dataDeletionDetectionPolicy);
+ }
+
+ String _eTag = obj.getETag();
+ searchIndexerDataSource.setETag(_eTag);
+
+ if (obj.getType() != null) {
+ com.azure.search.documents.implementation.models.SearchIndexerDataSourceType _type =
+ SearchIndexerDataSourceTypeConverter.map(obj.getType());
+ searchIndexerDataSource.setType(_type);
+ }
+ return searchIndexerDataSource;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerDataSourceTypeConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerDataSourceTypeConverter.java
new file mode 100644
index 000000000000..737c1e5eaf08
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerDataSourceTypeConverter.java
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.SearchIndexerDataSourceType;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.SearchIndexerDataSourceType} and
+ * {@link SearchIndexerDataSourceType}.
+ */
+public final class SearchIndexerDataSourceTypeConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(SearchIndexerDataSourceTypeConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.SearchIndexerDataSourceType} to enum
+ * {@link SearchIndexerDataSourceType}.
+ */
+ public static SearchIndexerDataSourceType map(com.azure.search.documents.implementation.models.SearchIndexerDataSourceType obj) {
+ if (obj == null) {
+ return null;
+ }
+ return SearchIndexerDataSourceType.fromString(obj.toString());
+ }
+
+ /**
+ * Maps from enum {@link SearchIndexerDataSourceType} to enum
+ * {@link com.azure.search.documents.implementation.models.SearchIndexerDataSourceType}.
+ */
+ public static com.azure.search.documents.implementation.models.SearchIndexerDataSourceType map(SearchIndexerDataSourceType obj) {
+ if (obj == null) {
+ return null;
+ }
+ return com.azure.search.documents.implementation.models.SearchIndexerDataSourceType.fromString(obj.toString());
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerErrorConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerErrorConverter.java
new file mode 100644
index 000000000000..482976f0d916
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerErrorConverter.java
@@ -0,0 +1,77 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.implementation.util.PrivateFieldAccessHelper;
+import com.azure.search.documents.models.SearchIndexerError;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.SearchIndexerError} and
+ * {@link SearchIndexerError}.
+ */
+public final class SearchIndexerErrorConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(SearchIndexerErrorConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.SearchIndexerError} to
+ * {@link SearchIndexerError}.
+ */
+ public static SearchIndexerError map(com.azure.search.documents.implementation.models.SearchIndexerError obj) {
+ if (obj == null) {
+ return null;
+ }
+ SearchIndexerError searchIndexerError = new SearchIndexerError();
+
+ String _errorMessage = obj.getErrorMessage();
+ PrivateFieldAccessHelper.set(searchIndexerError, "errorMessage", _errorMessage);
+
+ String _name = obj.getName();
+ PrivateFieldAccessHelper.set(searchIndexerError, "name", _name);
+
+ String _details = obj.getDetails();
+ PrivateFieldAccessHelper.set(searchIndexerError, "details", _details);
+
+ String _documentationLink = obj.getDocumentationLink();
+ PrivateFieldAccessHelper.set(searchIndexerError, "documentationLink", _documentationLink);
+
+ String _key = obj.getKey();
+ PrivateFieldAccessHelper.set(searchIndexerError, "key", _key);
+
+ int _statusCode = obj.getStatusCode();
+ PrivateFieldAccessHelper.set(searchIndexerError, "statusCode", _statusCode);
+ return searchIndexerError;
+ }
+
+ /**
+ * Maps from {@link SearchIndexerError} to
+ * {@link com.azure.search.documents.implementation.models.SearchIndexerError}.
+ */
+ public static com.azure.search.documents.implementation.models.SearchIndexerError map(SearchIndexerError obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.SearchIndexerError searchIndexerError =
+ new com.azure.search.documents.implementation.models.SearchIndexerError();
+
+ String _errorMessage = obj.getErrorMessage();
+ PrivateFieldAccessHelper.set(searchIndexerError, "errorMessage", _errorMessage);
+
+ String _name = obj.getName();
+ PrivateFieldAccessHelper.set(searchIndexerError, "name", _name);
+
+ String _details = obj.getDetails();
+ PrivateFieldAccessHelper.set(searchIndexerError, "details", _details);
+
+ String _documentationLink = obj.getDocumentationLink();
+ PrivateFieldAccessHelper.set(searchIndexerError, "documentationLink", _documentationLink);
+
+ String _key = obj.getKey();
+ PrivateFieldAccessHelper.set(searchIndexerError, "key", _key);
+
+ int _statusCode = obj.getStatusCode();
+ PrivateFieldAccessHelper.set(searchIndexerError, "statusCode", _statusCode);
+ return searchIndexerError;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerLimitsConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerLimitsConverter.java
new file mode 100644
index 000000000000..a82b82e45de3
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerLimitsConverter.java
@@ -0,0 +1,63 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.implementation.util.PrivateFieldAccessHelper;
+import com.azure.search.documents.models.SearchIndexerLimits;
+
+import java.time.Duration;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.SearchIndexerLimits} and
+ * {@link SearchIndexerLimits}.
+ */
+public final class SearchIndexerLimitsConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(SearchIndexerLimitsConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.SearchIndexerLimits} to
+ * {@link SearchIndexerLimits}.
+ */
+ public static SearchIndexerLimits map(com.azure.search.documents.implementation.models.SearchIndexerLimits obj) {
+ if (obj == null) {
+ return null;
+ }
+ SearchIndexerLimits searchIndexerLimits = new SearchIndexerLimits();
+
+ Duration _maxRunTime = obj.getMaxRunTime();
+ PrivateFieldAccessHelper.set(searchIndexerLimits, "maxRunTime", _maxRunTime);
+
+ Double _maxDocumentContentCharactersToExtract = obj.getMaxDocumentContentCharactersToExtract();
+ PrivateFieldAccessHelper.set(searchIndexerLimits, "maxDocumentContentCharactersToExtract",
+ _maxDocumentContentCharactersToExtract);
+
+ Double _maxDocumentExtractionSize = obj.getMaxDocumentExtractionSize();
+ PrivateFieldAccessHelper.set(searchIndexerLimits, "maxDocumentExtractionSize", _maxDocumentExtractionSize);
+ return searchIndexerLimits;
+ }
+
+ /**
+ * Maps from {@link SearchIndexerLimits} to
+ * {@link com.azure.search.documents.implementation.models.SearchIndexerLimits}.
+ */
+ public static com.azure.search.documents.implementation.models.SearchIndexerLimits map(SearchIndexerLimits obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.SearchIndexerLimits searchIndexerLimits =
+ new com.azure.search.documents.implementation.models.SearchIndexerLimits();
+
+ Duration _maxRunTime = obj.getMaxRunTime();
+ PrivateFieldAccessHelper.set(searchIndexerLimits, "maxRunTime", _maxRunTime);
+
+ Double _maxDocumentContentCharactersToExtract = obj.getMaxDocumentContentCharactersToExtract();
+ PrivateFieldAccessHelper.set(searchIndexerLimits, "maxDocumentContentCharactersToExtract",
+ _maxDocumentContentCharactersToExtract);
+
+ Double _maxDocumentExtractionSize = obj.getMaxDocumentExtractionSize();
+ PrivateFieldAccessHelper.set(searchIndexerLimits, "maxDocumentExtractionSize", _maxDocumentExtractionSize);
+ return searchIndexerLimits;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerSkillConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerSkillConverter.java
new file mode 100644
index 000000000000..7155e6f856b6
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerSkillConverter.java
@@ -0,0 +1,120 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.implementation.models.ConditionalSkill;
+import com.azure.search.documents.implementation.models.EntityRecognitionSkill;
+import com.azure.search.documents.implementation.models.ImageAnalysisSkill;
+import com.azure.search.documents.implementation.models.KeyPhraseExtractionSkill;
+import com.azure.search.documents.implementation.models.LanguageDetectionSkill;
+import com.azure.search.documents.implementation.models.MergeSkill;
+import com.azure.search.documents.implementation.models.OcrSkill;
+import com.azure.search.documents.implementation.models.SentimentSkill;
+import com.azure.search.documents.implementation.models.ShaperSkill;
+import com.azure.search.documents.implementation.models.SplitSkill;
+import com.azure.search.documents.implementation.models.TextTranslationSkill;
+import com.azure.search.documents.implementation.models.WebApiSkill;
+import com.azure.search.documents.models.SearchIndexerSkill;
+
+import static com.azure.search.documents.implementation.util.Constants.ABSTRACT_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ABSTRACT_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.SearchIndexerSkill} and
+ * {@link SearchIndexerSkill}.
+ */
+public final class SearchIndexerSkillConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(SearchIndexerSkillConverter.class);
+
+ /**
+ * Maps abstract class from {@link com.azure.search.documents.implementation.models.SearchIndexerSkill} to
+ * {@link SearchIndexerSkill}. Dedicate works to sub class converter.
+ */
+ public static SearchIndexerSkill map(com.azure.search.documents.implementation.models.SearchIndexerSkill obj) {
+ if (obj instanceof TextTranslationSkill) {
+ return TextTranslationSkillConverter.map((TextTranslationSkill) obj);
+ }
+ if (obj instanceof EntityRecognitionSkill) {
+ return EntityRecognitionSkillConverter.map((EntityRecognitionSkill) obj);
+ }
+ if (obj instanceof SentimentSkill) {
+ return SentimentSkillConverter.map((SentimentSkill) obj);
+ }
+ if (obj instanceof LanguageDetectionSkill) {
+ return LanguageDetectionSkillConverter.map((LanguageDetectionSkill) obj);
+ }
+ if (obj instanceof ConditionalSkill) {
+ return ConditionalSkillConverter.map((ConditionalSkill) obj);
+ }
+ if (obj instanceof ImageAnalysisSkill) {
+ return ImageAnalysisSkillConverter.map((ImageAnalysisSkill) obj);
+ }
+ if (obj instanceof ShaperSkill) {
+ return ShaperSkillConverter.map((ShaperSkill) obj);
+ }
+ if (obj instanceof KeyPhraseExtractionSkill) {
+ return KeyPhraseExtractionSkillConverter.map((KeyPhraseExtractionSkill) obj);
+ }
+ if (obj instanceof MergeSkill) {
+ return MergeSkillConverter.map((MergeSkill) obj);
+ }
+ if (obj instanceof SplitSkill) {
+ return SplitSkillConverter.map((SplitSkill) obj);
+ }
+ if (obj instanceof WebApiSkill) {
+ return WebApiSkillConverter.map((WebApiSkill) obj);
+ }
+ if (obj instanceof OcrSkill) {
+ return OcrSkillConverter.map((OcrSkill) obj);
+ }
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_EXTERNAL_ERROR_MSG,
+ obj.getClass().getSimpleName())));
+ }
+
+ /**
+ * Maps abstract class from {@link SearchIndexerSkill} to
+ * {@link com.azure.search.documents.implementation.models.SearchIndexerSkill}. Dedicate works to sub class
+ * converter.
+ */
+ public static com.azure.search.documents.implementation.models.SearchIndexerSkill map(SearchIndexerSkill obj) {
+ if (obj instanceof com.azure.search.documents.models.LanguageDetectionSkill) {
+ return LanguageDetectionSkillConverter.map((com.azure.search.documents.models.LanguageDetectionSkill) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.WebApiSkill) {
+ return WebApiSkillConverter.map((com.azure.search.documents.models.WebApiSkill) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.OcrSkill) {
+ return OcrSkillConverter.map((com.azure.search.documents.models.OcrSkill) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.TextTranslationSkill) {
+ return TextTranslationSkillConverter.map((com.azure.search.documents.models.TextTranslationSkill) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.EntityRecognitionSkill) {
+ return EntityRecognitionSkillConverter.map((com.azure.search.documents.models.EntityRecognitionSkill) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.ImageAnalysisSkill) {
+ return ImageAnalysisSkillConverter.map((com.azure.search.documents.models.ImageAnalysisSkill) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.SplitSkill) {
+ return SplitSkillConverter.map((com.azure.search.documents.models.SplitSkill) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.KeyPhraseExtractionSkill) {
+ return KeyPhraseExtractionSkillConverter.map((com.azure.search.documents.models.KeyPhraseExtractionSkill) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.SentimentSkill) {
+ return SentimentSkillConverter.map((com.azure.search.documents.models.SentimentSkill) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.ConditionalSkill) {
+ return ConditionalSkillConverter.map((com.azure.search.documents.models.ConditionalSkill) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.ShaperSkill) {
+ return ShaperSkillConverter.map((com.azure.search.documents.models.ShaperSkill) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.MergeSkill) {
+ return MergeSkillConverter.map((com.azure.search.documents.models.MergeSkill) obj);
+ }
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_INTERNAL_ERROR_MSG, obj.getClass().getSimpleName())));
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerSkillsetConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerSkillsetConverter.java
new file mode 100644
index 000000000000..91ef45fb1fdb
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerSkillsetConverter.java
@@ -0,0 +1,87 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.CognitiveServicesAccount;
+import com.azure.search.documents.models.SearchIndexerSkill;
+import com.azure.search.documents.models.SearchIndexerSkillset;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.SearchIndexerSkillset} and
+ * {@link SearchIndexerSkillset}.
+ */
+public final class SearchIndexerSkillsetConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(SearchIndexerSkillsetConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.SearchIndexerSkillset} to
+ * {@link SearchIndexerSkillset}.
+ */
+ public static SearchIndexerSkillset map(com.azure.search.documents.implementation.models.SearchIndexerSkillset obj) {
+ if (obj == null) {
+ return null;
+ }
+ SearchIndexerSkillset searchIndexerSkillset = new SearchIndexerSkillset();
+
+ if (obj.getSkills() != null) {
+ List _skills =
+ obj.getSkills().stream().map(SearchIndexerSkillConverter::map).collect(Collectors.toList());
+ searchIndexerSkillset.setSkills(_skills);
+ }
+
+ String _name = obj.getName();
+ searchIndexerSkillset.setName(_name);
+
+ if (obj.getCognitiveServicesAccount() != null) {
+ CognitiveServicesAccount _cognitiveServicesAccount =
+ CognitiveServicesAccountConverter.map(obj.getCognitiveServicesAccount());
+ searchIndexerSkillset.setCognitiveServicesAccount(_cognitiveServicesAccount);
+ }
+
+ String _description = obj.getDescription();
+ searchIndexerSkillset.setDescription(_description);
+
+ String _eTag = obj.getETag();
+ searchIndexerSkillset.setETag(_eTag);
+ return searchIndexerSkillset;
+ }
+
+ /**
+ * Maps from {@link SearchIndexerSkillset} to
+ * {@link com.azure.search.documents.implementation.models.SearchIndexerSkillset}.
+ */
+ public static com.azure.search.documents.implementation.models.SearchIndexerSkillset map(SearchIndexerSkillset obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.SearchIndexerSkillset searchIndexerSkillset =
+ new com.azure.search.documents.implementation.models.SearchIndexerSkillset();
+
+ if (obj.getSkills() != null) {
+ List _skills =
+ obj.getSkills().stream().map(SearchIndexerSkillConverter::map).collect(Collectors.toList());
+ searchIndexerSkillset.setSkills(_skills);
+ }
+
+ String _name = obj.getName();
+ searchIndexerSkillset.setName(_name);
+
+ if (obj.getCognitiveServicesAccount() != null) {
+ com.azure.search.documents.implementation.models.CognitiveServicesAccount _cognitiveServicesAccount =
+ CognitiveServicesAccountConverter.map(obj.getCognitiveServicesAccount());
+ searchIndexerSkillset.setCognitiveServicesAccount(_cognitiveServicesAccount);
+ }
+
+ String _description = obj.getDescription();
+ searchIndexerSkillset.setDescription(_description);
+
+ String _eTag = obj.getETag();
+ searchIndexerSkillset.setETag(_eTag);
+ return searchIndexerSkillset;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerStatusConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerStatusConverter.java
new file mode 100644
index 000000000000..30f45ab89d0e
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerStatusConverter.java
@@ -0,0 +1,92 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.implementation.util.PrivateFieldAccessHelper;
+import com.azure.search.documents.models.IndexerExecutionResult;
+import com.azure.search.documents.models.IndexerStatus;
+import com.azure.search.documents.models.SearchIndexerLimits;
+import com.azure.search.documents.models.SearchIndexerStatus;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.SearchIndexerStatus} and
+ * {@link SearchIndexerStatus}.
+ */
+public final class SearchIndexerStatusConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(SearchIndexerStatusConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.SearchIndexerStatus} to
+ * {@link SearchIndexerStatus}.
+ */
+ public static SearchIndexerStatus map(com.azure.search.documents.implementation.models.SearchIndexerStatus obj) {
+ if (obj == null) {
+ return null;
+ }
+ SearchIndexerStatus searchIndexerStatus = new SearchIndexerStatus();
+
+ if (obj.getLastResult() != null) {
+ IndexerExecutionResult _lastResult = IndexerExecutionResultConverter.map(obj.getLastResult());
+ PrivateFieldAccessHelper.set(searchIndexerStatus, "lastResult", _lastResult);
+ }
+
+ if (obj.getExecutionHistory() != null) {
+ List _executionHistory =
+ obj.getExecutionHistory().stream().map(IndexerExecutionResultConverter::map).collect(Collectors.toList());
+ PrivateFieldAccessHelper.set(searchIndexerStatus, "executionHistory", _executionHistory);
+ }
+
+ if (obj.getLimits() != null) {
+ SearchIndexerLimits _limits = SearchIndexerLimitsConverter.map(obj.getLimits());
+ PrivateFieldAccessHelper.set(searchIndexerStatus, "limits", _limits);
+ }
+
+ if (obj.getStatus() != null) {
+ IndexerStatus _status = IndexerStatusConverter.map(obj.getStatus());
+ PrivateFieldAccessHelper.set(searchIndexerStatus, "status", _status);
+ }
+ return searchIndexerStatus;
+ }
+
+ /**
+ * Maps from {@link SearchIndexerStatus} to
+ * {@link com.azure.search.documents.implementation.models.SearchIndexerStatus}.
+ */
+ public static com.azure.search.documents.implementation.models.SearchIndexerStatus map(SearchIndexerStatus obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.SearchIndexerStatus searchIndexerStatus =
+ new com.azure.search.documents.implementation.models.SearchIndexerStatus();
+
+ if (obj.getLastResult() != null) {
+ com.azure.search.documents.implementation.models.IndexerExecutionResult _lastResult =
+ IndexerExecutionResultConverter.map(obj.getLastResult());
+ PrivateFieldAccessHelper.set(searchIndexerStatus, "lastResult", _lastResult);
+ }
+
+ if (obj.getExecutionHistory() != null) {
+ List _executionHistory =
+ obj.getExecutionHistory().stream().map(IndexerExecutionResultConverter::map).collect(Collectors.toList());
+ PrivateFieldAccessHelper.set(searchIndexerStatus, "executionHistory", _executionHistory);
+ }
+
+ if (obj.getLimits() != null) {
+ com.azure.search.documents.implementation.models.SearchIndexerLimits _limits =
+ SearchIndexerLimitsConverter.map(obj.getLimits());
+ PrivateFieldAccessHelper.set(searchIndexerStatus, "limits", _limits);
+ }
+
+ if (obj.getStatus() != null) {
+ com.azure.search.documents.implementation.models.IndexerStatus _status =
+ IndexerStatusConverter.map(obj.getStatus());
+ PrivateFieldAccessHelper.set(searchIndexerStatus, "status", _status);
+ }
+ return searchIndexerStatus;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerWarningConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerWarningConverter.java
new file mode 100644
index 000000000000..051e9ff69343
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchIndexerWarningConverter.java
@@ -0,0 +1,71 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.implementation.util.PrivateFieldAccessHelper;
+import com.azure.search.documents.models.SearchIndexerWarning;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.SearchIndexerWarning} and
+ * {@link SearchIndexerWarning}.
+ */
+public final class SearchIndexerWarningConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(SearchIndexerWarningConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.SearchIndexerWarning} to
+ * {@link SearchIndexerWarning}.
+ */
+ public static SearchIndexerWarning map(com.azure.search.documents.implementation.models.SearchIndexerWarning obj) {
+ if (obj == null) {
+ return null;
+ }
+ SearchIndexerWarning searchIndexerWarning = new SearchIndexerWarning();
+
+ String _name = obj.getName();
+ PrivateFieldAccessHelper.set(searchIndexerWarning, "name", _name);
+
+ String _details = obj.getDetails();
+ PrivateFieldAccessHelper.set(searchIndexerWarning, "details", _details);
+
+ String _documentationLink = obj.getDocumentationLink();
+ PrivateFieldAccessHelper.set(searchIndexerWarning, "documentationLink", _documentationLink);
+
+ String _message = obj.getMessage();
+ PrivateFieldAccessHelper.set(searchIndexerWarning, "message", _message);
+
+ String _key = obj.getKey();
+ PrivateFieldAccessHelper.set(searchIndexerWarning, "key", _key);
+ return searchIndexerWarning;
+ }
+
+ /**
+ * Maps from {@link SearchIndexerWarning} to
+ * {@link com.azure.search.documents.implementation.models.SearchIndexerWarning}.
+ */
+ public static com.azure.search.documents.implementation.models.SearchIndexerWarning map(SearchIndexerWarning obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.SearchIndexerWarning searchIndexerWarning =
+ new com.azure.search.documents.implementation.models.SearchIndexerWarning();
+
+ String _name = obj.getName();
+ PrivateFieldAccessHelper.set(searchIndexerWarning, "name", _name);
+
+ String _details = obj.getDetails();
+ PrivateFieldAccessHelper.set(searchIndexerWarning, "details", _details);
+
+ String _documentationLink = obj.getDocumentationLink();
+ PrivateFieldAccessHelper.set(searchIndexerWarning, "documentationLink", _documentationLink);
+
+ String _message = obj.getMessage();
+ PrivateFieldAccessHelper.set(searchIndexerWarning, "message", _message);
+
+ String _key = obj.getKey();
+ PrivateFieldAccessHelper.set(searchIndexerWarning, "key", _key);
+ return searchIndexerWarning;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchModeConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchModeConverter.java
new file mode 100644
index 000000000000..3dc99a425680
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchModeConverter.java
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.SearchMode;
+
+import static com.azure.search.documents.implementation.util.Constants.ENUM_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ENUM_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.SearchMode} and {@link SearchMode}.
+ */
+public final class SearchModeConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(SearchModeConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.SearchMode} to enum {@link SearchMode}.
+ */
+ public static SearchMode map(com.azure.search.documents.implementation.models.SearchMode obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case ANY:
+ return SearchMode.ANY;
+ case ALL:
+ return SearchMode.ALL;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_EXTERNAL_ERROR_MSG, obj)));
+ }
+ }
+
+ /**
+ * Maps from enum {@link SearchMode} to enum {@link com.azure.search.documents.implementation.models.SearchMode}.
+ */
+ public static com.azure.search.documents.implementation.models.SearchMode map(SearchMode obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case ANY:
+ return com.azure.search.documents.implementation.models.SearchMode.ANY;
+ case ALL:
+ return com.azure.search.documents.implementation.models.SearchMode.ALL;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj)));
+ }
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchResourceEncryptionKeyConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchResourceEncryptionKeyConverter.java
new file mode 100644
index 000000000000..465342c2acb3
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchResourceEncryptionKeyConverter.java
@@ -0,0 +1,70 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.AzureActiveDirectoryApplicationCredentials;
+import com.azure.search.documents.models.SearchResourceEncryptionKey;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.SearchResourceEncryptionKey} and
+ * {@link SearchResourceEncryptionKey}.
+ */
+public final class SearchResourceEncryptionKeyConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(SearchResourceEncryptionKeyConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.SearchResourceEncryptionKey} to
+ * {@link SearchResourceEncryptionKey}.
+ */
+ public static SearchResourceEncryptionKey map(com.azure.search.documents.implementation.models.SearchResourceEncryptionKey obj) {
+ if (obj == null) {
+ return null;
+ }
+ SearchResourceEncryptionKey searchResourceEncryptionKey = new SearchResourceEncryptionKey();
+
+ String _keyVersion = obj.getKeyVersion();
+ searchResourceEncryptionKey.setKeyVersion(_keyVersion);
+
+ if (obj.getAccessCredentials() != null) {
+ AzureActiveDirectoryApplicationCredentials _accessCredentials =
+ AzureActiveDirectoryApplicationCredentialsConverter.map(obj.getAccessCredentials());
+ searchResourceEncryptionKey.setAccessCredentials(_accessCredentials);
+ }
+
+ String _keyName = obj.getKeyName();
+ searchResourceEncryptionKey.setKeyName(_keyName);
+
+ String _vaultUri = obj.getVaultUri();
+ searchResourceEncryptionKey.setVaultUri(_vaultUri);
+ return searchResourceEncryptionKey;
+ }
+
+ /**
+ * Maps from {@link SearchResourceEncryptionKey} to
+ * {@link com.azure.search.documents.implementation.models.SearchResourceEncryptionKey}.
+ */
+ public static com.azure.search.documents.implementation.models.SearchResourceEncryptionKey map(SearchResourceEncryptionKey obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.SearchResourceEncryptionKey searchResourceEncryptionKey =
+ new com.azure.search.documents.implementation.models.SearchResourceEncryptionKey();
+
+ String _keyVersion = obj.getKeyVersion();
+ searchResourceEncryptionKey.setKeyVersion(_keyVersion);
+
+ if (obj.getAccessCredentials() != null) {
+ com.azure.search.documents.implementation.models.AzureActiveDirectoryApplicationCredentials _accessCredentials = AzureActiveDirectoryApplicationCredentialsConverter.map(obj.getAccessCredentials());
+ searchResourceEncryptionKey.setAccessCredentials(_accessCredentials);
+ }
+
+ String _keyName = obj.getKeyName();
+ searchResourceEncryptionKey.setKeyName(_keyName);
+
+ String _vaultUri = obj.getVaultUri();
+ searchResourceEncryptionKey.setVaultUri(_vaultUri);
+ return searchResourceEncryptionKey;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchResultConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchResultConverter.java
new file mode 100644
index 000000000000..92230e8653ac
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SearchResultConverter.java
@@ -0,0 +1,69 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.SearchDocument;
+import com.azure.search.documents.implementation.util.PrivateFieldAccessHelper;
+import com.azure.search.documents.models.SearchResult;
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.SearchResult} and {@link SearchResult}.
+ */
+public final class SearchResultConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(SearchResultConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.SearchResult} to {@link SearchResult}.
+ */
+ public static SearchResult map(com.azure.search.documents.implementation.models.SearchResult obj) {
+ if (obj == null) {
+ return null;
+ }
+ SearchResult searchResult = new SearchResult();
+
+ double _score = obj.getScore();
+ PrivateFieldAccessHelper.set(searchResult, "score", _score);
+
+ if (obj.getHighlights() != null) {
+ Map> _highlights =
+ obj.getHighlights().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey,
+ Map.Entry::getValue));
+ PrivateFieldAccessHelper.set(searchResult, "highlights", _highlights);
+ }
+
+ SearchDocument _additionalProperties = new SearchDocument(obj.getAdditionalProperties());
+ PrivateFieldAccessHelper.set(searchResult, "additionalProperties", _additionalProperties);
+ return searchResult;
+ }
+
+ /**
+ * Maps from {@link SearchResult} to {@link com.azure.search.documents.implementation.models.SearchResult}.
+ */
+ public static com.azure.search.documents.implementation.models.SearchResult map(SearchResult obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.SearchResult searchResult =
+ new com.azure.search.documents.implementation.models.SearchResult();
+
+ double _score = obj.getScore();
+ PrivateFieldAccessHelper.set(searchResult, "score", _score);
+
+ if (obj.getHighlights() != null) {
+ Map> _highlights =
+ obj.getHighlights().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey,
+ Map.Entry::getValue));
+ PrivateFieldAccessHelper.set(searchResult, "highlights", _highlights);
+ }
+
+ SearchDocument _additionalProperties = obj.getDocument();
+ PrivateFieldAccessHelper.set(searchResult, "additionalProperties", _additionalProperties);
+ return searchResult;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SentimentSkillConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SentimentSkillConverter.java
new file mode 100644
index 000000000000..f74c00580d61
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SentimentSkillConverter.java
@@ -0,0 +1,98 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.InputFieldMappingEntry;
+import com.azure.search.documents.models.OutputFieldMappingEntry;
+import com.azure.search.documents.models.SentimentSkill;
+import com.azure.search.documents.models.SentimentSkillLanguage;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.SentimentSkill} and
+ * {@link SentimentSkill}.
+ */
+public final class SentimentSkillConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(SentimentSkillConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.SentimentSkill} to {@link SentimentSkill}.
+ */
+ public static SentimentSkill map(com.azure.search.documents.implementation.models.SentimentSkill obj) {
+ if (obj == null) {
+ return null;
+ }
+ SentimentSkill sentimentSkill = new SentimentSkill();
+
+ if (obj.getOutputs() != null) {
+ List _outputs =
+ obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ sentimentSkill.setOutputs(_outputs);
+ }
+
+ if (obj.getInputs() != null) {
+ List _inputs =
+ obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ sentimentSkill.setInputs(_inputs);
+ }
+
+ String _name = obj.getName();
+ sentimentSkill.setName(_name);
+
+ String _context = obj.getContext();
+ sentimentSkill.setContext(_context);
+
+ String _description = obj.getDescription();
+ sentimentSkill.setDescription(_description);
+
+ if (obj.getDefaultLanguageCode() != null) {
+ SentimentSkillLanguage _defaultLanguageCode =
+ SentimentSkillLanguageConverter.map(obj.getDefaultLanguageCode());
+ sentimentSkill.setDefaultLanguageCode(_defaultLanguageCode);
+ }
+ return sentimentSkill;
+ }
+
+ /**
+ * Maps from {@link SentimentSkill} to {@link com.azure.search.documents.implementation.models.SentimentSkill}.
+ */
+ public static com.azure.search.documents.implementation.models.SentimentSkill map(SentimentSkill obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.SentimentSkill sentimentSkill =
+ new com.azure.search.documents.implementation.models.SentimentSkill();
+
+ if (obj.getOutputs() != null) {
+ List _outputs =
+ obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ sentimentSkill.setOutputs(_outputs);
+ }
+
+ if (obj.getInputs() != null) {
+ List _inputs =
+ obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ sentimentSkill.setInputs(_inputs);
+ }
+
+ String _name = obj.getName();
+ sentimentSkill.setName(_name);
+
+ String _context = obj.getContext();
+ sentimentSkill.setContext(_context);
+
+ String _description = obj.getDescription();
+ sentimentSkill.setDescription(_description);
+
+ if (obj.getDefaultLanguageCode() != null) {
+ com.azure.search.documents.implementation.models.SentimentSkillLanguage _defaultLanguageCode =
+ SentimentSkillLanguageConverter.map(obj.getDefaultLanguageCode());
+ sentimentSkill.setDefaultLanguageCode(_defaultLanguageCode);
+ }
+ return sentimentSkill;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SentimentSkillLanguageConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SentimentSkillLanguageConverter.java
new file mode 100644
index 000000000000..a261e268112d
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SentimentSkillLanguageConverter.java
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.SentimentSkillLanguage;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.SentimentSkillLanguage} and
+ * {@link SentimentSkillLanguage}.
+ */
+public final class SentimentSkillLanguageConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(SentimentSkillLanguageConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.SentimentSkillLanguage} to enum
+ * {@link SentimentSkillLanguage}.
+ */
+ public static SentimentSkillLanguage map(com.azure.search.documents.implementation.models.SentimentSkillLanguage obj) {
+ if (obj == null) {
+ return null;
+ }
+ return SentimentSkillLanguage.fromString(obj.toString());
+ }
+
+ /**
+ * Maps from enum {@link SentimentSkillLanguage} to enum
+ * {@link com.azure.search.documents.implementation.models.SentimentSkillLanguage}.
+ */
+ public static com.azure.search.documents.implementation.models.SentimentSkillLanguage map(SentimentSkillLanguage obj) {
+ if (obj == null) {
+ return null;
+ }
+ return com.azure.search.documents.implementation.models.SentimentSkillLanguage.fromString(obj.toString());
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ServiceCountersConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ServiceCountersConverter.java
new file mode 100644
index 000000000000..f337ebe2feea
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ServiceCountersConverter.java
@@ -0,0 +1,116 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.ResourceCounter;
+import com.azure.search.documents.models.ServiceCounters;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.ServiceCounters} and
+ * {@link ServiceCounters}.
+ */
+public final class ServiceCountersConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(ServiceCountersConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.ServiceCounters} to {@link ServiceCounters}.
+ */
+ public static ServiceCounters map(com.azure.search.documents.implementation.models.ServiceCounters obj) {
+ if (obj == null) {
+ return null;
+ }
+ ServiceCounters serviceCounters = new ServiceCounters();
+
+ if (obj.getDocumentCounter() != null) {
+ ResourceCounter _documentCounter = ResourceCounterConverter.map(obj.getDocumentCounter());
+ serviceCounters.setDocumentCounter(_documentCounter);
+ }
+
+ if (obj.getIndexCounter() != null) {
+ ResourceCounter _indexCounter = ResourceCounterConverter.map(obj.getIndexCounter());
+ serviceCounters.setIndexCounter(_indexCounter);
+ }
+
+ if (obj.getSynonymMapCounter() != null) {
+ ResourceCounter _synonymMapCounter = ResourceCounterConverter.map(obj.getSynonymMapCounter());
+ serviceCounters.setSynonymMapCounter(_synonymMapCounter);
+ }
+
+ if (obj.getStorageSizeCounter() != null) {
+ ResourceCounter _storageSizeCounter = ResourceCounterConverter.map(obj.getStorageSizeCounter());
+ serviceCounters.setStorageSizeCounter(_storageSizeCounter);
+ }
+
+ if (obj.getDataSourceCounter() != null) {
+ ResourceCounter _dataSourceCounter = ResourceCounterConverter.map(obj.getDataSourceCounter());
+ serviceCounters.setDataSourceCounter(_dataSourceCounter);
+ }
+
+ if (obj.getIndexerCounter() != null) {
+ ResourceCounter _indexerCounter = ResourceCounterConverter.map(obj.getIndexerCounter());
+ serviceCounters.setIndexerCounter(_indexerCounter);
+ }
+
+ if (obj.getSkillsetCounter() != null) {
+ ResourceCounter _skillsetCounter = ResourceCounterConverter.map(obj.getSkillsetCounter());
+ serviceCounters.setSkillsetCounter(_skillsetCounter);
+ }
+ return serviceCounters;
+ }
+
+ /**
+ * Maps from {@link ServiceCounters} to {@link com.azure.search.documents.implementation.models.ServiceCounters}.
+ */
+ public static com.azure.search.documents.implementation.models.ServiceCounters map(ServiceCounters obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.ServiceCounters serviceCounters =
+ new com.azure.search.documents.implementation.models.ServiceCounters();
+
+ if (obj.getDocumentCounter() != null) {
+ com.azure.search.documents.implementation.models.ResourceCounter _documentCounter =
+ ResourceCounterConverter.map(obj.getDocumentCounter());
+ serviceCounters.setDocumentCounter(_documentCounter);
+ }
+
+ if (obj.getIndexCounter() != null) {
+ com.azure.search.documents.implementation.models.ResourceCounter _indexCounter =
+ ResourceCounterConverter.map(obj.getIndexCounter());
+ serviceCounters.setIndexCounter(_indexCounter);
+ }
+
+ if (obj.getSynonymMapCounter() != null) {
+ com.azure.search.documents.implementation.models.ResourceCounter _synonymMapCounter =
+ ResourceCounterConverter.map(obj.getSynonymMapCounter());
+ serviceCounters.setSynonymMapCounter(_synonymMapCounter);
+ }
+
+ if (obj.getStorageSizeCounter() != null) {
+ com.azure.search.documents.implementation.models.ResourceCounter _storageSizeCounter =
+ ResourceCounterConverter.map(obj.getStorageSizeCounter());
+ serviceCounters.setStorageSizeCounter(_storageSizeCounter);
+ }
+
+ if (obj.getDataSourceCounter() != null) {
+ com.azure.search.documents.implementation.models.ResourceCounter _dataSourceCounter =
+ ResourceCounterConverter.map(obj.getDataSourceCounter());
+ serviceCounters.setDataSourceCounter(_dataSourceCounter);
+ }
+
+ if (obj.getIndexerCounter() != null) {
+ com.azure.search.documents.implementation.models.ResourceCounter _indexerCounter =
+ ResourceCounterConverter.map(obj.getIndexerCounter());
+ serviceCounters.setIndexerCounter(_indexerCounter);
+ }
+
+ if (obj.getSkillsetCounter() != null) {
+ com.azure.search.documents.implementation.models.ResourceCounter _skillsetCounter =
+ ResourceCounterConverter.map(obj.getSkillsetCounter());
+ serviceCounters.setSkillsetCounter(_skillsetCounter);
+ }
+ return serviceCounters;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ServiceLimitsConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ServiceLimitsConverter.java
new file mode 100644
index 000000000000..35d7d1af232f
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ServiceLimitsConverter.java
@@ -0,0 +1,61 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.ServiceLimits;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.ServiceLimits} and {@link ServiceLimits}.
+ */
+public final class ServiceLimitsConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(ServiceLimitsConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.ServiceLimits} to {@link ServiceLimits}.
+ */
+ public static ServiceLimits map(com.azure.search.documents.implementation.models.ServiceLimits obj) {
+ if (obj == null) {
+ return null;
+ }
+ ServiceLimits serviceLimits = new ServiceLimits();
+
+ Integer _maxFieldNestingDepthPerIndex = obj.getMaxFieldNestingDepthPerIndex();
+ serviceLimits.setMaxFieldNestingDepthPerIndex(_maxFieldNestingDepthPerIndex);
+
+ Integer _maxFieldsPerIndex = obj.getMaxFieldsPerIndex();
+ serviceLimits.setMaxFieldsPerIndex(_maxFieldsPerIndex);
+
+ Integer _maxComplexObjectsInCollectionsPerDocument = obj.getMaxComplexObjectsInCollectionsPerDocument();
+ serviceLimits.setMaxComplexObjectsInCollectionsPerDocument(_maxComplexObjectsInCollectionsPerDocument);
+
+ Integer _maxComplexCollectionFieldsPerIndex = obj.getMaxComplexCollectionFieldsPerIndex();
+ serviceLimits.setMaxComplexCollectionFieldsPerIndex(_maxComplexCollectionFieldsPerIndex);
+ return serviceLimits;
+ }
+
+ /**
+ * Maps from {@link ServiceLimits} to {@link com.azure.search.documents.implementation.models.ServiceLimits}.
+ */
+ public static com.azure.search.documents.implementation.models.ServiceLimits map(ServiceLimits obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.ServiceLimits serviceLimits =
+ new com.azure.search.documents.implementation.models.ServiceLimits();
+
+ Integer _maxFieldNestingDepthPerIndex = obj.getMaxFieldNestingDepthPerIndex();
+ serviceLimits.setMaxFieldNestingDepthPerIndex(_maxFieldNestingDepthPerIndex);
+
+ Integer _maxFieldsPerIndex = obj.getMaxFieldsPerIndex();
+ serviceLimits.setMaxFieldsPerIndex(_maxFieldsPerIndex);
+
+ Integer _maxComplexObjectsInCollectionsPerDocument = obj.getMaxComplexObjectsInCollectionsPerDocument();
+ serviceLimits.setMaxComplexObjectsInCollectionsPerDocument(_maxComplexObjectsInCollectionsPerDocument);
+
+ Integer _maxComplexCollectionFieldsPerIndex = obj.getMaxComplexCollectionFieldsPerIndex();
+ serviceLimits.setMaxComplexCollectionFieldsPerIndex(_maxComplexCollectionFieldsPerIndex);
+ return serviceLimits;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ServiceStatisticsConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ServiceStatisticsConverter.java
new file mode 100644
index 000000000000..86afd19b669b
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ServiceStatisticsConverter.java
@@ -0,0 +1,64 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.ServiceCounters;
+import com.azure.search.documents.models.ServiceLimits;
+import com.azure.search.documents.models.ServiceStatistics;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.ServiceStatistics} and
+ * {@link ServiceStatistics}.
+ */
+public final class ServiceStatisticsConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(ServiceStatisticsConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.ServiceStatistics} to
+ * {@link ServiceStatistics}.
+ */
+ public static ServiceStatistics map(com.azure.search.documents.implementation.models.ServiceStatistics obj) {
+ if (obj == null) {
+ return null;
+ }
+ ServiceStatistics serviceStatistics = new ServiceStatistics();
+
+ if (obj.getCounters() != null) {
+ ServiceCounters _counters = ServiceCountersConverter.map(obj.getCounters());
+ serviceStatistics.setCounters(_counters);
+ }
+
+ if (obj.getLimits() != null) {
+ ServiceLimits _limits = ServiceLimitsConverter.map(obj.getLimits());
+ serviceStatistics.setLimits(_limits);
+ }
+ return serviceStatistics;
+ }
+
+ /**
+ * Maps from {@link ServiceStatistics} to
+ * {@link com.azure.search.documents.implementation.models.ServiceStatistics}.
+ */
+ public static com.azure.search.documents.implementation.models.ServiceStatistics map(ServiceStatistics obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.ServiceStatistics serviceStatistics =
+ new com.azure.search.documents.implementation.models.ServiceStatistics();
+
+ if (obj.getCounters() != null) {
+ com.azure.search.documents.implementation.models.ServiceCounters _counters =
+ ServiceCountersConverter.map(obj.getCounters());
+ serviceStatistics.setCounters(_counters);
+ }
+
+ if (obj.getLimits() != null) {
+ com.azure.search.documents.implementation.models.ServiceLimits _limits =
+ ServiceLimitsConverter.map(obj.getLimits());
+ serviceStatistics.setLimits(_limits);
+ }
+ return serviceStatistics;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ShaperSkillConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ShaperSkillConverter.java
new file mode 100644
index 000000000000..15bf2a5145d7
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ShaperSkillConverter.java
@@ -0,0 +1,84 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.InputFieldMappingEntry;
+import com.azure.search.documents.models.OutputFieldMappingEntry;
+import com.azure.search.documents.models.ShaperSkill;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.ShaperSkill} and {@link ShaperSkill}.
+ */
+public final class ShaperSkillConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(ShaperSkillConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.ShaperSkill} to {@link ShaperSkill}.
+ */
+ public static ShaperSkill map(com.azure.search.documents.implementation.models.ShaperSkill obj) {
+ if (obj == null) {
+ return null;
+ }
+ ShaperSkill shaperSkill = new ShaperSkill();
+
+ if (obj.getOutputs() != null) {
+ List _outputs =
+ obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ shaperSkill.setOutputs(_outputs);
+ }
+
+ if (obj.getInputs() != null) {
+ List _inputs =
+ obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ shaperSkill.setInputs(_inputs);
+ }
+
+ String _name = obj.getName();
+ shaperSkill.setName(_name);
+
+ String _context = obj.getContext();
+ shaperSkill.setContext(_context);
+
+ String _description = obj.getDescription();
+ shaperSkill.setDescription(_description);
+ return shaperSkill;
+ }
+
+ /**
+ * Maps from {@link ShaperSkill} to {@link com.azure.search.documents.implementation.models.ShaperSkill}.
+ */
+ public static com.azure.search.documents.implementation.models.ShaperSkill map(ShaperSkill obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.ShaperSkill shaperSkill =
+ new com.azure.search.documents.implementation.models.ShaperSkill();
+
+ if (obj.getOutputs() != null) {
+ List _outputs =
+ obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ shaperSkill.setOutputs(_outputs);
+ }
+
+ if (obj.getInputs() != null) {
+ List _inputs =
+ obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ shaperSkill.setInputs(_inputs);
+ }
+
+ String _name = obj.getName();
+ shaperSkill.setName(_name);
+
+ String _context = obj.getContext();
+ shaperSkill.setContext(_context);
+
+ String _description = obj.getDescription();
+ shaperSkill.setDescription(_description);
+ return shaperSkill;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ShingleTokenFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ShingleTokenFilterConverter.java
new file mode 100644
index 000000000000..11d2bdf55763
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ShingleTokenFilterConverter.java
@@ -0,0 +1,82 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.ShingleTokenFilter;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.ShingleTokenFilter} and
+ * {@link ShingleTokenFilter}.
+ */
+public final class ShingleTokenFilterConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(ShingleTokenFilterConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.ShingleTokenFilter} to
+ * {@link ShingleTokenFilter}.
+ */
+ public static ShingleTokenFilter map(com.azure.search.documents.implementation.models.ShingleTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ ShingleTokenFilter shingleTokenFilter = new ShingleTokenFilter();
+
+ String _name = obj.getName();
+ shingleTokenFilter.setName(_name);
+
+ Integer _minShingleSize = obj.getMinShingleSize();
+ shingleTokenFilter.setMinShingleSize(_minShingleSize);
+
+ Boolean _outputUnigrams = obj.isOutputUnigrams();
+ shingleTokenFilter.setOutputUnigrams(_outputUnigrams);
+
+ String _filterToken = obj.getFilterToken();
+ shingleTokenFilter.setFilterToken(_filterToken);
+
+ Boolean _outputUnigramsIfNoShingles = obj.isOutputUnigramsIfNoShingles();
+ shingleTokenFilter.setOutputUnigramsIfNoShingles(_outputUnigramsIfNoShingles);
+
+ Integer _maxShingleSize = obj.getMaxShingleSize();
+ shingleTokenFilter.setMaxShingleSize(_maxShingleSize);
+
+ String _tokenSeparator = obj.getTokenSeparator();
+ shingleTokenFilter.setTokenSeparator(_tokenSeparator);
+ return shingleTokenFilter;
+ }
+
+ /**
+ * Maps from {@link ShingleTokenFilter} to
+ * {@link com.azure.search.documents.implementation.models.ShingleTokenFilter}.
+ */
+ public static com.azure.search.documents.implementation.models.ShingleTokenFilter map(ShingleTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.ShingleTokenFilter shingleTokenFilter =
+ new com.azure.search.documents.implementation.models.ShingleTokenFilter();
+
+ String _name = obj.getName();
+ shingleTokenFilter.setName(_name);
+
+ Integer _minShingleSize = obj.getMinShingleSize();
+ shingleTokenFilter.setMinShingleSize(_minShingleSize);
+
+ Boolean _outputUnigrams = obj.isOutputUnigrams();
+ shingleTokenFilter.setOutputUnigrams(_outputUnigrams);
+
+ String _filterToken = obj.getFilterToken();
+ shingleTokenFilter.setFilterToken(_filterToken);
+
+ Boolean _outputUnigramsIfNoShingles = obj.isOutputUnigramsIfNoShingles();
+ shingleTokenFilter.setOutputUnigramsIfNoShingles(_outputUnigramsIfNoShingles);
+
+ Integer _maxShingleSize = obj.getMaxShingleSize();
+ shingleTokenFilter.setMaxShingleSize(_maxShingleSize);
+
+ String _tokenSeparator = obj.getTokenSeparator();
+ shingleTokenFilter.setTokenSeparator(_tokenSeparator);
+ return shingleTokenFilter;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SimilarityConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SimilarityConverter.java
new file mode 100644
index 000000000000..7aafd4719a30
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SimilarityConverter.java
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.Similarity;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.Similarity} and {@link Similarity}.
+ */
+public final class SimilarityConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(SimilarityConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.Similarity} to {@link Similarity}.
+ */
+ public static Similarity map(com.azure.search.documents.implementation.models.Similarity obj) {
+ if (obj == null) {
+ return null;
+ }
+ Similarity similarity = new Similarity();
+ return similarity;
+ }
+
+ /**
+ * Maps from {@link Similarity} to {@link com.azure.search.documents.implementation.models.Similarity}.
+ */
+ public static com.azure.search.documents.implementation.models.Similarity map(Similarity obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.Similarity similarity =
+ new com.azure.search.documents.implementation.models.Similarity();
+ return similarity;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SnowballTokenFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SnowballTokenFilterConverter.java
new file mode 100644
index 000000000000..385d181a20bf
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SnowballTokenFilterConverter.java
@@ -0,0 +1,58 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.SnowballTokenFilter;
+import com.azure.search.documents.models.SnowballTokenFilterLanguage;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.SnowballTokenFilter} and
+ * {@link SnowballTokenFilter}.
+ */
+public final class SnowballTokenFilterConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(SnowballTokenFilterConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.SnowballTokenFilter} to
+ * {@link SnowballTokenFilter}.
+ */
+ public static SnowballTokenFilter map(com.azure.search.documents.implementation.models.SnowballTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ SnowballTokenFilter snowballTokenFilter = new SnowballTokenFilter();
+
+ String _name = obj.getName();
+ snowballTokenFilter.setName(_name);
+
+ if (obj.getLanguage() != null) {
+ SnowballTokenFilterLanguage _language = SnowballTokenFilterLanguageConverter.map(obj.getLanguage());
+ snowballTokenFilter.setLanguage(_language);
+ }
+ return snowballTokenFilter;
+ }
+
+ /**
+ * Maps from {@link SnowballTokenFilter} to
+ * {@link com.azure.search.documents.implementation.models.SnowballTokenFilter}.
+ */
+ public static com.azure.search.documents.implementation.models.SnowballTokenFilter map(SnowballTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.SnowballTokenFilter snowballTokenFilter =
+ new com.azure.search.documents.implementation.models.SnowballTokenFilter();
+
+ String _name = obj.getName();
+ snowballTokenFilter.setName(_name);
+
+ if (obj.getLanguage() != null) {
+ com.azure.search.documents.implementation.models.SnowballTokenFilterLanguage _language =
+ SnowballTokenFilterLanguageConverter.map(obj.getLanguage());
+ snowballTokenFilter.setLanguage(_language);
+ }
+ return snowballTokenFilter;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SnowballTokenFilterLanguageConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SnowballTokenFilterLanguageConverter.java
new file mode 100644
index 000000000000..82791d1f3bc4
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SnowballTokenFilterLanguageConverter.java
@@ -0,0 +1,134 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.SnowballTokenFilterLanguage;
+
+import static com.azure.search.documents.implementation.util.Constants.ENUM_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ENUM_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.SnowballTokenFilterLanguage} and
+ * {@link SnowballTokenFilterLanguage}.
+ */
+public final class SnowballTokenFilterLanguageConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(SnowballTokenFilterLanguageConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.SnowballTokenFilterLanguage} to enum
+ * {@link SnowballTokenFilterLanguage}.
+ */
+ public static SnowballTokenFilterLanguage map(com.azure.search.documents.implementation.models.SnowballTokenFilterLanguage obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case ARMENIAN:
+ return SnowballTokenFilterLanguage.ARMENIAN;
+ case BASQUE:
+ return SnowballTokenFilterLanguage.BASQUE;
+ case CATALAN:
+ return SnowballTokenFilterLanguage.CATALAN;
+ case DANISH:
+ return SnowballTokenFilterLanguage.DANISH;
+ case DUTCH:
+ return SnowballTokenFilterLanguage.DUTCH;
+ case ENGLISH:
+ return SnowballTokenFilterLanguage.ENGLISH;
+ case FINNISH:
+ return SnowballTokenFilterLanguage.FINNISH;
+ case FRENCH:
+ return SnowballTokenFilterLanguage.FRENCH;
+ case GERMAN:
+ return SnowballTokenFilterLanguage.GERMAN;
+ case GERMAN2:
+ return SnowballTokenFilterLanguage.GERMAN2;
+ case HUNGARIAN:
+ return SnowballTokenFilterLanguage.HUNGARIAN;
+ case ITALIAN:
+ return SnowballTokenFilterLanguage.ITALIAN;
+ case KP:
+ return SnowballTokenFilterLanguage.KP;
+ case LOVINS:
+ return SnowballTokenFilterLanguage.LOVINS;
+ case NORWEGIAN:
+ return SnowballTokenFilterLanguage.NORWEGIAN;
+ case PORTER:
+ return SnowballTokenFilterLanguage.PORTER;
+ case PORTUGUESE:
+ return SnowballTokenFilterLanguage.PORTUGUESE;
+ case ROMANIAN:
+ return SnowballTokenFilterLanguage.ROMANIAN;
+ case RUSSIAN:
+ return SnowballTokenFilterLanguage.RUSSIAN;
+ case SPANISH:
+ return SnowballTokenFilterLanguage.SPANISH;
+ case SWEDISH:
+ return SnowballTokenFilterLanguage.SWEDISH;
+ case TURKISH:
+ return SnowballTokenFilterLanguage.TURKISH;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_EXTERNAL_ERROR_MSG, obj)));
+ }
+ }
+
+ /**
+ * Maps from enum {@link SnowballTokenFilterLanguage} to enum
+ * {@link com.azure.search.documents.implementation.models.SnowballTokenFilterLanguage}.
+ */
+ public static com.azure.search.documents.implementation.models.SnowballTokenFilterLanguage map(SnowballTokenFilterLanguage obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case ARMENIAN:
+ return com.azure.search.documents.implementation.models.SnowballTokenFilterLanguage.ARMENIAN;
+ case BASQUE:
+ return com.azure.search.documents.implementation.models.SnowballTokenFilterLanguage.BASQUE;
+ case CATALAN:
+ return com.azure.search.documents.implementation.models.SnowballTokenFilterLanguage.CATALAN;
+ case DANISH:
+ return com.azure.search.documents.implementation.models.SnowballTokenFilterLanguage.DANISH;
+ case DUTCH:
+ return com.azure.search.documents.implementation.models.SnowballTokenFilterLanguage.DUTCH;
+ case ENGLISH:
+ return com.azure.search.documents.implementation.models.SnowballTokenFilterLanguage.ENGLISH;
+ case FINNISH:
+ return com.azure.search.documents.implementation.models.SnowballTokenFilterLanguage.FINNISH;
+ case FRENCH:
+ return com.azure.search.documents.implementation.models.SnowballTokenFilterLanguage.FRENCH;
+ case GERMAN:
+ return com.azure.search.documents.implementation.models.SnowballTokenFilterLanguage.GERMAN;
+ case GERMAN2:
+ return com.azure.search.documents.implementation.models.SnowballTokenFilterLanguage.GERMAN2;
+ case HUNGARIAN:
+ return com.azure.search.documents.implementation.models.SnowballTokenFilterLanguage.HUNGARIAN;
+ case ITALIAN:
+ return com.azure.search.documents.implementation.models.SnowballTokenFilterLanguage.ITALIAN;
+ case KP:
+ return com.azure.search.documents.implementation.models.SnowballTokenFilterLanguage.KP;
+ case LOVINS:
+ return com.azure.search.documents.implementation.models.SnowballTokenFilterLanguage.LOVINS;
+ case NORWEGIAN:
+ return com.azure.search.documents.implementation.models.SnowballTokenFilterLanguage.NORWEGIAN;
+ case PORTER:
+ return com.azure.search.documents.implementation.models.SnowballTokenFilterLanguage.PORTER;
+ case PORTUGUESE:
+ return com.azure.search.documents.implementation.models.SnowballTokenFilterLanguage.PORTUGUESE;
+ case ROMANIAN:
+ return com.azure.search.documents.implementation.models.SnowballTokenFilterLanguage.ROMANIAN;
+ case RUSSIAN:
+ return com.azure.search.documents.implementation.models.SnowballTokenFilterLanguage.RUSSIAN;
+ case SPANISH:
+ return com.azure.search.documents.implementation.models.SnowballTokenFilterLanguage.SPANISH;
+ case SWEDISH:
+ return com.azure.search.documents.implementation.models.SnowballTokenFilterLanguage.SWEDISH;
+ case TURKISH:
+ return com.azure.search.documents.implementation.models.SnowballTokenFilterLanguage.TURKISH;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj)));
+ }
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SoftDeleteColumnDeletionDetectionPolicyConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SoftDeleteColumnDeletionDetectionPolicyConverter.java
new file mode 100644
index 000000000000..c871b3fdcff6
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SoftDeleteColumnDeletionDetectionPolicyConverter.java
@@ -0,0 +1,53 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.SoftDeleteColumnDeletionDetectionPolicy;
+
+/**
+ * A converter between
+ * {@link com.azure.search.documents.implementation.models.SoftDeleteColumnDeletionDetectionPolicy} and
+ * {@link SoftDeleteColumnDeletionDetectionPolicy}.
+ */
+public final class SoftDeleteColumnDeletionDetectionPolicyConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(SoftDeleteColumnDeletionDetectionPolicyConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.SoftDeleteColumnDeletionDetectionPolicy} to
+ * {@link SoftDeleteColumnDeletionDetectionPolicy}.
+ */
+ public static SoftDeleteColumnDeletionDetectionPolicy map(com.azure.search.documents.implementation.models.SoftDeleteColumnDeletionDetectionPolicy obj) {
+ if (obj == null) {
+ return null;
+ }
+ SoftDeleteColumnDeletionDetectionPolicy softDeleteColumnDeletionDetectionPolicy =
+ new SoftDeleteColumnDeletionDetectionPolicy();
+
+ String _softDeleteColumnName = obj.getSoftDeleteColumnName();
+ softDeleteColumnDeletionDetectionPolicy.setSoftDeleteColumnName(_softDeleteColumnName);
+
+ String _softDeleteMarkerValue = obj.getSoftDeleteMarkerValue();
+ softDeleteColumnDeletionDetectionPolicy.setSoftDeleteMarkerValue(_softDeleteMarkerValue);
+ return softDeleteColumnDeletionDetectionPolicy;
+ }
+
+ /**
+ * Maps from {@link SoftDeleteColumnDeletionDetectionPolicy} to
+ * {@link com.azure.search.documents.implementation.models.SoftDeleteColumnDeletionDetectionPolicy}.
+ */
+ public static com.azure.search.documents.implementation.models.SoftDeleteColumnDeletionDetectionPolicy map(SoftDeleteColumnDeletionDetectionPolicy obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.SoftDeleteColumnDeletionDetectionPolicy softDeleteColumnDeletionDetectionPolicy = new com.azure.search.documents.implementation.models.SoftDeleteColumnDeletionDetectionPolicy();
+
+ String _softDeleteColumnName = obj.getSoftDeleteColumnName();
+ softDeleteColumnDeletionDetectionPolicy.setSoftDeleteColumnName(_softDeleteColumnName);
+
+ String _softDeleteMarkerValue = obj.getSoftDeleteMarkerValue();
+ softDeleteColumnDeletionDetectionPolicy.setSoftDeleteMarkerValue(_softDeleteMarkerValue);
+ return softDeleteColumnDeletionDetectionPolicy;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SplitSkillConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SplitSkillConverter.java
new file mode 100644
index 000000000000..254b4e7ce038
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SplitSkillConverter.java
@@ -0,0 +1,114 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.InputFieldMappingEntry;
+import com.azure.search.documents.models.OutputFieldMappingEntry;
+import com.azure.search.documents.models.SplitSkill;
+import com.azure.search.documents.models.SplitSkillLanguage;
+import com.azure.search.documents.models.TextSplitMode;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.SplitSkill} and {@link SplitSkill}.
+ */
+public final class SplitSkillConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(SplitSkillConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.SplitSkill} to {@link SplitSkill}.
+ */
+ public static SplitSkill map(com.azure.search.documents.implementation.models.SplitSkill obj) {
+ if (obj == null) {
+ return null;
+ }
+ SplitSkill splitSkill = new SplitSkill();
+
+ if (obj.getOutputs() != null) {
+ List _outputs =
+ obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ splitSkill.setOutputs(_outputs);
+ }
+
+ if (obj.getInputs() != null) {
+ List _inputs =
+ obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ splitSkill.setInputs(_inputs);
+ }
+
+ String _name = obj.getName();
+ splitSkill.setName(_name);
+
+ String _context = obj.getContext();
+ splitSkill.setContext(_context);
+
+ String _description = obj.getDescription();
+ splitSkill.setDescription(_description);
+
+ Integer _maximumPageLength = obj.getMaximumPageLength();
+ splitSkill.setMaximumPageLength(_maximumPageLength);
+
+ if (obj.getTextSplitMode() != null) {
+ TextSplitMode _textSplitMode = TextSplitModeConverter.map(obj.getTextSplitMode());
+ splitSkill.setTextSplitMode(_textSplitMode);
+ }
+
+ if (obj.getDefaultLanguageCode() != null) {
+ SplitSkillLanguage _defaultLanguageCode = SplitSkillLanguageConverter.map(obj.getDefaultLanguageCode());
+ splitSkill.setDefaultLanguageCode(_defaultLanguageCode);
+ }
+ return splitSkill;
+ }
+
+ /**
+ * Maps from {@link SplitSkill} to {@link com.azure.search.documents.implementation.models.SplitSkill}.
+ */
+ public static com.azure.search.documents.implementation.models.SplitSkill map(SplitSkill obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.SplitSkill splitSkill =
+ new com.azure.search.documents.implementation.models.SplitSkill();
+
+ if (obj.getOutputs() != null) {
+ List _outputs =
+ obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ splitSkill.setOutputs(_outputs);
+ }
+
+ if (obj.getInputs() != null) {
+ List _inputs =
+ obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ splitSkill.setInputs(_inputs);
+ }
+
+ String _name = obj.getName();
+ splitSkill.setName(_name);
+
+ String _context = obj.getContext();
+ splitSkill.setContext(_context);
+
+ String _description = obj.getDescription();
+ splitSkill.setDescription(_description);
+
+ Integer _maximumPageLength = obj.getMaximumPageLength();
+ splitSkill.setMaximumPageLength(_maximumPageLength);
+
+ if (obj.getTextSplitMode() != null) {
+ com.azure.search.documents.implementation.models.TextSplitMode _textSplitMode =
+ TextSplitModeConverter.map(obj.getTextSplitMode());
+ splitSkill.setTextSplitMode(_textSplitMode);
+ }
+
+ if (obj.getDefaultLanguageCode() != null) {
+ com.azure.search.documents.implementation.models.SplitSkillLanguage _defaultLanguageCode =
+ SplitSkillLanguageConverter.map(obj.getDefaultLanguageCode());
+ splitSkill.setDefaultLanguageCode(_defaultLanguageCode);
+ }
+ return splitSkill;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SplitSkillLanguageConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SplitSkillLanguageConverter.java
new file mode 100644
index 000000000000..15b960e30709
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SplitSkillLanguageConverter.java
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.SplitSkillLanguage;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.SplitSkillLanguage} and
+ * {@link SplitSkillLanguage}.
+ */
+public final class SplitSkillLanguageConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(SplitSkillLanguageConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.SplitSkillLanguage} to enum
+ * {@link SplitSkillLanguage}.
+ */
+ public static SplitSkillLanguage map(com.azure.search.documents.implementation.models.SplitSkillLanguage obj) {
+ if (obj == null) {
+ return null;
+ }
+ return SplitSkillLanguage.fromString(obj.toString());
+ }
+
+ /**
+ * Maps from enum {@link SplitSkillLanguage} to enum
+ * {@link com.azure.search.documents.implementation.models.SplitSkillLanguage}.
+ */
+ public static com.azure.search.documents.implementation.models.SplitSkillLanguage map(SplitSkillLanguage obj) {
+ if (obj == null) {
+ return null;
+ }
+ return com.azure.search.documents.implementation.models.SplitSkillLanguage.fromString(obj.toString());
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SqlIntegratedChangeTrackingPolicyConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SqlIntegratedChangeTrackingPolicyConverter.java
new file mode 100644
index 000000000000..9550d7384c7d
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SqlIntegratedChangeTrackingPolicyConverter.java
@@ -0,0 +1,39 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.SqlIntegratedChangeTrackingPolicy;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.SqlIntegratedChangeTrackingPolicy} and
+ * {@link SqlIntegratedChangeTrackingPolicy}.
+ */
+public final class SqlIntegratedChangeTrackingPolicyConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(SqlIntegratedChangeTrackingPolicyConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.SqlIntegratedChangeTrackingPolicy} to
+ * {@link SqlIntegratedChangeTrackingPolicy}.
+ */
+ public static SqlIntegratedChangeTrackingPolicy map(com.azure.search.documents.implementation.models.SqlIntegratedChangeTrackingPolicy obj) {
+ if (obj == null) {
+ return null;
+ }
+ SqlIntegratedChangeTrackingPolicy sqlIntegratedChangeTrackingPolicy = new SqlIntegratedChangeTrackingPolicy();
+ return sqlIntegratedChangeTrackingPolicy;
+ }
+
+ /**
+ * Maps from {@link SqlIntegratedChangeTrackingPolicy} to
+ * {@link com.azure.search.documents.implementation.models.SqlIntegratedChangeTrackingPolicy}.
+ */
+ public static com.azure.search.documents.implementation.models.SqlIntegratedChangeTrackingPolicy map(SqlIntegratedChangeTrackingPolicy obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.SqlIntegratedChangeTrackingPolicy sqlIntegratedChangeTrackingPolicy = new com.azure.search.documents.implementation.models.SqlIntegratedChangeTrackingPolicy();
+ return sqlIntegratedChangeTrackingPolicy;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StemmerOverrideTokenFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StemmerOverrideTokenFilterConverter.java
new file mode 100644
index 000000000000..4b1322b519e3
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StemmerOverrideTokenFilterConverter.java
@@ -0,0 +1,60 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.StemmerOverrideTokenFilter;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.StemmerOverrideTokenFilter} and
+ * {@link StemmerOverrideTokenFilter}.
+ */
+public final class StemmerOverrideTokenFilterConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(StemmerOverrideTokenFilterConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.StemmerOverrideTokenFilter} to
+ * {@link StemmerOverrideTokenFilter}.
+ */
+ public static StemmerOverrideTokenFilter map(com.azure.search.documents.implementation.models.StemmerOverrideTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ StemmerOverrideTokenFilter stemmerOverrideTokenFilter = new StemmerOverrideTokenFilter();
+
+ String _name = obj.getName();
+ stemmerOverrideTokenFilter.setName(_name);
+
+ if (obj.getRules() != null) {
+ List _rules = new ArrayList<>(obj.getRules());
+ stemmerOverrideTokenFilter.setRules(_rules);
+ }
+ return stemmerOverrideTokenFilter;
+ }
+
+ /**
+ * Maps from {@link StemmerOverrideTokenFilter} to
+ * {@link com.azure.search.documents.implementation.models.StemmerOverrideTokenFilter}.
+ */
+ public static com.azure.search.documents.implementation.models.StemmerOverrideTokenFilter map(StemmerOverrideTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.StemmerOverrideTokenFilter stemmerOverrideTokenFilter =
+ new com.azure.search.documents.implementation.models.StemmerOverrideTokenFilter();
+
+ String _name = obj.getName();
+ stemmerOverrideTokenFilter.setName(_name);
+
+ if (obj.getRules() != null) {
+ List _rules = new ArrayList<>(obj.getRules());
+ stemmerOverrideTokenFilter.setRules(_rules);
+ }
+ return stemmerOverrideTokenFilter;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StemmerTokenFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StemmerTokenFilterConverter.java
new file mode 100644
index 000000000000..7e803cbf2ea5
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StemmerTokenFilterConverter.java
@@ -0,0 +1,58 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.StemmerTokenFilter;
+import com.azure.search.documents.models.StemmerTokenFilterLanguage;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.StemmerTokenFilter} and
+ * {@link StemmerTokenFilter}.
+ */
+public final class StemmerTokenFilterConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(StemmerTokenFilterConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.StemmerTokenFilter} to
+ * {@link StemmerTokenFilter}.
+ */
+ public static StemmerTokenFilter map(com.azure.search.documents.implementation.models.StemmerTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ StemmerTokenFilter stemmerTokenFilter = new StemmerTokenFilter();
+
+ String _name = obj.getName();
+ stemmerTokenFilter.setName(_name);
+
+ if (obj.getLanguage() != null) {
+ StemmerTokenFilterLanguage _language = StemmerTokenFilterLanguageConverter.map(obj.getLanguage());
+ stemmerTokenFilter.setLanguage(_language);
+ }
+ return stemmerTokenFilter;
+ }
+
+ /**
+ * Maps from {@link StemmerTokenFilter} to
+ * {@link com.azure.search.documents.implementation.models.StemmerTokenFilter}.
+ */
+ public static com.azure.search.documents.implementation.models.StemmerTokenFilter map(StemmerTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.StemmerTokenFilter stemmerTokenFilter =
+ new com.azure.search.documents.implementation.models.StemmerTokenFilter();
+
+ String _name = obj.getName();
+ stemmerTokenFilter.setName(_name);
+
+ if (obj.getLanguage() != null) {
+ com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage _language =
+ StemmerTokenFilterLanguageConverter.map(obj.getLanguage());
+ stemmerTokenFilter.setLanguage(_language);
+ }
+ return stemmerTokenFilter;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StemmerTokenFilterLanguageConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StemmerTokenFilterLanguageConverter.java
new file mode 100644
index 000000000000..0d271c18149d
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StemmerTokenFilterLanguageConverter.java
@@ -0,0 +1,262 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.StemmerTokenFilterLanguage;
+
+import static com.azure.search.documents.implementation.util.Constants.ENUM_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ENUM_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage} and
+ * {@link StemmerTokenFilterLanguage}.
+ */
+public final class StemmerTokenFilterLanguageConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(StemmerTokenFilterLanguageConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage} to enum
+ * {@link StemmerTokenFilterLanguage}.
+ */
+ public static StemmerTokenFilterLanguage map(com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case ARABIC:
+ return StemmerTokenFilterLanguage.ARABIC;
+ case ARMENIAN:
+ return StemmerTokenFilterLanguage.ARMENIAN;
+ case BASQUE:
+ return StemmerTokenFilterLanguage.BASQUE;
+ case BRAZILIAN:
+ return StemmerTokenFilterLanguage.BRAZILIAN;
+ case BULGARIAN:
+ return StemmerTokenFilterLanguage.BULGARIAN;
+ case CATALAN:
+ return StemmerTokenFilterLanguage.CATALAN;
+ case CZECH:
+ return StemmerTokenFilterLanguage.CZECH;
+ case DANISH:
+ return StemmerTokenFilterLanguage.DANISH;
+ case DUTCH:
+ return StemmerTokenFilterLanguage.DUTCH;
+ case DUTCH_KP:
+ return StemmerTokenFilterLanguage.DUTCH_KP;
+ case ENGLISH:
+ return StemmerTokenFilterLanguage.ENGLISH;
+ case LIGHT_ENGLISH:
+ return StemmerTokenFilterLanguage.LIGHT_ENGLISH;
+ case MINIMAL_ENGLISH:
+ return StemmerTokenFilterLanguage.MINIMAL_ENGLISH;
+ case POSSESSIVE_ENGLISH:
+ return StemmerTokenFilterLanguage.POSSESSIVE_ENGLISH;
+ case PORTER2:
+ return StemmerTokenFilterLanguage.PORTER2;
+ case LOVINS:
+ return StemmerTokenFilterLanguage.LOVINS;
+ case FINNISH:
+ return StemmerTokenFilterLanguage.FINNISH;
+ case LIGHT_FINNISH:
+ return StemmerTokenFilterLanguage.LIGHT_FINNISH;
+ case FRENCH:
+ return StemmerTokenFilterLanguage.FRENCH;
+ case LIGHT_FRENCH:
+ return StemmerTokenFilterLanguage.LIGHT_FRENCH;
+ case MINIMAL_FRENCH:
+ return StemmerTokenFilterLanguage.MINIMAL_FRENCH;
+ case GALICIAN:
+ return StemmerTokenFilterLanguage.GALICIAN;
+ case MINIMAL_GALICIAN:
+ return StemmerTokenFilterLanguage.MINIMAL_GALICIAN;
+ case GERMAN:
+ return StemmerTokenFilterLanguage.GERMAN;
+ case GERMAN2:
+ return StemmerTokenFilterLanguage.GERMAN2;
+ case LIGHT_GERMAN:
+ return StemmerTokenFilterLanguage.LIGHT_GERMAN;
+ case MINIMAL_GERMAN:
+ return StemmerTokenFilterLanguage.MINIMAL_GERMAN;
+ case GREEK:
+ return StemmerTokenFilterLanguage.GREEK;
+ case HINDI:
+ return StemmerTokenFilterLanguage.HINDI;
+ case HUNGARIAN:
+ return StemmerTokenFilterLanguage.HUNGARIAN;
+ case LIGHT_HUNGARIAN:
+ return StemmerTokenFilterLanguage.LIGHT_HUNGARIAN;
+ case INDONESIAN:
+ return StemmerTokenFilterLanguage.INDONESIAN;
+ case IRISH:
+ return StemmerTokenFilterLanguage.IRISH;
+ case ITALIAN:
+ return StemmerTokenFilterLanguage.ITALIAN;
+ case LIGHT_ITALIAN:
+ return StemmerTokenFilterLanguage.LIGHT_ITALIAN;
+ case SORANI:
+ return StemmerTokenFilterLanguage.SORANI;
+ case LATVIAN:
+ return StemmerTokenFilterLanguage.LATVIAN;
+ case NORWEGIAN:
+ return StemmerTokenFilterLanguage.NORWEGIAN;
+ case LIGHT_NORWEGIAN:
+ return StemmerTokenFilterLanguage.LIGHT_NORWEGIAN;
+ case MINIMAL_NORWEGIAN:
+ return StemmerTokenFilterLanguage.MINIMAL_NORWEGIAN;
+ case LIGHT_NYNORSK:
+ return StemmerTokenFilterLanguage.LIGHT_NYNORSK;
+ case MINIMAL_NYNORSK:
+ return StemmerTokenFilterLanguage.MINIMAL_NYNORSK;
+ case PORTUGUESE:
+ return StemmerTokenFilterLanguage.PORTUGUESE;
+ case LIGHT_PORTUGUESE:
+ return StemmerTokenFilterLanguage.LIGHT_PORTUGUESE;
+ case MINIMAL_PORTUGUESE:
+ return StemmerTokenFilterLanguage.MINIMAL_PORTUGUESE;
+ case PORTUGUESE_RSLP:
+ return StemmerTokenFilterLanguage.PORTUGUESE_RSLP;
+ case ROMANIAN:
+ return StemmerTokenFilterLanguage.ROMANIAN;
+ case RUSSIAN:
+ return StemmerTokenFilterLanguage.RUSSIAN;
+ case LIGHT_RUSSIAN:
+ return StemmerTokenFilterLanguage.LIGHT_RUSSIAN;
+ case SPANISH:
+ return StemmerTokenFilterLanguage.SPANISH;
+ case LIGHT_SPANISH:
+ return StemmerTokenFilterLanguage.LIGHT_SPANISH;
+ case SWEDISH:
+ return StemmerTokenFilterLanguage.SWEDISH;
+ case LIGHT_SWEDISH:
+ return StemmerTokenFilterLanguage.LIGHT_SWEDISH;
+ case TURKISH:
+ return StemmerTokenFilterLanguage.TURKISH;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_EXTERNAL_ERROR_MSG, obj)));
+ }
+ }
+
+ /**
+ * Maps from enum {@link StemmerTokenFilterLanguage} to enum
+ * {@link com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage}.
+ */
+ public static com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage map(StemmerTokenFilterLanguage obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case ARABIC:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.ARABIC;
+ case ARMENIAN:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.ARMENIAN;
+ case BASQUE:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.BASQUE;
+ case BRAZILIAN:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.BRAZILIAN;
+ case BULGARIAN:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.BULGARIAN;
+ case CATALAN:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.CATALAN;
+ case CZECH:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.CZECH;
+ case DANISH:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.DANISH;
+ case DUTCH:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.DUTCH;
+ case DUTCH_KP:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.DUTCH_KP;
+ case ENGLISH:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.ENGLISH;
+ case LIGHT_ENGLISH:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.LIGHT_ENGLISH;
+ case MINIMAL_ENGLISH:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.MINIMAL_ENGLISH;
+ case POSSESSIVE_ENGLISH:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.POSSESSIVE_ENGLISH;
+ case PORTER2:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.PORTER2;
+ case LOVINS:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.LOVINS;
+ case FINNISH:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.FINNISH;
+ case LIGHT_FINNISH:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.LIGHT_FINNISH;
+ case FRENCH:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.FRENCH;
+ case LIGHT_FRENCH:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.LIGHT_FRENCH;
+ case MINIMAL_FRENCH:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.MINIMAL_FRENCH;
+ case GALICIAN:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.GALICIAN;
+ case MINIMAL_GALICIAN:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.MINIMAL_GALICIAN;
+ case GERMAN:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.GERMAN;
+ case GERMAN2:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.GERMAN2;
+ case LIGHT_GERMAN:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.LIGHT_GERMAN;
+ case MINIMAL_GERMAN:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.MINIMAL_GERMAN;
+ case GREEK:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.GREEK;
+ case HINDI:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.HINDI;
+ case HUNGARIAN:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.HUNGARIAN;
+ case LIGHT_HUNGARIAN:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.LIGHT_HUNGARIAN;
+ case INDONESIAN:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.INDONESIAN;
+ case IRISH:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.IRISH;
+ case ITALIAN:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.ITALIAN;
+ case LIGHT_ITALIAN:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.LIGHT_ITALIAN;
+ case SORANI:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.SORANI;
+ case LATVIAN:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.LATVIAN;
+ case NORWEGIAN:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.NORWEGIAN;
+ case LIGHT_NORWEGIAN:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.LIGHT_NORWEGIAN;
+ case MINIMAL_NORWEGIAN:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.MINIMAL_NORWEGIAN;
+ case LIGHT_NYNORSK:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.LIGHT_NYNORSK;
+ case MINIMAL_NYNORSK:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.MINIMAL_NYNORSK;
+ case PORTUGUESE:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.PORTUGUESE;
+ case LIGHT_PORTUGUESE:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.LIGHT_PORTUGUESE;
+ case MINIMAL_PORTUGUESE:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.MINIMAL_PORTUGUESE;
+ case PORTUGUESE_RSLP:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.PORTUGUESE_RSLP;
+ case ROMANIAN:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.ROMANIAN;
+ case RUSSIAN:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.RUSSIAN;
+ case LIGHT_RUSSIAN:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.LIGHT_RUSSIAN;
+ case SPANISH:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.SPANISH;
+ case LIGHT_SPANISH:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.LIGHT_SPANISH;
+ case SWEDISH:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.SWEDISH;
+ case LIGHT_SWEDISH:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.LIGHT_SWEDISH;
+ case TURKISH:
+ return com.azure.search.documents.implementation.models.StemmerTokenFilterLanguage.TURKISH;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj)));
+ }
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StopAnalyzerConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StopAnalyzerConverter.java
new file mode 100644
index 000000000000..41d4c4353d02
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StopAnalyzerConverter.java
@@ -0,0 +1,57 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.StopAnalyzer;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.StopAnalyzer} and {@link StopAnalyzer}.
+ */
+public final class StopAnalyzerConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(StopAnalyzerConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.StopAnalyzer} to {@link StopAnalyzer}.
+ */
+ public static StopAnalyzer map(com.azure.search.documents.implementation.models.StopAnalyzer obj) {
+ if (obj == null) {
+ return null;
+ }
+ StopAnalyzer stopAnalyzer = new StopAnalyzer();
+
+ String _name = obj.getName();
+ stopAnalyzer.setName(_name);
+
+ if (obj.getStopwords() != null) {
+ List _stopwords = new ArrayList<>(obj.getStopwords());
+ stopAnalyzer.setStopwords(_stopwords);
+ }
+ return stopAnalyzer;
+ }
+
+ /**
+ * Maps from {@link StopAnalyzer} to {@link com.azure.search.documents.implementation.models.StopAnalyzer}.
+ */
+ public static com.azure.search.documents.implementation.models.StopAnalyzer map(StopAnalyzer obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.StopAnalyzer stopAnalyzer =
+ new com.azure.search.documents.implementation.models.StopAnalyzer();
+
+ String _name = obj.getName();
+ stopAnalyzer.setName(_name);
+
+ if (obj.getStopwords() != null) {
+ List _stopwords = new ArrayList<>(obj.getStopwords());
+ stopAnalyzer.setStopwords(_stopwords);
+ }
+ return stopAnalyzer;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StopwordsListConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StopwordsListConverter.java
new file mode 100644
index 000000000000..bda0c891a8c5
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StopwordsListConverter.java
@@ -0,0 +1,169 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.StopwordsList;
+
+import static com.azure.search.documents.implementation.util.Constants.ENUM_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ENUM_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.StopwordsList} and {@link StopwordsList}.
+ */
+public final class StopwordsListConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(StopwordsListConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.StopwordsList} to enum
+ * {@link StopwordsList}.
+ */
+ public static StopwordsList map(com.azure.search.documents.implementation.models.StopwordsList obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case ARABIC:
+ return StopwordsList.ARABIC;
+ case ARMENIAN:
+ return StopwordsList.ARMENIAN;
+ case BASQUE:
+ return StopwordsList.BASQUE;
+ case BRAZILIAN:
+ return StopwordsList.BRAZILIAN;
+ case BULGARIAN:
+ return StopwordsList.BULGARIAN;
+ case CATALAN:
+ return StopwordsList.CATALAN;
+ case CZECH:
+ return StopwordsList.CZECH;
+ case DANISH:
+ return StopwordsList.DANISH;
+ case DUTCH:
+ return StopwordsList.DUTCH;
+ case ENGLISH:
+ return StopwordsList.ENGLISH;
+ case FINNISH:
+ return StopwordsList.FINNISH;
+ case FRENCH:
+ return StopwordsList.FRENCH;
+ case GALICIAN:
+ return StopwordsList.GALICIAN;
+ case GERMAN:
+ return StopwordsList.GERMAN;
+ case GREEK:
+ return StopwordsList.GREEK;
+ case HINDI:
+ return StopwordsList.HINDI;
+ case HUNGARIAN:
+ return StopwordsList.HUNGARIAN;
+ case INDONESIAN:
+ return StopwordsList.INDONESIAN;
+ case IRISH:
+ return StopwordsList.IRISH;
+ case ITALIAN:
+ return StopwordsList.ITALIAN;
+ case LATVIAN:
+ return StopwordsList.LATVIAN;
+ case NORWEGIAN:
+ return StopwordsList.NORWEGIAN;
+ case PERSIAN:
+ return StopwordsList.PERSIAN;
+ case PORTUGUESE:
+ return StopwordsList.PORTUGUESE;
+ case ROMANIAN:
+ return StopwordsList.ROMANIAN;
+ case RUSSIAN:
+ return StopwordsList.RUSSIAN;
+ case SORANI:
+ return StopwordsList.SORANI;
+ case SPANISH:
+ return StopwordsList.SPANISH;
+ case SWEDISH:
+ return StopwordsList.SWEDISH;
+ case THAI:
+ return StopwordsList.THAI;
+ case TURKISH:
+ return StopwordsList.TURKISH;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_EXTERNAL_ERROR_MSG, obj)));
+ }
+ }
+
+ /**
+ * Maps from enum {@link StopwordsList} to enum
+ * {@link com.azure.search.documents.implementation.models.StopwordsList}.
+ */
+ public static com.azure.search.documents.implementation.models.StopwordsList map(StopwordsList obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case ARABIC:
+ return com.azure.search.documents.implementation.models.StopwordsList.ARABIC;
+ case ARMENIAN:
+ return com.azure.search.documents.implementation.models.StopwordsList.ARMENIAN;
+ case BASQUE:
+ return com.azure.search.documents.implementation.models.StopwordsList.BASQUE;
+ case BRAZILIAN:
+ return com.azure.search.documents.implementation.models.StopwordsList.BRAZILIAN;
+ case BULGARIAN:
+ return com.azure.search.documents.implementation.models.StopwordsList.BULGARIAN;
+ case CATALAN:
+ return com.azure.search.documents.implementation.models.StopwordsList.CATALAN;
+ case CZECH:
+ return com.azure.search.documents.implementation.models.StopwordsList.CZECH;
+ case DANISH:
+ return com.azure.search.documents.implementation.models.StopwordsList.DANISH;
+ case DUTCH:
+ return com.azure.search.documents.implementation.models.StopwordsList.DUTCH;
+ case ENGLISH:
+ return com.azure.search.documents.implementation.models.StopwordsList.ENGLISH;
+ case FINNISH:
+ return com.azure.search.documents.implementation.models.StopwordsList.FINNISH;
+ case FRENCH:
+ return com.azure.search.documents.implementation.models.StopwordsList.FRENCH;
+ case GALICIAN:
+ return com.azure.search.documents.implementation.models.StopwordsList.GALICIAN;
+ case GERMAN:
+ return com.azure.search.documents.implementation.models.StopwordsList.GERMAN;
+ case GREEK:
+ return com.azure.search.documents.implementation.models.StopwordsList.GREEK;
+ case HINDI:
+ return com.azure.search.documents.implementation.models.StopwordsList.HINDI;
+ case HUNGARIAN:
+ return com.azure.search.documents.implementation.models.StopwordsList.HUNGARIAN;
+ case INDONESIAN:
+ return com.azure.search.documents.implementation.models.StopwordsList.INDONESIAN;
+ case IRISH:
+ return com.azure.search.documents.implementation.models.StopwordsList.IRISH;
+ case ITALIAN:
+ return com.azure.search.documents.implementation.models.StopwordsList.ITALIAN;
+ case LATVIAN:
+ return com.azure.search.documents.implementation.models.StopwordsList.LATVIAN;
+ case NORWEGIAN:
+ return com.azure.search.documents.implementation.models.StopwordsList.NORWEGIAN;
+ case PERSIAN:
+ return com.azure.search.documents.implementation.models.StopwordsList.PERSIAN;
+ case PORTUGUESE:
+ return com.azure.search.documents.implementation.models.StopwordsList.PORTUGUESE;
+ case ROMANIAN:
+ return com.azure.search.documents.implementation.models.StopwordsList.ROMANIAN;
+ case RUSSIAN:
+ return com.azure.search.documents.implementation.models.StopwordsList.RUSSIAN;
+ case SORANI:
+ return com.azure.search.documents.implementation.models.StopwordsList.SORANI;
+ case SPANISH:
+ return com.azure.search.documents.implementation.models.StopwordsList.SPANISH;
+ case SWEDISH:
+ return com.azure.search.documents.implementation.models.StopwordsList.SWEDISH;
+ case THAI:
+ return com.azure.search.documents.implementation.models.StopwordsList.THAI;
+ case TURKISH:
+ return com.azure.search.documents.implementation.models.StopwordsList.TURKISH;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj)));
+ }
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StopwordsTokenFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StopwordsTokenFilterConverter.java
new file mode 100644
index 000000000000..eca40ba9cd7b
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StopwordsTokenFilterConverter.java
@@ -0,0 +1,84 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.StopwordsList;
+import com.azure.search.documents.models.StopwordsTokenFilter;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.StopwordsTokenFilter} and
+ * {@link StopwordsTokenFilter}.
+ */
+public final class StopwordsTokenFilterConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(StopwordsTokenFilterConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.StopwordsTokenFilter} to
+ * {@link StopwordsTokenFilter}.
+ */
+ public static StopwordsTokenFilter map(com.azure.search.documents.implementation.models.StopwordsTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ StopwordsTokenFilter stopwordsTokenFilter = new StopwordsTokenFilter();
+
+ String _name = obj.getName();
+ stopwordsTokenFilter.setName(_name);
+
+ Boolean _removeTrailingStopWords = obj.isRemoveTrailingStopWords();
+ stopwordsTokenFilter.setRemoveTrailingStopWords(_removeTrailingStopWords);
+
+ Boolean _ignoreCase = obj.isIgnoreCase();
+ stopwordsTokenFilter.setIgnoreCase(_ignoreCase);
+
+ if (obj.getStopwords() != null) {
+ List _stopwords = new ArrayList<>(obj.getStopwords());
+ stopwordsTokenFilter.setStopwords(_stopwords);
+ }
+
+ if (obj.getStopwordsList() != null) {
+ StopwordsList _stopwordsList = StopwordsListConverter.map(obj.getStopwordsList());
+ stopwordsTokenFilter.setStopwordsList(_stopwordsList);
+ }
+ return stopwordsTokenFilter;
+ }
+
+ /**
+ * Maps from {@link StopwordsTokenFilter} to
+ * {@link com.azure.search.documents.implementation.models.StopwordsTokenFilter}.
+ */
+ public static com.azure.search.documents.implementation.models.StopwordsTokenFilter map(StopwordsTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.StopwordsTokenFilter stopwordsTokenFilter =
+ new com.azure.search.documents.implementation.models.StopwordsTokenFilter();
+
+ String _name = obj.getName();
+ stopwordsTokenFilter.setName(_name);
+
+ Boolean _removeTrailingStopWords = obj.isRemoveTrailingStopWords();
+ stopwordsTokenFilter.setRemoveTrailingStopWords(_removeTrailingStopWords);
+
+ Boolean _ignoreCase = obj.isIgnoreCase();
+ stopwordsTokenFilter.setIgnoreCase(_ignoreCase);
+
+ if (obj.getStopwords() != null) {
+ List _stopwords = new ArrayList<>(obj.getStopwords());
+ stopwordsTokenFilter.setStopwords(_stopwords);
+ }
+
+ if (obj.getStopwordsList() != null) {
+ com.azure.search.documents.implementation.models.StopwordsList _stopwordsList =
+ StopwordsListConverter.map(obj.getStopwordsList());
+ stopwordsTokenFilter.setStopwordsList(_stopwordsList);
+ }
+ return stopwordsTokenFilter;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SuggestOptionsConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SuggestOptionsConverter.java
new file mode 100644
index 000000000000..b7494f87b272
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SuggestOptionsConverter.java
@@ -0,0 +1,108 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.implementation.util.PrivateFieldAccessHelper;
+import com.azure.search.documents.models.SuggestOptions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.SuggestOptions} and
+ * {@link SuggestOptions}.
+ */
+public final class SuggestOptionsConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(SuggestOptionsConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.SuggestOptions} to {@link SuggestOptions}.
+ */
+ public static SuggestOptions map(com.azure.search.documents.implementation.models.SuggestOptions obj) {
+ if (obj == null) {
+ return null;
+ }
+ SuggestOptions suggestOptions = new SuggestOptions();
+
+ String _filter = obj.getFilter();
+ suggestOptions.setFilter(_filter);
+
+ Boolean _useFuzzyMatching = obj.isUseFuzzyMatching();
+ suggestOptions.setUseFuzzyMatching(_useFuzzyMatching);
+
+ Double _minimumCoverage = obj.getMinimumCoverage();
+ suggestOptions.setMinimumCoverage(_minimumCoverage);
+
+ if (obj.getSelect() != null) {
+ List _select = new ArrayList<>(obj.getSelect());
+ PrivateFieldAccessHelper.set(suggestOptions, "select", _select);
+ }
+
+ Integer _top = obj.getTop();
+ suggestOptions.setTop(_top);
+
+ String _highlightPostTag = obj.getHighlightPostTag();
+ suggestOptions.setHighlightPostTag(_highlightPostTag);
+
+ if (obj.getOrderBy() != null) {
+ List _orderBy = new ArrayList<>(obj.getOrderBy());
+ PrivateFieldAccessHelper.set(suggestOptions, "orderBy", _orderBy);
+ }
+
+ if (obj.getSearchFields() != null) {
+ List _searchFields = new ArrayList<>(obj.getSearchFields());
+ PrivateFieldAccessHelper.set(suggestOptions, "searchFields", _searchFields);
+ }
+
+ String _highlightPreTag = obj.getHighlightPreTag();
+ suggestOptions.setHighlightPreTag(_highlightPreTag);
+ return suggestOptions;
+ }
+
+ /**
+ * Maps from {@link SuggestOptions} to {@link com.azure.search.documents.implementation.models.SuggestOptions}.
+ */
+ public static com.azure.search.documents.implementation.models.SuggestOptions map(SuggestOptions obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.SuggestOptions suggestOptions =
+ new com.azure.search.documents.implementation.models.SuggestOptions();
+
+ String _filter = obj.getFilter();
+ suggestOptions.setFilter(_filter);
+
+ Boolean _useFuzzyMatching = obj.useFuzzyMatching();
+ suggestOptions.setUseFuzzyMatching(_useFuzzyMatching);
+
+ Double _minimumCoverage = obj.getMinimumCoverage();
+ suggestOptions.setMinimumCoverage(_minimumCoverage);
+
+ if (obj.getSelect() != null) {
+ List _select = new ArrayList<>(obj.getSelect());
+ PrivateFieldAccessHelper.set(suggestOptions, "select", _select);
+ }
+
+ Integer _top = obj.getTop();
+ suggestOptions.setTop(_top);
+
+ String _highlightPostTag = obj.getHighlightPostTag();
+ suggestOptions.setHighlightPostTag(_highlightPostTag);
+
+ if (obj.getOrderBy() != null) {
+ List _orderBy = new ArrayList<>(obj.getOrderBy());
+ PrivateFieldAccessHelper.set(suggestOptions, "orderBy", _orderBy);
+ }
+
+ if (obj.getSearchFields() != null) {
+ List _searchFields = new ArrayList<>(obj.getSearchFields());
+ PrivateFieldAccessHelper.set(suggestOptions, "searchFields", _searchFields);
+ }
+
+ String _highlightPreTag = obj.getHighlightPreTag();
+ suggestOptions.setHighlightPreTag(_highlightPreTag);
+ return suggestOptions;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SuggestResultConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SuggestResultConverter.java
new file mode 100644
index 000000000000..1356df7c8a8a
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SuggestResultConverter.java
@@ -0,0 +1,53 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.SearchDocument;
+import com.azure.search.documents.implementation.util.PrivateFieldAccessHelper;
+import com.azure.search.documents.models.SuggestResult;
+
+import java.util.Map;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.SuggestResult} and {@link SuggestResult}.
+ */
+public final class SuggestResultConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(SuggestResultConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.SuggestResult} to {@link SuggestResult}.
+ */
+ public static SuggestResult map(com.azure.search.documents.implementation.models.SuggestResult obj) {
+ if (obj == null) {
+ return null;
+ }
+ SuggestResult suggestResult = new SuggestResult();
+
+ SearchDocument _additionalProperties = new SearchDocument(obj.getAdditionalProperties());
+ PrivateFieldAccessHelper.set(suggestResult, "additionalProperties", _additionalProperties);
+
+ String _text = obj.getText();
+ PrivateFieldAccessHelper.set(suggestResult, "text", _text);
+ return suggestResult;
+ }
+
+ /**
+ * Maps from {@link SuggestResult} to {@link com.azure.search.documents.implementation.models.SuggestResult}.
+ */
+ public static com.azure.search.documents.implementation.models.SuggestResult map(SuggestResult obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.SuggestResult suggestResult =
+ new com.azure.search.documents.implementation.models.SuggestResult();
+
+ Map _additionalProperties = obj.getDocument();
+ PrivateFieldAccessHelper.set(suggestResult, "additionalProperties", _additionalProperties);
+
+ String _text = obj.getText();
+ PrivateFieldAccessHelper.set(suggestResult, "text", _text);
+ return suggestResult;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SuggesterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SuggesterConverter.java
new file mode 100644
index 000000000000..93b79e5218e9
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SuggesterConverter.java
@@ -0,0 +1,62 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.implementation.util.PrivateFieldAccessHelper;
+import com.azure.search.documents.models.Suggester;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.Suggester} and {@link Suggester}.
+ */
+public final class SuggesterConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(SuggesterConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.Suggester} to {@link Suggester}.
+ */
+ public static Suggester map(com.azure.search.documents.implementation.models.Suggester obj) {
+ if (obj == null) {
+ return null;
+ }
+ Suggester suggester = new Suggester();
+
+ if (obj.getSourceFields() != null) {
+ List _sourceFields = new ArrayList<>(obj.getSourceFields());
+ suggester.setSourceFields(_sourceFields);
+ }
+
+ String _name = obj.getName();
+ suggester.setName(_name);
+
+ String _searchMode = obj.getSearchMode();
+ PrivateFieldAccessHelper.set(suggester, "searchMode", _searchMode);
+ return suggester;
+ }
+
+ /**
+ * Maps from {@link Suggester} to {@link com.azure.search.documents.implementation.models.Suggester}.
+ */
+ public static com.azure.search.documents.implementation.models.Suggester map(Suggester obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.Suggester suggester =
+ new com.azure.search.documents.implementation.models.Suggester();
+
+ if (obj.getSourceFields() != null) {
+ List _sourceFields = new ArrayList<>(obj.getSourceFields());
+ suggester.setSourceFields(_sourceFields);
+ }
+
+ String _name = obj.getName();
+ suggester.setName(_name);
+
+ suggester.setSearchMode("analyzingInfixMatching");
+ return suggester;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SynonymMapConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SynonymMapConverter.java
new file mode 100644
index 000000000000..7daf8c9b7be6
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SynonymMapConverter.java
@@ -0,0 +1,74 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.implementation.util.PrivateFieldAccessHelper;
+import com.azure.search.documents.models.SearchResourceEncryptionKey;
+import com.azure.search.documents.models.SynonymMap;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.SynonymMap} and {@link SynonymMap}.
+ */
+public final class SynonymMapConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(SynonymMapConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.SynonymMap} to {@link SynonymMap}.
+ */
+ public static SynonymMap map(com.azure.search.documents.implementation.models.SynonymMap obj) {
+ if (obj == null) {
+ return null;
+ }
+ SynonymMap synonymMap = new SynonymMap();
+
+ String _synonyms = obj.getSynonyms();
+ synonymMap.setSynonyms(_synonyms);
+
+ String _name = obj.getName();
+ synonymMap.setName(_name);
+
+ String _format = obj.getFormat();
+ PrivateFieldAccessHelper.set(synonymMap, "format", _format);
+
+ String _eTag = obj.getETag();
+ synonymMap.setETag(_eTag);
+
+ if (obj.getEncryptionKey() != null) {
+ SearchResourceEncryptionKey _encryptionKey =
+ SearchResourceEncryptionKeyConverter.map(obj.getEncryptionKey());
+ synonymMap.setEncryptionKey(_encryptionKey);
+ }
+ return synonymMap;
+ }
+
+ /**
+ * Maps from {@link SynonymMap} to {@link com.azure.search.documents.implementation.models.SynonymMap}.
+ */
+ public static com.azure.search.documents.implementation.models.SynonymMap map(SynonymMap obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.SynonymMap synonymMap =
+ new com.azure.search.documents.implementation.models.SynonymMap();
+
+ String _synonyms = obj.getSynonyms();
+ synonymMap.setSynonyms(_synonyms);
+
+ String _name = obj.getName();
+ synonymMap.setName(_name);
+
+ synonymMap.setFormat("solr");
+
+ String _eTag = obj.getETag();
+ synonymMap.setETag(_eTag);
+
+ if (obj.getEncryptionKey() != null) {
+ com.azure.search.documents.implementation.models.SearchResourceEncryptionKey _encryptionKey =
+ SearchResourceEncryptionKeyConverter.map(obj.getEncryptionKey());
+ synonymMap.setEncryptionKey(_encryptionKey);
+ }
+ return synonymMap;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SynonymTokenFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SynonymTokenFilterConverter.java
new file mode 100644
index 000000000000..46ca483a29ec
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/SynonymTokenFilterConverter.java
@@ -0,0 +1,72 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.SynonymTokenFilter;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.SynonymTokenFilter} and
+ * {@link SynonymTokenFilter}.
+ */
+public final class SynonymTokenFilterConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(SynonymTokenFilterConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.SynonymTokenFilter} to
+ * {@link SynonymTokenFilter}.
+ */
+ public static SynonymTokenFilter map(com.azure.search.documents.implementation.models.SynonymTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ SynonymTokenFilter synonymTokenFilter = new SynonymTokenFilter();
+
+ String _name = obj.getName();
+ synonymTokenFilter.setName(_name);
+
+ Boolean _expand = obj.isExpand();
+ synonymTokenFilter.setExpand(_expand);
+
+ if (obj.getSynonyms() != null) {
+ List _synonyms = new ArrayList<>(obj.getSynonyms());
+ synonymTokenFilter.setSynonyms(_synonyms);
+ }
+
+ Boolean _ignoreCase = obj.isIgnoreCase();
+ synonymTokenFilter.setIgnoreCase(_ignoreCase);
+ return synonymTokenFilter;
+ }
+
+ /**
+ * Maps from {@link SynonymTokenFilter} to
+ * {@link com.azure.search.documents.implementation.models.SynonymTokenFilter}.
+ */
+ public static com.azure.search.documents.implementation.models.SynonymTokenFilter map(SynonymTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.SynonymTokenFilter synonymTokenFilter =
+ new com.azure.search.documents.implementation.models.SynonymTokenFilter();
+
+ String _name = obj.getName();
+ synonymTokenFilter.setName(_name);
+
+ Boolean _expand = obj.isExpand();
+ synonymTokenFilter.setExpand(_expand);
+
+ if (obj.getSynonyms() != null) {
+ List _synonyms = new ArrayList<>(obj.getSynonyms());
+ synonymTokenFilter.setSynonyms(_synonyms);
+ }
+
+ Boolean _ignoreCase = obj.isIgnoreCase();
+ synonymTokenFilter.setIgnoreCase(_ignoreCase);
+ return synonymTokenFilter;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TagScoringFunctionConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TagScoringFunctionConverter.java
new file mode 100644
index 000000000000..2a1971abc41b
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TagScoringFunctionConverter.java
@@ -0,0 +1,77 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.ScoringFunctionInterpolation;
+import com.azure.search.documents.models.TagScoringFunction;
+import com.azure.search.documents.models.TagScoringParameters;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.TagScoringFunction} and
+ * {@link TagScoringFunction}.
+ */
+public final class TagScoringFunctionConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(TagScoringFunctionConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.TagScoringFunction} to
+ * {@link TagScoringFunction}.
+ */
+ public static TagScoringFunction map(com.azure.search.documents.implementation.models.TagScoringFunction obj) {
+ if (obj == null) {
+ return null;
+ }
+ TagScoringFunction tagScoringFunction = new TagScoringFunction();
+
+ if (obj.getInterpolation() != null) {
+ ScoringFunctionInterpolation _interpolation =
+ ScoringFunctionInterpolationConverter.map(obj.getInterpolation());
+ tagScoringFunction.setInterpolation(_interpolation);
+ }
+
+ String _fieldName = obj.getFieldName();
+ tagScoringFunction.setFieldName(_fieldName);
+
+ double _boost = obj.getBoost();
+ tagScoringFunction.setBoost(_boost);
+
+ if (obj.getParameters() != null) {
+ TagScoringParameters _parameters = TagScoringParametersConverter.map(obj.getParameters());
+ tagScoringFunction.setParameters(_parameters);
+ }
+ return tagScoringFunction;
+ }
+
+ /**
+ * Maps from {@link TagScoringFunction} to
+ * {@link com.azure.search.documents.implementation.models.TagScoringFunction}.
+ */
+ public static com.azure.search.documents.implementation.models.TagScoringFunction map(TagScoringFunction obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.TagScoringFunction tagScoringFunction =
+ new com.azure.search.documents.implementation.models.TagScoringFunction();
+
+ if (obj.getInterpolation() != null) {
+ com.azure.search.documents.implementation.models.ScoringFunctionInterpolation _interpolation =
+ ScoringFunctionInterpolationConverter.map(obj.getInterpolation());
+ tagScoringFunction.setInterpolation(_interpolation);
+ }
+
+ String _fieldName = obj.getFieldName();
+ tagScoringFunction.setFieldName(_fieldName);
+
+ double _boost = obj.getBoost();
+ tagScoringFunction.setBoost(_boost);
+
+ if (obj.getParameters() != null) {
+ com.azure.search.documents.implementation.models.TagScoringParameters _parameters =
+ TagScoringParametersConverter.map(obj.getParameters());
+ tagScoringFunction.setParameters(_parameters);
+ }
+ return tagScoringFunction;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TagScoringParametersConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TagScoringParametersConverter.java
new file mode 100644
index 000000000000..a9acafbee300
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TagScoringParametersConverter.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.TagScoringParameters;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.TagScoringParameters} and
+ * {@link TagScoringParameters}.
+ */
+public final class TagScoringParametersConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(TagScoringParametersConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.TagScoringParameters} to
+ * {@link TagScoringParameters}.
+ */
+ public static TagScoringParameters map(com.azure.search.documents.implementation.models.TagScoringParameters obj) {
+ if (obj == null) {
+ return null;
+ }
+ TagScoringParameters tagScoringParameters = new TagScoringParameters();
+
+ String _tagsParameter = obj.getTagsParameter();
+ tagScoringParameters.setTagsParameter(_tagsParameter);
+ return tagScoringParameters;
+ }
+
+ /**
+ * Maps from {@link TagScoringParameters} to
+ * {@link com.azure.search.documents.implementation.models.TagScoringParameters}.
+ */
+ public static com.azure.search.documents.implementation.models.TagScoringParameters map(TagScoringParameters obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.TagScoringParameters tagScoringParameters =
+ new com.azure.search.documents.implementation.models.TagScoringParameters();
+
+ String _tagsParameter = obj.getTagsParameter();
+ tagScoringParameters.setTagsParameter(_tagsParameter);
+ return tagScoringParameters;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TextExtractionAlgorithmConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TextExtractionAlgorithmConverter.java
new file mode 100644
index 000000000000..a6f3ee218cef
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TextExtractionAlgorithmConverter.java
@@ -0,0 +1,54 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.TextExtractionAlgorithm;
+
+import static com.azure.search.documents.implementation.util.Constants.ENUM_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ENUM_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.TextExtractionAlgorithm} and
+ * {@link TextExtractionAlgorithm}.
+ */
+public final class TextExtractionAlgorithmConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(TextExtractionAlgorithmConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.TextExtractionAlgorithm} to enum
+ * {@link TextExtractionAlgorithm}.
+ */
+ public static TextExtractionAlgorithm map(com.azure.search.documents.implementation.models.TextExtractionAlgorithm obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case PRINTED:
+ return TextExtractionAlgorithm.PRINTED;
+ case HANDWRITTEN:
+ return TextExtractionAlgorithm.HANDWRITTEN;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_EXTERNAL_ERROR_MSG, obj)));
+ }
+ }
+
+ /**
+ * Maps from enum {@link TextExtractionAlgorithm} to enum
+ * {@link com.azure.search.documents.implementation.models.TextExtractionAlgorithm}.
+ */
+ public static com.azure.search.documents.implementation.models.TextExtractionAlgorithm map(TextExtractionAlgorithm obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case PRINTED:
+ return com.azure.search.documents.implementation.models.TextExtractionAlgorithm.PRINTED;
+ case HANDWRITTEN:
+ return com.azure.search.documents.implementation.models.TextExtractionAlgorithm.HANDWRITTEN;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj)));
+ }
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TextSplitModeConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TextSplitModeConverter.java
new file mode 100644
index 000000000000..f8fe213eac08
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TextSplitModeConverter.java
@@ -0,0 +1,53 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.TextSplitMode;
+
+import static com.azure.search.documents.implementation.util.Constants.ENUM_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ENUM_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.TextSplitMode} and {@link TextSplitMode}.
+ */
+public final class TextSplitModeConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(TextSplitModeConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.TextSplitMode} to enum
+ * {@link TextSplitMode}.
+ */
+ public static TextSplitMode map(com.azure.search.documents.implementation.models.TextSplitMode obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case PAGES:
+ return TextSplitMode.PAGES;
+ case SENTENCES:
+ return TextSplitMode.SENTENCES;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_EXTERNAL_ERROR_MSG, obj)));
+ }
+ }
+
+ /**
+ * Maps from enum {@link TextSplitMode} to enum
+ * {@link com.azure.search.documents.implementation.models.TextSplitMode}.
+ */
+ public static com.azure.search.documents.implementation.models.TextSplitMode map(TextSplitMode obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case PAGES:
+ return com.azure.search.documents.implementation.models.TextSplitMode.PAGES;
+ case SENTENCES:
+ return com.azure.search.documents.implementation.models.TextSplitMode.SENTENCES;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj)));
+ }
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TextTranslationSkillConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TextTranslationSkillConverter.java
new file mode 100644
index 000000000000..ed735ced79e2
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TextTranslationSkillConverter.java
@@ -0,0 +1,124 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.InputFieldMappingEntry;
+import com.azure.search.documents.models.OutputFieldMappingEntry;
+import com.azure.search.documents.models.TextTranslationSkill;
+import com.azure.search.documents.models.TextTranslationSkillLanguage;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.TextTranslationSkill} and
+ * {@link TextTranslationSkill}.
+ */
+public final class TextTranslationSkillConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(TextTranslationSkillConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.TextTranslationSkill} to
+ * {@link TextTranslationSkill}.
+ */
+ public static TextTranslationSkill map(com.azure.search.documents.implementation.models.TextTranslationSkill obj) {
+ if (obj == null) {
+ return null;
+ }
+ TextTranslationSkill textTranslationSkill = new TextTranslationSkill();
+
+ if (obj.getOutputs() != null) {
+ List _outputs =
+ obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ textTranslationSkill.setOutputs(_outputs);
+ }
+
+ if (obj.getInputs() != null) {
+ List _inputs =
+ obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ textTranslationSkill.setInputs(_inputs);
+ }
+
+ String _name = obj.getName();
+ textTranslationSkill.setName(_name);
+
+ String _context = obj.getContext();
+ textTranslationSkill.setContext(_context);
+
+ String _description = obj.getDescription();
+ textTranslationSkill.setDescription(_description);
+
+ if (obj.getDefaultToLanguageCode() != null) {
+ TextTranslationSkillLanguage _defaultToLanguageCode =
+ TextTranslationSkillLanguageConverter.map(obj.getDefaultToLanguageCode());
+ textTranslationSkill.setDefaultToLanguageCode(_defaultToLanguageCode);
+ }
+
+ if (obj.getDefaultFromLanguageCode() != null) {
+ TextTranslationSkillLanguage _defaultFromLanguageCode =
+ TextTranslationSkillLanguageConverter.map(obj.getDefaultFromLanguageCode());
+ textTranslationSkill.setDefaultFromLanguageCode(_defaultFromLanguageCode);
+ }
+
+ if (obj.getSuggestedFrom() != null) {
+ TextTranslationSkillLanguage _suggestedFrom =
+ TextTranslationSkillLanguageConverter.map(obj.getSuggestedFrom());
+ textTranslationSkill.setSuggestedFrom(_suggestedFrom);
+ }
+ return textTranslationSkill;
+ }
+
+ /**
+ * Maps from {@link TextTranslationSkill} to
+ * {@link com.azure.search.documents.implementation.models.TextTranslationSkill}.
+ */
+ public static com.azure.search.documents.implementation.models.TextTranslationSkill map(TextTranslationSkill obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.TextTranslationSkill textTranslationSkill =
+ new com.azure.search.documents.implementation.models.TextTranslationSkill();
+
+ if (obj.getOutputs() != null) {
+ List _outputs =
+ obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ textTranslationSkill.setOutputs(_outputs);
+ }
+
+ if (obj.getInputs() != null) {
+ List _inputs =
+ obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ textTranslationSkill.setInputs(_inputs);
+ }
+
+ String _name = obj.getName();
+ textTranslationSkill.setName(_name);
+
+ String _context = obj.getContext();
+ textTranslationSkill.setContext(_context);
+
+ String _description = obj.getDescription();
+ textTranslationSkill.setDescription(_description);
+
+ if (obj.getDefaultToLanguageCode() != null) {
+ com.azure.search.documents.implementation.models.TextTranslationSkillLanguage _defaultToLanguageCode =
+ TextTranslationSkillLanguageConverter.map(obj.getDefaultToLanguageCode());
+ textTranslationSkill.setDefaultToLanguageCode(_defaultToLanguageCode);
+ }
+
+ if (obj.getDefaultFromLanguageCode() != null) {
+ com.azure.search.documents.implementation.models.TextTranslationSkillLanguage _defaultFromLanguageCode =
+ TextTranslationSkillLanguageConverter.map(obj.getDefaultFromLanguageCode());
+ textTranslationSkill.setDefaultFromLanguageCode(_defaultFromLanguageCode);
+ }
+
+ if (obj.getSuggestedFrom() != null) {
+ com.azure.search.documents.implementation.models.TextTranslationSkillLanguage _suggestedFrom =
+ TextTranslationSkillLanguageConverter.map(obj.getSuggestedFrom());
+ textTranslationSkill.setSuggestedFrom(_suggestedFrom);
+ }
+ return textTranslationSkill;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TextTranslationSkillLanguageConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TextTranslationSkillLanguageConverter.java
new file mode 100644
index 000000000000..d0b14a09bf85
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TextTranslationSkillLanguageConverter.java
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.TextTranslationSkillLanguage;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.TextTranslationSkillLanguage} and
+ * {@link TextTranslationSkillLanguage}.
+ */
+public final class TextTranslationSkillLanguageConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(TextTranslationSkillLanguageConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.TextTranslationSkillLanguage} to enum
+ * {@link TextTranslationSkillLanguage}.
+ */
+ public static TextTranslationSkillLanguage map(com.azure.search.documents.implementation.models.TextTranslationSkillLanguage obj) {
+ if (obj == null) {
+ return null;
+ }
+ return TextTranslationSkillLanguage.fromString(obj.toString());
+ }
+
+ /**
+ * Maps from enum {@link TextTranslationSkillLanguage} to enum
+ * {@link com.azure.search.documents.implementation.models.TextTranslationSkillLanguage}.
+ */
+ public static com.azure.search.documents.implementation.models.TextTranslationSkillLanguage map(TextTranslationSkillLanguage obj) {
+ if (obj == null) {
+ return null;
+ }
+ return com.azure.search.documents.implementation.models.TextTranslationSkillLanguage.fromString(obj.toString());
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TextWeightsConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TextWeightsConverter.java
new file mode 100644
index 000000000000..a2a42ba613aa
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TextWeightsConverter.java
@@ -0,0 +1,54 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.TextWeights;
+
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.TextWeights} and {@link TextWeights}.
+ */
+public final class TextWeightsConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(TextWeightsConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.TextWeights} to {@link TextWeights}.
+ */
+ public static TextWeights map(com.azure.search.documents.implementation.models.TextWeights obj) {
+ if (obj == null) {
+ return null;
+ }
+ TextWeights textWeights = new TextWeights();
+
+ if (obj.getWeights() != null) {
+ Map _weights =
+ obj.getWeights().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey,
+ Map.Entry::getValue));
+ textWeights.setWeights(_weights);
+ }
+ return textWeights;
+ }
+
+ /**
+ * Maps from {@link TextWeights} to {@link com.azure.search.documents.implementation.models.TextWeights}.
+ */
+ public static com.azure.search.documents.implementation.models.TextWeights map(TextWeights obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.TextWeights textWeights =
+ new com.azure.search.documents.implementation.models.TextWeights();
+
+ if (obj.getWeights() != null) {
+ Map _weights =
+ obj.getWeights().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey,
+ Map.Entry::getValue));
+ textWeights.setWeights(_weights);
+ }
+ return textWeights;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TokenCharacterKindConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TokenCharacterKindConverter.java
new file mode 100644
index 000000000000..36af5f78bc34
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TokenCharacterKindConverter.java
@@ -0,0 +1,66 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.TokenCharacterKind;
+
+import static com.azure.search.documents.implementation.util.Constants.ENUM_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ENUM_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.TokenCharacterKind} and
+ * {@link TokenCharacterKind}.
+ */
+public final class TokenCharacterKindConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(TokenCharacterKindConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.TokenCharacterKind} to enum
+ * {@link TokenCharacterKind}.
+ */
+ public static TokenCharacterKind map(com.azure.search.documents.implementation.models.TokenCharacterKind obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case LETTER:
+ return TokenCharacterKind.LETTER;
+ case DIGIT:
+ return TokenCharacterKind.DIGIT;
+ case WHITESPACE:
+ return TokenCharacterKind.WHITESPACE;
+ case PUNCTUATION:
+ return TokenCharacterKind.PUNCTUATION;
+ case SYMBOL:
+ return TokenCharacterKind.SYMBOL;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_EXTERNAL_ERROR_MSG, obj)));
+ }
+ }
+
+ /**
+ * Maps from enum {@link TokenCharacterKind} to enum
+ * {@link com.azure.search.documents.implementation.models.TokenCharacterKind}.
+ */
+ public static com.azure.search.documents.implementation.models.TokenCharacterKind map(TokenCharacterKind obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case LETTER:
+ return com.azure.search.documents.implementation.models.TokenCharacterKind.LETTER;
+ case DIGIT:
+ return com.azure.search.documents.implementation.models.TokenCharacterKind.DIGIT;
+ case WHITESPACE:
+ return com.azure.search.documents.implementation.models.TokenCharacterKind.WHITESPACE;
+ case PUNCTUATION:
+ return com.azure.search.documents.implementation.models.TokenCharacterKind.PUNCTUATION;
+ case SYMBOL:
+ return com.azure.search.documents.implementation.models.TokenCharacterKind.SYMBOL;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj)));
+ }
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TokenFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TokenFilterConverter.java
new file mode 100644
index 000000000000..7965f2ef76f0
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TokenFilterConverter.java
@@ -0,0 +1,209 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.implementation.models.AsciiFoldingTokenFilter;
+import com.azure.search.documents.implementation.models.CjkBigramTokenFilter;
+import com.azure.search.documents.implementation.models.CommonGramTokenFilter;
+import com.azure.search.documents.implementation.models.DictionaryDecompounderTokenFilter;
+import com.azure.search.documents.implementation.models.EdgeNGramTokenFilter;
+import com.azure.search.documents.implementation.models.EdgeNGramTokenFilterV2;
+import com.azure.search.documents.implementation.models.ElisionTokenFilter;
+import com.azure.search.documents.implementation.models.KeepTokenFilter;
+import com.azure.search.documents.implementation.models.KeywordMarkerTokenFilter;
+import com.azure.search.documents.implementation.models.LengthTokenFilter;
+import com.azure.search.documents.implementation.models.LimitTokenFilter;
+import com.azure.search.documents.implementation.models.NGramTokenFilter;
+import com.azure.search.documents.implementation.models.NGramTokenFilterV2;
+import com.azure.search.documents.implementation.models.PatternCaptureTokenFilter;
+import com.azure.search.documents.implementation.models.PatternReplaceTokenFilter;
+import com.azure.search.documents.implementation.models.PhoneticTokenFilter;
+import com.azure.search.documents.implementation.models.ShingleTokenFilter;
+import com.azure.search.documents.implementation.models.SnowballTokenFilter;
+import com.azure.search.documents.implementation.models.StemmerOverrideTokenFilter;
+import com.azure.search.documents.implementation.models.StemmerTokenFilter;
+import com.azure.search.documents.implementation.models.StopwordsTokenFilter;
+import com.azure.search.documents.implementation.models.SynonymTokenFilter;
+import com.azure.search.documents.implementation.models.TruncateTokenFilter;
+import com.azure.search.documents.implementation.models.UniqueTokenFilter;
+import com.azure.search.documents.implementation.models.WordDelimiterTokenFilter;
+import com.azure.search.documents.models.TokenFilter;
+
+import static com.azure.search.documents.implementation.util.Constants.ABSTRACT_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ABSTRACT_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.TokenFilter} and {@link TokenFilter}.
+ */
+public final class TokenFilterConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(TokenFilterConverter.class);
+
+ /**
+ * Maps abstract class from {@link com.azure.search.documents.implementation.models.TokenFilter} to
+ * {@link TokenFilter}. Dedicate works to sub class converter.
+ */
+ public static TokenFilter map(com.azure.search.documents.implementation.models.TokenFilter obj) {
+ if (obj instanceof CommonGramTokenFilter) {
+ return CommonGramTokenFilterConverter.map((CommonGramTokenFilter) obj);
+ }
+ if (obj instanceof KeepTokenFilter) {
+ return KeepTokenFilterConverter.map((KeepTokenFilter) obj);
+ }
+ if (obj instanceof StemmerOverrideTokenFilter) {
+ return StemmerOverrideTokenFilterConverter.map((StemmerOverrideTokenFilter) obj);
+ }
+ if (obj instanceof SynonymTokenFilter) {
+ return SynonymTokenFilterConverter.map((SynonymTokenFilter) obj);
+ }
+ if (obj instanceof DictionaryDecompounderTokenFilter) {
+ return DictionaryDecompounderTokenFilterConverter.map((DictionaryDecompounderTokenFilter) obj);
+ }
+ if (obj instanceof LengthTokenFilter) {
+ return LengthTokenFilterConverter.map((LengthTokenFilter) obj);
+ }
+ if (obj instanceof UniqueTokenFilter) {
+ return UniqueTokenFilterConverter.map((UniqueTokenFilter) obj);
+ }
+ if (obj instanceof KeywordMarkerTokenFilter) {
+ return KeywordMarkerTokenFilterConverter.map((KeywordMarkerTokenFilter) obj);
+ }
+ if (obj instanceof CjkBigramTokenFilter) {
+ return CjkBigramTokenFilterConverter.map((CjkBigramTokenFilter) obj);
+ }
+ if (obj instanceof EdgeNGramTokenFilterV2) {
+ return EdgeNGramTokenFilterV2Converter.map((EdgeNGramTokenFilterV2) obj);
+ }
+ if (obj instanceof PatternCaptureTokenFilter) {
+ return PatternCaptureTokenFilterConverter.map((PatternCaptureTokenFilter) obj);
+ }
+ if (obj instanceof NGramTokenFilterV2) {
+ return NGramTokenFilterV2Converter.map((NGramTokenFilterV2) obj);
+ }
+ if (obj instanceof PatternReplaceTokenFilter) {
+ return PatternReplaceTokenFilterConverter.map((PatternReplaceTokenFilter) obj);
+ }
+ if (obj instanceof NGramTokenFilter) {
+ return NGramTokenFilterConverter.map((NGramTokenFilter) obj);
+ }
+ if (obj instanceof ShingleTokenFilter) {
+ return ShingleTokenFilterConverter.map((ShingleTokenFilter) obj);
+ }
+ if (obj instanceof LimitTokenFilter) {
+ return LimitTokenFilterConverter.map((LimitTokenFilter) obj);
+ }
+ if (obj instanceof PhoneticTokenFilter) {
+ return PhoneticTokenFilterConverter.map((PhoneticTokenFilter) obj);
+ }
+ if (obj instanceof StopwordsTokenFilter) {
+ return StopwordsTokenFilterConverter.map((StopwordsTokenFilter) obj);
+ }
+ if (obj instanceof WordDelimiterTokenFilter) {
+ return WordDelimiterTokenFilterConverter.map((WordDelimiterTokenFilter) obj);
+ }
+ if (obj instanceof SnowballTokenFilter) {
+ return SnowballTokenFilterConverter.map((SnowballTokenFilter) obj);
+ }
+ if (obj instanceof AsciiFoldingTokenFilter) {
+ return AsciiFoldingTokenFilterConverter.map((AsciiFoldingTokenFilter) obj);
+ }
+ if (obj instanceof EdgeNGramTokenFilter) {
+ return EdgeNGramTokenFilterConverter.map((EdgeNGramTokenFilter) obj);
+ }
+ if (obj instanceof TruncateTokenFilter) {
+ return TruncateTokenFilterConverter.map((TruncateTokenFilter) obj);
+ }
+ if (obj instanceof StemmerTokenFilter) {
+ return StemmerTokenFilterConverter.map((StemmerTokenFilter) obj);
+ }
+ if (obj instanceof ElisionTokenFilter) {
+ return ElisionTokenFilterConverter.map((ElisionTokenFilter) obj);
+ }
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_EXTERNAL_ERROR_MSG,
+ obj.getClass().getSimpleName())));
+ }
+
+ /**
+ * Maps abstract class from {@link TokenFilter} to
+ * {@link com.azure.search.documents.implementation.models.TokenFilter}. Dedicate works to sub class converter.
+ */
+ public static com.azure.search.documents.implementation.models.TokenFilter map(TokenFilter obj) {
+ if (obj instanceof com.azure.search.documents.models.CjkBigramTokenFilter) {
+ return CjkBigramTokenFilterConverter.map((com.azure.search.documents.models.CjkBigramTokenFilter) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.ElisionTokenFilter) {
+ return ElisionTokenFilterConverter.map((com.azure.search.documents.models.ElisionTokenFilter) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.SynonymTokenFilter) {
+ return SynonymTokenFilterConverter.map((com.azure.search.documents.models.SynonymTokenFilter) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.LengthTokenFilter) {
+ return LengthTokenFilterConverter.map((com.azure.search.documents.models.LengthTokenFilter) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.PatternCaptureTokenFilter) {
+ return PatternCaptureTokenFilterConverter.map((com.azure.search.documents.models.PatternCaptureTokenFilter) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.KeepTokenFilter) {
+ return KeepTokenFilterConverter.map((com.azure.search.documents.models.KeepTokenFilter) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.AsciiFoldingTokenFilter) {
+ return AsciiFoldingTokenFilterConverter.map((com.azure.search.documents.models.AsciiFoldingTokenFilter) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.KeywordMarkerTokenFilter) {
+ return KeywordMarkerTokenFilterConverter.map((com.azure.search.documents.models.KeywordMarkerTokenFilter) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.UniqueTokenFilter) {
+ return UniqueTokenFilterConverter.map((com.azure.search.documents.models.UniqueTokenFilter) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.LimitTokenFilter) {
+ return LimitTokenFilterConverter.map((com.azure.search.documents.models.LimitTokenFilter) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.TruncateTokenFilter) {
+ return TruncateTokenFilterConverter.map((com.azure.search.documents.models.TruncateTokenFilter) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.EdgeNGramTokenFilter) {
+ return EdgeNGramTokenFilterConverter.map((com.azure.search.documents.models.EdgeNGramTokenFilter) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.EdgeNGramTokenFilterV2) {
+ return EdgeNGramTokenFilterV2Converter.map((com.azure.search.documents.models.EdgeNGramTokenFilterV2) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.DictionaryDecompounderTokenFilter) {
+ return DictionaryDecompounderTokenFilterConverter.map((com.azure.search.documents.models.DictionaryDecompounderTokenFilter) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.PatternReplaceTokenFilter) {
+ return PatternReplaceTokenFilterConverter.map((com.azure.search.documents.models.PatternReplaceTokenFilter) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.NGramTokenFilterV2) {
+ return NGramTokenFilterV2Converter.map((com.azure.search.documents.models.NGramTokenFilterV2) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.StemmerTokenFilter) {
+ return StemmerTokenFilterConverter.map((com.azure.search.documents.models.StemmerTokenFilter) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.PhoneticTokenFilter) {
+ return PhoneticTokenFilterConverter.map((com.azure.search.documents.models.PhoneticTokenFilter) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.CommonGramTokenFilter) {
+ return CommonGramTokenFilterConverter.map((com.azure.search.documents.models.CommonGramTokenFilter) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.StopwordsTokenFilter) {
+ return StopwordsTokenFilterConverter.map((com.azure.search.documents.models.StopwordsTokenFilter) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.WordDelimiterTokenFilter) {
+ return WordDelimiterTokenFilterConverter.map((com.azure.search.documents.models.WordDelimiterTokenFilter) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.SnowballTokenFilter) {
+ return SnowballTokenFilterConverter.map((com.azure.search.documents.models.SnowballTokenFilter) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.NGramTokenFilter) {
+ return NGramTokenFilterConverter.map((com.azure.search.documents.models.NGramTokenFilter) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.ShingleTokenFilter) {
+ return ShingleTokenFilterConverter.map((com.azure.search.documents.models.ShingleTokenFilter) obj);
+ }
+ if (obj instanceof com.azure.search.documents.models.StemmerOverrideTokenFilter) {
+ return StemmerOverrideTokenFilterConverter.map((com.azure.search.documents.models.StemmerOverrideTokenFilter) obj);
+ }
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ABSTRACT_INTERNAL_ERROR_MSG, obj.getClass().getSimpleName())));
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TokenFilterNameConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TokenFilterNameConverter.java
new file mode 100644
index 000000000000..3a0bf28abc4c
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TokenFilterNameConverter.java
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.TokenFilterName;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.TokenFilterName} and
+ * {@link TokenFilterName}.
+ */
+public final class TokenFilterNameConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(TokenFilterNameConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.TokenFilterName} to enum
+ * {@link TokenFilterName}.
+ */
+ public static TokenFilterName map(com.azure.search.documents.implementation.models.TokenFilterName obj) {
+ if (obj == null) {
+ return null;
+ }
+ return TokenFilterName.fromString(obj.toString());
+ }
+
+ /**
+ * Maps from enum {@link TokenFilterName} to enum
+ * {@link com.azure.search.documents.implementation.models.TokenFilterName}.
+ */
+ public static com.azure.search.documents.implementation.models.TokenFilterName map(TokenFilterName obj) {
+ if (obj == null) {
+ return null;
+ }
+ return com.azure.search.documents.implementation.models.TokenFilterName.fromString(obj.toString());
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TruncateTokenFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TruncateTokenFilterConverter.java
new file mode 100644
index 000000000000..3ef79423e0b9
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/TruncateTokenFilterConverter.java
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.TruncateTokenFilter;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.TruncateTokenFilter} and
+ * {@link TruncateTokenFilter}.
+ */
+public final class TruncateTokenFilterConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(TruncateTokenFilterConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.TruncateTokenFilter} to
+ * {@link TruncateTokenFilter}.
+ */
+ public static TruncateTokenFilter map(com.azure.search.documents.implementation.models.TruncateTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ TruncateTokenFilter truncateTokenFilter = new TruncateTokenFilter();
+
+ String _name = obj.getName();
+ truncateTokenFilter.setName(_name);
+
+ Integer _length = obj.getLength();
+ truncateTokenFilter.setLength(_length);
+ return truncateTokenFilter;
+ }
+
+ /**
+ * Maps from {@link TruncateTokenFilter} to
+ * {@link com.azure.search.documents.implementation.models.TruncateTokenFilter}.
+ */
+ public static com.azure.search.documents.implementation.models.TruncateTokenFilter map(TruncateTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.TruncateTokenFilter truncateTokenFilter =
+ new com.azure.search.documents.implementation.models.TruncateTokenFilter();
+
+ String _name = obj.getName();
+ truncateTokenFilter.setName(_name);
+
+ Integer _length = obj.getLength();
+ truncateTokenFilter.setLength(_length);
+ return truncateTokenFilter;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/UaxUrlEmailTokenizerConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/UaxUrlEmailTokenizerConverter.java
new file mode 100644
index 000000000000..e89d32cccf07
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/UaxUrlEmailTokenizerConverter.java
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.UaxUrlEmailTokenizer;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.UaxUrlEmailTokenizer} and
+ * {@link UaxUrlEmailTokenizer}.
+ */
+public final class UaxUrlEmailTokenizerConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(UaxUrlEmailTokenizerConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.UaxUrlEmailTokenizer} to
+ * {@link UaxUrlEmailTokenizer}.
+ */
+ public static UaxUrlEmailTokenizer map(com.azure.search.documents.implementation.models.UaxUrlEmailTokenizer obj) {
+ if (obj == null) {
+ return null;
+ }
+ UaxUrlEmailTokenizer uaxUrlEmailTokenizer = new UaxUrlEmailTokenizer();
+
+ String _name = obj.getName();
+ uaxUrlEmailTokenizer.setName(_name);
+
+ Integer _maxTokenLength = obj.getMaxTokenLength();
+ uaxUrlEmailTokenizer.setMaxTokenLength(_maxTokenLength);
+ return uaxUrlEmailTokenizer;
+ }
+
+ /**
+ * Maps from {@link UaxUrlEmailTokenizer} to
+ * {@link com.azure.search.documents.implementation.models.UaxUrlEmailTokenizer}.
+ */
+ public static com.azure.search.documents.implementation.models.UaxUrlEmailTokenizer map(UaxUrlEmailTokenizer obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.UaxUrlEmailTokenizer uaxUrlEmailTokenizer =
+ new com.azure.search.documents.implementation.models.UaxUrlEmailTokenizer();
+
+ String _name = obj.getName();
+ uaxUrlEmailTokenizer.setName(_name);
+
+ Integer _maxTokenLength = obj.getMaxTokenLength();
+ uaxUrlEmailTokenizer.setMaxTokenLength(_maxTokenLength);
+ return uaxUrlEmailTokenizer;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/UniqueTokenFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/UniqueTokenFilterConverter.java
new file mode 100644
index 000000000000..19896d7dfcf7
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/UniqueTokenFilterConverter.java
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.UniqueTokenFilter;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.UniqueTokenFilter} and
+ * {@link UniqueTokenFilter}.
+ */
+public final class UniqueTokenFilterConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(UniqueTokenFilterConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.UniqueTokenFilter} to
+ * {@link UniqueTokenFilter}.
+ */
+ public static UniqueTokenFilter map(com.azure.search.documents.implementation.models.UniqueTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ UniqueTokenFilter uniqueTokenFilter = new UniqueTokenFilter();
+
+ String _name = obj.getName();
+ uniqueTokenFilter.setName(_name);
+
+ Boolean _onlyOnSamePosition = obj.isOnlyOnSamePosition();
+ uniqueTokenFilter.setOnlyOnSamePosition(_onlyOnSamePosition);
+ return uniqueTokenFilter;
+ }
+
+ /**
+ * Maps from {@link UniqueTokenFilter} to
+ * {@link com.azure.search.documents.implementation.models.UniqueTokenFilter}.
+ */
+ public static com.azure.search.documents.implementation.models.UniqueTokenFilter map(UniqueTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.UniqueTokenFilter uniqueTokenFilter =
+ new com.azure.search.documents.implementation.models.UniqueTokenFilter();
+
+ String _name = obj.getName();
+ uniqueTokenFilter.setName(_name);
+
+ Boolean _onlyOnSamePosition = obj.isOnlyOnSamePosition();
+ uniqueTokenFilter.setOnlyOnSamePosition(_onlyOnSamePosition);
+ return uniqueTokenFilter;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/VisualFeatureConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/VisualFeatureConverter.java
new file mode 100644
index 000000000000..01848f164cda
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/VisualFeatureConverter.java
@@ -0,0 +1,73 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.VisualFeature;
+
+import static com.azure.search.documents.implementation.util.Constants.ENUM_EXTERNAL_ERROR_MSG;
+import static com.azure.search.documents.implementation.util.Constants.ENUM_INTERNAL_ERROR_MSG;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.VisualFeature} and {@link VisualFeature}.
+ */
+public final class VisualFeatureConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(VisualFeatureConverter.class);
+
+ /**
+ * Maps from enum {@link com.azure.search.documents.implementation.models.VisualFeature} to enum
+ * {@link VisualFeature}.
+ */
+ public static VisualFeature map(com.azure.search.documents.implementation.models.VisualFeature obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case ADULT:
+ return VisualFeature.ADULT;
+ case BRANDS:
+ return VisualFeature.BRANDS;
+ case CATEGORIES:
+ return VisualFeature.CATEGORIES;
+ case DESCRIPTION:
+ return VisualFeature.DESCRIPTION;
+ case FACES:
+ return VisualFeature.FACES;
+ case OBJECTS:
+ return VisualFeature.OBJECTS;
+ case TAGS:
+ return VisualFeature.TAGS;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_EXTERNAL_ERROR_MSG, obj)));
+ }
+ }
+
+ /**
+ * Maps from enum {@link VisualFeature} to enum
+ * {@link com.azure.search.documents.implementation.models.VisualFeature}.
+ */
+ public static com.azure.search.documents.implementation.models.VisualFeature map(VisualFeature obj) {
+ if (obj == null) {
+ return null;
+ }
+ switch (obj) {
+ case ADULT:
+ return com.azure.search.documents.implementation.models.VisualFeature.ADULT;
+ case BRANDS:
+ return com.azure.search.documents.implementation.models.VisualFeature.BRANDS;
+ case CATEGORIES:
+ return com.azure.search.documents.implementation.models.VisualFeature.CATEGORIES;
+ case DESCRIPTION:
+ return com.azure.search.documents.implementation.models.VisualFeature.DESCRIPTION;
+ case FACES:
+ return com.azure.search.documents.implementation.models.VisualFeature.FACES;
+ case OBJECTS:
+ return com.azure.search.documents.implementation.models.VisualFeature.OBJECTS;
+ case TAGS:
+ return com.azure.search.documents.implementation.models.VisualFeature.TAGS;
+ default:
+ throw LOGGER.logExceptionAsError(new RuntimeException(String.format(ENUM_INTERNAL_ERROR_MSG, obj)));
+ }
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/WebApiSkillConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/WebApiSkillConverter.java
new file mode 100644
index 000000000000..41a7cb55f9e4
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/WebApiSkillConverter.java
@@ -0,0 +1,129 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.InputFieldMappingEntry;
+import com.azure.search.documents.models.OutputFieldMappingEntry;
+import com.azure.search.documents.models.WebApiSkill;
+
+import java.time.Duration;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.WebApiSkill} and {@link WebApiSkill}.
+ */
+public final class WebApiSkillConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(WebApiSkillConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.WebApiSkill} to {@link WebApiSkill}.
+ */
+ public static WebApiSkill map(com.azure.search.documents.implementation.models.WebApiSkill obj) {
+ if (obj == null) {
+ return null;
+ }
+ WebApiSkill webApiSkill = new WebApiSkill();
+
+ if (obj.getOutputs() != null) {
+ List _outputs =
+ obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ webApiSkill.setOutputs(_outputs);
+ }
+
+ if (obj.getInputs() != null) {
+ List _inputs =
+ obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ webApiSkill.setInputs(_inputs);
+ }
+
+ String _name = obj.getName();
+ webApiSkill.setName(_name);
+
+ String _context = obj.getContext();
+ webApiSkill.setContext(_context);
+
+ String _description = obj.getDescription();
+ webApiSkill.setDescription(_description);
+
+ if (obj.getHttpHeaders() != null) {
+ Map _httpHeaders =
+ obj.getHttpHeaders().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
+ webApiSkill.setHttpHeaders(_httpHeaders);
+ }
+
+ String _httpMethod = obj.getHttpMethod();
+ webApiSkill.setHttpMethod(_httpMethod);
+
+ Integer _batchSize = obj.getBatchSize();
+ webApiSkill.setBatchSize(_batchSize);
+
+ String _uri = obj.getUri();
+ webApiSkill.setUri(_uri);
+
+ Duration _timeout = obj.getTimeout();
+ webApiSkill.setTimeout(_timeout);
+
+ Integer _degreeOfParallelism = obj.getDegreeOfParallelism();
+ webApiSkill.setDegreeOfParallelism(_degreeOfParallelism);
+ return webApiSkill;
+ }
+
+ /**
+ * Maps from {@link WebApiSkill} to {@link com.azure.search.documents.implementation.models.WebApiSkill}.
+ */
+ public static com.azure.search.documents.implementation.models.WebApiSkill map(WebApiSkill obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.WebApiSkill webApiSkill =
+ new com.azure.search.documents.implementation.models.WebApiSkill();
+
+ if (obj.getOutputs() != null) {
+ List _outputs =
+ obj.getOutputs().stream().map(OutputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ webApiSkill.setOutputs(_outputs);
+ }
+
+ if (obj.getInputs() != null) {
+ List _inputs =
+ obj.getInputs().stream().map(InputFieldMappingEntryConverter::map).collect(Collectors.toList());
+ webApiSkill.setInputs(_inputs);
+ }
+
+ String _name = obj.getName();
+ webApiSkill.setName(_name);
+
+ String _context = obj.getContext();
+ webApiSkill.setContext(_context);
+
+ String _description = obj.getDescription();
+ webApiSkill.setDescription(_description);
+
+ if (obj.getHttpHeaders() != null) {
+ Map _httpHeaders =
+ obj.getHttpHeaders().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey,
+ Map.Entry::getValue));
+ webApiSkill.setHttpHeaders(_httpHeaders);
+ }
+
+ String _httpMethod = obj.getHttpMethod();
+ webApiSkill.setHttpMethod(_httpMethod);
+
+ Integer _batchSize = obj.getBatchSize();
+ webApiSkill.setBatchSize(_batchSize);
+
+ String _uri = obj.getUri();
+ webApiSkill.setUri(_uri);
+
+ Duration _timeout = obj.getTimeout();
+ webApiSkill.setTimeout(_timeout);
+
+ Integer _degreeOfParallelism = obj.getDegreeOfParallelism();
+ webApiSkill.setDegreeOfParallelism(_degreeOfParallelism);
+ return webApiSkill;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/WordDelimiterTokenFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/WordDelimiterTokenFilterConverter.java
new file mode 100644
index 000000000000..f650983400b9
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/WordDelimiterTokenFilterConverter.java
@@ -0,0 +1,113 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.search.documents.implementation.converters;
+
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.search.documents.models.WordDelimiterTokenFilter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * A converter between {@link com.azure.search.documents.implementation.models.WordDelimiterTokenFilter} and
+ * {@link WordDelimiterTokenFilter}.
+ */
+public final class WordDelimiterTokenFilterConverter {
+ private static final ClientLogger LOGGER = new ClientLogger(WordDelimiterTokenFilterConverter.class);
+
+ /**
+ * Maps from {@link com.azure.search.documents.implementation.models.WordDelimiterTokenFilter} to
+ * {@link WordDelimiterTokenFilter}.
+ */
+ public static WordDelimiterTokenFilter map(com.azure.search.documents.implementation.models.WordDelimiterTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ WordDelimiterTokenFilter wordDelimiterTokenFilter = new WordDelimiterTokenFilter();
+
+ String _name = obj.getName();
+ wordDelimiterTokenFilter.setName(_name);
+
+ Boolean _catenateNumbers = obj.isCatenateNumbers();
+ wordDelimiterTokenFilter.setCatenateNumbers(_catenateNumbers);
+
+ if (obj.getProtectedWords() != null) {
+ List _protectedWords = new ArrayList<>(obj.getProtectedWords());
+ wordDelimiterTokenFilter.setProtectedWords(_protectedWords);
+ }
+
+ Boolean _generateNumberParts = obj.isGenerateNumberParts();
+ wordDelimiterTokenFilter.setGenerateNumberParts(_generateNumberParts);
+
+ Boolean _stemEnglishPossessive = obj.isStemEnglishPossessive();
+ wordDelimiterTokenFilter.setStemEnglishPossessive(_stemEnglishPossessive);
+
+ Boolean _splitOnCaseChange = obj.isSplitOnCaseChange();
+ wordDelimiterTokenFilter.setSplitOnCaseChange(_splitOnCaseChange);
+
+ Boolean _generateWordParts = obj.isGenerateWordParts();
+ wordDelimiterTokenFilter.setGenerateWordParts(_generateWordParts);
+
+ Boolean _splitOnNumerics = obj.isSplitOnNumerics();
+ wordDelimiterTokenFilter.setSplitOnNumerics(_splitOnNumerics);
+
+ Boolean _preserveOriginal = obj.isPreserveOriginal();
+ wordDelimiterTokenFilter.setPreserveOriginal(_preserveOriginal);
+
+ Boolean _catenateAll = obj.isCatenateAll();
+ wordDelimiterTokenFilter.setCatenateAll(_catenateAll);
+
+ Boolean _catenateWords = obj.isCatenateWords();
+ wordDelimiterTokenFilter.setCatenateWords(_catenateWords);
+ return wordDelimiterTokenFilter;
+ }
+
+ /**
+ * Maps from {@link WordDelimiterTokenFilter} to
+ * {@link com.azure.search.documents.implementation.models.WordDelimiterTokenFilter}.
+ */
+ public static com.azure.search.documents.implementation.models.WordDelimiterTokenFilter map(WordDelimiterTokenFilter obj) {
+ if (obj == null) {
+ return null;
+ }
+ com.azure.search.documents.implementation.models.WordDelimiterTokenFilter wordDelimiterTokenFilter =
+ new com.azure.search.documents.implementation.models.WordDelimiterTokenFilter();
+
+ String _name = obj.getName();
+ wordDelimiterTokenFilter.setName(_name);
+
+ Boolean _catenateNumbers = obj.isCatenateNumbers();
+ wordDelimiterTokenFilter.setCatenateNumbers(_catenateNumbers);
+
+ if (obj.getProtectedWords() != null) {
+ List _protectedWords = new ArrayList<>(obj.getProtectedWords());
+ wordDelimiterTokenFilter.setProtectedWords(_protectedWords);
+ }
+
+ Boolean _generateNumberParts = obj.generateNumberParts();
+ wordDelimiterTokenFilter.setGenerateNumberParts(_generateNumberParts);
+
+ Boolean _stemEnglishPossessive = obj.isStemEnglishPossessive();
+ wordDelimiterTokenFilter.setStemEnglishPossessive(_stemEnglishPossessive);
+
+ Boolean _splitOnCaseChange = obj.isSplitOnCaseChange();
+ wordDelimiterTokenFilter.setSplitOnCaseChange(_splitOnCaseChange);
+
+ Boolean _generateWordParts = obj.generateWordParts();
+ wordDelimiterTokenFilter.setGenerateWordParts(_generateWordParts);
+
+ Boolean _splitOnNumerics = obj.isSplitOnNumerics();
+ wordDelimiterTokenFilter.setSplitOnNumerics(_splitOnNumerics);
+
+ Boolean _preserveOriginal = obj.isPreserveOriginal();
+ wordDelimiterTokenFilter.setPreserveOriginal(_preserveOriginal);
+
+ Boolean _catenateAll = obj.isCatenateAll();
+ wordDelimiterTokenFilter.setCatenateAll(_catenateAll);
+
+ Boolean _catenateWords = obj.isCatenateWords();
+ wordDelimiterTokenFilter.setCatenateWords(_catenateWords);
+ return wordDelimiterTokenFilter;
+ }
+}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AnalyzeResult.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AnalyzeResult.java
index 5e07fb435ecd..42d20d1a2e80 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AnalyzeResult.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AnalyzeResult.java
@@ -7,7 +7,6 @@
package com.azure.search.documents.implementation.models;
import com.azure.core.annotation.Fluent;
-import com.azure.search.documents.models.AnalyzedTokenInfo;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AutocompleteRequest.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AutocompleteRequest.java
index b946b98ede53..f04004d38f8e 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AutocompleteRequest.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/AutocompleteRequest.java
@@ -7,7 +7,6 @@
package com.azure.search.documents.implementation.models;
import com.azure.core.annotation.Fluent;
-import com.azure.search.documents.models.AutocompleteMode;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
@@ -175,7 +174,7 @@ public AutocompleteRequest setFilter(String filter) {
*
* @return the useFuzzyMatching value.
*/
- public Boolean useFuzzyMatching() {
+ public Boolean isUseFuzzyMatching() {
return this.useFuzzyMatching;
}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ListDataSourcesResult.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ListDataSourcesResult.java
index 23121bc1d2cd..338397d234a8 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ListDataSourcesResult.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ListDataSourcesResult.java
@@ -7,7 +7,6 @@
package com.azure.search.documents.implementation.models;
import com.azure.core.annotation.Fluent;
-import com.azure.search.documents.models.SearchIndexerDataSource;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ListIndexersResult.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ListIndexersResult.java
index b4767ccc076f..c6d3f3b3e5b7 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ListIndexersResult.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ListIndexersResult.java
@@ -7,7 +7,6 @@
package com.azure.search.documents.implementation.models;
import com.azure.core.annotation.Fluent;
-import com.azure.search.documents.models.SearchIndexer;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ListIndexesResult.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ListIndexesResult.java
index ceb8a6710795..9bea8606eba1 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ListIndexesResult.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ListIndexesResult.java
@@ -7,7 +7,6 @@
package com.azure.search.documents.implementation.models;
import com.azure.core.annotation.Fluent;
-import com.azure.search.documents.models.SearchIndex;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ListSkillsetsResult.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ListSkillsetsResult.java
index 9c44fd682a1d..8b562068b5bd 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ListSkillsetsResult.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ListSkillsetsResult.java
@@ -7,7 +7,6 @@
package com.azure.search.documents.implementation.models;
import com.azure.core.annotation.Fluent;
-import com.azure.search.documents.models.SearchIndexerSkillset;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ListSynonymMapsResult.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ListSynonymMapsResult.java
index d78ff9323af0..918e11bec2b6 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ListSynonymMapsResult.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ListSynonymMapsResult.java
@@ -7,7 +7,6 @@
package com.azure.search.documents.implementation.models;
import com.azure.core.annotation.Fluent;
-import com.azure.search.documents.models.SynonymMap;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchDocumentsResult.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchDocumentsResult.java
index 70f04eda4d1a..6d1c006db147 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchDocumentsResult.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchDocumentsResult.java
@@ -7,8 +7,6 @@
package com.azure.search.documents.implementation.models;
import com.azure.core.annotation.Fluent;
-import com.azure.search.documents.models.FacetResult;
-import com.azure.search.documents.models.SearchResult;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchRequest.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchRequest.java
index c83a719db9c8..91b387ddad0c 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchRequest.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchRequest.java
@@ -7,9 +7,6 @@
package com.azure.search.documents.implementation.models;
import com.azure.core.annotation.Fluent;
-import com.azure.search.documents.models.QueryType;
-import com.azure.search.documents.models.ScoringParameter;
-import com.azure.search.documents.models.SearchMode;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
@@ -101,7 +98,7 @@ public final class SearchRequest {
* "mylocation--122.2,44.8" (without the quotes).
*/
@JsonProperty(value = "scoringParameters")
- private List scoringParameters;
+ private List scoringParameters;
/*
* The name of a scoring profile to evaluate match scores for matching
@@ -399,7 +396,7 @@ public SearchRequest setQueryType(QueryType queryType) {
*
* @return the scoringParameters value.
*/
- public List getScoringParameters() {
+ public List getScoringParameters() {
return this.scoringParameters;
}
@@ -413,7 +410,7 @@ public List getScoringParameters() {
* @param scoringParameters the scoringParameters value to set.
* @return the SearchRequest object itself.
*/
- public SearchRequest setScoringParameters(List